summaryrefslogtreecommitdiff
path: root/home/map.js
blob: 51993b17eff994507bc8a3cf200f846148f69541 (plain)
  1. var map=null; //global map object
  2. function init(){
  3. var map = L.map('map', {
  4. center: [55.8, 10.4],
  5. zoom: 8,
  6. layers: [L.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png')],
  7. maxBounds: [[54, 6],[58, 16]],
  8. zoomControl: false,
  9. attributionControl: false
  10. });
  11. var waypoints = L.geoJson([],{
  12. }).addTo(map);
  13. L.control.zoom({position: 'topright'}).addTo(map);
  14. L.control.attribution()
  15. .setPrefix(false)
  16. .addAttribution('&copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>')
  17. .addTo(map);
  18. L.control.scale({imperial: false}).addTo(map);
  19. Modernizr.load([
  20. {
  21. load: 'poi.js',
  22. callback: function() {
  23. waypoints.addData(data);
  24. }
  25. }
  26. ]);
  27. }
  28. Modernizr.load([
  29. {
  30. test: Modernizr.rgba,
  31. nope: '/usr/share/javascript/leaflet/leaflet.ie.css'
  32. }
  33. ]);