I have been making a simple Modify interaction in OpenLayers, for example

var dragInteraction = new ol.interaction.Modify({
    features: new ol.Collection([feature]),
    style: dragStyle

Can I force the interaction style to stay visible without having to hover over it? I am adjusting the anchor for each marker, which makes it difficult to know where to hover the cursor to actually drag the marker.

  • Ok, I was missing the very obvious pixelTolerance option, but I would still be interested in a way to show the interaction style without any need for hovering.
    – esjay
    Mar 17, 2018 at 0:51

1 Answer 1


If I understand your goal correctly, you can apply your interaction style to a specific feature by using a selection on the feature attribute and just change the selection criteria when you are ready to work with another feature to determine the best anchor point. Should be able to also create a function to apply that style when you click on a feature.

  • Yes you are correct, I already had the custom style, just needed to reuse it. Thanks.
    – esjay
    Mar 17, 2018 at 7:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.