summaryrefslogtreecommitdiff
path: root/templates/map.mdwn
blob: 4b8fb72e0b7dc265d802d4725d5a4273a2ef3af1 (plain)

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

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 latLngString(latLng) { return round(latLng.lat,5) + ", " + round(latLng.lng,5) }; var popup = L.popup(); function positionPopup(e) { popup .setLatLng(e.latlng) .setContent("Position (lat, long):" + latLngString(e.latlng)) .openOn(map); } map.on('contextmenu', positionPopup); </TMPL_IF>