<?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: Change point location -V.4.0 in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/change-point-location-v-4-0/m-p/564547#M52678</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You have to remove and replace the entire graphic from the "graphics" collection for it to work.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 01 Aug 2016 14:50:43 GMT</pubDate>
    <dc:creator>ReneRubalcava</dc:creator>
    <dc:date>2016-08-01T14:50:43Z</dc:date>
    <item>
      <title>Change point location -V.4.0</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/change-point-location-v-4-0/m-p/564540#M52671</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i am using esri javascript v.4 ,if i have a services that push lat,long for point how can i change the point location on map without add and remove it ,also if i need to change&amp;nbsp; its symbol and attributes .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jul 2016 16:03:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/change-point-location-v-4-0/m-p/564540#M52671</guid>
      <dc:creator>hebasaleh</dc:creator>
      <dc:date>2016-07-29T16:03:44Z</dc:date>
    </item>
    <item>
      <title>Re: Change point location -V.4.0</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/change-point-location-v-4-0/m-p/564541#M52672</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you are talking about, setGeometry and setSymbol methods that were there in 3.x (Graphic), you dont need them any more. In 4.x you can update the properties directly. I would suggest you to go through this &lt;A href="https://developers.arcgis.com/javascript/latest/guide/working-with-props/index.html" title="https://developers.arcgis.com/javascript/latest/guide/working-with-props/index.html"&gt;Working with properties | ArcGIS API for JavaScript 4.0&lt;/A&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jul 2016 16:42:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/change-point-location-v-4-0/m-p/564541#M52672</guid>
      <dc:creator>thejuskambi</dc:creator>
      <dc:date>2016-07-29T16:42:00Z</dc:date>
    </item>
    <item>
      <title>Re: Change point location -V.4.0</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/change-point-location-v-4-0/m-p/564542#M52673</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There are a couple of ways you can update existing graphics on the Map in 4.0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use the &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#source" rel="nofollow noopener noreferrer" target="_blank"&gt;FeatureLayer#source&lt;/A&gt; or &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GraphicsLayer.html#properties" rel="nofollow noopener noreferrer" target="_blank"&gt;GraphicsLayer#graphics&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want to update a Graphic, you can do it by &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html#clone" rel="nofollow noopener noreferrer" target="_blank"&gt;cloning&lt;/A&gt; the graphics, update the clone, remove the original and add the update.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Something like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;var originalGraphic = featureLayer.source.getItemAt(2);
var graphic = originalGraphic.clone();
graphic.geometry = updatedGeometry;
graphic.symbol = updatedSymbol;
featureLayer.source.removeAt(2);
featurelayer.source.add(graphic);&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That should work.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 00:19:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/change-point-location-v-4-0/m-p/564542#M52673</guid>
      <dc:creator>ReneRubalcava</dc:creator>
      <dc:date>2021-12-12T00:19:58Z</dc:date>
    </item>
    <item>
      <title>Re: Change point location -V.4.0</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/change-point-location-v-4-0/m-p/564543#M52674</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i tried to update the geometry as below but it didn't work&lt;/P&gt;&lt;P&gt;&amp;nbsp; var Layer =&amp;nbsp; this._service.map.layers.getItemAt(0);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Layer.graphics.getItemAt(0).geometry.latitude += 0.001;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Layer.graphics.getItemAt(0).geometry.longitude += 0.001;&lt;/P&gt;&lt;P&gt;assuming that i have only one graphic layer and only one graphic on it ,but nothing change.how can i write the path&lt;/P&gt;&lt;P&gt;on this._service.map.get("") if i have many graphic layers with many graphic&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jul 2016 20:29:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/change-point-location-v-4-0/m-p/564543#M52674</guid>
      <dc:creator>hebasaleh</dc:creator>
      <dc:date>2016-07-29T20:29:45Z</dc:date>
    </item>
    <item>
      <title>Re: Change point location -V.4.0</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/change-point-location-v-4-0/m-p/564544#M52675</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks for your reply, i am using Graphic layer not feature layer,and the graphic layer doesn't contain Clone,so i am doing the following&lt;/P&gt;&lt;P&gt; this.point.latitude += 0.001;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.point.longitude += 0.001;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var Layer =&amp;nbsp; this._service.map.layers.getItemAt(0);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var graphic =new Graphic({&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; geometry: this.point,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; attributes: {&lt;/P&gt;&lt;P&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;&amp;nbsp;&amp;nbsp; index: this._pointIndex&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; },&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; symbol: this.sym&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Layer.graphics.getItemAt(0);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Layer.graphics.removeAt(0);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Layer.graphics.add(graphic);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;which i didn't like as i want to update the geometry without adding and removing the graphic again&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jul 2016 20:42:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/change-point-location-v-4-0/m-p/564544#M52675</guid>
      <dc:creator>hebasaleh</dc:creator>
      <dc:date>2016-07-29T20:42:53Z</dc:date>
    </item>
    <item>
      <title>Re: Change point location -V.4.0</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/change-point-location-v-4-0/m-p/564545#M52676</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Rather than updating the latitude and longitude, I would suggest you could simply clone the geometry and try updating the Geometry of the graphic.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;var graphic = Layer.graphics.getItemAt(0);&lt;/P&gt;&lt;P&gt;var newPoint = this.point.clone();&lt;/P&gt;&lt;P&gt;//updated the newPoint&lt;/P&gt;&lt;P&gt;graphic.geometry = newPoint;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jul 2016 20:56:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/change-point-location-v-4-0/m-p/564545#M52676</guid>
      <dc:creator>thejuskambi</dc:creator>
      <dc:date>2016-07-29T20:56:43Z</dc:date>
    </item>
    <item>
      <title>Re: Change point location -V.4.0</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/change-point-location-v-4-0/m-p/564546#M52677</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i tried the following &lt;/P&gt;&lt;P&gt; var graphicItem = this.graphicLayer1.graphics.find((x) =&amp;gt; x.attributes["index"] == device.DeviceCode);&lt;/P&gt;&lt;P&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;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&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;&amp;nbsp;&amp;nbsp;&amp;nbsp; var newPoint = graphicItem.geometry;&lt;/P&gt;&lt;P&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;&amp;nbsp;&amp;nbsp;&amp;nbsp; var addpoint = newPoint.clone();&lt;/P&gt;&lt;P&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;&amp;nbsp;&amp;nbsp;&amp;nbsp; addpoint.longitude = device.Location.Longitude;&lt;/P&gt;&lt;P&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;&amp;nbsp;&amp;nbsp;&amp;nbsp; addpoint.latitude = device.Location.Latitude;&lt;/P&gt;&lt;P&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;&amp;nbsp;&amp;nbsp;&amp;nbsp; //updated the newPoint&lt;/P&gt;&lt;P&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;&amp;nbsp;&amp;nbsp;&amp;nbsp; graphicItem.geometry = addpoint;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but it didn't work .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Aug 2016 14:17:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/change-point-location-v-4-0/m-p/564546#M52677</guid>
      <dc:creator>hebasaleh</dc:creator>
      <dc:date>2016-08-01T14:17:02Z</dc:date>
    </item>
    <item>
      <title>Re: Change point location -V.4.0</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/change-point-location-v-4-0/m-p/564547#M52678</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You have to remove and replace the entire graphic from the "graphics" collection for it to work.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Aug 2016 14:50:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/change-point-location-v-4-0/m-p/564547#M52678</guid>
      <dc:creator>ReneRubalcava</dc:creator>
      <dc:date>2016-08-01T14:50:43Z</dc:date>
    </item>
  </channel>
</rss>

