I want to initialize modify interaction in the way that the user can only delete vertices. I want to disable the other two functionalities which interaction offers like moving and adding new ones. Does anyone have some suggestion?
1 Answer
You can pass the altKeyOnly
condition to the Modify interaction:
import { altKeyOnly } from "ol/events/condition";
import { Modify } from "ol/interaction";
const features = ...; // get modifying features
const modify = new Modify({
features: features,
condition: altKeyOnly,
...
});
...
-
I am working with OpenLayers 3 geoadmin.github.io/ol3/apidoc/ol.interaction.Modify.html, there isn't condition property– GoranOct 29, 2019 at 13:04
-
It works anyway, this is how my options looks like , but now my deleteCondition is not working , { features : select.getFeatures(), deleteCondition : ol.events.condition.click, condition: ol.events.condition.altKeyOnly, }– GoranOct 29, 2019 at 13:08