Find Latitude and Longitude Using maps.google.com
Here is a php script that gets the Latitude and Longitude of any address using the google maps API.
The original script comes from Ken. I just made some minor adjustments to it and made it dynamic.
This basically parses a JavaScript blob returned from the API and extracts the lat and long values.
If you’re feeling hackish, another neat trick found by qmchenry exposes Google Map’s JavaScript object and fires a series of functions to get the the lat and long values of the currently centered location in the browser. Just paste this JS into your address bar after you have searched for your address on google maps.
javascript:void(prompt('',gApplication.getMap().getCenter()));






1
at 9:00 am
It doesn’t seem to work. I Enter my address and click the submit button, but nothing works. It refreshes to a blank field and no results.
2
at 2:06 pm
same here, doesn’t seem to work.
3
at 8:47 pm
It seems google had updated their output so my regular expression search was failing. It should work now.
4
at 10:05 pm
To find latitude & longitude after entering country & state
5
at 7:53 am
Hi Mojo,
Would you give me te source code of this nice Find Latitude and Longitude Using maps.google.com script
With kind regards
Albert grooot