leaflet.js fire event when map pans

Viewed 9669

I use this function on my backbone view when a new GPS coordinate comes in:

onLocationFound: function(position){
    // this function runs every time we get a valid GPS fix
    
    // here I have some preparation code, like getting "position"

    if(myApp.mapView.hasCenter){
      this.map.panTo(position.coords.latlng);
    }
  },

Then, on another pice of code I run this function:

this.map.on("moveend", function(s){
    that.doDrawReports();
});

My Problem is that the moveend event isn't catching my panTo operation. How can I catch it?

1 Answers
Related