Question 1: When automatically positioning on the mobile phone, it always displays 'Location acquisition failed, go and select one manually', as shown below, it always goes to errorCallback, how can I go to the success function of showPosition? Please give me some guidance, please, please
Question 2: How can I get a positioning prompt after opening the mobile browser, as shown below? How does the picture below appear? Is there any expert who can give me some advice? Thank you very much
Chrome browser requires https to have permission to access the address. Ordinary http will fail to obtain it. The same is true for iOS. Alibaba Cloud and Tencent Cloud have free https certificates, which are free for one year. You can apply for them
The positioning of h5 is very unstable. You can run normally when it succeeds. When it fails, you can adjust the Baidu interface and get it again.
After several days of searching, I finally found a satisfactory answer. At the same time, thank you for your support;
html5 automatic positioning is unstable, so we use Tencent front-end positioning components to optimize html5 positioning;
For details, see: http:/ /lbs.qq.com/tool/compon...
h5’s positioning uses Google’s positioning function, so, you know, it’s good to succeed once in a while.
I use h5 positioning, and then convert the coordinates to Baidu map display. There is no problem. Only Google Maps can obtain the location using https protocol. Apple phones will experience positioning failure. The solution is to set the server to https protocol. Problem 2. As long as you have the software set up on your phone and the browser asks for location notifications, it will naturally pop up