change IsVisible properties by button in running mode

290
1
Jump to solution
02-17-2023 10:36 PM
hamedsetorg
New Contributor II

hello,

i want change layer properties like isvisible in game mode by button.

whats this function solution in unity sdk?

i try some code but dont solved problem.

i try use this function but there is not document for ArcGISCollection(foreach and for not work in this collection)

ArcGISCollection<ArcGISLayer> layers = arcGISMapComponent.View.Map.Layers;

thank you.

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
and1
by Esri Contributor
Esri Contributor

Hello, I'm sure there might be other solutions out there but on top of my head I think you can try to implement a toggle system to add/remove layers.

arcGISMap.Layers.Add(my_layer);

 

ArcGISMap.Layers.Remove(my_layer);

 

Or you could also play around with the opacity of the layer without needing to rebuild the map.

my_layer.Opacity = 0.1f;

 

 

View solution in original post

1 Reply
and1
by Esri Contributor
Esri Contributor

Hello, I'm sure there might be other solutions out there but on top of my head I think you can try to implement a toggle system to add/remove layers.

arcGISMap.Layers.Add(my_layer);

 

ArcGISMap.Layers.Remove(my_layer);

 

Or you could also play around with the opacity of the layer without needing to rebuild the map.

my_layer.Opacity = 0.1f;