<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Snapping in ArcGIS API for Silverlight Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/snapping/m-p/6455#M113</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You can try out the following sample that use both Add (Draw) and EditVertices. Both of these commands, allow snapping. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;By default, snap key is Ctrl-key and snap distance is 15. If you are using Draw or Editor, you overwrite the default in the same way &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;esri:Editor.SnapDistance="20" esri:Editor.SnapKey="S"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In this snippet, there are three different layers. You should be able to snap against features from another layer. This is also true for FeatureLayer (that inherits from GraphicsLayer). I included a checkbox that will turn off visibility of line layer, you will see that layers with visible=false are ignored in snapping. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; xmlns:esri="http://schemas.esri.com/arcgis/client/2009"&amp;gt;

&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Grid x:Name="LayoutRoot" Background="White"&amp;gt;
&amp;nbsp; &amp;lt;Grid.Resources&amp;gt;
&amp;nbsp;&amp;nbsp; &amp;lt;esri:Editor x:Key="MyRedEditor" Map="{Binding ElementName=MyMap}" LayerIDs="Red"/&amp;gt;
&amp;nbsp;&amp;nbsp; &amp;lt;esri:Editor x:Key="MyEditor" Map="{Binding ElementName=MyMap}" /&amp;gt;
&amp;nbsp;&amp;nbsp; &amp;lt;esri:Editor x:Key="MyBlueEditor" Map="{Binding ElementName=MyMap}" LayerIDs="Blue"/&amp;gt;
&amp;nbsp;&amp;nbsp; &amp;lt;esri:SimpleFillSymbol&amp;nbsp; x:Key="RedSymbol" Fill="Red"/&amp;gt;
&amp;nbsp;&amp;nbsp; &amp;lt;esri:SimpleFillSymbol&amp;nbsp; x:Key="BlueSymbol" Fill="Blue"/&amp;gt;
&amp;nbsp;&amp;nbsp; &amp;lt;esri:SimpleLineSymbol&amp;nbsp; x:Key="RedLineSymbol" Color="Red" Width="5"/&amp;gt;
&amp;nbsp; &amp;lt;/Grid.Resources&amp;gt;
&amp;nbsp; &amp;lt;esri:Map x:Name="MyMap"&amp;gt;
&amp;nbsp;&amp;nbsp; &amp;lt;esri:ArcGISTiledMapServiceLayer Url="http://services.arcgisonline.com/ArcGIS/rest/services/NGS_Topo_US_2D/MapServer"/&amp;gt;
&amp;nbsp;&amp;nbsp; &amp;lt;esri:GraphicsLayer ID="Red"/&amp;gt;
&amp;nbsp;&amp;nbsp; &amp;lt;esri:GraphicsLayer ID="Blue"/&amp;gt;
&amp;nbsp;&amp;nbsp; &amp;lt;esri:GraphicsLayer ID="Line" Visible="True"&amp;gt;
&amp;nbsp;&amp;nbsp; &amp;lt;esri:Graphic Symbol="{StaticResource RedLineSymbol}"&amp;nbsp; &amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;esri:Polyline &amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;esri:Polyline.Paths&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;esri:PointCollection&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;esri:MapPoint X="-118.169" Y="34.016" /&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;esri:MapPoint X="-104.941" Y="39.7072" /&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;esri:MapPoint X="-96.724" Y="32.732" /&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;esri:MapPoint X="-87.671" Y="41.804" /&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;esri:MapPoint X="-74" Y="40.68" /&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/esri:PointCollection&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/esri:Polyline.Paths&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/esri:Polyline&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/esri:Graphic&amp;gt;
&amp;nbsp;&amp;nbsp; &amp;lt;/esri:GraphicsLayer&amp;gt;
&amp;nbsp; &amp;lt;/esri:Map&amp;gt;
&amp;nbsp; &amp;lt;StackPanel Orientation="Horizontal" VerticalAlignment="Top" HorizontalAlignment="Center"&amp;gt;
&amp;nbsp;&amp;nbsp; &amp;lt;Button Content="AddBlue" DataContext="{StaticResource MyBlueEditor}" 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Command="{Binding Add}" CommandParameter="{StaticResource BlueSymbol}"/&amp;gt;
&amp;nbsp;&amp;nbsp; &amp;lt;Button Content="AddRed" DataContext="{StaticResource MyRedEditor}" 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Command="{Binding Add}" CommandParameter="{StaticResource RedSymbol}"/&amp;gt;
&amp;nbsp;&amp;nbsp; &amp;lt;Button Content="EditVertices" DataContext="{StaticResource MyEditor}" 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Command="{Binding EditVertices}" /&amp;gt;
&amp;nbsp;&amp;nbsp; &amp;lt;CheckBox x:Name="LineVisible" DataContext="{Binding ElementName=MyMap, Path=Layers[Line]}" 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Content="Line layer visiblity"&amp;nbsp; IsChecked="{Binding Visible, Mode=TwoWay}" /&amp;gt;
&amp;nbsp; &amp;lt;/StackPanel&amp;gt;
 &amp;lt;/Grid&amp;gt;
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 10 Dec 2021 20:16:11 GMT</pubDate>
    <dc:creator>JenniferNery</dc:creator>
    <dc:date>2021-12-10T20:16:11Z</dc:date>
    <item>
      <title>Snapping</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/snapping/m-p/6454#M112</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have several [simple] questions about snapping (v2.1 onwards):&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1) I see that the editor class has setting to control the snapping hotkey and tolerances.&amp;nbsp; But its not clear what graphics it can snap to whilst adding new geometry.&amp;nbsp; To enable the add command we are limited to one layerid (see add command api docs), does this mean snapping is limited to that layer or all visible graphics?&amp;nbsp; [Note: I tried the editor widget sdk example and it doesn't snap to the red graphics.&amp;nbsp; It does have multiple layerids set in the C#.&amp;nbsp; Adding seems to fail after the pop up box asks for a number\text]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;2) Almost by accident we found that snapping is available via the draw class (i.e. NOT the editor or editor widget) using the Control (CTRL) key.&amp;nbsp; How do we change this key and the associated tolerances for the draw class?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;3) When adding graphics using the draw or editor class the snapping doesn't allow me to snap to the graphic currently been drawn.&amp;nbsp; Can this be added in future?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;4) Finally before discovering the draw class snapping I tried to add my own snap code.&amp;nbsp; This went well until trying to replace the point the user clicked with my own nearest snap point.&amp;nbsp; The only api hook I could find was the draw.vertexadded event.&amp;nbsp; In here I tried to undo the last vertex and then add my own but this gave strange behaviour.&amp;nbsp; As anyone got something similar to work and how? [a berforevertex added event with e.handled would be useful here]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks in anticipation,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Matt&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Jun 2011 06:58:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/snapping/m-p/6454#M112</guid>
      <dc:creator>MatthewPilgrim</dc:creator>
      <dc:date>2011-06-07T06:58:40Z</dc:date>
    </item>
    <item>
      <title>Re: Snapping</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/snapping/m-p/6455#M113</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You can try out the following sample that use both Add (Draw) and EditVertices. Both of these commands, allow snapping. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;By default, snap key is Ctrl-key and snap distance is 15. If you are using Draw or Editor, you overwrite the default in the same way &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;esri:Editor.SnapDistance="20" esri:Editor.SnapKey="S"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In this snippet, there are three different layers. You should be able to snap against features from another layer. This is also true for FeatureLayer (that inherits from GraphicsLayer). I included a checkbox that will turn off visibility of line layer, you will see that layers with visible=false are ignored in snapping. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; xmlns:esri="http://schemas.esri.com/arcgis/client/2009"&amp;gt;

&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Grid x:Name="LayoutRoot" Background="White"&amp;gt;
&amp;nbsp; &amp;lt;Grid.Resources&amp;gt;
&amp;nbsp;&amp;nbsp; &amp;lt;esri:Editor x:Key="MyRedEditor" Map="{Binding ElementName=MyMap}" LayerIDs="Red"/&amp;gt;
&amp;nbsp;&amp;nbsp; &amp;lt;esri:Editor x:Key="MyEditor" Map="{Binding ElementName=MyMap}" /&amp;gt;
&amp;nbsp;&amp;nbsp; &amp;lt;esri:Editor x:Key="MyBlueEditor" Map="{Binding ElementName=MyMap}" LayerIDs="Blue"/&amp;gt;
&amp;nbsp;&amp;nbsp; &amp;lt;esri:SimpleFillSymbol&amp;nbsp; x:Key="RedSymbol" Fill="Red"/&amp;gt;
&amp;nbsp;&amp;nbsp; &amp;lt;esri:SimpleFillSymbol&amp;nbsp; x:Key="BlueSymbol" Fill="Blue"/&amp;gt;
&amp;nbsp;&amp;nbsp; &amp;lt;esri:SimpleLineSymbol&amp;nbsp; x:Key="RedLineSymbol" Color="Red" Width="5"/&amp;gt;
&amp;nbsp; &amp;lt;/Grid.Resources&amp;gt;
&amp;nbsp; &amp;lt;esri:Map x:Name="MyMap"&amp;gt;
&amp;nbsp;&amp;nbsp; &amp;lt;esri:ArcGISTiledMapServiceLayer Url="http://services.arcgisonline.com/ArcGIS/rest/services/NGS_Topo_US_2D/MapServer"/&amp;gt;
&amp;nbsp;&amp;nbsp; &amp;lt;esri:GraphicsLayer ID="Red"/&amp;gt;
&amp;nbsp;&amp;nbsp; &amp;lt;esri:GraphicsLayer ID="Blue"/&amp;gt;
&amp;nbsp;&amp;nbsp; &amp;lt;esri:GraphicsLayer ID="Line" Visible="True"&amp;gt;
&amp;nbsp;&amp;nbsp; &amp;lt;esri:Graphic Symbol="{StaticResource RedLineSymbol}"&amp;nbsp; &amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;esri:Polyline &amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;esri:Polyline.Paths&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;esri:PointCollection&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;esri:MapPoint X="-118.169" Y="34.016" /&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;esri:MapPoint X="-104.941" Y="39.7072" /&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;esri:MapPoint X="-96.724" Y="32.732" /&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;esri:MapPoint X="-87.671" Y="41.804" /&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;esri:MapPoint X="-74" Y="40.68" /&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/esri:PointCollection&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/esri:Polyline.Paths&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/esri:Polyline&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/esri:Graphic&amp;gt;
&amp;nbsp;&amp;nbsp; &amp;lt;/esri:GraphicsLayer&amp;gt;
&amp;nbsp; &amp;lt;/esri:Map&amp;gt;
&amp;nbsp; &amp;lt;StackPanel Orientation="Horizontal" VerticalAlignment="Top" HorizontalAlignment="Center"&amp;gt;
&amp;nbsp;&amp;nbsp; &amp;lt;Button Content="AddBlue" DataContext="{StaticResource MyBlueEditor}" 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Command="{Binding Add}" CommandParameter="{StaticResource BlueSymbol}"/&amp;gt;
&amp;nbsp;&amp;nbsp; &amp;lt;Button Content="AddRed" DataContext="{StaticResource MyRedEditor}" 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Command="{Binding Add}" CommandParameter="{StaticResource RedSymbol}"/&amp;gt;
&amp;nbsp;&amp;nbsp; &amp;lt;Button Content="EditVertices" DataContext="{StaticResource MyEditor}" 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Command="{Binding EditVertices}" /&amp;gt;
&amp;nbsp;&amp;nbsp; &amp;lt;CheckBox x:Name="LineVisible" DataContext="{Binding ElementName=MyMap, Path=Layers[Line]}" 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Content="Line layer visiblity"&amp;nbsp; IsChecked="{Binding Visible, Mode=TwoWay}" /&amp;gt;
&amp;nbsp; &amp;lt;/StackPanel&amp;gt;
 &amp;lt;/Grid&amp;gt;
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 20:16:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/snapping/m-p/6455#M113</guid>
      <dc:creator>JenniferNery</dc:creator>
      <dc:date>2021-12-10T20:16:11Z</dc:date>
    </item>
    <item>
      <title>Re: Snapping</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/snapping/m-p/6456#M114</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Snapping is enabled for any client side graphics you have. If you want to disable graphics for specific layers, you can temporarily disable hittesting on those layers. Ie. layer.IsHitTestVisible=false;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regarding (3): You cannot snap to the feature you are drawing, since it would cause a self-intersection on the path/ring. This is by design. However if you are editing a multi-part geometry (ie holes etc), you can snap to the other parts of that geometry instance, but the "active" path/ring will still be ignored.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Jun 2011 22:35:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/snapping/m-p/6456#M114</guid>
      <dc:creator>dotMorten_esri</dc:creator>
      <dc:date>2011-06-07T22:35:59Z</dc:date>
    </item>
    <item>
      <title>Re: Snapping</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/snapping/m-p/6457#M115</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;&lt;BR /&gt;By default, snap key is Ctrl-key and snap distance is 15. If you are using Draw or Editor, you overwrite the default in the same way &lt;BR /&gt;esri:Editor.SnapDistance="20" esri:Editor.SnapKey="S"&lt;BR /&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;So how do I get to the Draw objects Editor?&amp;nbsp; I don't see a Editor property on that object.&amp;nbsp; In debug mode there are all the editor properties, however, they are not public.&amp;nbsp; Any help with this would be great!&amp;nbsp; If the Editor is not currently available can you put in a request to expose that object in the next release of the SL API?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Apr 2013 17:15:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/snapping/m-p/6457#M115</guid>
      <dc:creator>JustinCornell</dc:creator>
      <dc:date>2013-04-24T17:15:46Z</dc:date>
    </item>
  </channel>
</rss>

