Skip to content

Map.setOptions()

wf9a5m75 edited this page Sep 9, 2014 · 9 revisions

Set the attributions of the map

###Description You can change the camera view and the UIs. This is useful when you want to show the specific location of the map. Available options are mapType, controls, gestures, and camera.


###Code

var GORYOKAKU_JAPAN = new plugin.google.maps.LatLng(41.796875,140.757007);
map.setOptions({
  'mapType': plugin.google.maps.MapTypeId.HYBRID,
  'controls': {
    'compass': true,
    'myLocationButton': true,
    'indoorPicker': true,
    'zoom': true  //Only for Android
  },
  'gestures': {
    'scroll': false,  //Disable scrolling
    'tilt': false,    //Disable changing the tilt
    'rotate': false,  //Disable changing the bearing
    'zoom': false     //Disable changing the zoom
  },
  'camera': {
    'latLng': GORYOKAKU_JAPAN,
    'tilt': 30,
    'zoom': 15,
    'bearing': 50
  }
});

Join the official community

New versions will be announced through the official community. Stay tune!

Do you have a question or feature request?

Feel free to ask me on the issues tracker.

Or on the official community is also welcome!


New version 2.0-beta2 is available.

The cordova-googlemaps-plugin v2.0 has more faster, more features.

https://github.com/mapsplugin/cordova-plugin-googlemaps-doc/tree/master/v2.0.0/README.md

Clone this wiki locally