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()));

12 Comments

  1. 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. 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

  3. Hi Mojo..

    This is Vishu from India.. The program is nice. I have to create one module to find latitude and longitude values in php. So, can you guide me how to do that? Or any chances to share your source code. It would be better to understand your logic.

    Thanks in Advance.

    Cheers,
    Vishu

  4. Hi Mojo,

    Would you give me te source code of this nice Find Latitude and Longitude Using maps.google.com script

    Best regards
    Yesmin

  5. Hey Mojo, this is exactly what I’ve been looking for. Will you please share the script with me? Thanks in advance!

    Tom

  6. Hi

    The php script that you have at the begin of thispage is working well, but i cannot finf the script it self to introduce into my new page.

    can you help me?

    Thanks a lot

Leave a Reply

Your email address will not be published. Required fields are marked *

Visited 12822 times, 2 so far today