My goal
After I've executed a function like setCenter
or setZoom
on the Map, I want to know when the map is done loading tiles so I can add my markers without distractions to the user.
The "obvious" solution
Listen to the tilesloaded
events, it will fire when the map is done loading tiles.
The problem
If the map doesn't move, or moves so little that no new tiles are loaded, the event never fires. There doesn't seem to be a way to know beforehand if a move is going to cause new tiles to be loaded, and there is no property or method on the Map class to indicate whether or not tiles are currently being fetched.
So my question is, after I've executed a map.setCenter
or setZoom
function, how do I know for sure when the map has stopped moving (in the case of an animated move) and all tiles are loaded?