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

Deferred tile loading causes tiles to fetch from API at low zooms #4572

Closed
bhousel opened this issue Nov 28, 2017 · 0 comments
Closed

Deferred tile loading causes tiles to fetch from API at low zooms #4572

bhousel opened this issue Nov 28, 2017 · 0 comments
Labels
bug-release-blocker An important bug - let's get this fixed in the next release! priority A top priority issue that has a big impact or matter most to new mappers

Comments

@bhousel
Copy link
Member

bhousel commented Nov 28, 2017

This could be causing a bunch of other weird hangs (maybe this is the cause of the mysterious Firefox crash).

I found that we were fetching a lot of tiles from OSM after a fast mousewheel zoom out. I paused the debugger after iD appeared hung for a little while, and it stopped in loadTiles called from window.requestIdleCallback :

screenshot 2017-11-28 09 26 57

This is the part of the code in services/osm.js that fetches the tiles:

screenshot 2017-11-28 09 28 11

So how many tiles exactly are we trying to fetch?

screenshot 2017-11-28 09 30 58

Wow, 315810 - that is way too many!.. Scroll up in the code to see what happened:

screenshot 2017-11-28 09 31 55

Ok, so I mousewheeled out to z8 and this code is just fetching all the OSM data at that level. 🚒

This means that if we defer tile loading, we need to add extra checks to make sure that when the deferred code actually runs, the projection (and zoom) has not changed to something unreasonable 🔥

cc @kepta

@bhousel bhousel added bug-release-blocker An important bug - let's get this fixed in the next release! priority A top priority issue that has a big impact or matter most to new mappers labels Nov 28, 2017
@bhousel bhousel closed this as completed in 5e19c93 Dec 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug-release-blocker An important bug - let's get this fixed in the next release! priority A top priority issue that has a big impact or matter most to new mappers
Projects
None yet
Development

No branches or pull requests

1 participant