Markers and MouseEvent

338 views
Skip to first unread message

Gabriel Svennerberg

unread,
May 30, 2010, 2:53:49 AM5/30/10
to Google Maps JavaScript API v3
According to the API documentation when you click a marker it will
return an Event. This seems strange to me, why not return a MouseEvent
object for all the markers mouse events? That way the API would work
the same way regardless of what type of overlay you click.

Best regards,
Gabriel Svennerberg


Rossko

unread,
May 30, 2010, 4:43:13 AM5/30/10
to Google Maps JavaScript API v3
> According to the API documentation when you click a marker it will
> return an Event. This seems strange to me, why not return a MouseEvent
> object for all the markers mouse events? That way the API would work
> the same way regardless of what type of overlay you click.

I'm not sure what your complaint is. Don't know where in the docs you
are looking, but it doesn't say that ONLY clicking Markers returns
MouseEvent.
For example,
http://code.google.com/apis/maps/documentation/javascript/reference.html#Polygon
look down to Events

Esa

unread,
May 30, 2010, 5:38:14 AM5/30/10
to Google Maps JavaScript API v3
I agree.

I remember that Marker used to return MouseEvent by 'click'. Now it
returns a browser specific object. Also MouseEvent used to have a
documented 'pixel' property as well. Now only Map is returning 'pixel'
but that is undocumented.

'mouseover' and 'mouseout' return objects like 'click' does.

Esa

unread,
May 30, 2010, 5:54:03 AM5/30/10
to Google Maps JavaScript API v3
> it doesn't say that ONLY clicking Markers returns
> MouseEvent.


Just the opposite. Marker is the only overlay that does not return
MouseEvent. According to documentation and in real life.

MouseEvent object is returned by mouse events of:
- Polyline
- Polygon
- Circle
- Rectangle

but not by Marker. Clicking the above listed overlays also causes a
Map 'click' which returns a full MouseObject with 'pixel' property as
well. Clicking on Marker prevents Map 'click' event.

Rossko

unread,
May 30, 2010, 6:50:33 AM5/30/10
to Google Maps JavaScript API v3
> Just the opposite. Marker is the only overlay that does not return
> MouseEvent. According to documentation and in real life.

aha, I completely misunderstood
Reply all
Reply to author
Forward
0 new messages