Reputation: 513
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
Upvotes: 1
Views: 125
Reputation: 7521
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".
Upvotes: 1