I am currently encountering an issue loading a web map from an ArcGIS Enterprise Portal using ArcGIS JavaScript web components.
Are there examples available for succesfully loading a web map from an Enterprise Portal?
@ReneRubalcava
Thank you for your quick response!
After taking a second look at the links you provided, I was able to adjust the script and successfully load the web map of interest.
This is going to depend on how you are building your app. Here is some documentation showing the steps to set up the esriConfig portal url.
https://developers.arcgis.com/javascript/latest/programming-patterns/#set-the-portalurl-in-an-amd-application
https://developers.arcgis.com/javascript/latest/programming-patterns/#set-the-portalurl-in-an-esm-application
If you are building your app from scratch with npm, I would recommend you set up the esriConfig portal url, and any auth needed before loading your components, so something like this.
esriConfig.portalUrl = something; esriId.registerOAuthInfos([info]); import("@arcgis/map-components/dist/loader").then( ({ defineCustomElements }) => { defineCustomElements(); }, );
Membros conectados podem postar, seguir atualizações e mais. Novo aqui? Registre uma conta gratuita.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.