diff --git a/examples/modify-icon.js b/examples/modify-icon.js index 0efee5e415..b89971e5fa 100644 --- a/examples/modify-icon.js +++ b/examples/modify-icon.js @@ -58,10 +58,9 @@ const modify = new Modify({ modify.on(['modifystart', 'modifyend'], function (evt) { target.style.cursor = evt.type === 'modifystart' ? 'grabbing' : 'pointer'; }); -map.on('pointermove', function (evt) { - if (!evt.dragging) { - target.style.cursor = map.hasFeatureAtPixel(evt.pixel) ? 'pointer' : ''; - } +const overlaySource = modify.getOverlay().getSource(); +overlaySource.on(['addfeature', 'removefeature'], function (evt) { + target.style.cursor = evt.type === 'addfeature' ? 'pointer' : ''; }); map.addInteraction(modify); diff --git a/src/ol/interaction/Modify.js b/src/ol/interaction/Modify.js index fa4fb9dbd5..573f1ddbd7 100644 --- a/src/ol/interaction/Modify.js +++ b/src/ol/interaction/Modify.js @@ -108,7 +108,7 @@ const ModifyEventType = { * @property {number} [pixelTolerance=10] Pixel tolerance for considering the * pointer close enough to a segment or vertex for editing. * @property {import("../style/Style.js").StyleLike} [style] - * Style used for the modification point. For linestrings and polygons, this will + * Style used for the modification point or vertex. For linestrings and polygons, this will * be the affected vertex, for circles a point along the circle, and for points the actual * point. If not configured, the default edit style is used (see {@link module:ol/style}). * When using a style function, the point feature passed to the function will have a `features` @@ -505,7 +505,7 @@ class Modify extends PointerInteraction { } /** - * Get the overlay layer that this interaction renders sketch features to. + * Get the overlay layer that this interaction renders the modification point or vertex to. * @return {VectorLayer} Overlay layer. * @api */