Skip to content

Instantly share code, notes, and snippets.

@iamgeoknight
Last active September 12, 2021 13:23
Show Gist options
  • Save iamgeoknight/0c609b4c99452df817694eacfa6d818f to your computer and use it in GitHub Desktop.
Save iamgeoknight/0c609b4c99452df817694eacfa6d818f to your computer and use it in GitHub Desktop.
Creating a Geometry Event Listener
let draw = new ol.interaction.Draw({
type: "LineString"
});
//Create interaction listener for draw
draw.on('drawstart', function (e) {
//Perform Task on when interaction starts
});
draw.on('drawend', function (e) {
//Perform Task on when interaction ends
});
map.addInteraction(draw);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment