Leaflet : Firing an event when bounds change

后端 未结 1 1172
予麋鹿
予麋鹿 2021-02-19 00:33

I am using leaflet to develop a new application. You can have an idea of the app here.

I would like to fire an event whenever the bounds of the map change. I looked at

相关标签:
1条回答
  • 2021-02-19 01:14

    Map bounds are updated each time the map is moved (either by pan or zoom). So you can use moveend event for your purpose

    map.on('moveend', function(e) {
       var bounds = map.getBounds();
    });
    
    0 讨论(0)
提交回复
热议问题