I am using the ol.geom.Polygon object to draw a polygon and I have added a tooltip to this to show the acres drawn like this.
if (geom instanceof ol.geom.Polygon) {
MapValues.polyAcres = MapService.formatArea(geom);
tooltipCoord = geom.getInteriorPoint().getCoordinates();
MapValues.measureTooltipElement.innerHTML = MapValues.polyAcres;
MapValues.measureTooltip.setPosition(tooltipCoord);
UPDATE
This is how I'm creating the tool-tip...
mapSVC.createMeasureTooltip = function(){
if (MapValues.measureTooltipElement) {
MapValues.measureTooltipElement.parentNode.removeChild(MapValues.measureTooltipElement);
}
MapValues.measureTooltipElement = document.createElement('div');
MapValues.measureTooltipElement.className = 'tooltip tooltip-measure';
MapValues.measureTooltipElement.style = 'pointer-events: none';
MapValues.measureTooltip = new ol.Overlay({
element: MapValues.measureTooltipElement,
offset: [0, -15],
positioning: 'bottom-center'
});
MapValues.mapObj.addOverlay(MapValues.measureTooltip);
}
The problem is, depending on the shape drawn a point and the tool-tip can overlap which effectively blocks my ability to set a point.
How can I add the style 'pointer-events: none' to the ol.Overlay?