Skip to content

Instantly share code, notes, and snippets.

@RicSwirrl
Created January 19, 2012 12:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RicSwirrl/1639834 to your computer and use it in GitHub Desktop.
Save RicSwirrl/1639834 to your computer and use it in GitHub Desktop.
MapManager refresh
MapManager.prototype = {
refresh: function() {
$(this).trigger('started');
errored = false;
// clear these variables for this refresh
if (map.getZoom() > minZoom) {
$(this).trigger('zoomOK');
var tiles = getTiles();
deleteOldTilesData(tiles);
newTiles = getNewTiles(tiles);
// remember this set of tiles for comparison next time.
prevTiles = tiles;
// TODO: also get the boundary data.
lsoaDataRetrieved = false;
getLsoaData(newTiles);
} else {
$(this).trigger('zoomTooWide');
$(this).trigger('finished');
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment