Ejemplo n.º 1
0
 internal void Close()
 {
     MapVM.MapView.GeoViewTapped -= Identify;
     GraphicsOverlay.Graphics.Clear();
     FeatureAttributes = new List <FeatureAttribute>();
     IdentifyLayerResults.Clear();
     MapVM.IdentifyIsVisible = false;
 }
Ejemplo n.º 2
0
        public IdentifyResultsViewModel(IEnumerable <IdentifyLayerResult> identifyLayerResults) : this()
        {
            foreach (var result in identifyLayerResults)
            {
                IdentifyLayerResults.Add(result);
            }

            SelectedLayerIndex        = 0;
            SelectedLayerName         = IdentifyLayerResults[SelectedLayerIndex].LayerContent.Name;
            SelectedLayerDisplayIndex = 1;
            LayerCount                  = IdentifyLayerResults.Count;
            SelectedElementIndex        = 0;
            SelectedElementDisplayIndex = 1;
            ElementCount                = IdentifyLayerResults.First().GeoElements.Count;
            SelectedGeoElement          = IdentifyLayerResults[SelectedLayerIndex].GeoElements[SelectedElementIndex];
        }
Ejemplo n.º 3
0
        private async void Identify(object sender, Esri.ArcGISRuntime.UI.Controls.GeoViewInputEventArgs e)
        {
            GraphicsOverlay.Graphics.Clear();
            FeatureAttributes = new List <FeatureAttribute>();
            if (SelectedLayer.Name == "<All>")
            {
                IdentifyLayerResults.Clear();
                var results = await MapVM.MapView.IdentifyLayersAsync(e.Position, 10, false);

                foreach (var result in results)
                {
                    if (result.LayerContent is FeatureLayer && LayerList.FirstOrDefault(layer => layer.Name == result.LayerContent.Name) != null)
                    {
                        IdentifyLayerResults.Add(GetLayerResult(result));
                    }

                    if (result.LayerContent is GroupLayer)
                    {
                        foreach (var subresult in result.SublayerResults)
                        {
                            if (subresult.LayerContent is FeatureLayer && LayerList.FirstOrDefault(layer => layer.Name == subresult.LayerContent.Name) != null)
                            {
                                IdentifyLayerResults.Add(GetLayerResult(subresult));
                            }
                        }
                    }
                }
            }
            else
            {
                IdentifyLayerResults.Clear();
                var result = await MapVM.MapView.IdentifyLayerAsync(SelectedLayer, e.Position, 10, false);

                IdentifyLayerResults.Add(GetLayerResult(result));
            }
        }