summaryrefslogtreecommitdiff
path: root/home/map.js
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2013-11-04 20:59:03 +0100
committerJonas Smedegaard <dr@jones.dk>2013-11-04 20:59:03 +0100
commit5377a72d49d4c4bfb591a6e189d21c7ebb3b7324 (patch)
treeefa7d3923a40e7de75484b64d02e88758604ea09 /home/map.js
parent77d4a85ff104efaeddf1f27b7dda708d94adfd81 (diff)
Add map to home.
Diffstat (limited to 'home/map.js')
-rw-r--r--home/map.js38
1 files changed, 38 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('&copy; <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'
+ }
+]);