IWantToMenu Module
This module can be configured using Manager. For instructions, see I Want To Menu.
The I Want To menu is a list of frequently performed tasks. The IWantToMenu Module implements the I Want To menu and its menu items. The menu is called the I Want To menu because the default text on the button that opens the menu is I want to.... In the Desktop and Tablet interfaces, the I Want To button is in the top left corner of the map. In the Handheld interface, the button is at the top left of the screen.
I Want To menu shown in the Handheld preview
If you do not want the viewer to have an I Want To menu, you can hide it by clearing the Show Menu checkbox on the viewer’s I Want To Menu page in Manager. Alternatively, you can set the IWantToMenuViewModel
's showMenu
property to false
in the configuration files.
Global Menu
By default, the I Want To menu has a horizontal menu at the top, which is implemented by the GlobalMenu Module. You can hide the Global menu using the IWantToMenuViewModel
's showGlobalMenu
property. For example, you might want to hide the Global menu if the viewer does not allow users to sign in. For more information about the Global menu, see GlobalMenu Module.
Configuration Properties
Module
-
menus
: An array of menus with one menu in it—the I Want To menu. The 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.
-
-
Views
-
IWantToMenuButtonView
: (Desktop and Tablet interfaces) Noconfiguration
properties -
IWantToMenuView
:-
menuId
: The ID of the menu displayed in the view.
-
View Models
-
IWantToMenuViewModel
:-
showMenu
: When this property is set totrue
, the I Want To menu shows in the viewer. IfshowMenu
is set tofalse
, the viewer does not have an I Want To menu. The default istrue
. -
showGlobalMenu
: When this property is set totrue
, the Global menu shows in the I Want To menu. IfshowGlobalMenu
is set tofalse
, the I Want To menu does not have a Global menu. The default istrue
. -
menuTitle
: The text that appears on the button that opens the I Want To menu, by default, I want to...If your viewer is going to be available in one language only, type the menu title. If your viewer is going to be available in more than one language, enter the text key that the menu title is assigned to. See Configure User Interface Text for more information on using text keys.
primaryButtonColor
:The color of the I Want To menu button as a RRGGBB hex code. The default value is #1A72C4.
-
See Also...