Last active
December 17, 2015 13:49
-
-
Save ratbeard/5620464 to your computer and use it in GitHub Desktop.
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 getMapData = function( ) { | |
this.stateOutlines = {}; | |
this.HRROutlines = {}; | |
this.filterableData = {}; | |
this.layersByHRRNUM = {}; | |
var stateJSON = 'assets/js/data/states.json'; | |
var hrrJSON = 'assets/js/data/hospital-referral-regions.json'; | |
var filterableJSON = 'assets/js/data/filterable-data.json'; | |
}; | |
getMapData.prototype.getData = function() { | |
if (!this.dataPromise) { | |
this.dataPromise = $.when( | |
this.getStateOutlines(), | |
this.getHRROutlines(), | |
this.getFilterableData() | |
).done(this.combineData); | |
} | |
return this.dataPromise; | |
}; | |
getMapData.prototype.combineData = function() { | |
return $.extend(this._stateData, this._hfrData, this._filterData); | |
}; | |
mapData = new MapData; | |
mapData.getData().done(drawMap); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment