<?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 intercept and change image path when loading KML files (get around CORS) in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-intercept-and-change-image-path-when/m-p/1258180#M80252</link>
    <description>&lt;P&gt;It seems to me you could use &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#request" target="_self"&gt;esriConfig.request&lt;/A&gt;.interceptors to do this.&amp;nbsp; If so, it would look something like:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;require(["esri/config", function(esriConfig) {
	esriConfig.request.interceptors.push({
		urls: "https://fsapps.nwcg.gov/afm/data/kml/images/",
		before: function(params) {
			params.url = "https://myServer/images" + params.url.substr(params.url.lastIndexOf("/"));

			return null;
		}
	});
});&lt;/LI-CODE&gt;</description>
    <pubDate>Tue, 14 Feb 2023 20:13:34 GMT</pubDate>
    <dc:creator>JoelBennett</dc:creator>
    <dc:date>2023-02-14T20:13:34Z</dc:date>
    <item>
      <title>How to intercept and change image path when loading KML files (get around CORS)</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-intercept-and-change-image-path-when/m-p/1258139#M80251</link>
      <description>&lt;P&gt;I am able to load kml/kmz files using KmlLayer of the v4.25 javascript SDK.&amp;nbsp; The issue is some images within the KML cause CORS errors.&amp;nbsp; I would like to programmatically update the image URL to a locally hosted copy of the image during kml layer load.&amp;nbsp; I just can't determine where/how to find the images within the layer.&lt;/P&gt;&lt;P&gt;Code to load the layer:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;let&lt;/SPAN&gt;&lt;SPAN&gt; layer_KML_test: KmlLayer = &lt;/SPAN&gt;&lt;SPAN&gt;new&lt;/SPAN&gt;&lt;SPAN&gt; KmlLayer({&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; url: &lt;EM&gt;{public url to kml}&lt;/EM&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; title: layerFile.name,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; });&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Error:&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;SPAN&gt;[esri.views.2d.engine.webgl.mesh.templates.WGLTemplateStore] s {name: 'mapview-invalid-resource', details: undefined, message: 'Could not fetch requested resource at https:…ages/modis_mod14/modis_prev_6_days_fire.png.'}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I want to change the path from:&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://fsapps.nwcg.gov/afm/data/kml/images/modis_mod14/modis_prev_6_days_fire.png" target="_blank" rel="noopener"&gt;https://fsapps.nwcg.gov/afm/data/kml/images/modis_mod14/modis_prev_6_days_fire.png&lt;/A&gt;&lt;/P&gt;&lt;P&gt;To:&lt;/P&gt;&lt;P&gt;https://{myappdomain.com}/images/modis_prev_6_days_fire.png&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Feb 2023 19:53:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-intercept-and-change-image-path-when/m-p/1258139#M80251</guid>
      <dc:creator>JasonK</dc:creator>
      <dc:date>2023-02-14T19:53:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to intercept and change image path when loading KML files (get around CORS)</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-intercept-and-change-image-path-when/m-p/1258180#M80252</link>
      <description>&lt;P&gt;It seems to me you could use &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#request" target="_self"&gt;esriConfig.request&lt;/A&gt;.interceptors to do this.&amp;nbsp; If so, it would look something like:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;require(["esri/config", function(esriConfig) {
	esriConfig.request.interceptors.push({
		urls: "https://fsapps.nwcg.gov/afm/data/kml/images/",
		before: function(params) {
			params.url = "https://myServer/images" + params.url.substr(params.url.lastIndexOf("/"));

			return null;
		}
	});
});&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 14 Feb 2023 20:13:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-intercept-and-change-image-path-when/m-p/1258180#M80252</guid>
      <dc:creator>JoelBennett</dc:creator>
      <dc:date>2023-02-14T20:13:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to intercept and change image path when loading KML files (get around CORS)</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-intercept-and-change-image-path-when/m-p/1258193#M80254</link>
      <description>&lt;P&gt;I think this is what I'm looking for.&amp;nbsp; Thanks for the quick reply.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Feb 2023 20:36:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-intercept-and-change-image-path-when/m-p/1258193#M80254</guid>
      <dc:creator>JasonK</dc:creator>
      <dc:date>2023-02-14T20:36:52Z</dc:date>
    </item>
  </channel>
</rss>

