Exemplo n.º 1
0
 internal void Close()
 {
     MapVM.MapView.GeoViewTapped -= Identify;
     GraphicsOverlay.Graphics.Clear();
     FeatureAttributes = new List <FeatureAttribute>();
     IdentifyLayerResults.Clear();
     MapVM.IdentifyIsVisible = false;
 }
Exemplo n.º 2
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));
            }
        }