Simpler API with hitDetection option

This commit is contained in:
Andreas Hocevar
2020-12-01 13:47:40 +01:00
parent d0a1c10cec
commit 128d20abf3
3 changed files with 68 additions and 84 deletions

View File

@@ -52,8 +52,8 @@ const map = new Map({
});
const modify = new Modify({
layer: vectorLayer,
style: function () {}, // do not render the modification vertex
hitDetection: vectorLayer,
source: vectorSource,
});
modify.on(['modifystart', 'modifyend'], function (evt) {
target.style.cursor = evt.type === 'modifystart' ? 'grabbing' : 'pointer';