Map Viewer

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. To learn more and see examples of Map Viewer apps, see this story.

When you create an app from this template, you must provide a title to create an app. Use the Settings tool to customize your Map Viewer app.

Requirements

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 to make an offline map - part 1 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

Property JSON nameTypeDescription

Background image

startBackground

String (image URL)

Image to use for the start page background.

Brand color

startForegroundColor

String (color value)

Color to use as the primary color.

Base font size

baseFontSize

Number

Sets the base font size used throughout the app.

Title font file

regularFontTTF

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

mediumFontTTF

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.

Feedback email

feedbackEmail

String (email ID)

Email address where user feedback will be sent.

Show disclaimer

showDisclaimer

Boolean (true|false)

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

Property JSON nameTypeDescription

Maps query

galleryMapsQuery

String

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.

Total results to show in gallery

maxNumberOfQueryResults

Number

Enter the maximum number of web maps that should be returned from querying the portal.

Portal url

portalUrl

String

URL of the ArcGIS portal to query for web maps.

Basemaps group ID

baseMapsGroupId

String

Lists the basemaps from the provided group.

Support secured maps

supportSecuredMaps

Boolean (true|false)

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

enableAnonymousAccess

Boolean (true|false)

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.

Support editing

supportEditAttributes

Boolean (true|false)

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

mapTypes

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

portalSortField

String

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

portalSortOrder (asc|desc)

String

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.