Deferred tile loading causes tiles to fetch from API at low zooms #4572
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
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 fromwindow.requestIdleCallback
:This is the part of the code in
services/osm.js
that fetches the tiles:So how many tiles exactly are we trying to fetch?
Wow, 315810 - that is way too many!.. Scroll up in the code to see what happened:
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
The text was updated successfully, but these errors were encountered: