Skip to content

Latest commit

 

History

History
31 lines (22 loc) · 787 Bytes

File metadata and controls

31 lines (22 loc) · 787 Bytes

⚠️ This document is aim for older versions (from 2.3.0 to 2.5.3). Document for new version is https://github.com/mapsplugin/cordova-plugin-googlemaps-doc/blob/master/v2.6.0/README.md

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