<?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: How to Use Local File  for GeoJsonLayer in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-use-local-file-for-geojsonlayer/m-p/1025016#M71707</link>
    <description>&lt;P&gt;You can load the geojson via formdata and add it to a GeoJSONLayer via a Blob URL&lt;/P&gt;&lt;P&gt;&lt;A href="https://codepen.io/odoe/pen/YzKqLZO" target="_blank"&gt;https://codepen.io/odoe/pen/YzKqLZO&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 09 Feb 2021 20:21:17 GMT</pubDate>
    <dc:creator>ReneRubalcava</dc:creator>
    <dc:date>2021-02-09T20:21:17Z</dc:date>
    <item>
      <title>How to Use Local File  for GeoJsonLayer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-use-local-file-for-geojsonlayer/m-p/1024645#M71692</link>
      <description>&lt;P&gt;So, I am trying to use a local geojson file, but it doesn't appear to be found. I am using React with Typescript and ES Modules.&lt;BR /&gt;&lt;BR /&gt;Code&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;const geoJSONLayer = new GeoJSONLayer({
    url: "./example.geojson",
    renderer: renderer,
    outFields: ["*"]
});&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;Errors:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[esri.layers.GeoJSONLayer] #load() Failed to load layer (title: 'GeoJSON', id: '1778390536e-layer-30') {error: s}

[esri.views.LayerViewManager] Failed to create layerview for layer title:'GeoJSON', id:'1778390536e-layer-30' of type 'geojson'. {layer: p, error: s}&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 08 Feb 2021 21:50:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-use-local-file-for-geojsonlayer/m-p/1024645#M71692</guid>
      <dc:creator>developerarce</dc:creator>
      <dc:date>2021-02-08T21:50:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to Use Local File  for GeoJsonLayer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-use-local-file-for-geojsonlayer/m-p/1024758#M71700</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/445592"&gt;@developerarce&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;You might want to retrieve that geojson location as absolute url.&lt;/P&gt;&lt;P&gt;Not sure where your code is running, below is the sample, try and adjust accordingly.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;//get absolute url here
let getjsonUrl = location.pathname.replace(/\/[^/]+$/, "");
geojsonUrl = geojsonUrl +"/example.geojson";
//you might need this line like =&amp;gt; geojsonUrl = location.href + geojsonUrl;
//try the log and change code accordingly
console.log("geo json absolute url:"+geojsonUrl);
const geoJSONLayer = new GeoJSONLayer({
    url: geojsonUrl,
    renderer: renderer,
    outFields: ["*"]
});&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Than&lt;/P&gt;</description>
      <pubDate>Tue, 09 Feb 2021 04:06:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-use-local-file-for-geojsonlayer/m-p/1024758#M71700</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-02-09T04:06:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to Use Local File  for GeoJsonLayer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-use-local-file-for-geojsonlayer/m-p/1025016#M71707</link>
      <description>&lt;P&gt;You can load the geojson via formdata and add it to a GeoJSONLayer via a Blob URL&lt;/P&gt;&lt;P&gt;&lt;A href="https://codepen.io/odoe/pen/YzKqLZO" target="_blank"&gt;https://codepen.io/odoe/pen/YzKqLZO&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Feb 2021 20:21:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-use-local-file-for-geojsonlayer/m-p/1025016#M71707</guid>
      <dc:creator>ReneRubalcava</dc:creator>
      <dc:date>2021-02-09T20:21:17Z</dc:date>
    </item>
  </channel>
</rss>

