<?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: Download client-side graphics using ArcGIS JS? in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/download-client-side-graphics-using-arcgis-js/m-p/643385#M60012</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your reply. Specifically, I do want to download user-drawn graphics that are stored in a graphics array in javascript to a local file. However, i would like them in a useable format, such as a SHP file. Is there a way to convert the .json to a format such as SHP? I know that there is an "Export Data" widget but that is only for hosted feature layers.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 28 Aug 2017 15:20:37 GMT</pubDate>
    <dc:creator>NickRobles2</dc:creator>
    <dc:date>2017-08-28T15:20:37Z</dc:date>
    <item>
      <title>Download client-side graphics using ArcGIS JS?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/download-client-side-graphics-using-arcgis-js/m-p/643383#M60010</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #242729; background-color: #ffffff;"&gt;I've looked everywhere for ways to to download user-drawn graphics using ArcGIS JS API but have not found a solution. Is this something that can at least be done using a GP task?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Aug 2017 17:13:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/download-client-side-graphics-using-arcgis-js/m-p/643383#M60010</guid>
      <dc:creator>NickRobles2</dc:creator>
      <dc:date>2017-08-21T17:13:46Z</dc:date>
    </item>
    <item>
      <title>Re: Download client-side graphics using ArcGIS JS?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/download-client-side-graphics-using-arcgis-js/m-p/643384#M60011</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What do you mean by download user graphics? &amp;nbsp;Do you want to save user drawn graphics in a file, locally? &amp;nbsp;In what format, a ,json file with a json array of graphics?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I understood you question correctly, here's one way you might approach this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="comment token"&gt;// start with array of graphics from any source&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;let&lt;/SPAN&gt; graphics &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;graphic1&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; graphic2&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; graphic3&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;// convert each graphic into JSON, now we have a valid JSON array&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;let&lt;/SPAN&gt; jsonGraphics &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; graphics&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;map&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;g &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; g&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;toJSON&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;// first stringify the JSON, then URI encode it&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;let&lt;/SPAN&gt; jsonString &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;encodeURIComponent&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;JSON&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;stringify&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;jsonGraphics&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;// now you could set the JSON string as the href of an anchor tag with a download attribute&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;let&lt;/SPAN&gt; a &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; document&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;getElementById&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'download-graphics'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;'
a&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;setAttribute&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'href'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="template-string token"&gt;&lt;SPAN class="string token"&gt;`data:text/json;charset=utf-8,&lt;/SPAN&gt;&lt;SPAN class="interpolation token"&gt;&lt;SPAN class="interpolation-punctuation punctuation token"&gt;${&lt;/SPAN&gt;jsonString&lt;SPAN class="interpolation-punctuation punctuation token"&gt;}&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;`&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
a&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;setAttribute&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'download'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'graphics.json'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;// now click the anchor link to download the .json file file&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are other methods to get the browser to download a file. &amp;nbsp;One of them is to open a new tab with a MIME type of 'application/octet-stream' instead of 'text/json'.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 03:20:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/download-client-side-graphics-using-arcgis-js/m-p/643384#M60011</guid>
      <dc:creator>ThomasSolow</dc:creator>
      <dc:date>2021-12-12T03:20:19Z</dc:date>
    </item>
    <item>
      <title>Re: Download client-side graphics using ArcGIS JS?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/download-client-side-graphics-using-arcgis-js/m-p/643385#M60012</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your reply. Specifically, I do want to download user-drawn graphics that are stored in a graphics array in javascript to a local file. However, i would like them in a useable format, such as a SHP file. Is there a way to convert the .json to a format such as SHP? I know that there is an "Export Data" widget but that is only for hosted feature layers.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Aug 2017 15:20:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/download-client-side-graphics-using-arcgis-js/m-p/643385#M60012</guid>
      <dc:creator>NickRobles2</dc:creator>
      <dc:date>2017-08-28T15:20:37Z</dc:date>
    </item>
    <item>
      <title>Re: Download client-side graphics using ArcGIS JS?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/download-client-side-graphics-using-arcgis-js/m-p/643386#M60013</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It should be possible to do this but you're going to have to jump through&amp;nbsp;some hoops. &amp;nbsp;This is the REST call you'll make to export to a shapefile:&amp;nbsp;&lt;A class="link-titled" href="http://resources.arcgis.com/en/help/arcgis-rest-api/#/Export_Item/02r30000008s000000/" title="http://resources.arcgis.com/en/help/arcgis-rest-api/#/Export_Item/02r30000008s000000/"&gt;ArcGIS REST API&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That call is made&amp;nbsp;on an existing portal item, so you'll need to take an array of graphics in JavaScript, convert it to a Feature Collection, post the Feature Collection as a new Portal Item, export the new portal item as a shape file, and then direct the user to the newly created shapefile.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It also looks like you need to have a portal subscription to do this.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Aug 2017 15:57:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/download-client-side-graphics-using-arcgis-js/m-p/643386#M60013</guid>
      <dc:creator>ThomasSolow</dc:creator>
      <dc:date>2017-08-28T15:57:03Z</dc:date>
    </item>
    <item>
      <title>Re: Download client-side graphics using ArcGIS JS?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/download-client-side-graphics-using-arcgis-js/m-p/643387#M60014</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;A less intense option might be to convert the &lt;A href="https://github.com/mapbox/tokml"&gt;JSON to KML&lt;/A&gt;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Aug 2017 16:03:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/download-client-side-graphics-using-arcgis-js/m-p/643387#M60014</guid>
      <dc:creator>SteveCole</dc:creator>
      <dc:date>2017-08-28T16:03:06Z</dc:date>
    </item>
    <item>
      <title>Re: Download client-side graphics using ArcGIS JS?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/download-client-side-graphics-using-arcgis-js/m-p/643388#M60015</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Awesome! This is probably a more practical solution&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Aug 2017 16:25:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/download-client-side-graphics-using-arcgis-js/m-p/643388#M60015</guid>
      <dc:creator>NickRobles2</dc:creator>
      <dc:date>2017-08-28T16:25:15Z</dc:date>
    </item>
    <item>
      <title>Re: Download client-side graphics using ArcGIS JS?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/download-client-side-graphics-using-arcgis-js/m-p/643389#M60016</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Steve, have you had experience using the JSON to KML?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Aug 2017 16:38:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/download-client-side-graphics-using-arcgis-js/m-p/643389#M60016</guid>
      <dc:creator>NickRobles2</dc:creator>
      <dc:date>2017-08-28T16:38:17Z</dc:date>
    </item>
    <item>
      <title>Re: Download client-side graphics using ArcGIS JS?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/download-client-side-graphics-using-arcgis-js/m-p/643390#M60017</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No- I'm afraid I have not. I have manually created a KML file of circles via JS (using the HTML5 file object) but that's about it. I originally wanted to create this using the JS API but ESRI didn't provide a worldwide free elevation query service so I opted for Google's map API instead. Anyways, the KML construction part should be JS API independent. Don't know if this will actually be useful for you but here's &lt;A href="http://blog.scolephoto.com/photos/kmlGrid/"&gt;the link&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Essentially, zoom in someplace, click a location, provide a file name, and click the Make KML button. The browser should prompt you to either open a KML or save it locally.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Aug 2017 17:18:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/download-client-side-graphics-using-arcgis-js/m-p/643390#M60017</guid>
      <dc:creator>SteveCole</dc:creator>
      <dc:date>2017-08-28T17:18:57Z</dc:date>
    </item>
    <item>
      <title>Re: Download client-side graphics using ArcGIS JS?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/download-client-side-graphics-using-arcgis-js/m-p/643391#M60018</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This looks like another possible open source JS library you could check out: &lt;A class="link-titled" href="https://github.com/mapbox/shp-write" title="https://github.com/mapbox/shp-write"&gt;GitHub - mapbox/shp-write: create and write to shapefiles in pure javascript&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Aug 2017 17:25:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/download-client-side-graphics-using-arcgis-js/m-p/643391#M60018</guid>
      <dc:creator>ThomasSolow</dc:creator>
      <dc:date>2017-08-28T17:25:59Z</dc:date>
    </item>
    <item>
      <title>Re: Download client-side graphics using ArcGIS JS?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/download-client-side-graphics-using-arcgis-js/m-p/643392#M60019</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Steve, Nick, everyone!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using ArcGis Javascript Api 3.22 I create a web map viewer.&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Download client side graphic to kml file" class="image-4 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/385170_kml1.png" style="width: 620px; height: 478px;" /&gt;&lt;/P&gt;&lt;P&gt;I take one (only none -- see red circle above!) client side graphic in the variable named&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;selected&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can get the Json of &lt;STRONG&gt;&lt;EM&gt;selected&lt;/EM&gt; &lt;/STRONG&gt;using:&lt;/P&gt;&lt;DIV style="color: #d4d4d4; background-color: #1e1e1e; font-weight: normal; font-size: 14px;"&gt;&lt;DIV&gt;&lt;SPAN style="color: #9cdcfe;"&gt;selected&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #dcdcaa;"&gt;toJson&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;();&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using Terraformer I can transform from ArcGis Json to GeoJson using:&lt;/P&gt;&lt;DIV style="color: #d4d4d4; background-color: #1e1e1e; font-weight: normal; font-size: 14px;"&gt;&lt;DIV&gt;&lt;SPAN style="color: #9cdcfe;"&gt;currentPrimitive&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #9cdcfe;"&gt;Terraformer&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #9cdcfe;"&gt;ArcGIS&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #dcdcaa;"&gt;parse&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #9cdcfe;"&gt;selected&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #dcdcaa;"&gt;toJson&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;());&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;but in &lt;EM&gt;&lt;STRONG&gt;currentPrimitive&lt;/STRONG&gt; &lt;/EM&gt;the coordinates look like 0.000000111 .. a lot of 0000...(terraformer coordinates transformations??)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If&amp;nbsp; I want to see geographic coordinates&amp;nbsp;in GeoJson I need to use the next line instead:&lt;/P&gt;&lt;DIV style="color: #d4d4d4; background-color: #1e1e1e; font-weight: normal; font-size: 14px;"&gt;&lt;DIV&gt;&lt;SPAN style="color: #9cdcfe;"&gt;currentPrimitive&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #9cdcfe;"&gt;Terraformer&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #9cdcfe;"&gt;ArcGIS&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #dcdcaa;"&gt;parse&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #9cdcfe;"&gt;selected&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #dcdcaa;"&gt;toJson&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;()).&lt;/SPAN&gt;&lt;SPAN style="color: #dcdcaa;"&gt;toMercator&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;();&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I am ready to export to KML using&amp;nbsp;&lt;SPAN style="background-color: #ffffff;"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;A href="https://community.esri.com/external-link.jspa?url=https%3A%2F%2Fgithub.com%2Fmapbox%2Ftokml" rel="nofollow" style="color: #287433; background-color: #ffffff; border: 0px; text-decoration: none; padding: 0px calc(12px + 0.35ex) 0px 0px;" target="_blank"&gt;JSON to KML&lt;/A&gt;,&amp;nbsp;but before I&amp;nbsp;had&amp;nbsp;to fix some issues:&lt;/P&gt;&lt;P&gt;1) Inside &lt;STRONG&gt;&lt;EM&gt;geoJsonString&lt;/EM&gt; &lt;/STRONG&gt;I found some &lt;STRONG&gt;&lt;EM&gt;null&lt;/EM&gt;&lt;/STRONG&gt; that&amp;nbsp;I had to replace with &lt;STRONG&gt;&lt;EM&gt;{}&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;2) I&amp;nbsp;had to complete the &lt;EM&gt;&lt;STRONG&gt;geoJsonString&lt;/STRONG&gt;&lt;/EM&gt; using the strings '&lt;STRONG&gt;&lt;EM&gt;inicio&lt;/EM&gt;&lt;/STRONG&gt;' and '&lt;STRONG&gt;&lt;EM&gt;fin&lt;/EM&gt;&lt;/STRONG&gt;' (to configure a geoJson FeatureCollection with the selected graphic -- a featurecollection with only one graphic)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV style="color: #d4d4d4; background-color: #1e1e1e; font-weight: normal; font-size: 14px;"&gt;&lt;DIV&gt;&lt;SPAN style="color: #9cdcfe;"&gt;geoJsonString&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #4ec9b0;"&gt;JSON&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #dcdcaa;"&gt;stringify&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #9cdcfe;"&gt;currentPrimitive&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV style="color: #d4d4d4; background-color: #1e1e1e; font-weight: normal; font-size: 14px;"&gt;&lt;DIV&gt;&lt;SPAN style="color: #9cdcfe;"&gt;inicio&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #ce9178;"&gt;"{&lt;/SPAN&gt;&lt;SPAN style="color: #d7ba7d;"&gt;\"&lt;/SPAN&gt;&lt;SPAN style="color: #ce9178;"&gt;type&lt;/SPAN&gt;&lt;SPAN style="color: #d7ba7d;"&gt;\"&lt;/SPAN&gt;&lt;SPAN style="color: #ce9178;"&gt;:&lt;/SPAN&gt;&lt;SPAN style="color: #d7ba7d;"&gt;\"&lt;/SPAN&gt;&lt;SPAN style="color: #ce9178;"&gt;FeatureCollection&lt;/SPAN&gt;&lt;SPAN style="color: #d7ba7d;"&gt;\"&lt;/SPAN&gt;&lt;SPAN style="color: #ce9178;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #d7ba7d;"&gt;\"&lt;/SPAN&gt;&lt;SPAN style="color: #ce9178;"&gt;properties&lt;/SPAN&gt;&lt;SPAN style="color: #d7ba7d;"&gt;\"&lt;/SPAN&gt;&lt;SPAN style="color: #ce9178;"&gt;:{},&lt;/SPAN&gt;&lt;SPAN style="color: #d7ba7d;"&gt;\"&lt;/SPAN&gt;&lt;SPAN style="color: #ce9178;"&gt;features&lt;/SPAN&gt;&lt;SPAN style="color: #d7ba7d;"&gt;\"&lt;/SPAN&gt;&lt;SPAN style="color: #ce9178;"&gt;:[ "&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #9cdcfe;"&gt;fin&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #ce9178;"&gt;" ]}"&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #9cdcfe;"&gt;geoJsonString2&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #9cdcfe;"&gt;geoJsonString&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #dcdcaa;"&gt;replace&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #ce9178;"&gt;"null"&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #ce9178;"&gt;"{}"&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #9cdcfe;"&gt;geoJsonString3&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #9cdcfe;"&gt;inicio&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;+&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #9cdcfe;"&gt;geoJsonString2&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;+&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #9cdcfe;"&gt;fin&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #569cd6;"&gt;var&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #9cdcfe;"&gt;kml&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #dcdcaa;"&gt;tokml&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #4ec9b0;"&gt;JSON&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #dcdcaa;"&gt;parse&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #9cdcfe;"&gt;geoJsonString3&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;));&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and now I am ready to put the KML in a HTML element using an hyperlink:&lt;/P&gt;&lt;DIV style="color: #d4d4d4; background-color: #1e1e1e; font-weight: normal; font-size: 14px;"&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #9cdcfe;"&gt;kmlString2&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #dcdcaa;"&gt;encodeURIComponent&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #9cdcfe;"&gt;kml&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #9cdcfe;"&gt;d&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #9cdcfe;"&gt;document&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #dcdcaa;"&gt;getElementById&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #ce9178;"&gt;'download-kml'&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #9cdcfe;"&gt;d&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #dcdcaa;"&gt;setAttribute&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #ce9178;"&gt;'href'&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #ce9178;"&gt;`data:text/kml;charset=utf-8,&lt;/SPAN&gt;&lt;SPAN style="color: #569cd6;"&gt;${&lt;/SPAN&gt;&lt;SPAN style="color: #9cdcfe;"&gt;kmlString2&lt;/SPAN&gt;&lt;SPAN style="color: #569cd6;"&gt;}&lt;/SPAN&gt;&lt;SPAN style="color: #ce9178;"&gt;`&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #d4d4d4;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #9cdcfe;"&gt;d&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #dcdcaa;"&gt;setAttribute&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #ce9178;"&gt;'Descargar'&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #ce9178;"&gt;'graphics.kml'&lt;/SPAN&gt;&lt;SPAN style="color: #d4d4d4;"&gt;);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Download client side graphic" class="image-2 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/385168_kml2.png" style="width: 620px; height: 531px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And the graphic border inside google earth:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Download client side graphic to kml file" class="image-3 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/385169_kml3.png" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your suggestions.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But now I need to export the KML with the ArcGis Api symbols and colors. Do you have ideas to deal with it?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alexys H Rodríguez&lt;/P&gt;&lt;DIV style="color: #d4d4d4; background-color: #1e1e1e; font-weight: normal; font-size: 14px;"&gt; &lt;/DIV&gt;&lt;DIV style="color: #d4d4d4; background-color: #1e1e1e; font-weight: normal; font-size: 14px;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Nov 2017 06:22:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/download-client-side-graphics-using-arcgis-js/m-p/643392#M60019</guid>
      <dc:creator>Alexys_HerleymRodriguez_Avell1</dc:creator>
      <dc:date>2017-11-29T06:22:11Z</dc:date>
    </item>
    <item>
      <title>Re: Download client-side graphics using ArcGIS JS?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/download-client-side-graphics-using-arcgis-js/m-p/643393#M60020</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I had some simple user drawn data and I was able to do this by using the following two libs:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/Esri/arcgis-to-geojson-utils"&gt;https://github.com/Esri/arcgis-to-geojson-utils&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/mapbox/shp-write"&gt;https://github.com/mapbox/shp-write&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV style="color: #000000; background-color: #ffffff; font-weight: normal; font-size: 14px;"&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;// convert it to geojson ready for saving&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;// parse ArcGIS JSON, convert it to GeoJSON&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff;"&gt;this&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;.geojson &lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; esriUtils.arcgisToGeoJSON(graphic);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #008000; background-color: #ffffff;"&gt;//&amp;nbsp;download the data&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #000000;"&gt; shpwrite.download({&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #000000;"&gt; type: &lt;/SPAN&gt;&lt;SPAN style="color: #a31515;"&gt;'FeatureCollection'&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #000000;"&gt; features: [&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff;"&gt;this&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;.geojson&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #000000;"&gt; ]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #000000;"&gt; });&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #000000;"&gt;Currently an issue with mapbox which I had to manually fix:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #000000;"&gt;&lt;A href="https://github.com/mapbox/shp-write/issues/48"&gt;https://github.com/mapbox/shp-write/issues/48&lt;/A&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Apr 2019 03:45:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/download-client-side-graphics-using-arcgis-js/m-p/643393#M60020</guid>
      <dc:creator>DavidWilton</dc:creator>
      <dc:date>2019-04-04T03:45:20Z</dc:date>
    </item>
  </channel>
</rss>

