OfflineMaps Module
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.
Configuration Properties
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 totrue
. The default istrue
. -
fillColor
: The color of the area beyond the offline map area, specified as an HTML color. The default isnull
, that is, no fill color. -
boundaryColor
: The color of the boundary outline between the offline map area and beyond it. The default isblack
. -
boundaryWidth
: The width of the boundary outline between the offline map area and beyond it. The default is2
. -
boundaryStyle
: The style of the boundary outline between the offline map area and beyond it. Possible values include:solid
,dash
,dot
andnull
. The default isdash
. -
layerId
: The ID of the layer to use for the area outside the offline map area of interest. The default isOfflineMapsAOIMask
. -
matchMapBackground
: If you want the map background color to match the fill color of the area beyond the offline map area, set totrue
. This setting applies to all areas lacking map data. This setting only applies if thefillColor
is notnull
. The default isfalse
.
-
Views
-
ListOfflineMapsView
:-
sync
: Determines the command to execute when a user clicks the Sync button:
-
command
: The command to execute. The default isStartOfflineSyncAndShowProgress
. -
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 mapto download it:
-
command
: The command to execute. The default isStartOfflineDownloadAndShowProgress
. -
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 isShowOfflineMapEditor
. -
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 isShowOfflineMapEditor
. -
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
: Noconfiguration
properties. -
OfflineMapEditorLayersView
: Noconfiguration
properties. -
OfflineMapEditorGeometryView
:-
geometrylayerId
: The ID of the geometry layer to use for selecting an offline map area. The default isOfflineMapEditorGeometry
. -
fillColor
: The fill color of the selected offline map area in RGBA notation. The default isrgba(200, 0, 0, 0.3)
. -
outlineColor
: The outline color of the selected offline map area in RGBA notation. The default isrgba(200, 0, 0, 0.7)
. -
outlineWidth
: The outline width of the selected offline map area in pixels. The default is1
.
-
-
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 isShowOfflineMapEditorBasemapLevels
. -
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
: Noconfiguration
properties. -
OfflineMapEditorSharingView
: Noconfiguration
properties. -
SyncStatusView
:-
showXButton
: To display a button to close the Sync window, set totrue
; otherwise set tofalse
. The default isfalse
.
-
View Models
-
OfflineMapsViewModel
:-
saveOfflineMaps
: To allow users to save offline maps, set totrue
; otherwise set tofalse
. The default istrue
. -
defaultThumbnail
: The path to the default offline map preview thumbnail. -
menus
: An array of menus. By default, these include theListOfflineMapsActions
andManageOfflineMapsActions
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 thetext
. 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 thebatch
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 thebatch
property.In the following example from the Feature Actions menu, a
commandParameter
is passed into theShowFeatureDetailsCompact
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 totrue
and the menu item's command cannot run, the menu item does not show in the menu.If
hideOnDisable
isfalse
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
isfalse
by default.If you set the
batch
property, do not set thecommand
orcommandParameter
properties.
-
-
-
-
OfflineMapEditorViewModel
:-
thumbnail
:-
width
: The width of the offline map preview thumbnail in pixels. The default is70
. -
height
: The width of the offline map preview thumbnail in pixels. The default is50
. -
dpi
: The thumbnail resolution in Dots Per Inch. The default is20
.
-
-
steps
: An array of views that represents the steps for creating and editing offline maps. By default, they include:OfflineMapEditorNameView
,OfflineMapEditorGeometryView
,OfflineMapEditorLayersView
,OfflineMapEditorBasemapsView
andOfflineMapEditorSharingView
. -
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 isDeactivateView
. -
commandParameter
: The parameter to pass to the command. The default isLayerDataContainerView
.
-
-
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 areActivateView
. -
commandParameter
: The parameter to pass to the command. The first default command parameter isLayerDataContainerView
; the second default command parameter isManageOfflineMapsView
.
-
-
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 thistool
. -
type
: The type istool
. -
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 totrue
and the tool's command cannot run, the tool does not show in the toolbar.If
hideOnDisable
isfalse
and the tool's command cannot run, the tool shows in the toolbar, but it is grayed out. -
isSticky
: When set totrue
, 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
tofalse
. -
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 isOfflineMapEditorGeometryActions
. -
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 thetext
. 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
: Noconfiguration
properties. -
SyncStatusViewModel
: Noconfiguration
properties.