Skip to content

Latest commit

 

History

History
30 lines (21 loc) · 636 Bytes

File metadata and controls

30 lines (21 loc) · 636 Bytes

💚 This is the latest document.

map.panBy()

Changes the center of the map by the given distance in pixels.


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);

var button = div.getElementsByTagName('button')[0];
button.addEventListener('click', function() {
  // Move to left by 100px
  // Move to top by 50px
  map.panBy(100, 50);
});