HOWTO: use latitude and longitude with Google Maps

gmaplatlon_20070802.jpg

Whether you want to quickly add a waypoint to your GPS, or view a map of a known location, it can often be convenient to use real latitude and longitude values with Google Maps instead of dealing with street addresses.

Rerieving a map for a lat/lon value is simple enough with Google Maps. You can simply enter the decimal latitude and longitude into the search form instead of a street address.

However, if you're viewing a map and you want to retrieve the lat/lon location, there unfortunately isn't a convenient "get latitude and longitude" button. Google Maps deals with latitude and longitude locations internally, though, so with this little snippet of javascript, you can easily get the job done:

javascript:void(prompt('',gApplication.getMap().getCenter())

This will return the coordinates of the map's center point. You might want to double-click a position on the map before running the above code. Doing so will reposition that point to the center of the map automatically.

Get Latitude and Longitude values from Google Maps - [via] Link


Recent Entries

Comments

Oldest comments listed first.

Posted by: ltt on August 2, 2007 at 10:55 PM

Great tip, but why the I-35W bridge?


Posted by: ltt on August 2, 2007 at 10:56 PM

Great tip, but why the I-35W bridge?


Posted by: neilbert on August 3, 2007 at 4:54 AM

@ltt: You're kidding, right?

http://www.cnn.com


Posted by: MacGyverS2000 on August 3, 2007 at 6:16 AM

An easier method that doesn't require javascript (though may be [u]slightly[/u] less accurate) is to simply right-click on the area of the map you're interested in and click the "Directions to here" option. If you don't have a starting point already on the map, it will fill in the endpoint above with the location followed by the lat/lon (i.e., Anywhere,TX@xx.xxxxxx, yy.yyyyyy).


Posted by: jason_striegel on August 3, 2007 at 9:48 AM

Thanks ltt. Regarding the 35W Mississippi bridge -- I live in Minneapolis and was seeing if Google's map had been updated. It seemed like an appropriate and topical location which doesn't have a street address, but that a person might want to locate.

For those who didn't hear about this, the bridge completely collapsed during a bumper-to-bumper traffic jam Wednesday and, thankfully, the vast majority of drivers managed to walk away after plummeting 70 feet into the river.

Here's a good photo gallery if you're insterested - Link


Posted by: ltt on August 4, 2007 at 9:47 PM

@ neilbert: I was fully aware of the bridge collapse when I posted my previous comment. It was no joke. Thats why I asked. I live near the Twin Cities, and lived in Minneapolis for a short time years ago. The tragedy is close to my heart as well. I was simply wondering why there was no other explanation as to why that location was chosen.

@ jason_striegel: Thanks for clearing it up though.


Posted by: cyenobite on August 6, 2007 at 12:56 PM

...also just click on the "link to this page" the Lat and Long show up in the link... in several different formats.


Leave a comment


Subscribe to MAKE!Subscribe to MAKE Magazine!

Subscribe today, save 42% and get web access to MAKE free. MAKE Digital Edition is available only to subscribers.

$34.95 / 1 year
(4 Quarterly Issues)

Subscribe now


Void your warranty, violate a user agreement, fry a circuit, blow a fuse, poke an eye out. Make: The risk-takers, the doers, the makers of things... Welcome to Make: Online!


CRAFT Maker Shed Maker Faire MAKE television
Holiday Gift Guides from MAKE
Gifts for Dads
Science and Chemistry
Gifts Under $20
More guides: Santa Claus Machines, Geek Toys for Grown Up Girls & Boys


Check out all of the episodes of Make: television

Alex Rider Dream Gadget Contest
Make: Science Room

Connect with MAKE

Be a MAKE fan on Facebook MAKE on Facebook
Visit our Facebook page and become a fan of MAKE!
MAKE on Twitter MAKE on Twitter
Follow our MAKE tweets!
MAKE Flickr Pool MAKE on Flickr
Join our MAKE Flickr Pool!
    make_tips on Twitter




    Maker SHED

    Advertise here with FM.

    Why advertise on MAKE?
    Read what folks are saying about us!

    Click here to advertise on MAKE!



    Subscribe to MAKE Magazine!

    Make: Online authors!

    Gareth BranwynGareth Branwyn
    Senior Editor


    Phillip TorronePhillip Torrone
    Senior Editor
    | AIM | Twitter


    Becky SternBecky Stern
    Associate Editor
    | AIM | Twitter


    Marc de VinckMarc de Vinck
    Contributing Writer
    | AIM | Twitter


    John ParkJohn Park
    Contributing Writer
    | Twitter


    Sean RaganSean Ragan
    Contributing Writer
    | Twitter


    Matt MetsMatt Mets
    Contributing Writer
    | AIM | Twitter


    Dale DoughertyDale Dougherty
    Editor & Publisher
    | Twitter


    Shawn ConnallyShawn Connally
    Managing Editor
    | Twitter


    Goli MohammadiGoli Mohammadi
    Associate Managing Editor

    Kip KayKip Kay
    Weekend Projects
    | AIM | Twitter


    Collin CunninghamCollin Cunningham
    Contributing Writer
    | AIM | Twitter

    Adam FlahertyAdam Flaherty
    Contributing Writer
    | AIM | Twitter



    More contributors: Mark Frauenfelder (Editor-in-Chief, MAKE magazine), Kipp Bradford (Technical Consultant/Writer), Chris Connors (Education), Diana Eng (Guest Author), Peter Horvath (Intern), Brian Jepson (O'Reilly Media), Robert Bruce Thompson (Science Room)

    Suggest a Site!

    Current Podcast

    itunesdl.gif Weekend Project: Beetlebot Simple robot from your parts bin that avoids obstacles. Thanks go to Jerome Demers for the original article in MAKE, Volume 12. To download the Beetlebot video, click here or subscribe in iTunes. Check out the complete Beetlebot article... More...

    Get the Make: Online sent via email
    Enter your email to receive Make: Online each day:



    MAKE Fascination video series brought to you by Dow

    Make: Education
    MAKE: en EspaƱol MAKE: Japan
    Important please read


    Subscribe to MAKE Magazine!

    Recent Posts from the Craft: Blog