The Map Viewer template allows you to create apps that allow users to search and view either a single map or a gallery of maps.
When you create an app from this template, you need to provide a title to create an app. Use the Settings tool to customize your Map Viewer app.
The requirements for the Map Viewer template are as follows:
- Web maps can be public or secured. To access a secured web map in your organization or ArcGIS Enterprise portal using OAuth2, register your app and provide a client ID. For more information, see Sign your app. By default, only public web maps will appear in the Map Viewer gallery; to access secured maps, enable the support secured maps property in the app's settings.
- Along with web maps, the Map Viewer query string also supports mobile map packages (MMPKs). Due to licensing restrictions in the default template, you must sign in to your portal or organizational account to access and view these MMPKs, unless the MMPK was created using the ArcGIS Pro Publisher extension with anonymous use enabled. For more information on creating MMPKs, see the ArcGIS Pro documentation on mobile map packages, or the Use ArcGIS Pro 2.1 to make an offline map blog post.
- The web map version must be 2.0 or later; otherwise, the map will fail to load.
- Optional—To use the feature search in the app, at least one layer of the web map must have search capability configured in the web map.
- Optional—Enable pop-ups on layers in the web map to use the web map identify feature.
- Optional—Configure bookmarks in the web map to use the bookmark feature.
- Optional—To display the legend, at least one layer of the web map must have a legend defined in a map service.
The Map Viewer template works best when displaying map services. Feature services may display but typically are slow to draw.
Customize your app
Once you create your app, you can customize it by changing the app settings.
Start AppStudio and, in the side panel, click Settings > Properties. The following table lists the contents of the tabs on the Map Viewer Properties tab, sorted by the tab on which they appear, and their purposes. They can also be modified directly in the app's appinfo.json file. If you change any of these properties, click Apply to save them before starting your app again.
Start Screen tab contents
String (image URL)
Image to use for the start page background.
String (color value)
Color to use as the primary color.
Base font size
Sets the base font size used throughout the app.
Title font file
String (font file URL)
Sets the custom title font to be used throughout the app. This font will be used in headings, page titles, and so on.
Text font file
String (font file URL)
Sets the custom text font to be used throughout the app. This font will be used in descriptions of photos, about text, and so on.
String (email ID)
Email address where user feedback will be sent.
Shows the disclaimer text as a pop-up in the app. This text is the content from the Access and Use Constraints section of the Details tab.
Gallery tab contents
Enter an ArcGIS query to select web maps or MMPKs from the portal to display in the gallery. This can be any valid string such as USA or a valid item ID such as id:d5e02a0c1f2b4ec399823fdd3c2fdebd.
URL of the ArcGIS portal to query for web maps.
Support secured maps
Provides the ability to sign in to an organization for access to secured web maps and MMPKs, as per the query parameters.
Skip sign in
Provides the ability to bypass sign-in and only show publicly available web maps and MMPKs created using the ArcGIS Pro Publisher extension with anonymous use enabled. The default is true.
Setting this option to true enables the editing of feature attributes and attachments if the feature layer is editable and the user has permission to edit features.
Maps to show in Gallery
Options (combo box)
Specifies the type of maps displayed in the Map Viewer gallery. There are three possible values: showWebMapsOnly will only display online web maps, showOfflineMapsOnly will only display mobile map packages, and showBoth will display both web maps and MMPKs.
Portal sort field
Specifies the name of the field used to perform the sort of web maps shown in the gallery. Possible values include title, created, type, owner, modified, avgRating, numRatings, numComments, and numViews. The default is modified.
Portal sort order
Specifies the order of web maps shown in the gallery in either ascending or descending order based on the designated portalSortField. The default is desc.