blob: 51993b17eff994507bc8a3cf200f846148f69541 (
plain)
- 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'
- }
- ]);
|