foreach (Layer layer in MyMap.Layers) { if (layer is FeatureLayer) { foreach (Graphic item in (layer as FeatureLayer).Graphics) item.Selected = false; } }
foreach (Graphic item in Map.Graphics) item.Selected = false;
FeatureLayer layer = sender as FeatureLayer; foreach (Graphic item in layer.Graphics) item.Selected = false; this.Attributes.FeatureLayer = layer; // And the rest of your code ........
private void FeatureLayer_MouseLeftButtonUp(object sender, GraphicMouseButtonEventArgs e) { foreach (Graphic item in Map.Graphics) item.Selected = false; this.Attributes.FeatureLayer = sender as FeatureLayer; this.Attributes.GraphicSource = e.Graphic; this.Attachments.GraphicSource = e.Graphic; this.Attachments.FeatureLayer = sender as FeatureLayer; FeatureLayer featureLayer = sender as FeatureLayer;
foreach (Graphic item in layer.Graphics) item.Selected = false;
private void FeatureLayer_MouseLeftButtonDown(object sender, ESRI.ArcGIS.Client.GraphicMouseButtonEventArgs e) { this.MyFeatureDataForm.FeatureLayer = sender as FeatureLayer; this.MyFeatureDataForm.GraphicSource = e.Graphic; }
<esri:Map x:Name="MyMap"> <esri:ArcGISTiledMapServiceLayer ID="BaseLayer" Url="http://services.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer" /> <esri:FeatureLayer ID="Fire" OutFields="*" DisableClientCaching="True" AutoSave="False" MouseLeftButtonUp="FeatureLayer_MouseLeftButtonUp" Url="http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Fire/Sheep/FeatureServer/0" /> <esri:FeatureLayer ID="HomelandSecurity" OutFields="*" DisableClientCaching="True" AutoSave="False" MouseLeftButtonUp="FeatureLayer_MouseLeftButtonUp" Url="http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/HomelandSecurity/operations/FeatureServer/0" /> </esri:Map>
<StackPanel HorizontalAlignment="Right" VerticalAlignment="Top" Margin="10"> <StackPanel Orientation="Horizontal"> <TextBlock Text="Select Layer" /> <ComboBox x:Name="cboLayers" Margin="3,0,0,0"> <ComboBoxItem Content="Fire" DataContext="{Binding Path=Layers[1], ElementName=MyMap}" /> <ComboBoxItem Content="HomelandSecurity" DataContext="{Binding Path=Layers[2], ElementName=MyMap}" /> </ComboBox> </StackPanel> <esri:FeatureDataForm x:Name="MyFeatureDataForm" Width="400" Height="400" FeatureLayer="{Binding Path=SelectedItem.DataContext, ElementName=cboLayers}" GraphicSource="{Binding Path=SelectedItem.DataContext.SelectedGraphics[0], ElementName=cboLayers}" /> </StackPanel>
private void FeatureLayer_MouseLeftButtonUp(object sender, ESRI.ArcGIS.Client.GraphicMouseButtonEventArgs e) { FeatureLayer featureLayer = sender as FeatureLayer; for (int i = 0; i < featureLayer.SelectionCount; i++) featureLayer.SelectedGraphics.ToList().UnSelect(); e.Graphic.Select(); }
Les membres connectés peuvent publier, suivre les mises à jour, et plus encore. Nouveau ici ? Inscrivez-vous gratuitement.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.