I am dynamically changing the cursor type on a Google Map using the Javascript V3 API.
map.setOptions({draggableCursor:'crosshair'});
This is easy but I cannot figure out how to change back to the default draggable hand cursor.
Any suggestion of how I can reference the default cursor type. I have tried default, auto and hand to no avail. Below is how the hand looks before I change it.
roadmap displays the default road map view. This is the default map type. satellite displays Google Earth satellite images. hybrid displays a mixture of normal and satellite views.
Street View Map Usage By default, Street View is enabled on a map, and a Street View Pegman control appears integrated within the navigation (zoom and pan) controls. You may hide this control within the map's MapOptions by setting streetViewControl to false .
This seems to work for me
map.setOptions({draggableCursor:''});
It's an Image: http://maps.gstatic.com/mapfiles/openhand_8_8.cur
cursor: url("https://maps.gstatic.com/mapfiles/openhand_8_8.cur"), default;
I don't know if it is documented somewhere, but setting the draggableCursor-option to null
will restore the default for me, it could be an better option.
I've had some problems to change the default cursor type at Google Maps v3. Whenever you want the cursor set to the hand, use draggableCursor: 'pointer' at the mapOptions definition, but if you want to get rid of the little hand, and you just want to see the standard web pointer, the value for draggableCursor must be 'default', like the code below.
var mapOptions = {
zoom: 8,
center: position,
mapTypeId: mapTypeId,
draggableCursor: 'default'
};
This tool might be of some help: http://www.birdtheme.org/useful/v3tool.html.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With