<?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: copy feature from one layer to another in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/copy-feature-from-one-layer-to-another/m-p/77426#M7019</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Robert Scheitlin..&lt;/P&gt;&lt;P&gt;&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; Yes,&amp;nbsp; Layer2 is published as&amp;nbsp; Featureservice.&amp;nbsp; What I am trying to do is select the feature from Layer1 as graphic, and trying to do ApplyEdit (graphic to Layer2) is this the right way? But it fails. I meanLayer2 is not updated in the Geodatabase.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 19 Jan 2016 06:28:01 GMT</pubDate>
    <dc:creator>cadgism</dc:creator>
    <dc:date>2016-01-19T06:28:01Z</dc:date>
    <item>
      <title>copy feature from one layer to another</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/copy-feature-from-one-layer-to-another/m-p/77424#M7017</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have two feature&amp;nbsp; layers layer1 &amp;amp; layer2. I want to copy a feature from layer1 to layer2&amp;nbsp; and chnage its attributes as per layer2. I had already created a graphic from layer1 and how can i copy this to layer2 please ???&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Jan 2016 08:29:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/copy-feature-from-one-layer-to-another/m-p/77424#M7017</guid>
      <dc:creator>cadgism</dc:creator>
      <dc:date>2016-01-14T08:29:26Z</dc:date>
    </item>
    <item>
      <title>Re: copy feature from one layer to another</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/copy-feature-from-one-layer-to-another/m-p/77425#M7018</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;cadgis,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Is Layer2 a FeatureService? You can only edit features using a FeatureService (i.e. FeatureServer instead of MapServer in the url). If it is then you can use &lt;A href="https://developers.arcgis.com/javascript/jsapi/featurelayer-amd.html#applyedits"&gt;applyEdits&lt;/A&gt;​&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Jan 2016 13:11:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/copy-feature-from-one-layer-to-another/m-p/77425#M7018</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2016-01-14T13:11:10Z</dc:date>
    </item>
    <item>
      <title>Re: copy feature from one layer to another</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/copy-feature-from-one-layer-to-another/m-p/77426#M7019</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Robert Scheitlin..&lt;/P&gt;&lt;P&gt;&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; Yes,&amp;nbsp; Layer2 is published as&amp;nbsp; Featureservice.&amp;nbsp; What I am trying to do is select the feature from Layer1 as graphic, and trying to do ApplyEdit (graphic to Layer2) is this the right way? But it fails. I meanLayer2 is not updated in the Geodatabase.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Jan 2016 06:28:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/copy-feature-from-one-layer-to-another/m-p/77426#M7019</guid>
      <dc:creator>cadgism</dc:creator>
      <dc:date>2016-01-19T06:28:01Z</dc:date>
    </item>
    <item>
      <title>Re: copy feature from one layer to another</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/copy-feature-from-one-layer-to-another/m-p/77427#M7020</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;cadgis m,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Are you passing the graphic object directly to ApplyEdits? I guess that would cause it not to save because &lt;SPAN style="line-height: 1.5;"&gt;If you directly fetch feature out from FeatureLayer then it has few properties that are referenced to its parent feature layer.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5;"&gt;Try to get the JSON from the graphic and create a new Graphic using that JSON and save this new graphic to Layer2.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5;"&gt; var newFeature = new Graphic(&lt;/SPAN&gt;graphic.toJson());&lt;/P&gt;&lt;P&gt;featureLayer.applyEdits([newFeature], null, null)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you can also update the attributes of the newFeature before applying edits.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Girish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Jan 2016 06:51:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/copy-feature-from-one-layer-to-another/m-p/77427#M7020</guid>
      <dc:creator>GirishYadav</dc:creator>
      <dc:date>2016-01-19T06:51:35Z</dc:date>
    </item>
    <item>
      <title>Re: copy feature from one layer to another</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/copy-feature-from-one-layer-to-another/m-p/77428#M7021</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Girish Yadav&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Oh yes i passing the graphic object directly to ApplyEdits . &lt;/P&gt;&lt;P&gt; I will try the JSON thing and come back.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Jan 2016 10:05:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/copy-feature-from-one-layer-to-another/m-p/77428#M7021</guid>
      <dc:creator>cadgism</dc:creator>
      <dc:date>2016-01-19T10:05:23Z</dc:date>
    </item>
    <item>
      <title>Re: copy feature from one layer to another</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/copy-feature-from-one-layer-to-another/m-p/77429#M7022</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Grish..&lt;/P&gt;&lt;P&gt;I tried to as you said the following way, there is no error but it simple does not work meaning the feature is not saved in the Geodatabase.&amp;nbsp; Can you please check...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for (var i = 0; i &amp;lt; results.features.length; i++) {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Create the graphic for the parcels&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var graphic = results.features&lt;I&gt;;&lt;/I&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; graphic.setSymbol(symbol);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; app.map.graphics.add(graphic);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; app.map.setExtent(graphic.geometry.getExtent().expand(2));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var schAttrib = " " + graphic.attributes.PIN;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var schTextSymbol = new esri.symbol.TextSymbol(schAttrib);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; schTextSymbol.setColor(new dojo.Color([255, 0, 0]));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var schFont = new esri.symbol.Font("9pt",&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; esri.symbol.Font.STYLE_NORMAL,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; esri.symbol.Font.VARIANT_NORMAL,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; esri.symbol.Font.WEIGHT_BOLD, "Arial");&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //text symbol for the PIN&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; schTextSymbol.setAlign(esri.symbol.TextSymbol.ALIGN_MIDDLE);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; schTextSymbol.setFont(schFont);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var pt = graphic.geometry.getExtent().getCenter();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var gra = new esri.Graphic(pt, schTextSymbol);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; app.map.graphics.add(gra);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; app.map.removeLayer(cadastrePlotLayer);&lt;/P&gt;&lt;P&gt;&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; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var newFeature = new esri.Graphic(graphic.toJson());&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ladpTempLayer.applyEdits([newFeature], null, null)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Jun 2016 07:22:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/copy-feature-from-one-layer-to-another/m-p/77429#M7022</guid>
      <dc:creator>cadgism</dc:creator>
      <dc:date>2016-06-13T07:22:17Z</dc:date>
    </item>
    <item>
      <title>Re: copy feature from one layer to another</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/copy-feature-from-one-layer-to-another/m-p/77430#M7023</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi cadgis m,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry for the late reply, I saw this post just now. I don't know whether you have figured out the solution or not, but as this question is not yet marked as answered, I will put in my thoughts...&lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/wink.png" /&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is the Spatial reference of the input Graphic same as the spatial reference of Layer 2?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;looks like you are making a query to Layer1 and inserting the returned graphic into Layer2. One thing to remember here is that the query does take "outSR" param as input and if its not specified then the returned graphics will be in Map SR (mostly 102100). And&amp;nbsp; if Layer2 has different SR then map's SR then the graphic will get added into the layer but it will be displaced (or not visible). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Therefore, either&lt;/P&gt;&lt;P&gt;1. reproject graphics geom into Layer2's SR and then do ApplyEdits OR &lt;/P&gt;&lt;P&gt;2. set "outSR" into your query to match Layer2's SR, (but in&amp;nbsp; this case adding graphic to map will not show graphic to the correct place).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Girish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jul 2016 07:55:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/copy-feature-from-one-layer-to-another/m-p/77430#M7023</guid>
      <dc:creator>GirishYadav</dc:creator>
      <dc:date>2016-07-29T07:55:01Z</dc:date>
    </item>
    <item>
      <title>Re: copy feature from one layer to another</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/copy-feature-from-one-layer-to-another/m-p/77431#M7024</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Solved. The problem was i was not using proxy.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Dec 2017 05:22:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/copy-feature-from-one-layer-to-another/m-p/77431#M7024</guid>
      <dc:creator>cadgism</dc:creator>
      <dc:date>2017-12-05T05:22:53Z</dc:date>
    </item>
  </channel>
</rss>

