Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Maps API - Default cursor type

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.

enter image description here

like image 560
jotamon Avatar asked Mar 28 '12 15:03

jotamon


People also ask

What is the default map type in Google map view?

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.

Which is the default view of Google Maps which shows the street view of the selected region?

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 .


3 Answers

This seems to work for me

map.setOptions({draggableCursor:''});
like image 152
warmski Avatar answered Oct 23 '22 09:10

warmski


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.

like image 24
Dr.Molle Avatar answered Oct 23 '22 11:10

Dr.Molle


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.

like image 8
MarcoSantana Avatar answered Oct 23 '22 10:10

MarcoSantana