map.setAllGesturesEnabled()

April 20, 2018 ยท View on GitHub

Sets the preference for whether all gestures should be enabled or disabled.

map.setAllGesturesEnabled(flag)

Parameters

nametypedescription
flagbooleantrue: enable, false: disable

Demo code

<div class="map" id="map_canvas">
  <span class="smallPanel"><button>current: map.allGesturesEnabled = true</button></span>
</div>
map: GoogleMap;
isEnabled: boolean = true;

loadMap() {
  this.map = GoogleMaps.create('map_canvas', {
    'gestures': {
      'scroll': true,
      'tilt': true,
      'rotate': true,
      'zoom': true
    }
  });
}

onButtonClick() {
  this.isEnabled = !this.isEnabled;
  this.map.setAllGesturesEnabled(this.isEnabled);
}