From 5377a72d49d4c4bfb591a6e189d21c7ebb3b7324 Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Mon, 4 Nov 2013 20:59:03 +0100 Subject: Add map to home. --- home/map.js | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 home/map.js (limited to 'home/map.js') 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('© OpenStreetMap contributors, CC-BY-SA') + .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' + } +]); -- cgit v1.2.3