LabelOptions Module
The LabelOptions Module configures feature label fonts and styles for dynamic layers-enabled map services. It also provides default label styles if the layer does not already have set styles. For more information about configuring symbolization, see Symbolization.
By default, the viewer allows users to customize a label's font color, font size, placement, and the layer field to display
Customize Label Options panel for a dynamic layer called Land Use
To customize label options in the viewer:
If you customize the labels of a map service that uses Maplex labels, the labels become standard labels for the duration of your browser session.
-
Locate the layer you want to customize from the layer list.
-
Select the
Action button next to the layer name.
-
Select the Customize Labels action.
Alternatively, you can quickly toggle the feature labels by selecting the Toggle Labels action.
-
If label styles are already defined, you must choose the Customize button to begin customizing them.
If label styles are not defined, you are presented with forms and drop-down menus to modify the label styles. For more information see Default Layer Styles.
-
Change the label styles using the available forms and drop-down menus.
-
Click Apply to apply the new styles.
You can click Reset to Default to clear the changes that you have made.
-
Choose Done or exit the Label Options panel.
Default Label Styles
If no label styles have been defined previously (either in the layer properties or in the dynamic definitions set in Essentials), when the user chooses to customize the labels the style values default to the styles set in the viewer's configuration files. If the user customizes the styles, they cannot revert the styles to their original state for the rest of the session.
Before users can access the label options panel, they are informed that the configured styles cannot be edited, and that customizing the styles replaces the existing styles. The user can use the Customize button to continue modifying the styles.
Dialog box indicating that no label styles have been defined previously
Modify Label Styles in the Viewer
Users can modify label styles using the following options:
-
Show Labels: When this checkbox is selected, a label is displayed for each feature on the map.
Alternatively, you can use the Toggle Labels layer action to quickly show or hide all of the labels.
-
Field: Chooses the field that is used as the label. Eligible fields from the layer are displayed in a drop-down menu.
-
Font Size: Chooses the font size for the labels from a drop-down menu.
The default values enabled are Extra Small (10), Small (12), Medium (14), Large (16), and Extra Large (18). However, if
fontSizeChoiceIsEnabled
is set tofalse
in the viewer configuration files, then the user can input a numeric value for the font size instead. -
Font Family: Chooses the font family for the labels from a drop-down menu.
By default, the available font families are Arial, Cambria, Georgia, Times New Roman, and Verdana. You can configure additional fonts in the viewer configuration files.
-
Font Style: Select whether labels are bold, italic, and underlined.
The Font Style configuration checkboxes do not appear in the viewer by default. They must first be configured in the viewer configuration files.
-
Bold: Select this checkbox to display the labels as bold text.
-
Italic: Select this checkbox to display the labels as italic text.
-
Underline: Select this checkbox to display the labels as underlined text.
-
-
Font Color: Choose a font color using the color picker tool.
-
Label Placement: Choose the placement of the label relative to the feature.
Label placement is configured differently for point, line, and polygon features. In the case of polygons, label placement cannot be configured at all.
-
Points: Labels for point features have nine configurable placements. All the placements are either horizontally left, at the center, or right of and vertically above, at the center of, or below the feature.
Label placement options for point geometries
-
Lines: Labels for line features have fifteen configurable placements. All of the placements are either horizontally before, at the start of, along, at the end of, or after the feature, and vertically above, at the center of, or below the feature.
Label placement options for point geometries
-
Polygons: Label placement for polygons cannot be set.
-
-
Outline Width: The width of the outline around the label in pixels.
The Outline Width input field does not appear in the viewer by default. It must first be configured in the viewer configuration files.
-
Outline Color: The color of the outline around the label.
The Outline Color input field does not appear in the viewer by default. It must first be configured in the viewer configuration files.
Configuration Properties
Module
No configuration
properties
Views
-
LabelOptionsView
: Noconfiguration
properties
View Models
-
LabelOptionsViewModel
:-
showLabels
: The default value istrue
. -
fontSizeExtraSmall
: Defines the Extra Small preset font size. The default value is10
. -
fontSizeSmall
: Defines the Small preset font size. The default value is12
. -
fontSizeMedium
: Defines the Medium preset font size. The default value is14
. -
fontSizeLarge
: Defines the Large preset font size. The default value is16
. -
fontSizeExtraLarge
: Defines the Extra Large preset font size. The default value is18
. -
fontSizeChoiceIsEnabled
: Enables the preset values for Extra Small, Small, Medium, Large, and Extra Large font sizes as a drop-down menu. When this setting is disabled, the user can input the font size as a numeric value. The default value istrue
. -
fontSize
: The default font size for unstyled labels. The default value is14
. -
fontColor
: The default font color for unstyled labels. The default value is#000000
. -
fontFamilies
: Configures the list of available font families that can be used for labels. The default value is"Arial", "Cambria", "Georgia", "Times New Roman", "Verdana"
. Add any web-safe font to this array. -
fontIsBold
: Enables a checkbox that allows users to make label fonts bold. The default value isfalse
. -
fontIsItalic
: Enables a checkbox that allows users to make label fonts italic. The default value isfalse
. -
fontIsUnderline
: Enables a checkbox that allows users to make label fonts underlined. The default value isfalse
. -
haloSize
: The default width of an unstyled label's outline in pixels. The default value is0
. -
haloColor
: The default color of an unstyled label's outline in pixels. The default value is#000000
. -
showLabelsIsVisible
: Enables a checkbox that allows users to toggle labels on or off. The default value istrue
. -
fieldIsVisible
: Enables the Field drop-down menu. The user can configure which layer field is displayed as the label. The default value istrue
. -
fontSizeIsVisible
: Enables the Font Size option. The default value istrue
. -
fontColorIsVisible
: Enables the Font Color option. The default value istrue
. -
labelPlacementIsVisible
: Enables the Label Placement option. The user can configure where the label should appear in relation to the feature. The default value istrue
. -
fontFamiliesIsVisible
: Enables the Font Family picker. The default value isfalse
. -
fontStyleIsVisible
: Enables the Font Style options, which includes Bold, Italic, and Underline checkboxes. The default value isfalse
. -
haloSizeIsVisible
: Enables the Outline Width option. The default value isfalse
. -
haloColorIsVisible
: Enables the Outline Color option. The default value isfalse
.
-