BasemapGallery.Behavior developer basemaps from default portal
williambohrmann3 opened this issue · 1 comments
Upon loading the sample BasemapGalleryController.LoadFromDefaultPortal()
calls PopulateFromDefaultList()
which returns 27 developer basemaps from the default portal (https://arcgisonline.com). These populate the component's ListView. Upon clicking the "Load ArcGIS Online basemaps" button, the portal is set to the default. There is no call to GetDeveloperBasemapsAsync(), resulting in 30 basemaps in the gallery. This is a gallery item mismatch between startup and upon a button click, both referencing the default portal not the custom portal. Two potential solutions to remedy this:
- Removing code which filters the developer basemaps from
PopulateFromDefaultList()
- Adding code which filters the developer basemaps in
Button_Load_AGOL
Solution 2 could be tricky considering that BasemapGalleryItems can't be instantiated from the sample .cs file. Somehow calling PopulateFromDefaultList() from the button event is also tricky.
To emphasize that initially AGOL default portal items are loaded, it could be beneficial to have the "Load ArcGIS Online basemaps" button color fill to something like red upon starting the sample. A button click would update the button color fills to emphasize if it's the custom portal or default portal whose basemaps are loaded. This would work similarly to the .NET sketch-on-map sample buttons.
To further differentiate between the two portals, perhaps changing the custom portal to a public portal with unique basemaps would be beneficial.
Use the custom setter for settings basemaps.