Last active
August 29, 2015 14:06
-
-
Save shouse/ce2a960c73e099aed024 to your computer and use it in GitHub Desktop.
Ti.Map :: Event : Region Changed happens continuously when moving map. Here's a fix
This file contains hidden or 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
var updateMapTimeout; | |
$.mapView.addEventListener('regionChanged', function() { | |
if (updateMapTimeout) clearTimeout(updateMapTimeout); | |
// Wait 100ms and if timeout hasn't been cleared by another regionChanged event then it's good to go | |
updateMapTimeout = setTimeout(function() { | |
// update your map | |
}, 100); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment