0

Is there a way to watch for the completion of the rendering of Google map tiles?

Related to this, is there a way to test whether or not all map tiles were successfully rendered?

This is based on an unresolved issue described here.

Community
  • 1
  • 1
Larry Eitel
  • 1,397
  • 5
  • 19
  • 37
  • Take a look [here](https://stackoverflow.com/questions/7341769/google-maps-v3-how-to-tell-when-an-imagemaptype-overlays-tiles-are-finished-lo) for a part of your question > is there a way to test whether or not all map tiles were successfully > rendered? – varun May 08 '13 at 15:38

1 Answers1

4

Listen for the tilesloaded event, e.g.

google.maps.event.addListener( 'tilesloaded', function() {
    // tiles have been loaded
});

I don't think there is any method in the API to ask whether the tiles have been loaded, but you can set a flag in your event listener.

Michael Geary
  • 28,450
  • 9
  • 65
  • 75
  • Thank you Michael, your answer is useful and perhaps can wrap the [solution](http://stackoverflow.com/a/7355063/913295) mentioned by varun. – Larry Eitel May 09 '13 at 14:01
  • 1
    Awesome. Used this and added in a check to make sure it only fires once, then forced my map to center when the event fires. I had to add my map object before the 'tilesloaded' parameter though, e.g. `addListener(myMap, 'tilesloaded', function()...` – Luke Alderton Mar 08 '16 at 12:56