aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHarry Cutts <eternal.linux@gmail.com>2013-02-03 13:28:36 +0000
committerHarry Cutts <eternal.linux@gmail.com>2013-02-03 13:28:36 +0000
commit31c59cac49991fa2f31d0e31d224968991593640 (patch)
treecfe2466525585de2247180ee149829665eeaea69
parent9ab440f1369957b5e1225bfb4f3191dfb0caebb2 (diff)
downloadhealth-map-31c59cac49991fa2f31d0e31d224968991593640.tar
health-map-31c59cac49991fa2f31d0e31d224968991593640.tar.gz
Rename "villages" to "settlements"
-rw-r--r--resources/map.js19
1 files changed, 9 insertions, 10 deletions
diff --git a/resources/map.js b/resources/map.js
index 27e4de8..552bc76 100644
--- a/resources/map.js
+++ b/resources/map.js
@@ -14,8 +14,8 @@ function initMap(self) {
self.amenityLayers = {}; // contains the layers for each amenity type
self.catchmentAreas = {};
- // Create the village layer
- self.villageLayer = L.geoJson({ type: "FeatureCollection", features: [] }, {
+ // Create the settlement layer
+ self.settlementLayer = L.geoJson({ type: "FeatureCollection", features: [] }, {
style: function(feature) {
return {fillColor: 'green',
weight: 2,
@@ -25,11 +25,11 @@ function initMap(self) {
fillOpacity: 0.1};
}
});
- map.addLayer(self.villageLayer);
+ map.addLayer(self.settlementLayer);
// Layer controller
self.layersControl = L.control.layers().addTo(map);
- self.layersControl.addOverlay(self.villageLayer, "Settlements");
+ self.layersControl.addOverlay(self.settlementLayer, "Settlements");
L.control.locate().addTo(map);
@@ -197,7 +197,7 @@ function displayMap(self, map) {
});
}
- function createCatchmentAreaVillageLayer(catchmentArea) {
+ function addSettlementsForArea(catchmentArea) {
if (typeof catchmentArea.settlements != 'undefined') {
return;
}
@@ -211,14 +211,14 @@ function displayMap(self, map) {
var query = 'data=[out:json];(node(poly:"' + poly + '");<;node(w););out;';
- // Fetch village data
+ // Fetch settlement data
self.converter.fetch("http://overpass-api.de/api/interpreter", query, zoom, function(data) {
data.features = _.filter(data.features, function(feature) {
return _.contains(_.keys(feature.properties), "place") ||
feature.properties["landuse"] == "residential";
});
catchmentArea.settlements = data.features;
- self.villageLayer.addData(data);
+ self.settlementLayer.addData(data);
});
}
@@ -238,8 +238,7 @@ function displayMap(self, map) {
// Add it to the associative array
self.catchmentAreas[catchmentArea.properties["subject"]] = catchmentArea;
- // Create a village layer
- createCatchmentAreaVillageLayer(catchmentArea);
+ addSettlementsForArea(catchmentArea);
}
);
@@ -268,7 +267,7 @@ function displayMap(self, map) {
_.each(self.catchmentAreas, function(catchmentArea, i) {
// Update the data for each CatchmentAreaVillageLayer
- createCatchmentAreaVillageLayer(catchmentArea);
+ addSettlementsForArea(catchmentArea);
});
}
});