Created
August 21, 2022 10:51
-
-
Save dbauszus-glx/3890bcbf9a8be2befd4c7fdd0b3610bb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
draw.interaction = new ol.interaction.Draw({ | |
source: draw.Layer.getSource(), | |
geometryFunction: draw.geometryFunction, | |
freehand: draw.freehand, | |
type: draw.type, | |
style: draw.style, | |
condition: e => { | |
if (e.originalEvent.buttons === 1) { | |
draw.vertices.push(e.coordinate); | |
draw.mapview.popup(null); | |
// Execute each method pushed into the draw.conditions array. | |
draw.conditions?.forEach(fn => typeof fn === 'function' && fn(e)) | |
return true; | |
} | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment