<?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: JS API - Select map features and add to array in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/js-api-select-map-features-and-add-to-array/m-p/106400#M9832</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In your event, you can just create a JavaScript array and push (look at jQuery push to an array) to it. To remove look into jQuery grep. You can also go a step further and create a custom JavaScript object, create an new instance of that object and populate properties in that object. This way, you'd have an array of custom objects.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To convert your array from JavaScript to C#, look into JavaScriptSerializer. If you ever want to go back from C# to JavaScript, use JSON.parse in JavaScript.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FYI, the data you want to add to your array is Esri, but the concept is not (it sounds that way, at least). You might find a lot more specific info on JavaScript arrays and objects on stackoverflow. Then refer back here for the data you want to add to your array.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 25 Sep 2015 14:54:52 GMT</pubDate>
    <dc:creator>TyroneBiggums</dc:creator>
    <dc:date>2015-09-25T14:54:52Z</dc:date>
    <item>
      <title>JS API - Select map features and add to array</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/js-api-select-map-features-and-add-to-array/m-p/106399#M9831</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've been asked to add a map to an existing ASP.NET data collection form. ArcGIS API for JavaScript seems like the best way to do this, but I've always struggled a bit with JavaScript. Any suggestions appreciated. &lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Users want to select multiple polygons from the map. They would like to make selections with individual mouse clicks, not by drawing/dragging selection box around polygons. Values from the data collection form (including selected polygon names) are saved to SQL Server tables when users click ASP.NET "Save" button. &lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, basically, I'm looking for help with adding/removing polygon values to/from a Javascript array(?) with each mouse click on the map. Then, at ASP.NET button click event, JS array needs to be converted to C# values and from there insert into the DB.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks, &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Sep 2015 16:06:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/js-api-select-map-features-and-add-to-array/m-p/106399#M9831</guid>
      <dc:creator>JoeN</dc:creator>
      <dc:date>2015-09-15T16:06:19Z</dc:date>
    </item>
    <item>
      <title>Re: JS API - Select map features and add to array</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/js-api-select-map-features-and-add-to-array/m-p/106400#M9832</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In your event, you can just create a JavaScript array and push (look at jQuery push to an array) to it. To remove look into jQuery grep. You can also go a step further and create a custom JavaScript object, create an new instance of that object and populate properties in that object. This way, you'd have an array of custom objects.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To convert your array from JavaScript to C#, look into JavaScriptSerializer. If you ever want to go back from C# to JavaScript, use JSON.parse in JavaScript.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FYI, the data you want to add to your array is Esri, but the concept is not (it sounds that way, at least). You might find a lot more specific info on JavaScript arrays and objects on stackoverflow. Then refer back here for the data you want to add to your array.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Sep 2015 14:54:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/js-api-select-map-features-and-add-to-array/m-p/106400#M9832</guid>
      <dc:creator>TyroneBiggums</dc:creator>
      <dc:date>2015-09-25T14:54:52Z</dc:date>
    </item>
  </channel>
</rss>

