Skip to content

Latest commit

 

History

History
45 lines (34 loc) · 1.1 KB

File metadata and controls

45 lines (34 loc) · 1.1 KB

💚 This is the latest document.

map.moveCamera()

You can change camera position without animation.

map.moveCamera(options, callback);

Parameters

name type description
options CameraPosition new camera position (the duration property is ignored.)
callback Function (optional) callback

Demo code

<div class="map" id="map_canvas">
    <button>Click here</button>
</div>
var div = document.getElementById("map_canvas");
var map = plugin.google.maps.Map.getMap(div);

var button = div.getElementsByTagName('button')[0];
button.addEventListener('click', function() {
  map.moveCamera({
    target: {lat: 37.422359, lng: -122.084344},
    zoom: 17,
    tilt: 60,
    bearing: 140
  }, function() {
    alert("Camera target has been changed");
  });
});