Change the cursor to an image?

50 views
Skip to first unread message

Lecter

unread,
Oct 25, 2011, 6:03:26 AM10/25/11
to google-map...@googlegroups.com
i'm trying to change the cursor when we pass inside of the map clearly, my idea is to change the typical hand of google maps to a cat, I saw it  before changed by the option "cross-hair", and it change the cursor to a cross or a "text" that works fine, but look like is not working with a url image instead of standard icons this is the code I'm using..

 var options = { 
      zoom: 3, 
      center: new google.maps.LatLng(37.09, -95.71), 
      mapTypeId: google.maps.MapTypeId.ROADMAP,
      draggable: true,
      draggableCursor:'img/cat.png'
      };

It is a bug in the API V3? I saw a few answers about the same subject but in V2 and it was ..
Thanks for the answers .

Chris Broadfoot

unread,
Oct 26, 2011, 4:28:07 AM10/26/11
to google-map...@googlegroups.com
Hi Lecter,

The cursor properties are like in CSS - you will need to specify two separated by a comma - first your custom one, then one of the built in ones provided by the browser.

Try one of these:
draggableCursor:'img/cat.png,default' 
draggableCursor:'img/cat.png,pointer' 
draggableCursor:'img/cat.png,crosshair' 

Chris
--



--
You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-maps-js-api-v3/-/0D9JVm5USKcJ.
To post to this group, send email to google-map...@googlegroups.com.
To unsubscribe from this group, send email to google-maps-js-a...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-maps-js-api-v3?hl=en.

Reply all
Reply to author
Forward
0 new messages