Good day,
I have a question, how do I set my checkbox in the add-in to make the layer visible / invisible? The layer is called "selection". My code doesn't work because IsvisibleInView is read-only.
Thanks for the advice
namespace KoncoveBody
{
internal class ViditelnostVrstvy : CheckBox
{
public ViditelnostVrstvy()
{
IsChecked = true;
}protected override void OnClick()
{
var mapView = MapView.Active;
var vrstva =
mapView.Map.GetLayersAsFlattenedList().OfType<FeatureLayer>().FirstOrDefault(l => l.Name == "Vyber") as
BasicFeatureLayer;
if (mapView == null) return;
bool isLayerVisibleInView = vrstva.IsVisibleInView(mapView);
if (isLayerVisibleInView)
{
vrstva.IsVisibleInView(mapView)=false;}
}}
}
Solved! Go to Solution.
Hi,
You can use SetVisibility method from Layer type object
Hi,
Thank you very much that´s right!