简体   繁体   中英

How to get my last google map location?

Google maps have this button which shows your location based on your last track. Actually if i click this button it says that it got my location from my phone and it shows the correct address. Right now my application can track the user's location, but with a major downside. If the device has no GPS it tracks the IP location which the most of the time is not the actual user's position. Is there any way that i can integrate this feature in my application? I'm searching for an API but i haven't found something yet. Thanks

http://puu.sh/lq4n0/e53483c429.png

By following I assume you are talking about WEB -application.

Your browser can detect your location if you allow that. This data (latitude and longitude) could be obtained via JavaScript. For instance: http://www.w3schools.com/html/html5_geolocation.asp or https://github.com/onury/geolocator . Hundreds of example can be googled using query "javascrip geolocation library".

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM