# How to get the lat and lng from Google MAPS

**URL:** <https://www.ruby-forum.com/t/how-to-get-the-lat-and-lng-from-google-maps/173875>\
**Category:** Rails\
**Created:** [August 17, 2009, 3:56pm UTC](https://www.ruby-forum.com/t/how-to-get-the-lat-and-lng-from-google-maps/173875 "2009-08-17T15:56:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![flaubert](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/858c86/32.png) [@flaubert](https://www.ruby-forum.com/u/flaubert)\
**Post date:** [August 17, 2009, 3:56pm UTC](https://www.ruby-forum.com/t/how-to-get-the-lat-and-lng-from-google-maps/173875/1 "2009-08-17T15:56:28Z")

</div>

Hi everyone,

I have two form fields and google maps displayed.  
When click in some location on the map, a want to fill these fields,  
is this possible?

what the best way?

tnks a lot!

---

<div class="post-metadata">

**Author:** ![flaubert](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/858c86/32.png) [@flaubert](https://www.ruby-forum.com/u/flaubert)\
**Post date:** [August 17, 2009, 4:05pm UTC](https://www.ruby-forum.com/t/how-to-get-the-lat-and-lng-from-google-maps/173875/2 "2009-08-17T16:05:15Z")

</div>

On Mon, Aug 17, 2009 at 3:55 PM, flaubert[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> tnks a lot!

Use a click event handler in the Google Maps API  
It returns a location which contains latitude and longitude.  
See more at [Documentación de Google Maps Platform &nbsp;|&nbsp; API de Maps JavaScript &nbsp;|&nbsp; Google for Developers](http://code.google.com/apis/maps/documentation/events.html)

Andrew T.  
[http://ramblingsonrails.com](http://ramblingsonrails.com)

[http://MyMvelope.com](http://MyMvelope.com) - The SIMPLE way to manage your savings
