<?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 AddVertex on Draw object uses mouse location instead of geometry passed in in ArcGIS Runtime SDK for WPF (Retired) Questions</title>
    <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/addvertex-on-draw-object-uses-mouse-location/m-p/760438#M3791</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello there, I seem to be running into what was described in &lt;/SPAN&gt;&lt;A href="http://forums.arcgis.com/threads/34985-Draw-object-mouse-last-position-used-in-Addvertex"&gt;this thread&lt;/A&gt;&lt;SPAN&gt; in the 10.1.1 WPF Runtime and was wondering if anyone else had found any workarounds, since the bug seems to still be present.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Briefly described, I have enabled a Draw object using PolyLine draw mode. I click with the mouse on a location of the map to initiate drawing. I then use a keyboard key to pull up an input form (much like Ctrl-A to choose Direction in ArcMap while creating a polyline) and type in the angle and length of the segment I would like to draw. Upon hitting enter, the dialog is dismissed and I call AddVertex on the draw object with the MapPoint I have calculated. I do this several times, and call CompleteDraw. What I then see is that the geometry for the polyline is not the series of MapPoints I have specified via AddVertex, but instead the locations that the mouse cursor was over while the dialog had focus, is instead used for the geometry of the polyline.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I attached an annotated screenshot of the resulting data to show what was expected based on the MapPoints entered, and the resulting geometry of the polyline that was created.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any advice? I tried moving the cursor with code to the same location as that which I was calling AddVertex on, but it didn't appear to affect the geometry used to create the line.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 05 Aug 2013 18:38:21 GMT</pubDate>
    <dc:creator>DanielRouleau</dc:creator>
    <dc:date>2013-08-05T18:38:21Z</dc:date>
    <item>
      <title>AddVertex on Draw object uses mouse location instead of geometry passed in</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/addvertex-on-draw-object-uses-mouse-location/m-p/760438#M3791</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello there, I seem to be running into what was described in &lt;/SPAN&gt;&lt;A href="http://forums.arcgis.com/threads/34985-Draw-object-mouse-last-position-used-in-Addvertex"&gt;this thread&lt;/A&gt;&lt;SPAN&gt; in the 10.1.1 WPF Runtime and was wondering if anyone else had found any workarounds, since the bug seems to still be present.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Briefly described, I have enabled a Draw object using PolyLine draw mode. I click with the mouse on a location of the map to initiate drawing. I then use a keyboard key to pull up an input form (much like Ctrl-A to choose Direction in ArcMap while creating a polyline) and type in the angle and length of the segment I would like to draw. Upon hitting enter, the dialog is dismissed and I call AddVertex on the draw object with the MapPoint I have calculated. I do this several times, and call CompleteDraw. What I then see is that the geometry for the polyline is not the series of MapPoints I have specified via AddVertex, but instead the locations that the mouse cursor was over while the dialog had focus, is instead used for the geometry of the polyline.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I attached an annotated screenshot of the resulting data to show what was expected based on the MapPoints entered, and the resulting geometry of the polyline that was created.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any advice? I tried moving the cursor with code to the same location as that which I was calling AddVertex on, but it didn't appear to affect the geometry used to create the line.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Aug 2013 18:38:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/addvertex-on-draw-object-uses-mouse-location/m-p/760438#M3791</guid>
      <dc:creator>DanielRouleau</dc:creator>
      <dc:date>2013-08-05T18:38:21Z</dc:date>
    </item>
    <item>
      <title>Re: AddVertex on Draw object uses mouse location instead of geometry passed in</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/addvertex-on-draw-object-uses-mouse-location/m-p/760439#M3792</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;For anyone else who happens to run into this, I coded up a hacky workaround to move the mouse cursor to the position I was hoping to add the vertex, and have the user click there instead (much like the tool in ArcMap, though I was hoping to automatically place the feature).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
MapPoint referencePole; // Set elsewhere in application
var screenPoint = Map.MapToScreen(referencePole);

// Get position of Map Control on screen
var locationFromScreen = Map.PointToScreen(new System.Windows.Point(0, 0));

// Set cursor based on the above reference point and the location of the MapControl
System.Windows.Forms.Cursor.Position = new Point(Convert.ToInt32(locationFromScreen.X + screenPoint .X), Convert.ToInt32(locationFromScreen.Y + screenPoint .Y));&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'll try to create a reproducible sample and get this sent into Tech Support as well, I believe this to be a bug.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 08:17:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-wpf-retired-questions/addvertex-on-draw-object-uses-mouse-location/m-p/760439#M3792</guid>
      <dc:creator>DanielRouleau</dc:creator>
      <dc:date>2021-12-12T08:17:59Z</dc:date>
    </item>
  </channel>
</rss>

