aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKatie Filbert <filbertk@gmail.com>2012-12-01 16:50:25 +0100
committerKatie Filbert <filbertk@gmail.com>2012-12-01 16:50:25 +0100
commit81a81cf0fb61637997266e700ad0509372e0390a (patch)
treeba2bb0303db54fcbebeb2c36ed12dc82355a4c78
parent683b3ec897e43fa9c4aab27a081ddcf47b92d1da (diff)
downloadhealth-map-81a81cf0fb61637997266e700ad0509372e0390a.tar
health-map-81a81cf0fb61637997266e700ad0509372e0390a.tar.gz
add geojson and fix location
-rw-r--r--resources/map.js22
-rw-r--r--resources/op2geojson.js2
2 files changed, 16 insertions, 8 deletions
diff --git a/resources/map.js b/resources/map.js
index 190f4c1..dbd437b 100644
--- a/resources/map.js
+++ b/resources/map.js
@@ -4,6 +4,7 @@ $(document).ready(function() {
fetchLayers();
var map = L.map( 'map', {
+ zoom: 12,
layers: [self.tileLayer, self.hospitalLayer]
});
@@ -11,13 +12,19 @@ $(document).ready(function() {
map.on('locationfound', onLocationFound);
map.on('locationerror', onLocationError);
- map.locate({setView: true, maxZoom: 16});
+ map.locate({setView: true, maxZoom: 12});
initLayerControl();
function geojsonLayer() {
converter = new op2geojson();
data = converter.geojson();
- return L.geoJson(data);
+ var style = {
+ "color": "#ff7800",
+ "weight" : 5,
+ "opacity" : 0.65
+ };
+ layer = L.geoJson(data, style);
+ return layer;
}
function fetchLayers() {
@@ -50,10 +57,11 @@ $(document).ready(function() {
var hospitalIcon = L.icon({
iconUrl: 'resources/img/hospital.png'
});
- if (self.currentLocation) {
- L.marker([self.currentLocation.lat, self.currentLocation.lng], {icon: hospitalIcon})
- .addTo(self.hospitalLayer)
- .bindPopup('Hospital 1');
- }
+ self.hospitalLayer.addTo(map);
+// if (self.currentLocation) {
+// L.marker([self.currentLocation.lat, self.currentLocation.lng], {icon: hospitalIcon})
+// .addTo(self.hospitalLayer)
+// .bindPopup('Hospital 1');
+// }
}
});
diff --git a/resources/op2geojson.js b/resources/op2geojson.js
index c4d7d79..8850fa9 100644
--- a/resources/op2geojson.js
+++ b/resources/op2geojson.js
@@ -21,7 +21,7 @@ op2geojson = function() {
point = {
"geometry" : {
"type" : "Point",
- "coordinates" : [52.480732,13.3172386]
+ "coordinates" : [13.3172386,52.480732]
},
"type" : "Feature",
"properties" : { "name" : "Sankt Gertrauden-Krankenhaus" },