Helped a lot, TYVM.


On Mar 22, 4:14 pm, chinhua kong <[email protected]> wrote:
> Please see inline.
>
> On Tue, Mar 22, 2011 at 9:17 AM, Andre Eugenio <[email protected]>wrote:
>
> > Is there a way to get latLng from a Marker using eventListerner?
>
> > For instance... this code works using a map object
> >        google.maps.event.addListener(map, 'click', function(event) {
> >                alert(event.latLng);
> >        });
>
> > But using a maker object its not working
> >        google.maps.event.addListener(marker, 'click', function(event) {
> >                alert(event.latLng); // undefined
> >        });
>
> From what I know that the event.latLng is mouse position on the map. It only
> available for map object. If you want the latLng value of the marker while
> it is clicked, you should get the marker position value. You can do this by
> following
>
>  google.maps.event.addListener(
>
>
>
> > marker, 'click', function(event) {
> >                alert(this.position);
> >        });
>
> Hope this help.
>
>
>
>
>
>
>
>
>
> > The docs
> >http://code.google.com/apis/maps/documentation/javascript/reference.h...
> > clearly says that the event generates a MouseEvent object (same as Map
> > object) but its not working.
>
> > TIA.
>
> > --
> > 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.
>
> --
> Best and Regards,
> Chin Hua Kong

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