示例#1
0
        private void OnLayerViewStateChanged(object sender, LayerViewStateChangedEventArgs e)
        {
            // For each execution of the MapView.LayerViewStateChanged Event, get the name of
            // the layer and its LayerViewState.Status
            string lName       = e.Layer.Name;
            string lViewStatus = e.LayerViewState.Status.ToString();

            // Display the layer name and view status in the appropriate TextBlock control
            switch (lName)
            {
            case "Tiled Layer":
                StatusLabel_TiledLayer.Text = lName + " - " + lViewStatus;
                break;

            case "Image Layer":
                StatusLabel_ImageLayer.Text = lName + " - " + lViewStatus;
                break;

            case "Feature Layer":
                StatusLabel_FeatureLayer.Text = lName + " - " + lViewStatus;
                break;

            default:
                break;
            }
        }
示例#2
0
        private void MapView_LayerViewStateChanged(object sender, LayerViewStateChangedEventArgs e)
        {
            // get the name of the layer that raised the event
            var layerName = e.Layer.Name;

            // check the status and report the value
            switch (e.LayerViewState.Status)
            {
            case LayerViewStatus.Active:
                break;

            case LayerViewStatus.Error:
                Console.WriteLine("Error displaying " + layerName);
                break;

            case LayerViewStatus.Loading:
                break;

            case LayerViewStatus.NotVisible:
                Console.WriteLine(layerName + " is not visible.");
                break;

            case LayerViewStatus.OutOfScale:
                Console.WriteLine(layerName + " is not displayed due to the current scale.");
                break;

            default:
                Console.WriteLine("Status of " + layerName + " is unknown.");
                break;
            }
        }
        private void OnLayerViewStateChanged(object sender, LayerViewStateChangedEventArgs e)
        {
            // State changed event is sent by a layer. In the list, find the layer which sends this event.
            // If it exists then update the status
            var model = _layerStatusModels.FirstOrDefault(l => l.LayerName == e.Layer.Name);

            if (model != null)
            {
                model.LayerViewStatus = e.LayerViewState.Status.ToString();
            }
        }
示例#4
0
 private void mapView_LayerViewStateChanged(object sender, LayerViewStateChangedEventArgs e)
 {
     // Update the progress bar as the layers load
     if (e.LayerViewState.Status == LayerViewStatus.Active)
     {
         Dispatcher.Invoke(() =>
         {
             progress.Value    = mapView.Map.OperationalLayers.Where(l => l.LoadStatus == Esri.ArcGISRuntime.LoadStatus.Loaded || l.LoadStatus == Esri.ArcGISRuntime.LoadStatus.FailedToLoad).Count();
             progressText.Text = $"{progress.Value} / {mapView.Map.OperationalLayers.Count}";
             if (progress.Value == mapView.Map.OperationalLayers.Count)
             {
                 if (LoadingProgressPanel.Visibility == Visibility.Visible)
                 {
                     LoadingProgressPanel.Visibility = Visibility.Collapsed;
                     ZoomToAllLayers();
                 }
             }
         });
     }
 }
        private void OnLayerViewStateChanged(object sender, LayerViewStateChangedEventArgs e)
        {
            // For each execution of the MapView.LayerViewStateChanged Event, get the name of
            // the layer and its LayerViewState.Status
            string lName = e.Layer.Name;
            string lViewStatus = e.LayerViewState.Status.ToString();

            // Display the layer name and view status in the appropriate Label control
            switch (lName)
            {
                case "Tiled Layer":
                    StatusLabel_TiledLayer.Content = lName + " - " + lViewStatus;
                    break;
                case "Image Layer":
                    StatusLabel_ImageLayer.Content = lName + " - " + lViewStatus;
                    break;
                case "Feature Layer":
                    StatusLabel_FeatureLayer.Content = lName + " - " + lViewStatus;
                    break;
                default:
                    break;
            }
        }
示例#6
0
        private void MapView_LayerViewStateChanged(object sender, LayerViewStateChangedEventArgs e)
        {
            try
            {
                // get the name of the layer that raised the event
                var layerName = e.Layer.Name;
                // check the status and report the value
                switch (e.LayerViewState.Status)
                {
                case LayerViewStatus.Active:
                    break;

                case LayerViewStatus.Error:
                    Console.WriteLine("Error displaying " + layerName);
                    break;

                case LayerViewStatus.Loading:
                    break;

                case LayerViewStatus.NotVisible:
                    Console.WriteLine(layerName + " is not visible.");
                    break;

                case LayerViewStatus.OutOfScale:
                    Console.WriteLine(layerName + " is not displayed due to the current scale.");
                    break;

                default:
                    Console.WriteLine("Status of " + layerName + " is unknown.");
                    break;
                }
            }
            catch (Exception ex)
            {
                ErrorHelper.OnError(MethodBase.GetCurrentMethod().DeclaringType.Name, "Error on layer view state changed", ex);
            }
        }
 protected virtual void OnLayerViewStateChanged(Layer?layer, LayerViewStateChangedEventArgs layerViewState)
 {
 }
 private void GeoView_LayerViewStateChanged(object?sender, LayerViewStateChangedEventArgs e)
 {
     OnLayerViewStateChanged(sender as Layer, e);
 }
 private void OnLayerViewStateChanged(object sender, LayerViewStateChangedEventArgs e)
 {
     // State changed event is sent by a layer. In the list, find the layer which sends this event. 
     // If it exists then update the status
     var model = _layerStatusModels.FirstOrDefault(l => l.LayerName == e.Layer.Name);
     if (model != null)
         model.LayerViewStatus = e.LayerViewState.Status.ToString();
 }
示例#10
0
 private void OnLayerViewStateChanged(object sender, LayerViewStateChangedEventArgs e)
 {
 }