How can I set features [graphics] visibility in Feature Layer client side without setting layer definitionExpression?

1774
6
07-30-2019 10:54 AM
RoelGarcia
New Contributor III

I have a client side Layer [Feature Layer] and I like to set graphics visibility [visible = false/true] in the client side without using the DefinitionExpression.

Please let me know you anyone has any idea.

Thank you.

Tags (1)
0 Kudos
6 Replies
RobertScheitlin__GISP
MVP Emeritus

Have you tried looping through the graphics and setting the individual graphics visibility property?

0 Kudos
RoelGarcia
New Contributor III

I have tried to set visible property equals to false before insert all the features into the layer by using applyEdits but it does not work.

How can I get all the graphics? 

in 3.x the layer contains array of graphics..

Thanks,

Roel

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Have you tried to set the graphics visibility to false after they have inserted into the FL?

The only way to get the FLs graphics is to queryFeatures on the FL or the FeatureLayerView.

0 Kudos
RoelGarcia
New Contributor III

I have not try that yet,  my only concern about that is the performance, I like to hide / show graphics very fast(Instantly).

I read this ticket, but I think set the definition expression is not fast enough according what I want..

https://community.esri.com/thread/195152-hideshow-graphic-with-43-api

Thanks,

Roel

0 Kudos
mgeorge
Esri Contributor
0 Kudos
MarkHolzworth
New Contributor II

Does anybody understand why the setting an individual feature's visible property to false will hide the feature in a Scene View, but not a Map View?

0 Kudos