Change mouse pointer/cursor (not on marker)

4,658 views
Skip to first unread message

spooks

unread,
May 3, 2011, 9:38:46 AM5/3/11
to google-map...@googlegroups.com
Hi ... is there a way where i can change the mouse pointer.. so when the user loads the page and when the mouse is active on the map canvas it will have a different pointer and a tooltip telling them to mark a polygon...

like in this site:

JKurtock

unread,
May 3, 2011, 10:32:22 AM5/3/11
to Google Maps JavaScript API v3
Curses! Foiled again....

What you want to change is the cursor, which is a property of the
mapOptions object. http://code.google.com/intl/en/apis/maps/documentation/javascript/reference.html#MapOptions

map.setOptions({draggableCursor:'crosshair'}); will set the cursor to
a crosshair.
map.setOptions({draggableCursor:null}); sets it back to default.

For a wacky cursor you can specify a url, but I prefer to stay with
something more mundane. "crosshair" pulls up an OS-determined cursor,
which helps your users recognize that they are looking at a cursor,
rather than, say, a flying toaster. You might have to do some
experimentation with the constant; pointer, hand and crosshair all
work, but I think you can also get ibeam, sizens, sizenesw, and so on.

- Jeff
Reply all
Reply to author
Forward
0 new messages