blob: f3b907b1493f75991ff189080c86266ae25c9eb6 (
plain)
[[!meta stylesheet=map rel="stylesheet"]]
L.control.scale({ imperial: false }).addTo(map);
L.Icon.Default.imagePath = '/usr/share/javascript/leaflet/images/';
<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>
|