Last week, Google announced new location sharing features in Google Maps that would allow you to easily share your current position momentarily or indefinitely with select people.
The option is the same that we've had in Google for a few years, except it would now be in the app that made most sense, Maps.
Google use Geolocation a lot, especially for things like Google Maps, you’re bound to have seen the popups ‘This page would like to use your current location’. Using Java Script, we can gather the details of our current location, or whichever device we are on.
Please bear in mind though, some ISPs are a little quirky with Geolocation, and sometimes shows you in a different area than you actually are, or not at all.
I imagine this is all down to the internet/DNS/ISP/something.
But hey, we can still build something with it, and 99% of the time it’s fine. I haven’t included any error handling in this script so if it doesn’t work for you, try later.
Geolocation is one of the best new HTML5 APIs, so let’s see what we can do with it.