Whats the problem
We are trying to put a loader to our map component while there is ongoing tile requests. When we call maps flyTo function from outside of the component (we have to), new requests are sent, but layers loaded event is fired before responses of new requests.
How to reproduce problem
Start map with a center point and a zoom level.
Before getting all responses to theese tile requests, zoom out / drag (make new requests).
You will see loaded event will be fired when first requests finished.
How we fixed the problem
We have changed async function called from Layer._checkSourceRequestsAndFireEvents (TileClient._getTiles) to a cancelable-promise. At every call to _checkSourceRequestsAndFireEvents we cancelled that promise in order not to execute then block.
Whats the problem We are trying to put a loader to our map component while there is ongoing tile requests. When we call maps flyTo function from outside of the component (we have to), new requests are sent, but layers loaded event is fired before responses of new requests.
How to reproduce problem
How we fixed the problem We have changed async function called from
Layer._checkSourceRequestsAndFireEvents
(TileClient._getTiles) to a cancelable-promise. At every call to _checkSourceRequestsAndFireEvents we cancelled that promise in order not to execute then block.