HOWTO: use latitude and longitude with Google Maps

Technology
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

What will the next generation of Make: look like? We’re inviting you to shape the future by investing in Make:. By becoming an investor, you help decide what’s next. The future of Make: is in your hands. Learn More.

Tagged
Discuss this article with the rest of the community on our Discord server!

ADVERTISEMENT

Escape to an island of imagination + innovation as Maker Faire Bay Area returns for its 16th iteration!

Prices Increase in....

Days
Hours
Minutes
Seconds
FEEDBACK