var map; var ajaxRequest; var plotlist; var plotlayers=[]; window.onDomReady = initReady; window.onDomReady(initmap); function initReady(fn) { if(document.addEventListener) { document.addEventListener("DOMContentLoaded", fn, false); } } function initmap() { // set up the map map = new L.Map('map'); // create the tile layer with correct attribution //var osmUrl='http://{s}.tile.cloudmade.com/API-key/997/256/{z}/{x}/{y}.png'; var osmUrl='http://otile1.mqcdn.com/tiles/1.0.0/osm/{z}/{x}/{y}.png'; //var osmUrl='http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png'; var osmAttrib='Data, imagery and map information provided by MapQuest, OpenStreetMap and contributors, ODbL .' var osm = new L.TileLayer(osmUrl, {minZoom: 12, maxZoom: 18, attribution: osmAttrib}); map.setView(new L.LatLng(51.335, 12.37),14); map.addLayer(osm); //L.marker([51.33, 12.35], {icon: hfw1Icon}).addTo(map); //L.marker([51.37, 12.33], {icon: hfw2Icon}).addTo(map); //L.marker([51.31, 12.31], {icon: hfw3Icon}).addTo(map); } var hfw1Icon = L.icon({ iconUrl: 'images/new-hfw-marker.png', shadowUrl: 'images/hfw-marker-shadow.png', iconSize: [50, 80], // size of the icon shadowSize: [50, 74], // size of the shadow iconAnchor: [25, 80], // point of the icon which will correspond to marker's location shadowAnchor: [25, 60], // the same for the shadow popupAnchor: [0, 74] // point from which the popup should open relative to the iconAnchor }); var hfw2Icon = L.icon({ iconUrl: 'images/hfw-puzzle.png', shadowUrl: 'images/hfw-marker-shadow.png', iconSize: [50, 80], // size of the icon shadowSize: [50, 74], // size of the shadow iconAnchor: [25, 80], // point of the icon which will correspond to marker's location shadowAnchor: [25, 60], // the same for the shadow popupAnchor: [0, 74] // point from which the popup should open relative to the iconAnchor }); var hfw3Icon = L.icon({ iconUrl: 'images/hfw-marker.png', shadowUrl: 'images/hfw-marker-shadow.png', iconSize: [50, 74], // size of the icon shadowSize: [50, 74], // size of the shadow iconAnchor: [25, 54], // point of the icon which will correspond to marker's location shadowAnchor: [25, 54], // the same for the shadow popupAnchor: [0, 74] // point from which the popup should open relative to the iconAnchor });