<?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 update point location (geometry) in code in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/update-point-location-geometry-in-code/m-p/424846#M39091</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;i would like to enable an "easy button" which will enable field users the ability to move an existing point feature to their device gps location.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;essentially, there is a button, "update location" which will update the selected feature's location/geometry and set it's x,y to the user's device x,y.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;code is as follows... (however, this does not actually update the selected features geometry, any suggestions?)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; var moveButton = new dijit.form.Button({&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; label : "Update Location",&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; "class" : "saveButton"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; });&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; dojo.place(moveButton.domNode, attInspector.deleteBtn.domNode, "after");&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; dojo.connect(moveButton, "onClick", function() { &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; if(navigator.geolocation) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; navigator.geolocation.getCurrentPosition(function(position) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; myGPS = esri.geometry.geographicToWebMercator(new esri.geometry.Point(position.coords.longitude, position.coords.latitude));&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; var newGraphic = new esri.Graphic(myGPS, null, null);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; updateFeature.geometry = newGraphic.geometry; &amp;lt;&amp;lt;---- the money code line here&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; }, function(error) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; HideProgressIndicator();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; switch (error.code) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; case error.TIMEOUT:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; alert('Timeout');&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; break;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; case error.POSITION_UNAVAILABLE:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; alert('Position unavailable');&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; break;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; case error.PERMISSION_DENIED:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; alert('Permission denied');&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; break;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; case error.UNKNOWN_ERROR:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; alert('Unknown error');&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; break;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; });&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; } else {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; alert('Browser does not support GeoLocation');&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; updateFeature.getLayer().applyEdits(null, [updateFeature], null);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; HideServiceRequestContainer();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; reloadLayers(); //to remove/reload layers to overcome the iPad graphics cache issue&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; });&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 13 Feb 2012 16:24:27 GMT</pubDate>
    <dc:creator>JaredAllen</dc:creator>
    <dc:date>2012-02-13T16:24:27Z</dc:date>
    <item>
      <title>update point location (geometry) in code</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/update-point-location-geometry-in-code/m-p/424846#M39091</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;i would like to enable an "easy button" which will enable field users the ability to move an existing point feature to their device gps location.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;essentially, there is a button, "update location" which will update the selected feature's location/geometry and set it's x,y to the user's device x,y.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;code is as follows... (however, this does not actually update the selected features geometry, any suggestions?)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; var moveButton = new dijit.form.Button({&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; label : "Update Location",&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; "class" : "saveButton"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; });&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; dojo.place(moveButton.domNode, attInspector.deleteBtn.domNode, "after");&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; dojo.connect(moveButton, "onClick", function() { &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; if(navigator.geolocation) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; navigator.geolocation.getCurrentPosition(function(position) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; myGPS = esri.geometry.geographicToWebMercator(new esri.geometry.Point(position.coords.longitude, position.coords.latitude));&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; var newGraphic = new esri.Graphic(myGPS, null, null);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; updateFeature.geometry = newGraphic.geometry; &amp;lt;&amp;lt;---- the money code line here&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; }, function(error) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; HideProgressIndicator();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; switch (error.code) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; case error.TIMEOUT:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; alert('Timeout');&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; break;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; case error.POSITION_UNAVAILABLE:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; alert('Position unavailable');&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; break;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; case error.PERMISSION_DENIED:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; alert('Permission denied');&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; break;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; case error.UNKNOWN_ERROR:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; alert('Unknown error');&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; break;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; });&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; } else {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; alert('Browser does not support GeoLocation');&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; updateFeature.getLayer().applyEdits(null, [updateFeature], null);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; HideServiceRequestContainer();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; reloadLayers(); //to remove/reload layers to overcome the iPad graphics cache issue&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; });&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Feb 2012 16:24:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/update-point-location-geometry-in-code/m-p/424846#M39091</guid>
      <dc:creator>JaredAllen</dc:creator>
      <dc:date>2012-02-13T16:24:27Z</dc:date>
    </item>
    <item>
      <title>Re: update point location (geometry) in code</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/update-point-location-geometry-in-code/m-p/424847#M39092</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Where is updateFeature defined?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Rather than setting the feature's geometry directly, try calling &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/webapi/javascript/arcgis/help/jsapi/point.htm#update"&gt;update&lt;/A&gt;&lt;SPAN&gt; and passing in the new X and Y.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Feb 2012 17:14:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/update-point-location-geometry-in-code/m-p/424847#M39092</guid>
      <dc:creator>derekswingley1</dc:creator>
      <dc:date>2012-02-13T17:14:26Z</dc:date>
    </item>
    <item>
      <title>Re: update point location (geometry) in code</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/update-point-location-geometry-in-code/m-p/424848#M39093</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt; i would like to enable an "easy button" which will enable field users the ability to move an existing point feature to their device gps location.&amp;nbsp; &lt;BR /&gt; &lt;BR /&gt;essentially, there is a button, "update location" which will update the selected feature's location/geometry and set it's x,y to the user's device x,y.&amp;nbsp; &lt;BR /&gt; &lt;BR /&gt;code is as follows... (however, this does not actually update the selected features geometry, any suggestions?)&amp;nbsp; &lt;BR /&gt; &lt;BR /&gt; var moveButton = new dijit.form.Button({&amp;nbsp; &lt;BR /&gt; label : "Update Location",&amp;nbsp; &lt;BR /&gt; "class" : "saveButton"&amp;nbsp; &lt;BR /&gt; });&amp;nbsp; &lt;BR /&gt; &lt;BR /&gt; dojo.place(moveButton.domNode, attInspector.deleteBtn.domNode, "after");&amp;nbsp; &lt;BR /&gt; &lt;BR /&gt; dojo.connect(moveButton, "onClick", function() {&amp;nbsp;&amp;nbsp; &lt;BR /&gt; if(navigator.geolocation) {&amp;nbsp; &lt;BR /&gt; navigator.geolocation.getCurrentPosition(function(position) {&amp;nbsp; &lt;BR /&gt; myGPS = esri.geometry.geographicToWebMercator(new esri.geometry.Point(position.coords.longitude, position.coords.latitude));&amp;nbsp; &lt;BR /&gt; var newGraphic = new esri.Graphic(myGPS, null, null);&amp;nbsp; &lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color:&amp;quot;#FF0000&amp;quot;;"&gt;updateFeature.geometry = newGraphic.geometry;&lt;/SPAN&gt; &amp;lt;&amp;lt;---- the money code line here&amp;nbsp; &lt;BR /&gt; }, function(error) {&amp;nbsp; &lt;BR /&gt; HideProgressIndicator();&amp;nbsp; &lt;BR /&gt; switch (error.code) {&amp;nbsp; &lt;BR /&gt; case error.TIMEOUT:&amp;nbsp; &lt;BR /&gt; alert('Timeout');&amp;nbsp; &lt;BR /&gt; break;&amp;nbsp; &lt;BR /&gt; case error.POSITION_UNAVAILABLE:&amp;nbsp; &lt;BR /&gt; alert('Position unavailable');&amp;nbsp; &lt;BR /&gt; break;&amp;nbsp; &lt;BR /&gt; case error.PERMISSION_DENIED:&amp;nbsp; &lt;BR /&gt; alert('Permission denied');&amp;nbsp; &lt;BR /&gt; break;&amp;nbsp; &lt;BR /&gt; case error.UNKNOWN_ERROR:&amp;nbsp; &lt;BR /&gt; alert('Unknown error');&amp;nbsp; &lt;BR /&gt; break;&amp;nbsp; &lt;BR /&gt; }&amp;nbsp; &lt;BR /&gt; });&amp;nbsp; &lt;BR /&gt; } else {&amp;nbsp; &lt;BR /&gt; alert('Browser does not support GeoLocation');&amp;nbsp; &lt;BR /&gt; }&amp;nbsp; &lt;BR /&gt; updateFeature.getLayer().applyEdits(null, [updateFeature], null);&amp;nbsp; &lt;BR /&gt; HideServiceRequestContainer();&amp;nbsp; &lt;BR /&gt; reloadLayers(); //to remove/reload layers to overcome the iPad graphics cache issue&amp;nbsp; &lt;BR /&gt; });&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;updateFeature is set to each currently selected feature.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;i've attempted the .update() method but the result gives no errors and no visible adjustment of actual feature geometry.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Feb 2012 13:48:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/update-point-location-geometry-in-code/m-p/424848#M39093</guid>
      <dc:creator>JaredAllen</dc:creator>
      <dc:date>2012-02-16T13:48:14Z</dc:date>
    </item>
  </channel>
</rss>

