I am using d3 with Leaflet (v 1.0.2) and need to catch the viewreset event, but it's not fired.
this.map.on("viewreset", () => console.log("VIEW RESET"));
Is anyone else having this problem? I'm able to catch the zoomend event for example.
Also, manipulating positions and etc. on svg-layers is a bit of a pain as well in the new versions of Leaflet...but that is another story.
JSFidlle showing the problem http://leafletjs.com/reference-1.0.2.html
According to: https://github.com/Leaflet/Leaflet/issues/4837
in 1.0, layers will have to rely on both zoom (zoom change) and viewreset (full reset of a layer). This was necessary to implement flyTo and other arbitrary animations.
And in: https://github.com/Leaflet/Leaflet/pull/3278
remove viewreset event and depend solely on zoom event in layers instead
So viewreset event is no longer triggered on zoom.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With