I have an Interactive Legend Instant App that is hosted in Portal and shared with AGO via a distributed collaboration for inclusion on a Hub site hosted on AGO. The app opens up fine from the Hub site except that its basemap toggle tool is nowhere to be seen. I have confirmed that when opened from Portal, the app's basemap toggle tool displays and functions normally. Everything else in the app seems to be functioning as expected when launched from Portal, the Hub site, or the item details page in AGO.
Here's the app launched from Portal, with basemap toggle in lower left:
And here it is launched from AGO, with basemap toggle MIA:
At first, I thought maybe there was a sharing/permissions issue with the basemaps group in Enterprise where they couldn't be viewed by someone logged in with an AGO account, but then I realized that the basemap switcher widget works just fine in a Web AppBuilder app hosted on Portal and shared to AGO in the same manner.
Here's the Portal-hosted WAB app launched from AGO with basemaps galore:
Any ideas? Many thanks in advance!
Off the top of my head, I would guess the difference here is that the WAB widget just pulls a list of basemaps available in the active Portal / AGOL org. You might try adding a "test" basemap to your Portal and see if that basemap is visible in the gallery in AGOL; I suspect it will not.
The basemap switcher, on the other hand, is configured to toggle with a specific map. In the JSON definition of the app, the basemap is being referred to directly by ID, which would not carry over to AGOL.
Can you pull the JSON for the app in both places and see?
Open your browser's developer tools and watch the Network tab as the app loads, then look for something like
Or else, just browse to the portal/sharing/rest/content endpoint, if that's easier for you.
Either way, at the end of the JSON, you'll find something like this:
Thanks for your response, and apologies for not seeing it until now.
Your response made perfect sense and made me realize that I probably needed to share the basemap with AGO through our distributed collaboration. I hadn't thought to do that since it was already shared with everybody on Portal, but it makes sense that the item ID would need to be present in our AGO environment because of the way the basemap switcher widget calls the alternate basemap by item ID. After adding it to the group associated with our Distributed Collaboration, the basemap switcher widget is now visible even when the app is launched from AGO. Thanks!!
Oh, and to respond to your theory about the WAB basemap widget, it does include our custom Portal basemaps in its gallery even in a Portal app shared to AGO.
Now I have to figure out a new (and possibly related issue), which is that the Environmental Screening Tool WAB widget doesn't seem to have any analysis layers configured when it's shared from Portal to AGO via our distributed collaboration, even though it works fine when launched directly from Portal. I think your explanation of how some widgets access content by item ID may be relevant, though in this case those layers are already shared with AGO through our distributed collaboration and retain the same item IDs. I'm off to inspect the JSON for that app now... thanks again for the tips!