Hi all,
Iam digging in the new API 4.X. I am not sure how to clear all graphics.
When using API 3.X we could write something like
map.graphics.clear();
for the 4.X for individual graphics:
view.graphics.remove(graphlocate);
I was hoping there would be a but it does not seem to exist?
view.graphics.removeAll();
Any other techniques?
Solved! Go to Solution.
Alex,
There is a removeAll method on the GL:
right. Is there something similar for graphics though? if not, i should probably only use GLs.
???
Graphics have to be added to a layer (either a GraphicsLayer or a FeatureLayer)....
Hi Rob,
Can you please help me on this thread that I just posted? Your help is much
appreciated.
Regards,
-Sushil
https://community.esri.com/message/803450-customised-layer-list-widget
Hi All, I need to customize my Layer List Widget in Web AppBuilder so that
whenever a sublayer and sub-sublayers are Switched ON, the parent layer(s)
gets automatically switched ON. If anyone has any suggestion or already
developed widget, i would be glad to hear. I have layers up to 3 or 4
levels of sub-classes and I hate to click 3 or 4 times to display a single
layer.
Many thanks,
Sushil
I am adding the graphics this way right now:
view.graphics.add(pointGraphic);
I have not set up any GraphisLayer like this yet
var layerbuffer = new GraphicsLayer();
Alex,
view.graphics is the Views default GraphicsLayer object.
Ok so this should work then.
view.graphics.removeAll();
View.graphics is a Collection, which does have a removeAll method.
Thanks Robert and Ken!