Starting in version 2.0 of the Geocortex Viewer for HTML5, using the viewer offline requires the Geocortex Mobile App Framework. For an introduction to offline, see About Offline in the Geocortex Mobile App Framework help.
The OfflineMaps Module implements the user interface for using and managing offline maps. The OfflineMaps Module works with the Offline Module.
Module
aoiMask
: An object representing the area outside the offline map area of interest, with the following properties:
enabled
: If you want a visual indicator for the area beyond the offline map area, set to true
. The default is true
.
fillColor
: The color of the area beyond the offline map area, specified as an HTML color. The default is null
, that is, no fill color.
boundaryColor
: The color of the boundary outline between the offline map area and beyond it. The default is black
.
boundaryWidth
: The width of the boundary outline between the offline map area and beyond it. The default is 2
.
boundaryStyle
: The style of the boundary outline between the offline map area and beyond it. Possible values include: solid
, dash
, dot
and null
. The default is dash
.
layerId
: The ID of the layer to use for the area outside the offline map area of interest. The default is OfflineMapsAOIMask
.
matchMapBackground
: If you want the map background color to match the fill color of the area beyond the offline map area, set to true
. This setting applies to all areas lacking map data. This setting only applies if the fillColor
is not null
. The default is false
.
Views
ListOfflineMapsView
:
sync
: Determines the command to execute when a user clicks the Sync button :
command
: The command to execute. The default is StartOfflineSyncAndShowProgress
.
commandParameter
: A command parameter object with a single property:
offlineMap
: The offline map to sync. By default, the {{offlineMap}}
token is used. This special token represents the offline map selected.
download
: Determines the command to execute when a user first taps an offline map to download it:
command
: The command to execute. The default is StartOfflineDownloadAndShowProgress
.
commandParameter
: A command parameter object with a single property:
offlineMap
: The offline map to sync. By default, the {{offlineMap}}
token is used. This special token represents the offline map selected.
ManageOfflineMapsView
:
newOfflineMap
: Determines the command to execute when a user begins to create a new offline map:
command
: The command to execute. The default is ShowOfflineMapEditor
.
commandParameter
: A command parameter object. By default, this object is empty.
editOfflineMap
: Determines the command to execute when a user begins to edit an offline map:
command
: The command to execute. The default is ShowOfflineMapEditor
.
commandParameter
: A command parameter object with a single property:
existingOfflineMap
: The offline map to edit. By default, the {{offlineMap}}
token is used. This special token represents the offline map selected.
OfflineMapEditorView
:
title
: Determines the panel title:
forNew
: The panel title to use when creating a new offline map. The default is @language-offlinemapeditor-new-title
.
forExisting
: The panel title to use when editing an existing offline map. The default is @language-offlinemapeditor-title
.
OfflineMapEditorNameView
: No configuration
properties.
OfflineMapEditorLayersView
: No configuration
properties.
OfflineMapEditorGeometryView
:
geometrylayerId
: The ID of the geometry layer to use for selecting an offline map area. The default is OfflineMapEditorGeometry
.
fillColor
: The fill color of the selected offline map area in RGBA notation. The default is rgba(200, 0, 0, 0.3)
.
outlineColor
: The outline color of the selected offline map area in RGBA notation. The default is rgba(200, 0, 0, 0.7)
.
outlineWidth
: The outline width of the selected offline map area in pixels. The default is 1
.
OfflineMapEditorBasemapsView
:
showBasemapsLevelEditorView
: Determines the command to execute when a user begins to select the maximum level of detail for the offline basemap:
command
: The command to execute. The default is ShowOfflineMapEditorBasemapLevels
.
commandParameter
: A command parameter object with a single property:
basemap
: The offline basemap for which to select the maximum level of detail. By default, the {{basemap}}
token is used. This special token represents to the offline basemap selected.
OfflineMapEditorBasemapLevelsView
: No configuration
properties.
OfflineMapEditorSharingView
: No configuration
properties.
SyncStatusView
:
showXButton
: To display a button to close the Sync window, set to true
; otherwise set to false
. The default is false
.
View Models
OfflineMapsViewModel
:
saveOfflineMaps
: To allow users to save offline maps, set to true
; otherwise set to false
. The default is true
.
defaultThumbnail
: The path to the default offline map preview thumbnail.
menus
: An array of menus. By default, these include the ListOfflineMapsActions
and ManageOfflineMapsActions
menus. Each menu has the following properties:
id
: The menu's ID.
description
: A short description of the menu.
If your viewer is going to be available in more than one language, enter the text key that the description is assigned to. See Configure User Interface Text for more information on using text keys.
moduleId
: The ID of the module that the menu belongs to.
defaultIconUri
: The URI of the default icon for menu items.
items
: An array of menu items. Menu items have the following properties:
iconUri
: The image to display beside the menu item. The recommended image size is 24px by 24px.
text
: The text to appear on the menu item. You can use a text key or the literal text.
description
: A brief description of the menu item to appear below the text
. You can use a text key or the literal text.
command
: The command to execute when the menu item is selected.
If you set the command
property, do not set the batch
property.
commandParameter
: The parameter value to pass to the command when it runs, if it has a parameter. Parameters may either be simple strings or complex objects containing any number of parameters.
If you set the commandParameter
property, do not set the batch
property.
In the following example from the Feature Actions menu, a commandParameter
is passed into the ShowFeatureDetailsCompact
command to display feature details in the sidebar:
"command": "ShowFeatureDetailsCompact
", "commandParameter
": "{{context}}
"
The {{context}}
token is a special token that retrieves the default menu context which a menu may have. For example, the default context of the Feature Actions menu is the current feature. Therefore, the command displays feature details about the current feature.
hideOnDisable
: If this property is set to true
and the menu item's command cannot run, the menu item does not show in the menu.
If hideOnDisable
is false
and the menu item's command cannot run, the menu item shows in the menu, but it is grayed out.
batch
: An array of objects, each with three properties: an executable command, an optional command parameter, and an optional Boolean to abort the execution of further commands if a command fails to execute. This allows multiple commands to be executed in a specified order, although some commands may trigger asynchronous actions.
The following example attempts to activate the tabbed toolbar and, if successful, proceeds to greet the user with an alert:
"batch": [ { "command": "ActivateView", "commandParameter": "TabbedToolbarView", "abortBatchOnFailure": true }, { "command": "Alert", "commandParameter": "Hello!" } ]
If omitted, abortBatchOnFailure
is false
by default.
If you set the batch
property, do not set the command
or commandParameter
properties.
OfflineMapEditorViewModel
:
thumbnail
:
width
: The width of the offline map preview thumbnail in pixels. The default is 70
.
height
: The width of the offline map preview thumbnail in pixels. The default is 50
.
dpi
: The thumbnail resolution in Dots Per Inch. The default is 20
.
steps
: An array of views that represents the steps for creating and editing offline maps. By default, they include: OfflineMapEditorNameView
, OfflineMapEditorGeometryView
, OfflineMapEditorLayersView
, OfflineMapEditorBasemapsView
and OfflineMapEditorSharingView
.
onEditingStarted
: An array of commands with parameters to execute when a user begins editing an offline map. By default, a single command is included:
command
: The command to execute. The default is DeactivateView
.
commandParameter
: The parameter to pass to the command. The default is LayerDataContainerView
.
onEditingFinished
: An array of commands with parameters to execute when a user finishes editing an offline map. By default, a two commands are included:
command
: The command to execute. Both default commands are ActivateView
.
commandParameter
: The parameter to pass to the command. The first default command parameter is LayerDataContainerView
; the second default command parameter is ManageOfflineMapsView
.
tools
: An array of tools with which the user can select the map area to use offline. By default, the tools included are: Current Extent, Polygon, Freehand Polygon, Circle, Ellipse and Rectangle. Each tool can have the following properties:
id
: A unique ID for this tool
.
type
: The type is tool
.
iconUri
: The URI for the icon that you want to appear on the tool. The image must be an appropriate size to fit on the tool. Valid file formats are PNG, BMP, JPG, and JPEG.
command
: The command that the tool runs after the user has drawn the geometry for the command to operate on.
For information on commands, see .
drawMode
: The type of geometry the user draws, upon which the tool operates.
name
: The name that you want to appear on the tool. You can use a text key or the literal text.
For example, @language-toolbar-tasks-identify or Identify.
tooltip
: The text for the tool tip that opens when the user positions the pointer over the tool. You can use a text key or the literal text.
For example, @language-toolbar-identify-point-tooltip or Find out about a location on the map.
hideOnDisable
: If this property is set to true
and the tool's command cannot run, the tool does not show in the toolbar.
If hideOnDisable
is false
and the tool's command cannot run, the tool shows in the toolbar, but it is grayed out.
isSticky
: When set to true
, the tool remains selected after the user has used it. To deselect the tool, the user must click the tool a second time, or click a different tool. This allows the user to use a tool repeatedly without having to reselect it each time.
If you do not want a tool to remain selected after it is used, set isSticky
to false
.
statusText
: The status message to display when the tool is activated, often containing instructions for the user. You can use a text key or the literal text.
For example, @language-toolbar-identify-point-desc or Click or tap a location on the map to learn what’s there.
menus
: An array of menus. By default, this is includes a single menu: OfflineMapEditorGeometryActions
. Each menu has the following properties:
id
: The ID of the menu. The default is OfflineMapEditorGeometryActions
.
description
: A short description of the menu.
If your viewer is going to be available in more than one language, enter the text key that the description is assigned to. See Configure User Interface Text for more information on using text keys.
items
: An array of menu items to select the map area to use offline. By default, the menu items included are: Clear, Current Extent, Polygon, Freehand Polygon, Circle, Ellipse and Rectangle. Menu items have the following properties:
text
: The text to appear on the menu item. You can use a text key or the literal text.
description
: A brief description of the menu item to appear below the text
. You can use a text key or the literal text.
iconUri
: The image to display beside the menu item. The recommended image size is 24px by 24px.
command
: The command to execute when the menu item is selected.
commandParameter
: The parameter value to pass to the command when it runs, if it has a parameter. Parameters may either be simple strings or complex objects containing any number of parameters.
OfflineMapEditorBasemapLevelsViewModel
: No configuration
properties.
SyncStatusViewModel
: No configuration
properties.