LabelClass not working when Layer is filtered

106
2
04-10-2020 04:14 AM
Highlighted
New Contributor III

Hi, 
I'm working with 4.14 version of JavaScript API, but apparently, LabelClass is not working as expected. I have a widget that filters out features from a layer based on its status. In the illustration, I have overlapping points. Filtering works. However, labels for filtered features are not showing. 

This is how I filter: 

This is my labelClass: 

This is how I set the labelingInfo:

This is the result:

I hope someone can help me with this. Thank you. 

Reply
0 Kudos
2 Replies
Highlighted
Esri Contributor

Hi there, 

At this time, it is an expected behavior. 4.x labeling engine checks if labels are on exact same spots and keeps one for performance reasons. This behavior is on our radar and we will be enhancing the labels engine to count for scenarios like this one. 

You could add an another layer with no fill and controlling the labels there.

-Undral

Highlighted
New Contributor III

Hi Undral, with another layer, you mean a duplicate of my geojsonLayer with filter expression? Or a graphicsLayer? It will show in my layerlist though. 

Reply
0 Kudos