Search for web map by keyword
This sample demonstrates how find portal items by using a keyword, and limit the results to items of a certain type - in this case, web maps.
How it works
Portalis created with no credential set, when the app starts, the portal is loaded.
- A search bar allows the user to enter a keyword (a tag) to search for - e.g. "usa".
- The search term is passed as the
PortalQueryParametersForItemswhich also has the
PortalItemType::WebMap. NOTE if multiple item types are required these can be set via the
typesproperty. Since webmaps authored prior to July 2nd, 2014 are not supported, a date filter is also applied.
- The query parameters are passed to the portal's
- Once the
findItemstask is complete, a
PortalQueryResultSetForItemsis obtained by calling
findItemsResulton the portal.
PortalItemListModelfrom the items result is set on a
ListViewto display the set of web maps. If many web maps match the search criteria, the results will contain only the 1st set (to allow "paging" through the results in batches).
- If there are additional results, a subsequent query can be issued by clicking the "More Results" button. This passes the itemResult's
nextQueryParametersobject to a new
- When the user double-clicks on a web map in the list, the
PortalItemis loaded and set as a
- If the item is secured, the user may be prompted to login via the