Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'viewreset' seems to be not firing on v1rc3 #4837

Closed
shri3k opened this issue Aug 23, 2016 · 1 comment
Closed

'viewreset' seems to be not firing on v1rc3 #4837

shri3k opened this issue Aug 23, 2016 · 1 comment

Comments

@shri3k
Copy link

shri3k commented Aug 23, 2016

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.

@mourner
Copy link
Member

mourner commented Aug 23, 2016

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

@mourner mourner closed this as completed Aug 23, 2016
sdjacobs added a commit to camsys/otp-vtrans-ui that referenced this issue Aug 21, 2017
1) Leaflet.Label plugin has been replaced by L.Tooltip and is now in core: https://github.com/Leaflet/Leaflet.label
2) viewreset event replaced by zoom and viewreset: Leaflet/Leaflet#4837
3) Zoom artifacts fixed by CSS update
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants