Geographic Information Systems Asked on January 30, 2021
I am trying to bring an ImageMapLayer into an ArcGIS JS API project. The layer is here:
https://maps.disasters.nasa.gov/ags04/rest/services/ca_fires_202008/sentinel2/MapServer
I am creating the layer like this:
export const SC2Sept29 = new MapImageLayer({
url:
'https://maps.disasters.nasa.gov/ags04/rest/services/ca_fires_202008/sentinel2/MapServer',
});
When adding it to the map, I get the classic cors error:
Access to fetch at 'https://maps.disasters.nasa.gov/ags04/rest/services/ca_fires_202008/sentinel2/MapServer/547
?f=json' from origin 'https://8080-ea244033-ed39-4cd4-86f7-6fb2cfbea40b.ws-us02.gitpod.io'
has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the
requested resource. If an opaque response serves your needs, set the request's mode to
'no-cors' to fetch the resource with CORS disabled.
I was under the impression that NASA’s GIS/ESRI data is available for public use. Are their servers not configured for CORS? What am I missing here?
Allow Origin
in the portal end
Restrict cross-domain requests to your portaltrustedservers
in esri/config,
and if it is not added, then the CORS issue might arise, giving the error:
No-Access-Control-Allow-OriginAnswered by Yogesh Chavan on January 30, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP