diff options
author | Willi <willi@jups42.de> | 2012-12-01 17:28:52 +0100 |
---|---|---|
committer | Willi <willi@jups42.de> | 2012-12-01 17:28:52 +0100 |
commit | 0a94d892169f26c17326b7840e420530b4bb9176 (patch) | |
tree | 5883d63cd8cc269872ae1a4cd158ffe227735a69 | |
parent | 856bdb5466050a810214296775070b6466404431 (diff) | |
download | health-map-0a94d892169f26c17326b7840e420530b4bb9176.tar health-map-0a94d892169f26c17326b7840e420530b4bb9176.tar.gz |
popup states hospial's name
-rw-r--r-- | resources/map.js | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/resources/map.js b/resources/map.js index e5c9b06..1b28a03 100644 --- a/resources/map.js +++ b/resources/map.js @@ -16,14 +16,21 @@ $(document).ready(function() { initLayerControl(); function geojsonLayer() { - converter = new op2geojson(); - data = converter.geojson(); + var converter = new op2geojson(); + var data = converter.geojson(); var style = { - "color": "#ff7800", - "weight" : 5, - "opacity" : 0.65 + color: "red", + weight : 50, + opacity : 0.65 }; - layer = L.geoJson(data, style); + var layer = L.geoJson(data, { + style: function(feature) { + return style; + }, + onEachFeature: function(feature, layer) { + layer.bindPopup(feature.properties.name); + } + }); return layer; } @@ -33,6 +40,12 @@ $(document).ready(function() { maxZoom: 18, attribution: 'Map data © <a href="http://openstreetmap.org">OpenStreetMap</a> contributors' }); + // L.geoJson(self.hospitalLayer, { + // pointToLayer: function(feature, latlng) { + // debugger; + // L.circleMarker(latlng); + // } + // }) } function initLayerControl() { @@ -46,7 +59,6 @@ $(document).ready(function() { var radius = e.accuracy / 2; L.marker(e.latlng).addTo(map) .bindPopup("You are within " + radius + " meters from this point").openPopup(); - $('body').trigger('hospitalsfetched'); } function onLocationError(e) { |