Skip to content

Latest commit

 

History

History
47 lines (36 loc) · 907 Bytes

File metadata and controls

47 lines (36 loc) · 907 Bytes

💚 This is the latest document.

map.setCameraBearing()

Change the camera view bearing.

marker.setCameraBearing(bearing);

Parameters

name type description
bearing number new camera bearing

Demo code

<div class="map" id="map_canvas">
    <span class="smallPanel"><button>Click here</button></span>
</div>
var div = document.getElementById("map_canvas");
var map = plugin.google.maps.Map.getMap(div, {
  camera: {
    target: {
      lat: 37.422858,
      lng: -122.085065
    },
    zoom: 15
  }
});

var bearing = 0;
var button = div.getElementsByTagName('button')[0];
button.addEventListener('click', function() {
  bearing += 15;
  map.setCameraBearing(bearing);
});