BouchProg
BouchProg

Reputation: 21

ol.interaction.Select -> icon disappears

I use ol.interaction.Select but when fly over feature, my icon disappears.

 var selectPointerMove = new ol.interaction.Select({
       condition: ol.events.condition.pointerMove,
       style: []
 });

What should I put in style to keep my basic icon?

thanks for your help

Upvotes: 1

Views: 918

Answers (2)

BouchProg
BouchProg

Reputation: 21

Thanks for your response but if no style, I have a blue point

For example : My Map with icon

When my pointer is on icon

I want just my icon, no blue point... I have many feature with different icon.

Upvotes: 1

Sumanth Shastry
Sumanth Shastry

Reputation: 1159

Just remove style:[] from the above code or create a style object.

If you see the documentation of ol.interaction.Selecthttp://openlayers.org/en/latest/apidoc/ol.interaction.Select.html

It clearly says style property will be applied for selected Features. Since in your code you have declared an empty style object so the feature is not getting displayed.

Fix :

var selectPointerMove = new ol.interaction.Select({
       condition: ol.events.condition.pointerMove,
 });

Upvotes: 2

Related Questions