xmlns:esri="http://schemas.esri.com/arcgis/client/2009"> <Grid x:Name="LayoutRoot" Background="White"> <Grid.Resources> <esri:SimpleMarkerSymbol x:Key="RedMarkerSymbol" Color="Red" Size="12" Style="Circle" /> <esri:SimpleLineSymbol x:Key="RedLineSymbol" Color="Red" Width="4" Style="Solid" /> <esri:SimpleFillSymbol x:Key="RedFillSymbol" Fill="#66FF0000" BorderBrush="Red" BorderThickness="2" /> <esri:Editor x:Key="MyEditor" Map="{Binding ElementName=MyMap}" EditCompleted="Editor_EditCompleted"/> </Grid.Resources> <esri:Map x:Name="MyMap"> <esri:ArcGISTiledMapServiceLayer Url="http://services.arcgisonline.com/ArcGIS/rest/services/NGS_Topo_US_2D/MapServer"/> <esri:GraphicsLayer ID="MyGraphicsLayer" MouseLeftButtonDown="GraphicsLayer_MouseLeftButtonDown" > <esri:GraphicsLayer.Graphics > <esri:Graphic Symbol="{StaticResource RedMarkerSymbol}" > <esri:MapPoint X="-140.9" Y="63.391" /> </esri:Graphic> <esri:Graphic Symbol="{StaticResource RedLineSymbol}" > <esri:Polyline > <esri:Polyline.Paths> <esri:PointCollection> <esri:MapPoint X="0" Y="51.399" /> <esri:MapPoint X="2.637" Y="48.865" /> <esri:MapPoint X="12.568" Y="41.706" /> <esri:MapPoint X="13.447" Y="52.483" /> <esri:MapPoint X="21.357" Y="52.160" /> <esri:MapPoint X="30.322" Y="59.845" /> </esri:PointCollection> </esri:Polyline.Paths> </esri:Polyline> </esri:Graphic> <esri:Graphic Symbol="{StaticResource RedFillSymbol}"> <esri:Polygon > <esri:Polygon.Rings> <esri:PointCollection> <esri:MapPoint X="110.039" Y="-20.303" /> <esri:MapPoint X="132.539" Y="-7.0137" /> <esri:MapPoint X="153.281" Y="-13.923" /> <esri:MapPoint X="162.773" Y="-35.174" /> <esri:MapPoint X="133.594" Y="-43.180" /> <esri:MapPoint X="111.797" Y="-36.032" /> <esri:MapPoint X="110.039" Y="-20.303" /> </esri:PointCollection> </esri:Polygon.Rings> </esri:Polygon> </esri:Graphic> </esri:GraphicsLayer.Graphics> </esri:GraphicsLayer> </esri:Map> <Button DataContext="{StaticResource MyEditor}" Command="{Binding EditVertices}" Content="Edit" VerticalAlignment="Top" HorizontalAlignment="Center"/> </Grid>
private void Editor_EditCompleted(object sender, Editor.EditEventArgs e) { foreach (var edit in e.Edits) { resultGeometry = Geometry.Clone(edit.Graphic.Geometry); } } Geometry originalGeometry, resultGeometry; private void GraphicsLayer_MouseLeftButtonDown(object sender, GraphicMouseButtonEventArgs e) { originalGeometry = Geometry.Clone(e.Graphic.Geometry); }
Aangemelde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Registreer een gratis account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.