I am building an android application which would store latitude and longitude information from google maps. The application receives the Send/Share intent from Google maps when user chooses location from map and extracts co-ordinates by un-shortening the goo.gl map link (e.g. http://goo.gl/maps/FcglP) embedded in intent. This task is easy if the location being shared from google maps is unknown or named "dropped pin". In that case the un-shortened URL looks like
http://maps.google.com/?q=17.50122123,74.12351323&.....
If the location is well known (http://goo.gl/maps/FcglP), e.g. some road, un-shortened URL looks like
http://maps.google.com/?q=Sutarwadi+Baner+Gaon+Rd%2C+Baner&ftid=0x3bc2becfa70b8b3f:0xd210c15f634bcec3&hl=en&gl=us
I have been searching for last three hours about how to extract the co-ordinates from this kind of URL but couldn't find any information. Is there any other method to extract co-ordinates from a given goo.gl map URL? Some already developed library or google API?
To get GPS coordinates using Google Maps is really easy. There are two ways you can go about it. Firstly, go to maps.google.com and type in the address or location you are interested in. Once it has loaded, you can just look in the address bar and you'll see the coordinates are contained within the URL itself.
2 steps:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With