Show organization basemaps
This sample demonstrates how to load a Portal and then use the organization's predefined basemaps query to get all basemaps. Thumbnails for these basemaps are then shown in a picker, to allow the user to select a basemap for use in a Map in a MapView.
How it works
- The user is prompted to load a portal anonymously or with a log-in.
Portalis then loaded - if the user chose to log-in in step 1, this uses a
Credentialof type OAuth.
- When the app starts, the portal is loaded and if required, the
AuthenticationManagerissues a challenge for the supplied credential type.
- The user is presented with an
AuthenticationViewwhich allows them to log-in.
- After a successful load, a request is made to
fetchBasemapsfrom the portal instance.
- When the basemaps are successfully retrieved, the portal's
BasemapListModelis passed to a QML
- A delegate shows each basemap's
titleand thumbnail image.
- When the user double-clicks on a
Basemapin the list, a
Mapis created using this (unloaded) item.
- The map is then loaded and once the operation is complete it is set on a
MapViewto show the user's selected basemap.
- A back button allows the user to return to the list of basemaps.