how can i disable/enable dragging, zooming in a 'map' object. also how can i change the cursor to for example a plus sign and then change it back to default.
I have tried these but doesn't work:
map.google.maps.MapOptions.disableDoubleClickZoom = true;
map.google.maps.MapOptions.draggable = false;
You have two options how to set map options:
map = new google.maps.Map({ draggable : false }); // upon initialization
map.setOptions({ draggable : false }); // or in runtime
to disable the zoom you may try to use minZoom
and maxZoom
options (set them to the same value as zoom
option), or you may try to set zoomControl
to false,
to change the cursor which is displayed over the map use draggableCursor
option, i.e. map.setOptions({ draggableCursor: 'crosshair' });
. To change back to default just set it to null
: map.setOptions({ draggableCursor: null });
.
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