Thanks!  That got me on the right track, and I figured it out!

Here's what I went with...

google.maps.event.addListener(map, "click", function (e) {
        document.form1.waypointLog.value = e.latLng.lat().toFixed(6)
        + ' |' + e.latLng.lng().toFixed(6);
});





On Mar 31, 4:15 pm, Andreas Sommer <[email protected]>
wrote:
> On 31.03.2011 21:35, David wrote:
>
> > I'm trying to get the coordinates for a single click on the map.
>
> > The code below is something I've cobbled together that gets the coords
> > for the center of the map, upon double click.  But I'd like to get the
> > point under the mouse when I single click.
>
> > (stuff in comments are attempts)
>
> > google.maps.event.addListener(
> >    map, "dblclick", function(
> >            overlay, latlng, overlaylatlng
> >    ) {
> >            // var point = new GLatLng( latlng.y, latlng.x );
> >            //document.getElementById("log").innerHTML =
> > map.getCenter().toString();
> >            document.getElementById("log").innerHTML = '|' +
> > map.getCenter().lat().toFixed(6) + ' |' +
> > map.getCenter().lng().toFixed(6);
> >    });
>
> This is mixed V2 and V3 code. See the reference for the Map class
> <https://code.google.com/apis/maps/documentation/javascript/reference....>,
> the dblclick event callback only gets one argument (MouseEvent), which
> contains the lat/lng of the click.

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