aboutsummaryrefslogtreecommitdiff
path: root/resources/map.js
diff options
context:
space:
mode:
authorKatie Filbert <filbertk@gmail.com>2012-12-01 17:53:34 +0100
committerKatie Filbert <filbertk@gmail.com>2012-12-01 17:53:34 +0100
commit34026213a1d6aa2377b16aaa503fc12077980ce1 (patch)
treef93153b9472e60f628eca9d5dccefd7fa080cf2c /resources/map.js
parent0a94d892169f26c17326b7840e420530b4bb9176 (diff)
downloadhealth-map-34026213a1d6aa2377b16aaa503fc12077980ce1.tar
health-map-34026213a1d6aa2377b16aaa503fc12077980ce1.tar.gz
hospital layer has hospitals
Diffstat (limited to 'resources/map.js')
-rw-r--r--resources/map.js32
1 files changed, 17 insertions, 15 deletions
diff --git a/resources/map.js b/resources/map.js
index 1b28a03..e14022a 100644
--- a/resources/map.js
+++ b/resources/map.js
@@ -16,22 +16,24 @@ $(document).ready(function() {
initLayerControl();
function geojsonLayer() {
- var converter = new op2geojson();
- var data = converter.geojson();
- var style = {
- color: "red",
- weight : 50,
- opacity : 0.65
- };
- var layer = L.geoJson(data, {
- style: function(feature) {
- return style;
- },
- onEachFeature: function(feature, layer) {
- layer.bindPopup(feature.properties.name);
- }
+ url = "http://overpass-api.de/api/interpreter?data=[out:json];node[amenity=hospital](52.34,13.3,52.52,13.6);out;";
+ converter = new op2geojson();
+ converter.fetch(url, function(data) {
+ var style = {
+ "color": "red",
+ "weight" : 50,
+ "opacity" : 0.65
+ };
+ layer = L.geoJson(data, {
+ style: function(feature) {
+ return style;
+ },
+ onEachFeature: function(feature, layer) {
+ layer.bindPopup(feature.properties.name);
+ }
+ });
+ return layer;
});
- return layer;
}
function fetchLayers() {