diff options
author | Jonas Smedegaard <dr@jones.dk> | 2013-11-04 20:59:03 +0100 |
---|---|---|
committer | Jonas Smedegaard <dr@jones.dk> | 2013-11-04 20:59:03 +0100 |
commit | 5377a72d49d4c4bfb591a6e189d21c7ebb3b7324 (patch) | |
tree | efa7d3923a40e7de75484b64d02e88758604ea09 /home | |
parent | 77d4a85ff104efaeddf1f27b7dda708d94adfd81 (diff) |
Add map to home.
Diffstat (limited to 'home')
-rw-r--r-- | home/map.js | 38 | ||||
-rw-r--r-- | home/poi.js | 48 |
2 files changed, 86 insertions, 0 deletions
diff --git a/home/map.js b/home/map.js new file mode 100644 index 0000000..548db5e --- /dev/null +++ b/home/map.js @@ -0,0 +1,38 @@ +var map=null; //global map object + +function init(){ + var map = L.map('map', { + center: [55.8, 10.4], + zoom: 8, + layers: [L.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png')], + maxBounds: [[54, 6],[58, 16]], + zoomControl: false, + attributionControl: false + }); + var waypoints = L.geoJson([],{ + } + }).addTo(map); + + L.control.zoom({position: 'topright'}).addTo(map); + L.control.attribution() + .setPrefix(false) + .addAttribution('© <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>') + .addTo(map); + L.control.scale({imperial: false}).addTo(map); + + Modernizr.load([ + { + load: 'poi.js', + callback: function() { + waypoints.addData(data); + } + } + ]); +} + +Modernizr.load([ + { + test: Modernizr.rgba, + nope: '/usr/share/javascript/leaflet/leaflet.ie.css' + } +]); diff --git a/home/poi.js b/home/poi.js new file mode 100644 index 0000000..9539152 --- /dev/null +++ b/home/poi.js @@ -0,0 +1,48 @@ +var data = { "type": "FeatureCollection", "features": [ +{ + "type": "Feature", + "properties": { + "area": "Gamløse", + "location": "Stauninggårdsvej 25" + }, + "geometry": { + "type": "Point", + "coordinates": [11.81712, 55.76432] + } +}, +{ + "type": "Feature", + "properties": { + "area": "Mørkøv", + "location": "Ringstedvej 24 A" + }, + "geometry": { + "type": "Point", + "coordinates": [11.50349, 55.64768] + } +}, +{ + "type": "Feature", + "properties": { + "area": "Amager", + "location": "Prøvestens Allé 15", + "type": "Combi" + }, + "geometry": { + "type": "Point", + "coordinates": [12.617495, 55.6596697] + } +}, +{ + "type": "Feature", + "properties": { + "area": "Røde Hus", + "location": "Ringstedvej 65 th." + }, + "geometry": { + "type": "Point", + "coordinates": [11.52641, 55.63933] + } +}, +]} + |