I have a feature that has a custom style (color). When I click on it, it does not highlight. However, if I edit the code by commenting out the
myFeature.setStyle(myStyle)
call it highlights as expected.
Is there a way to force it to highlight when a style already exists for the feature?
Code sample:
const myFill = new Fill();
myFill.setColor('rgba(100,100,200,0.60)');
const myStyle = new Style({myFill});
const myFeature = new Feature(someObject);
myFeature.setStyle(myStyle);
mySource.addFeature(myFeature);
//...
const select = new Select({condition:click});
map.addInteraction(select);
I tried adding a style to the Select but no luck.
const select = new Select({condition:click, style: myHighlightStyle});