[Google Maps API v2] Re: Get latitude and longitude from Google Map
On Dec 10, 6:49 am, Pradeep <pwprad...@gmail.com> wrote:
>
> GEvent.addDomListener(document.getElementById("map"), "mousemove",
> function(e) {
> alert('mousemove:'+e.lat()+':'+e.lng());
> });
>
> It gives me "undefined" output. What can be the solution for this?
The cause is that the DOM Event object, if one is passed at all,
doesn't contain lat and lng functions.
The solution is to use the right listener:
GEvent.addListener(map,"mousemove", ... )
when the handler function you have will work. Note that you need to
have created a map, and the "map" in that line needs to refer to it.
If you have difficulty please post a link, not code.
--
You received this message because you are subscribed to the Google Groups "Google Maps API V2" group.
To post to this group, send email to google-maps-api@googlegroups.com.
To unsubscribe from this group, send email to google-maps-api+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-maps-api?hl=en.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home