I'm not able to add a WebMap from Portal to my 4.x application - it looks like it needs something other than portalUrl. My code works fine for a webmap in arcgis.com. Does anyone know what I might be missing? The webmap is shared with everyone and I don't need to log into Portal to see it.
Ryan, check the order of the classes in your require... make sure they're declared and used in the same order.
I landed on this page looking for a solution to the same issue and, while the OP's problem has been solved here from somebody else, I wanted to add what I found in case others landed here looking for answers.
I did something really stupid - I was typing esri/Config instead of esri/config. Once I changed to lower case "c", the web map populated. Maybe my stupidity will help somebody else save a little time.
Thanks John! You are absolutely right - I had the order of the classes messed up.
This is a total user error, which I'm going to blame on my inability to switch between the Control and Command keys for Copy/Paste in Windows vs Mac...
Try running your app again and watch the network traffic using the browser's debugging tools. You should see a request for your web map id and you can check to make sure the request is for the correct resource.
Sorry - bad example - that was some debug code. This is what I currently have, and it is not working.
You're not assigning the URL to the esriConfig.portalUrl. You're currently creating an unrelated variable called portalUrl and assigning a value to it, while esriConfig.portalUrl remains unchanged.
Jayanta,
As I mentioned in my original post, portalUrl does not seem to help.
Thanks,
-Ryan
To reference an item from an on-premise portal, set the URL of the portal in esriConfig.portalUrl.
Load a basic WebMap | ArcGIS API for JavaScript 4.3
Les membres connectés peuvent publier, suivre les mises à jour, et plus encore. Nouveau ici ? Inscrivez-vous gratuitement.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.