<?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: How to move a graphic via dragging 4.2 in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-move-a-graphic-via-dragging-4-2/m-p/704309#M65574</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Might be helpful for you, &lt;A href="https://community.esri.com/people/michaellodes"&gt;michaellodes&lt;/A&gt;‌&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 05 Feb 2018 10:02:56 GMT</pubDate>
    <dc:creator>LarsSchmitz</dc:creator>
    <dc:date>2018-02-05T10:02:56Z</dc:date>
    <item>
      <title>How to move a graphic via dragging 4.2</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-move-a-graphic-via-dragging-4-2/m-p/704307#M65572</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm making a polyline and placing marker graphics at every path point. However I've been looking around for hours and can't find anything on setting events on drag click on a graphic to redraw the graphic. Does anyone have any insight?&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;&lt;BR /&gt;Nardo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Jan 2017 05:28:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-move-a-graphic-via-dragging-4-2/m-p/704307#M65572</guid>
      <dc:creator>BernardoArevalo</dc:creator>
      <dc:date>2017-01-10T05:28:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to move a graphic via dragging 4.2</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-move-a-graphic-via-dragging-4-2/m-p/704308#M65573</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Don't know if you're still having the problem, but I am currently having the same issue. &amp;nbsp;I'm coming from Google Maps API v3 and wow, I'm finding ArcGIS JS 4.3 severely limited in terms of functionality in their API (as of the time of this writing). &amp;nbsp;Not to mention documentation is just awful compared to Google's API.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you're still having the problem, this is what I have figured out for my purposes. &amp;nbsp;It may or may not help you. &amp;nbsp;Basically you can attach a "drag" event handler to your MapView, then use the hitTest() method to determine whether the event occurred on a graphic that is in your MapView. &amp;nbsp;Then you can convert to map coordinates, at which point you can remove and then re-add a graphic at the new location. &amp;nbsp;The inability to just change the geometry of a Symbol is currently the biggest hurdle. &amp;nbsp;The fact that you actually have to remove and then re-add the graphic is a real pain.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;view.on("drag", function(evt) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; evt.stopPropagation();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; var screenPoint = {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; x: evt.x,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; y: evt.y&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; };&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; console.log(evt.action);&lt;/SPAN&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; view.hitTest(screenPoint).then(function(response) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var graphic = response.results[0].graphic;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; if (graphic) {&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; console.log(response.results[0].mapPoint);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var newGraphic = Graphic({&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; geometry: response.results[0].mapPoint,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; symbol: new PictureMarkerSymbol({&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; url: myUrl,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; width: "48px",&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; height: "48px"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; })&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; });&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; view.graphics.remove(graphic);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; view.graphics.add(newGraphic);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; }&lt;/SPAN&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;});&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;});&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;I also got some of this from a Stack Overflow question &lt;A href="http://gis.stackexchange.com/questions/223047/how-to-change-the-symbol-and-or-geometry-in-arcgis-api-for-javascript-4"&gt;here&lt;/A&gt;. &amp;nbsp;Basically it confirms that for API 4.0+ you have to remove a Graphic and then re-add it in order to move it.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;Let me know if you have figured out anything different or better. &amp;nbsp;This is not at all an ideal solution, but it's the best I've been able to figure out, and at this point I'm pretty frustrated with the ArcGIS API.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Mar 2017 17:20:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-move-a-graphic-via-dragging-4-2/m-p/704308#M65573</guid>
      <dc:creator>JohnCleveland</dc:creator>
      <dc:date>2017-03-08T17:20:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to move a graphic via dragging 4.2</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-move-a-graphic-via-dragging-4-2/m-p/704309#M65574</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Might be helpful for you, &lt;A href="https://community.esri.com/people/michaellodes"&gt;michaellodes&lt;/A&gt;‌&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Feb 2018 10:02:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-move-a-graphic-via-dragging-4-2/m-p/704309#M65574</guid>
      <dc:creator>LarsSchmitz</dc:creator>
      <dc:date>2018-02-05T10:02:56Z</dc:date>
    </item>
  </channel>
</rss>

