Hi.

You can add an event listener to your map listening for the 'click'
event.

google.maps.event.addListener(myMap, 'click', function(myEvent){
var myClickLatLng=myEvent.latLng;
// now process myClickLatLng
});

That 'pseudo code' assumes your map object is named myMap, on a map
click the function executes and is passed a MouseEvent object which
has a latLng property - where the user clicked on the map.

http://code.google.com/apis/maps/documentation/javascript/reference.html#Map
Scroll down to the Map Events section.

http://code.google.com/apis/maps/documentation/javascript/reference.html#MouseEvent

http://code.google.com/apis/maps/documentation/javascript/reference.html#MapsEventListener

Martin.


On Dec 9, 6:44 am, Mesh3L <[email protected]> wrote:
> Hello,
>
> I'm not very familiar with JavaScript. Let's say that I want the user
> to be able to chose a spot on the map (a mouse click), and than to have
> back the LatLng of that spot in order to save it an a database. I read
> the reference and i can see that the answer is around there but as i
> said, my knowledge in JavaScript didn't help.
>
> I will appreciate it if someone can assist me on this. Thanks

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps JavaScript API v3" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-maps-js-api-v3?hl=en.

Reply via email to