Hand cursor on mouseover KMLLayer in Google Maps

265 views
Skip to first unread message

jacek.francuz

unread,
Mar 11, 2011, 10:00:43 AM3/11/11
to Google Maps JavaScript API v3
Hello,

is it possible to show hand cursor on mouseover KMLLayer in Google
Maps 3?

I see the two solutions (but it seems that they cannot be used):

1. handle mouseover event for KMLLayer and change cursor in CSS
2. handle mouseover event for Map and check if cursor's location is
contained by KMLLayer

The problem is that mouseover event does not exist for KMLLayer :(

Do you have any ideas?

Thanks

Rossko

unread,
Mar 11, 2011, 1:05:59 PM3/11/11
to Google Maps JavaScript API v3
> The problem is that mouseover event does not exist for KMLLayer :(

kmlLayer is rendered as image tiles at Google's servers, this makes
mouseover difficult to implement.

There is an alternative client-side KML parser , GeoXml3 which allows
you access to locally created map objects. Tradeoff, performance
against flexibility.

M

unread,
Mar 22, 2011, 4:19:24 PM3/22/11
to Google Maps JavaScript API v3
Couldn't you just apply a click listener to the layer in order to make
it show the hand cursor?

google.maps.event.addListener(yourLayerObject, 'click', function
(kmlMouseEvent) {
...whatever...
});

Now whenever you mouseover the area contained in the KML layer, the
cursor should turn into a hand.
Reply all
Reply to author
Forward
0 new messages