I am able to load kml/kmz files using KmlLayer of the v4.25 javascript SDK. The issue is some images within the KML cause CORS errors. I would like to programmatically update the image URL to a locally hosted copy of the image during kml layer load. I just can't determine where/how to find the images within the layer.
Code to load the layer:
let layer_KML_test: KmlLayer = new KmlLayer({
url: {public url to kml},
title: layerFile.name,
});
Error:
[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.'}
I want to change the path from:
https://fsapps.nwcg.gov/afm/data/kml/images/modis_mod14/modis_prev_6_days_fire.png
To:
https://{myappdomain.com}/images/modis_prev_6_days_fire.png