Why don't my featureLayer labels display when using timeSlider widget (Javascript API for ArcGIS 4.14)

4055
6
03-29-2020 06:19 PM
CarlVricella
New Contributor III

You only see all the labels when the slider has gone through the full time extent; at initialization there is nothing, they then start rendering as the slider plays.

Anyone know what the issue is?

See my codepen here: https://codepen.io/cvricella2/pen/eYNxdQg

Thanks!

Tags (1)
0 Kudos
6 Replies
UndralBatsukh
Esri Regular 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. 

I added your information to our issue system. 

-Undral

CarlVricella
New Contributor III

Okay could you offer an alternative solution?

I am thinking maybe adding another layer with no fill and controlling the labels there?

Also wondering if I perhaps could somehow use layer filtering like with this example: https://developers.arcgis.com/javascript/latest/sample-code/timeslider-filter/index.html

Carl Vricella

GIS Analyst – System Mapping

Mobile: 631-559-9633

Carl.vricella@pseg.com<mailto:Carl.vricella@pseg.com>

<http://www.psegliny.com>

<http://www.facebook.com/psegli> <http://www.twitter.com/psegli> <http://www.youtube.com/user/PSEGLI> <http://www.flickr.com/photos/psegli>

PSEGSC

0 Kudos
UndralBatsukh
Esri Regular Contributor

Hi there, 

You are absolutely on the right track for the workaround. I would do exactly what you suggested. I am thinking maybe adding another layer with no fill and controlling the labels there?

UndralBatsukh
Esri Regular Contributor

As for your second comment, do you mean to filter the layers? As for the layer, you can definitely use the filter and effect.  It won't work for the labeling because the labeling optimization happens before filtering. 

Please let me know if you need more info. 

Hope this makes sense,

-Undral

CarlVricella
New Contributor III

Ah I see, thank a lot for your help

0 Kudos
UndralBatsukh
Esri Regular Contributor

Hi there, 

I am writing to let you know that this issue issue is addressed at 4.18.

 

-Undral

0 Kudos