ember-leaflet
ember-leaflet copied to clipboard
panning howto
Not an issue, more a request for help.
With leaflet it is possible to pan the map by a specific amount of pixels like this:
map.panBy([200 0]);
What I want to achieve is to zoom and pan to a marker locations, but also offset the final location by 200pixels. The panning and zooming is done auto-magically by binding to the controllers' zoom
and center
properties.
How would I achieve the panning? I tried to add the following method to my MapView
:
panMap: function(){
var that = this;
window.map = this; // this is just for testing
Ember.run.later(function(){
that._layer.panBy([200, 0]); // FIXME: nothing happens
}, 1000);
}.observes('center'),
but the panning does not work.
Note that I am able to pan the map by later calling:
window.map._layer.panBy([200, 0])
from the console.
Any tips are appreciated!