2

I am using OpenLayers 3 and I want to have a hover effect of a polygon layer below the top layer with labels. I can arrange the order of the layers that the labels are on top of the polygon, but unfortunately, the hover effect (pointerMove) jumps on top of the labels. Is there a way to fix that?

I created a fiddle with a simple example: http://jsfiddle.net/a4kL9441/1/

2 Answers 2

0

If you use select interaction, an overlay is created with the hover effect, that's why the label's tile are covered.

So, set style on feature on pointermove. A working fiddle.

2
  • Dear Jonatas, thanks for your efforts. This works perfect. Besides the hover event I also added a click event: jsfiddle.net/a4kL9441/7
    – fidelfisch
    Commented Aug 3, 2015 at 10:48
  • I'm glad to help. Have a good day. Commented Aug 3, 2015 at 10:55
0

heres a working example without ol.interaction.select: http://jsfiddle.net/a4kL9441/5/

but how to do that with ol.interaction.select I don´t know

2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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