Parameters
- isVisible
- Visible.
Exception | Description |
---|---|
ArcGIS.Core.CalledOnWrongThreadException | This method or property must be called within the lambda passed to QueuedTask.Run. |
if (!layer.IsVisible) layer.SetVisibility(true); if (layer is FeatureLayer featureLayer) { if (!featureLayer.IsEditable) featureLayer.SetEditable(true); if (!featureLayer.IsSnappable) featureLayer.SetSnappable(true); }
//Must be on the QueuedTask var url = "https://geoeventsample1.esri.com:6443/arcgis/rest/services/AirportTraffics/StreamServer"; var createParam = new FeatureLayerCreationParams(new Uri(url)) { IsVisible = false //turned off by default }; var streamLayer = LayerFactory.Instance.CreateLayer<StreamLayer>(createParam, map); //or use "original" create layer (will be visible by default) Uri uri = new Uri(url); streamLayer = LayerFactory.Instance.CreateLayer(uri, map) as StreamLayer; streamLayer.SetVisibility(false);//turn off
Target Platforms: Windows 11, Windows 10