Created
June 15, 2016 01:09
-
-
Save cmawhorter/a1b0b6a6b73678b97920f748ebca244b to your computer and use it in GitHub Desktop.
if you absolutely want to use that SO code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// snippet for SO: http://stackoverflow.com/a/14138133/670023 | |
// Never do this. Handlers inside of handlers is a Bad Idea regardless of whether they're once or not. | |
google.maps.event.addListenerOnce(map, 'tilesloaded', function(){ | |
//this part runs when the mapobject is created and rendered | |
google.maps.event.addListenerOnce(map, 'tilesloaded', function(){ | |
//this part runs when the mapobject shown for the first time | |
}); | |
}); | |
// i'm not saying that answer is correct, but if you absolutely want to use that solution, do this instead: | |
var tilesLoadedCount = 0; | |
google.maps.event.addListener(map, 'tilesloaded', function() { | |
tilesLoadedCount++; | |
if (tilesLoadedCount === 2) { | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
thanks for your gits, maybe last tilesload subscription is the question to be solved, I try to debug for "last change of tiles loaded before idle map", and my research found nearly your solution: