I am trying to create an OpenLayers map in which I can highlight a selected point feature by putting another graphic around it, such as this red box:
What I have done so far is to add a vector layer with a single point feature, and a styleMap that displays the reticule as its externalGraphic. I then move the feature and display it when I want to highlight something, or hide the feature when I don't. This works reasonably well, but I currently have to choose between one of two options, but each has a disadvantage I want to avoid.
Option 1: Correct display, incorrect interaction.
The display is as above, exactly as I want it, but features "covered" by the transparent reticule can no longer be clicked. I achieve this by adding the reticule layer to the SelectFeature control and using setLayerIndex to move it the top. This means that hovering over or clicking on any other features within the red square has no effect.
Option 2: Incorrect display, correct interaction.
If instead I don't add the reticule layer to the SelectFeature control, I can successfully click on any of the selectable features to move the reticule to them. However no matter what I set the z-index of the reticule layer or its feature to, all of the features added to the SelectFeature obscure it, as in this image:
So my question is, how can I achieve the combined effect? I want the highlighting reticule above all features, but to have no interaction with the mouse events. Is there a better way than defining this separate layer for the highlight image? If this is the best way to go, can I pass any click or hover events through the reticule layer to the feature layers below it?