I currently have a feature layer with a click event, and a label layer drawing on top of that to label the features. If I click the feature where there is a label, that label dom node blocks the click event on the feature layer.
In my ideal world the 'disableMouseEvents()' method on an "esri/layers/LabelLayer" would also pass off click events to the layer directly beneath it. In that sense it would be transparent, but just for clicks...
Has anyone else dealt with this? My current ideas are:
- Hard code the feature layer information into a special function triggered on the label layer click
- Generalize a label layer click function, so that it does a spatial query around it for affected layers and selects the layer with the highest map index
Did you ever find a solution to this? I'm having the same issue and it's pretty frustrating. Thanks
I never did, I just use small text to try and block as little of the polygon as possible 😕
Brain,
Are you using api version 3.14 or greater? if so, you should be using "setLabelingInfo" instead of LabelLayer.
~Thejus
Thanks, I am using v 3.18, and I am using the setLabelingInfo method on the feature layer.
Did any of you happen to figure out a solution for this one?
i have a feature that opens a hyperlink on click, and same thing, the label blocks the event from happening.
Thanks,
Aaron
All,
Actually this is a pretty simple css fix. All you need to do is add this css rule:
#_internal_LabelLayer_layer {
pointer-events: none;
}
rscheitlin That did the trick!
Thank you for your help on this
It's really great!
Thank you!!!
Hi,
For information, the class name has been changed with version 3.25, the new class name is :
BR