Leaflet: 'viewreset' seems to be not firing on v1rc3

Created on 23 Aug 2016  路  1Comment  路  Source: Leaflet/Leaflet

Hi,
I'm new to leaflet so this might just be a question but as I was playing with the rc3 version I noticed that viewreset doesn't fire when zoomed in/out.

My attempt so far:-

var mymap = L.map('map').setView([51.505, -0.09], 13);
L.tileLayer("http://{s}.tile.osm.org/{z}/{x}/{y}.png").addTo(mymap);
mymap.on('viewreset', function(){
    console.log('resetting..');
});

or can be tested here

On v0.7.7 however it seems to work fine. I could theoretically just use zoom event for now but there were lot of tutorials out there that seems to be referring to this event so just wanted to know if it was going to be changed.

Thanks.

Most helpful comment

Yes, 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. See #3278

>All comments

Yes, 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. See #3278

Was this page helpful?
0 / 5 - 0 ratings