Open alissonrodrigo opened 5 days ago
You have to get the interaction associated with the controls (2 and 3) and set the tooltip feature with the one of the draw:
// Add a tooltip
var tooltip = new ol.Overlay.Tooltip();
map.addOverlay(tooltip);
// Set drawing feature (interaction on control 2 and 3
[2,3].forEach(function(i) {
// Drawline interaction
var draw= editbar.getControls()[i].getInteraction()
// Set feature on drawstart
draw.on('drawstart', tooltip.setFeature.bind(tooltip));
// Remove feature on finish
draw.on(['change:active','drawend'], tooltip.removeFeature.bind(tooltip));
})
tooltip
Is it possible to fix the measured value? instead of just a tooltip
Use CSS:
.ol-popup.tooltips.black {
transform: none !important;
bottom: 0;
}
I don't think I can explain it properly, so I'll attach an image. You can see that for each line there is fixed measurement data
Does anyone know how I can fix the values on the screen?
I don't intend to fix the popup, but rather a label with the distance fixed
I would like to know how I can add the distance and area measurement feature to the "LineString" and "Polygon" controls in the example "https://viglino.github.io/ol-ext/examples/bar/map.control.editionbar. html" I would like to set these values as caption and not tooltip. Thank you, sorry for anything but I'm new here.