summaryrefslogtreecommitdiff
path: root/templates/map.mdwn
blob: 74c0884ef11db8e5303b96ba6f09810e10fb1106 (plain)

[[!meta stylesheet=map rel="stylesheet"]]

map = L.map('content', { layers: [OSMLayer] }); map.attributionControl.setPrefix(false); map.fitBounds(Box);

L.control.scale({ imperial: false }).addTo(map);

<TMPL_IF positionpopup> function round(n,d) { return Math.round(Math.pow(10,d)*n)/Math.pow(10,d) }; function lngLatString(latLng) { return round(latLng.lng,5) + ", " + round(latLng.lat,5) }; var popup = L.popup(); function positionPopup(e) { popup .setLatLng(e.latlng) .setContent("Position (long, lat):" + lngLatString(e.latlng)) .openOn(map); } map.on('contextmenu', positionPopup); </TMPL_IF>