Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

disable double click zoom in google maps while drawing

I want to draw a polyline on the maps. i am not using the Drawing lib from google maps api.. i have written my own..

problem: Before starting the line draw i disabled the double click zoom as below

map.setOptions({disableDoubleClickZoom: false });

double click event is added to line end. after this event i am enabled by calling the

map.setOptions({disableDoubleClickZoom: true });

but still the zoom is happening.

even if i put the stop event code in double click.

 mouseEvent.stop();
like image 962
chiranjeevigk Avatar asked Feb 13 '14 07:02

chiranjeevigk


People also ask

How do I turn off zoom on Google Maps?

Show activity on this post. map. setOptions({draggable: false, zoomControl: false, scrollwheel: false, disableDoubleClickZoom: true}); If this doesn't prevent zooming, you could always set the minimum and maximum zoom to the current zoom level.

How do I control zoom on Google Maps?

The Zoom control displays "+" and "-" buttons for changing the zoom level of the map. This control appears by default in the bottom right corner of the map.

How do I change the default zoom on Google Maps?

You can change the zoom level of the map using simple steps. Step 1 Go to Add or Edit Map page . Step 2 Select 'Default zoom level' in the 'Map Information section'. Step 3 click save map and see the changes.

How can we enable or disable the zoom in the map?

The Maps API provides built-in zoom controls that appear in the bottom right hand corner of the map. These are disabled by default, but can be enabled by calling UiSettings. setZoomControlsEnabled(true) .


1 Answers

It should be the other way around:

To disable

map.setOptions({disableDoubleClickZoom: true });

To enable

map.setOptions({disableDoubleClickZoom: false });
like image 180
Marco Ramires Avatar answered Sep 23 '22 00:09

Marco Ramires