In WeChat development, we need to get the current city. I use Amap, but some cities are positioned incorrectly. For example, Shenzhen will be positioned to Chengdu. Is there any other way to locate the current city, such as obtaining the longitude and latitude obtained through HTML5? city
In WeChat development, we need to get the current city. I use Amap, but some cities are positioned incorrectly. For example, Shenzhen will be positioned to Chengdu. Is there any other way to locate the current city, such as obtaining the longitude and latitude obtained through HTML5? city
WeChat has its own location interface https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1421141115&token=&lang=zh_CN
You can use IP location and link the IP library to search.
Sina interface http://int .dpool.sina.com.cn/iplookup/iplookup.php?format=js
<code><script src="http://int.dpool.sina.com.cn/iplookup/iplookup.php?format=js"></script> <script> alert(remote_ip_info.province + '\n' + remote_ip_info.city) </script> </code>
Have you reversed the longitude and latitude parameters