Leaflet.PolylineMeasure
Leaflet.PolylineMeasure copied to clipboard
Doesn't work with image overlays
I tried to measure a wall, unfortunately, the lines are displayed outside the map and not where I clicked
This is how I create my map
var map = L.map('map', {
crs: L.CRS.Simple,
attributionControl: false,
noWrap: true,
continuousWorld: true,
minZoom: -5,
zoomDelta: 0.2,
zoomSnap: 0.2,
wheelPxPerZoomLevel: 300
});
// Add a custom .bmp image layer
var imageBounds = [[0, 0], [size.height, size.width]];
L.imageOverlay(imageUrl, imageBounds, {
noWrap: true,
continuousWorld: true
}).addTo(map);
// Fit the bounds to the image size
map.fitBounds(imageBounds);
map.setZoom(0);
options = {
position: 'topleft', // Position to show the control. Values: 'topright', 'topleft', 'bottomright', 'bottomleft'
};
L.control.polylineMeasure(options).addTo(map);