<?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: Defining new vertex distance while editing in ArcGIS API for Silverlight Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/defining-new-vertex-distance-while-editing/m-p/477656#M12327</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Jennifer,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I already knew this event "VertexAdded", but what I wanted to do is to manipulate the line before the user click. Let me explain exactly what I want to do.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The user begins drawing a Geometry, and while adding new vertexes, he might click on an option named by "Define Length". Then, a modal pops up and asks him the length, in meters, that he wants to constrain. After that, he informs a Double value in a textbox and click ok. The line that shows up at the user interface ( The one that follows the mouse and represent the distance between the latest vertex added and where the new one is going to be ) should have EXACTLY the length the user typed. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I literally want to recreate the "Length" feature supported on ArcGIS Desktop while Editing. Is there a way I can manipulate the "Line" that follows the mouse? The one that indicates where the new vertex is going to be added... If so, this will help me a LOT, because I also need to implement the "parallel" and "perperndicular" features while editing.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you so much!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 18 Jan 2012 17:21:26 GMT</pubDate>
    <dc:creator>RafaelCarvalho</dc:creator>
    <dc:date>2012-01-18T17:21:26Z</dc:date>
    <item>
      <title>Defining new vertex distance while editing</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/defining-new-vertex-distance-while-editing/m-p/477653#M12324</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Everyone,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm trying to reproduce on a Silverlight Application the "Length" resource availiable while editing/adding to a feature class on ArcMap Desktop Software. Is there a way to constraint the length of the line that identifies where the new vertex for a polygon is going to be fixed?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I would appreciate any help! Thanks!!! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Jan 2012 15:26:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/defining-new-vertex-distance-while-editing/m-p/477653#M12324</guid>
      <dc:creator>RafaelCarvalho</dc:creator>
      <dc:date>2012-01-12T15:26:18Z</dc:date>
    </item>
    <item>
      <title>Re: Defining new vertex distance while editing</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/defining-new-vertex-distance-while-editing/m-p/477654#M12325</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello again!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've been trying to find a solution to this since yesterday, but I couldn't find none that would suit well for my project. I also couldn't find the class responsable to handle the line representation that indicates where the new vertex is going to be fixed while creating a geometric figure. Isn't there a event or a property where I can limit the length of this new line?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Jan 2012 09:18:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/defining-new-vertex-distance-while-editing/m-p/477654#M12325</guid>
      <dc:creator>RafaelCarvalho</dc:creator>
      <dc:date>2012-01-13T09:18:27Z</dc:date>
    </item>
    <item>
      <title>Re: Defining new vertex distance while editing</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/defining-new-vertex-distance-while-editing/m-p/477655#M12326</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm not sure if this works for you but you can try updating this SDK sample: &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#EditToolsGeometry" rel="nofollow noopener noreferrer" target="_blank"&gt;http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#EditToolsGeometry&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;VertexAdded is one of GeometryEdit action, you can compare the distance between vertices then and if the shortest distance is still outside the max distance, you can Undo the last edit.&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; private void EditGeometry_GeometryEdit(object sender, EditGeometry.GeometryEditEventArgs e)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp; if (e.Action == EditGeometry.Action.VertexAdded)
&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp; var graphic = e.Graphic as Graphic;
&amp;nbsp;&amp;nbsp;&amp;nbsp; var polyline = graphic.Geometry as Polyline;
&amp;nbsp;&amp;nbsp;&amp;nbsp; var distance = double.NaN;
&amp;nbsp;&amp;nbsp;&amp;nbsp; var vertex = e.NewItems[0] as MapPoint;
&amp;nbsp;&amp;nbsp;&amp;nbsp; foreach (var p in polyline.Paths[0])
&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (!double.IsNaN(distance)) break;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var d = Math.Sqrt(Math.Pow(Math.Abs(vertex.X - p.X), 2) + Math.Pow(Math.Abs(vertex.Y - p.Y), 2));
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (double.IsNaN(distance) || d &amp;lt; distance)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; distance = d;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp; if (distance &amp;gt; maxDistance)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; editGeometry.UndoLastEdit();
&amp;nbsp;&amp;nbsp; }
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 21:05:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/defining-new-vertex-distance-while-editing/m-p/477655#M12326</guid>
      <dc:creator>JenniferNery</dc:creator>
      <dc:date>2021-12-11T21:05:52Z</dc:date>
    </item>
    <item>
      <title>Re: Defining new vertex distance while editing</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/defining-new-vertex-distance-while-editing/m-p/477656#M12327</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Jennifer,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I already knew this event "VertexAdded", but what I wanted to do is to manipulate the line before the user click. Let me explain exactly what I want to do.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The user begins drawing a Geometry, and while adding new vertexes, he might click on an option named by "Define Length". Then, a modal pops up and asks him the length, in meters, that he wants to constrain. After that, he informs a Double value in a textbox and click ok. The line that shows up at the user interface ( The one that follows the mouse and represent the distance between the latest vertex added and where the new one is going to be ) should have EXACTLY the length the user typed. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I literally want to recreate the "Length" feature supported on ArcGIS Desktop while Editing. Is there a way I can manipulate the "Line" that follows the mouse? The one that indicates where the new vertex is going to be added... If so, this will help me a LOT, because I also need to implement the "parallel" and "perperndicular" features while editing.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you so much!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Jan 2012 17:21:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/defining-new-vertex-distance-while-editing/m-p/477656#M12327</guid>
      <dc:creator>RafaelCarvalho</dc:creator>
      <dc:date>2012-01-18T17:21:26Z</dc:date>
    </item>
    <item>
      <title>Re: Defining new vertex distance while editing</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/defining-new-vertex-distance-while-editing/m-p/477657#M12328</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The code-snippet I posted is for editing. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If the graphic does not exist yet and you want to intercept the draw, you can use Draw.VertexAdded event, Draw.UndoLastVertex(), calculate new MapPoint, and Draw.AddVertex(newPoint). After the vertex was removed (UndoLastVertex), endpoint will be the start point from which you need to calculate the next point given the desired distance. Once you have this new point, you can AddVertex(newPoint).&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
PointCollection pnts = (_graphic.Geometry as Polyline).Paths[0];
MapPoint endPoint = pnts[pnts.Count - 1];
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 21:05:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/defining-new-vertex-distance-while-editing/m-p/477657#M12328</guid>
      <dc:creator>JenniferNery</dc:creator>
      <dc:date>2021-12-11T21:05:55Z</dc:date>
    </item>
    <item>
      <title>Re: Defining new vertex distance while editing</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/defining-new-vertex-distance-while-editing/m-p/477658#M12329</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Jennifer,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm developing this function to new graphics on the map, using the Draw class.&amp;nbsp; I'm not being able to detect the first vertex added position to refer myself. The vertexAdded event only works for the second vertex added and on... I tryed to get the mapPoint throught the mapClick event of my map, but it seens that when I'm on DrawMode, the mapClick event doesn't trigger.&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; private void drawObjectVertexAdded(object sender, VertexAddedEventArgs args)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _drawingObjectMapPointCollection.Add(args.Vertex.Extent.GetCenter());
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _drawingObjectSpatialReferenceCollection.Add(args.Vertex.SpatialReference);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The code above doesn't work on the first vertex added to the graphic &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt; . How can I get those references, considering that mapClick doesn't trigger while drawing?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm stucked, any help is welcome. Thank you.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 21:05:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/defining-new-vertex-distance-while-editing/m-p/477658#M12329</guid>
      <dc:creator>RafaelCarvalho</dc:creator>
      <dc:date>2021-12-11T21:05:57Z</dc:date>
    </item>
    <item>
      <title>Re: Defining new vertex distance while editing</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/defining-new-vertex-distance-while-editing/m-p/477659#M12330</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;What version of the API are you using? v2.3 and up will raise VertexAdded even for the first point. You can quickly try the following code, VertexAdded is raised immediately after DrawBegin for the first point and then for every vertex added.&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;nbsp;&amp;nbsp; 
Draw d = new Draw(MyMap){DrawMode= ESRI.ArcGIS.Client.DrawMode.Polygon, IsEnabled = true};
&amp;nbsp;&amp;nbsp; d.DrawBegin += (s, e) =&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; { 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; };
&amp;nbsp;&amp;nbsp; d.DrawComplete += (s, e) =&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp; };
&amp;nbsp;&amp;nbsp; d.VertexAdded += (s, e) =&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp; };
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 21:06:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/defining-new-vertex-distance-while-editing/m-p/477659#M12330</guid>
      <dc:creator>JenniferNery</dc:creator>
      <dc:date>2021-12-11T21:06:00Z</dc:date>
    </item>
    <item>
      <title>Re: Defining new vertex distance while editing</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/defining-new-vertex-distance-while-editing/m-p/477660#M12331</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Jennifer,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm using the version 3.0 of the API. The vertexAdded isn't triggered on the first vertex. I tryed using your code snippet, but I've encoutered the same problem using it. The drawBegin method gets triggered on the first vertex, but it can't handle the 2 parameters like you did on your code snippet "(s, e)", so I can't get the mapPoint.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]11415[/ATTACH]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You can see what I'm trying to do on the image above. I need the mapPoint reference for the first vertex circled in red. Thank you once again!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Jan 2012 08:54:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/defining-new-vertex-distance-while-editing/m-p/477660#M12331</guid>
      <dc:creator>RafaelCarvalho</dc:creator>
      <dc:date>2012-01-25T08:54:23Z</dc:date>
    </item>
    <item>
      <title>Re: Defining new vertex distance while editing</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/defining-new-vertex-distance-while-editing/m-p/477661#M12332</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Did anyone ever solve this? It would be a very useful tool.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 May 2012 17:09:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/defining-new-vertex-distance-while-editing/m-p/477661#M12332</guid>
      <dc:creator>JaredWhite</dc:creator>
      <dc:date>2012-05-30T17:09:05Z</dc:date>
    </item>
    <item>
      <title>Re: Defining new vertex distance while editing</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/defining-new-vertex-distance-while-editing/m-p/477662#M12333</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;EditGeometry will allow you to UndoLastEdit/RedoLastEdit but not add a vertex. However, draw will allow you to AddVertex to a specific location and UndoLastVertex.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 May 2012 17:46:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/defining-new-vertex-distance-while-editing/m-p/477662#M12333</guid>
      <dc:creator>JenniferNery</dc:creator>
      <dc:date>2012-05-30T17:46:13Z</dc:date>
    </item>
  </channel>
</rss>

