<?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 How to add a (x, y) coord. to feature layer without using Editor and Drawing tools in ArcGIS API for Flex Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/how-to-add-a-x-y-coord-to-feature-layer-without/m-p/427111#M9989</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi, friends,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have many points in xml format. I can read this xml file in Flex.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;My goal is to add these points to a feature layer which is served in Feature Server with Feature Access enabled.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The scenario is: first, read x, y coordinate from external file; second, convert the x, y coordinate to a MapPoint; thirdly, add this MapPoint to a layer in a Feature Service served through ArcGIS Server with Feature Access enabled.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;All the samples use Editor tool and/or Drawing tool. How can I add&amp;nbsp; to these x,y coordinates to a Feature Layer without using Editor and/or Drawing tool?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 23 Jan 2013 01:33:25 GMT</pubDate>
    <dc:creator>xiannianchen</dc:creator>
    <dc:date>2013-01-23T01:33:25Z</dc:date>
    <item>
      <title>How to add a (x, y) coord. to feature layer without using Editor and Drawing tools</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/how-to-add-a-x-y-coord-to-feature-layer-without/m-p/427111#M9989</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi, friends,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have many points in xml format. I can read this xml file in Flex.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;My goal is to add these points to a feature layer which is served in Feature Server with Feature Access enabled.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The scenario is: first, read x, y coordinate from external file; second, convert the x, y coordinate to a MapPoint; thirdly, add this MapPoint to a layer in a Feature Service served through ArcGIS Server with Feature Access enabled.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;All the samples use Editor tool and/or Drawing tool. How can I add&amp;nbsp; to these x,y coordinates to a Feature Layer without using Editor and/or Drawing tool?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jan 2013 01:33:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/how-to-add-a-x-y-coord-to-feature-layer-without/m-p/427111#M9989</guid>
      <dc:creator>xiannianchen</dc:creator>
      <dc:date>2013-01-23T01:33:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to add a (x, y) coord. to feature layer without using Editor and Drawing tool</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/how-to-add-a-x-y-coord-to-feature-layer-without/m-p/427112#M9990</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Parse xml (the ArcGIS Flex Viewer is a big sample of how to do it)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Create &lt;/SPAN&gt;&lt;A href="http://resources.arcgis.com/en/help/flex-api/apiref/com/esri/ags/geometry/MapPoint.html"&gt;MapPoint&lt;/A&gt;&lt;SPAN&gt;s from readed data, and existing layer SpatialReference&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Create &lt;/SPAN&gt;&lt;A href="http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/Array.html"&gt;array&lt;/A&gt;&lt;SPAN&gt; of &lt;/SPAN&gt;&lt;A href="http://resources.arcgis.com/en/help/flex-api/apiref/com/esri/ags/Graphic.html"&gt;Graphic&lt;/A&gt;&lt;SPAN&gt;s with created geometries and required(not nullable) attributes&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://resources.arcgis.com/en/help/flex-api/apiref/com/esri/ags/layers/FeatureLayer.html#applyEdits()"&gt;applyEdits()&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jan 2013 04:13:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/how-to-add-a-x-y-coord-to-feature-layer-without/m-p/427112#M9990</guid>
      <dc:creator>IvanBespalov</dc:creator>
      <dc:date>2013-01-23T04:13:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to add a (x, y) coord. to feature layer without using Editor and Drawing tool</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/how-to-add-a-x-y-coord-to-feature-layer-without/m-p/427113#M9991</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thank for the reply.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Basically, that is what my understanding. I have done like this. That confirms that I am on the right direction. But, so far, no any success yet. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I successfuly creates the graphic array based on the xml file.&amp;nbsp; Then, I have the program called the addFeatureArrayToFeatureLayer function. I created two event listners. But the EDITS_COMPLETE listner never return me anything while EDITS_STARTING listener does give me feedbacks. And I don't know what's going after I called the method of ApplyEdits() function. ArcGIS Server Manager log section has no further information.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have tested my fecture service on ArcGIS.com. I can add features to the layer on ArcGIS.com. That means my feature service has no problem. Right?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;main body&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; var fs:Array = new Array();&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; for each ( pt in pts) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; var graphic:Graphic = new Graphic(WebMercatorUtil.geographicToWebMercator(tweet.twtPoint));&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; graphic.attributes = {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; "User": pt.AuthorName,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; "ID": pt.Tid,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; "XY": pt.LocationXY,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; "Datetime": pt.PublishDate&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; };&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; fs.push(graphic);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; addFeatureArrayToFeatureLayer(fs);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &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;protected function addFeatureArrayToFeatureLayer(fs:Array):void&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;SPAN&gt; var fLayer:FeatureLayer = new FeatureLayer("&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://url/arcgis/rest/services/myMap/myService/FeatureServer/0" rel="nofollow" target="_blank"&gt;http://url/arcgis/rest/services/myMap/myService/FeatureServer/0&lt;/A&gt;&lt;SPAN&gt;");&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; fLayer.addEventListener(FeatureLayerEvent.EDITS_COMPLETE,addFeatureDone);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; fLayer.addEventListener(FeatureLayerEvent.EDITS_STARTING,addFeatureStarting);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; fLayer.applyEdits(fs,null,null);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;private function addFeatureStarting(e:FeatureLayerEvent):void&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; Alert.show("Starting"); &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;private function addFeatureDone(e:FeatureLayerEvent):void&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; Alert.show("Succeed"); &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;BLOCKQUOTE class="jive-quote"&gt;Parse xml (the ArcGIS Flex Viewer is a big sample of how to do it)&lt;BR /&gt;Create &lt;A href="http://resources.arcgis.com/en/help/flex-api/apiref/com/esri/ags/geometry/MapPoint.html"&gt;MapPoint&lt;/A&gt;s from readed data&lt;BR /&gt;Create &lt;A href="http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/Array.html"&gt;array&lt;/A&gt; of &lt;A href="http://resources.arcgis.com/en/help/flex-api/apiref/com/esri/ags/Graphic.html"&gt;Graphic&lt;/A&gt;s with created geometries and required(not nullable) attributes&lt;BR /&gt;&lt;A href="http://resources.arcgis.com/en/help/flex-api/apiref/com/esri/ags/layers/FeatureLayer.html#applyEdits()"&gt;applyEdits()&lt;/A&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jan 2013 11:34:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/how-to-add-a-x-y-coord-to-feature-layer-without/m-p/427113#M9991</guid>
      <dc:creator>xiannianchen</dc:creator>
      <dc:date>2013-01-23T11:34:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to add a (x, y) coord. to feature layer without using Editor and Drawing tool</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/how-to-add-a-x-y-coord-to-feature-layer-without/m-p/427114#M9992</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Xiannian,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; Make sure you are passing graphics with all required attributes (as Ivan Mentioned) as an array.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If it is a single graphic use code like this (all the items in red are required):&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;FeatureLayer.applyEdits(&lt;SPAN style="color:#ff0000;"&gt;[ptGraphic],null,null&lt;/SPAN&gt;,true,null);&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jan 2013 11:44:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/how-to-add-a-x-y-coord-to-feature-layer-without/m-p/427114#M9992</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2013-01-23T11:44:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to add a (x, y) coord. to feature layer without using Editor and Drawing tool</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/how-to-add-a-x-y-coord-to-feature-layer-without/m-p/427115#M9993</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Robert,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for the reply.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What do you mean &lt;/SPAN&gt;&lt;SPAN style="color:&amp;quot;#FF0000&amp;quot;;"&gt;all required attributes&lt;/SPAN&gt;&lt;SPAN&gt;? The attributes I attached to the Graphic variable is the direct copy of the field list of my feature class which is stored in a Workgroup SDE database. OK, except the ObjectID and GlobalID fields. Do I need to populate some numerical value for this field? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Also, the FeatureServer service that I am using works fine in ArcGIS.com. Without editing any attributes in ArcGIS.com platform, I can add new features into the same layer which I am using in the ArcGIS Flex API environment. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks again,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Xiannian&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt; Xiannian,&amp;nbsp; &lt;BR /&gt; &lt;BR /&gt; Make sure you are passing graphics with all required attributes (as Ivan Mentioned) as an array.&amp;nbsp; &lt;BR /&gt;If it is a single graphic use code like this (all the items in red are required):&amp;nbsp; &lt;BR /&gt; &lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;FeatureLayer.applyEdits(&lt;SPAN style="color:#ff0000;"&gt;[ptGraphic],null,null&lt;/SPAN&gt;,true,null);&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jan 2013 13:20:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/how-to-add-a-x-y-coord-to-feature-layer-without/m-p/427115#M9993</guid>
      <dc:creator>xiannianchen</dc:creator>
      <dc:date>2013-01-23T13:20:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to add a (x, y) coord. to feature layer without using Editor and Drawing tool</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/how-to-add-a-x-y-coord-to-feature-layer-without/m-p/427116#M9994</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Xiannian,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; Just like Ivan mentioned non nullable attributes. No you do not need to populate the OID or GlobalID fields. Not sure what problem you are having as I do editing this way all the time.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jan 2013 13:27:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/how-to-add-a-x-y-coord-to-feature-layer-without/m-p/427116#M9994</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2013-01-23T13:27:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to add a (x, y) coord. to feature layer without using Editor and Drawing tool</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/how-to-add-a-x-y-coord-to-feature-layer-without/m-p/427117#M9995</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Robert and Ivan,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for the replies. I have found that the &lt;/SPAN&gt;&lt;SPAN style="text-decoration:underline;"&gt;&lt;STRONG style="color: &amp;quot;#FF0000&amp;quot;;"&gt;isEditable &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN&gt;property of my FeatureLayer variable is &lt;/SPAN&gt;&lt;STRONG&gt;false&lt;/STRONG&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is this the reason of my problem? Since this property is readonly, what should I do if I need to make it &lt;/SPAN&gt;&lt;SPAN style="text-decoration:underline;"&gt;true&lt;/SPAN&gt;&lt;SPAN&gt;?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Xiannian&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt; Xiannian,&amp;nbsp; &lt;BR /&gt; &lt;BR /&gt; Just like Ivan mentioned non nullable attributes. No you do not need to populate the OID or GlobalID fields. Not sure what problem you are having as I do editing this way all the time.&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jan 2013 15:35:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/how-to-add-a-x-y-coord-to-feature-layer-without/m-p/427117#M9995</guid>
      <dc:creator>xiannianchen</dc:creator>
      <dc:date>2013-01-23T15:35:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to add a (x, y) coord. to feature layer without using Editor and Drawing tool</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/how-to-add-a-x-y-coord-to-feature-layer-without/m-p/427118#M9996</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;xiannian,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; You have to be use Feature Access is enable in ArcGIS Manager and that your SDE data is versioned.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jan 2013 16:20:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/how-to-add-a-x-y-coord-to-feature-layer-without/m-p/427118#M9996</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2013-01-23T16:20:36Z</dc:date>
    </item>
  </channel>
</rss>

