Adds a ruler to the map (#1332)

* Adds a ruler to the map

* Updating changelog

* Updating changelog
This commit is contained in:
bgreman
2021-06-24 02:58:39 -04:00
committed by GitHub
parent b43e5bac0b
commit a50a6fa917
3 changed files with 32 additions and 0 deletions

View File

@@ -123,6 +123,30 @@ const map = L.map("map", {
}).setView([0, 0], 3);
L.control.scale({ maxWidth: 200 }).addTo(map);
const rulerOptions = {
position: 'topleft',
circleMarker: {
color: Colors.Highlight,
radius: 2
},
lineStyle: {
color: Colors.Highlight,
dashArray: '1,6'
},
lengthUnit: {
display: "nm",
decimal: "2",
factor: 0.539956803,
label: "Distance:"
},
angleUnit: {
display: '°',
decimal: 0,
label: "Bearing:"
}
};
L.control.ruler(rulerOptions).addTo(map);
// https://esri.github.io/esri-leaflet/api-reference/layers/basemap-layer.html
const baseLayers = {
"Imagery Clarity": L.esri.basemapLayer("ImageryClarity", { maxZoom: 17 }),