Created
January 19, 2012 12:22
-
-
Save ricroberts/1639783 to your computer and use it in GitHub Desktop.
MapManager Constructor
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
var MapManager = function(googleMap, initialScoreDomain) { | |
self = this; | |
map = googleMap; | |
scoreDomain = initialScoreDomain; | |
$(this).bind('lsoaDataRetrieved', function() { | |
lsoaDataRetrieved = true; | |
// TODO: this is where we'll refresh the polygons on the map, later. | |
// for now, just log out the lsoa data, and say we've done | |
window.swirrl.log(lsoaData); | |
$(self).trigger('finished'); | |
}); | |
// if there was an error getting any data, finish the request, | |
// but don't remember the tiles ... so we can try again next time. | |
$(this).bind('dataError', function() { | |
// we only want to do this once - | |
// but getting boundaries or lsoa data (sparql) could raise this | |
if (!errored) { | |
errored = true; | |
window.swirrl.log('data error!'); | |
prevTiles = []; // blank out the prevTiles | |
$(this).trigger('finished'); // tell people we're done | |
} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment