javascript - How to get the current location geolocation in H5 or JS, just get the latitude and longitude
大家讲道理
大家讲道理 2017-05-16 13:22:48
0
4
1025

In April 2017, at the current time, how to obtain the current location geolocation through H5 or JS, all the geolocation APIs that come with H5 are not valid


Nothing happens after running the official document


You can’t get geolocation through any browser or Baidu map.


Have been personally tested and have no effect

After the pop-up window clicked Allow, there was no response

大家讲道理
大家讲道理

光阴似箭催人老,日月如移越少年。

reply all(4)
洪涛

The problem has been solved, I forgot to close it, now I will show it to everyone
You must declare it first
Introduce the corresponding js under index.html


Then the positioning is ok, but it takes about three seconds to position on the PC browser, and the mobile 4G network is great

滿天的星座

Publish it as a domain test like (localhost/xxx/xxx.html), do not open the .html directly and browse it on the browser, it will become (file:///)
Baidu needs to apply for an account and have its own key to ensure operation of?

淡淡烟草味

If you try using IE, it should show that Google is blocked.

Peter_Zhu

http://stackoverflow.com/ques...

The latest version of chrome needs to enable https to use geolocation

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!