summaryrefslogtreecommitdiff
path: root/templates/map.mdwn
blob: a2e953ede96ce9bd1c3b5822da283ba2626a4109 (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>