<?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: Automatically populate latitude longitude values with graphic move in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/automatically-populate-latitude-longitude-values/m-p/129442#M12004</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;An error like that isn't the right syntax ....&amp;nbsp; Uncaught TypeError:&amp;nbsp; Cannot read property '_getInfo' of undefined.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 27 Jan 2016 17:46:33 GMT</pubDate>
    <dc:creator>TracySchloss</dc:creator>
    <dc:date>2016-01-27T17:46:33Z</dc:date>
    <item>
      <title>Automatically populate latitude longitude values with graphic move</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/automatically-populate-latitude-longitude-values/m-p/129440#M12002</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm confused about how to use applyEdits to update my latitude and longitude columns once my graphic has been moved. It seems like I need to have a complete Graphic element created to use as input for applyEdits.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This isn't giving my any errors, but when I tried this, it doesn't change my attributes.&lt;/P&gt;&lt;P&gt;&lt;/P&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; app.myEditor.editToolbar.on('graphic-move-stop', function(evt){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var currentGraphic = evt.graphic;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var latLongCoord = webMercatorUtils.xyToLngLat(evt.graphic.geometry.x, evt.graphic.geometry.y);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; console.log("Latitude:&amp;nbsp; " + latLongCoord[1] + ", Longitude:&amp;nbsp; " + latLongCoord[0]); 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var latCoor = latLongCoord[1].toFixed(6);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var longCoor = latLongCoord[0].toFixed(6);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var att = {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "OBJECTID":currentGraphic.attributes.OBJECTID,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "Name": currentGraphic.attributes.Name,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "Address": currentGraphic.attributes.Address,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "City": currentGraphic.attributes.City,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "State": currentGraphic.attributes.State,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "ZIP": currentGraphic.attributes.ZIP,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "Phone": currentGraphic.attributes.Phone,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "Cell": currentGraphic.attributes.Cell,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "Latitude": latCoor,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "Longitude":longCoor&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;&amp;nbsp;&amp;nbsp; var updateGraphic = new Graphic(currentGraphic,mySymbols.redPinSymbol_edit(),att);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; app.eusLayer.applyEdits(null,[updateGraphic], null );
&amp;nbsp;&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 07:18:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/automatically-populate-latitude-longitude-values/m-p/129440#M12002</guid>
      <dc:creator>TracySchloss</dc:creator>
      <dc:date>2021-12-11T07:18:19Z</dc:date>
    </item>
    <item>
      <title>Re: Automatically populate latitude longitude values with graphic move</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/automatically-populate-latitude-longitude-values/m-p/129441#M12003</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What do you get when you add the error function to the applyEdits?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="javascript" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14539164058855919" data-renderedposition="50_8_912_16" jivemacro_uid="_14539164058855919"&gt;&lt;P&gt;app.eusLayer.applyEdits(&lt;SPAN class="keyword"&gt;null,[updateGraphic], &lt;SPAN class="keyword"&gt;null, function () { console.log("Features updated!"); }, function (error) { console.log("Features not updated! ", error); });&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN class="keyword"&gt;&lt;SPAN class="keyword"&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Jan 2016 17:40:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/automatically-populate-latitude-longitude-values/m-p/129441#M12003</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2016-01-27T17:40:11Z</dc:date>
    </item>
    <item>
      <title>Re: Automatically populate latitude longitude values with graphic move</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/automatically-populate-latitude-longitude-values/m-p/129442#M12004</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;An error like that isn't the right syntax ....&amp;nbsp; Uncaught TypeError:&amp;nbsp; Cannot read property '_getInfo' of undefined.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Jan 2016 17:46:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/automatically-populate-latitude-longitude-values/m-p/129442#M12004</guid>
      <dc:creator>TracySchloss</dc:creator>
      <dc:date>2016-01-27T17:46:33Z</dc:date>
    </item>
    <item>
      <title>Re: Automatically populate latitude longitude values with graphic move</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/automatically-populate-latitude-longitude-values/m-p/129443#M12005</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've been looking at attr(name,value), which is something in the FeatureLayer documentation.&amp;nbsp; That seems more straight forward, since I'm just trying to modify a couple of attributes.&amp;nbsp; That doesn't work either, or I don't have the syntax right.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think maybe my lat and long coordinates are coming through typed as string.&amp;nbsp; I'm going to get them changed to a number and see if that's the problem. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Jan 2016 17:48:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/automatically-populate-latitude-longitude-values/m-p/129443#M12005</guid>
      <dc:creator>TracySchloss</dc:creator>
      <dc:date>2016-01-27T17:48:58Z</dc:date>
    </item>
    <item>
      <title>Re: Automatically populate latitude longitude values with graphic move</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/automatically-populate-latitude-longitude-values/m-p/129444#M12006</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I modified the latitude/longitude to numbers.&amp;nbsp; That didn't fix anything.&amp;nbsp;&amp;nbsp;&amp;nbsp; I also didn't have the graphic constructor correct.&amp;nbsp; It should have been curentGraphic&lt;SPAN style="text-decoration: underline;"&gt;.geometry.&lt;/SPAN&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;var updateGraphic = new Graphic(currentGraphic.geometry, mySymbols.redPinSymbol_edit() ,att);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Still isn't updating the attributes.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Jan 2016 18:09:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/automatically-populate-latitude-longitude-values/m-p/129444#M12006</guid>
      <dc:creator>TracySchloss</dc:creator>
      <dc:date>2016-01-27T18:09:26Z</dc:date>
    </item>
    <item>
      <title>Re: Automatically populate latitude longitude values with graphic move</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/automatically-populate-latitude-longitude-values/m-p/129445#M12007</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have you verified that the updateGraphic has the new attributes when it is being passed to the applyEdits method?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Jan 2016 19:09:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/automatically-populate-latitude-longitude-values/m-p/129445#M12007</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2016-01-27T19:09:01Z</dc:date>
    </item>
    <item>
      <title>Re: Automatically populate latitude longitude values with graphic move</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/automatically-populate-latitude-longitude-values/m-p/129446#M12008</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, it does.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I just now realized something.&amp;nbsp; As long as the feature is still selected, it has the original attributes.&amp;nbsp; But if I click away from it, so it's un-selected, and then select it again, I see that it has the updated coordinates.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It was working, but it didn't look like it was ....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have you ever used graphic.attr(name, value)?&amp;nbsp;&amp;nbsp; Reading the documentation, it sure sounded like it was what I needed, as opposed to going through the applyEdits process. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Jan 2016 19:13:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/automatically-populate-latitude-longitude-values/m-p/129446#M12008</guid>
      <dc:creator>TracySchloss</dc:creator>
      <dc:date>2016-01-27T19:13:20Z</dc:date>
    </item>
    <item>
      <title>Re: Automatically populate latitude longitude values with graphic move</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/automatically-populate-latitude-longitude-values/m-p/129447#M12009</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One of my apps has the capability of update attributes for a feature. The user could select many features to update (selecting attributes from comboboxes), so I had a array of features (featureSet). This is how I updated the attributes&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;array.forEach(featureSet, function (feature) {
&amp;nbsp;&amp;nbsp;&amp;nbsp; feature.attributes.Priority = registry.byId('cboPriority').get("value");
&amp;nbsp;&amp;nbsp;&amp;nbsp; feature.attributes.Management = registry.byId('cboManagement').get("value");
&amp;nbsp;&amp;nbsp;&amp;nbsp; feature.attributes.Criteria1 = registry.byId('cboCriteria1').get("value");
&amp;nbsp;&amp;nbsp;&amp;nbsp; feature.attributes.Criteria2 = registry.byId('cboCriteria2').get("value");
&amp;nbsp;&amp;nbsp;&amp;nbsp; feature.attributes.Criteria3 = registry.byId('cboCriteria3').get("value");
});

layerFeatureLayer.applyEdits(null, featureSet, null, function () { console.log("Features updated!"); }, function (error) { console.log("Features not updated! ", error); });&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 07:18:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/automatically-populate-latitude-longitude-values/m-p/129447#M12009</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2021-12-11T07:18:21Z</dc:date>
    </item>
  </channel>
</rss>

