markerSettings

An object specifying options for the map markers.

Type: Object

A marker is a point on a map accompanied by text that helps you flag places on the map. For example, you can use markers to designate cities on the map. The appearance of the markers is specified by the options of the markerSettings configuration object. If these options are defined on the first level of the markerSettings object, they are applied to all the markers at once. However, you can specify several of these options for certain markers exclusively. See the customize option description to learn how.

Show Example:
jQuery

In this example, each marker is accompanied by a label that displays the name of the state's capital. This name is obtained from the 'name' attribute of the map's data source using the customize option. The font size of the labels is decreased so that the labels do not overlap each other. In addition, the capability to select/deselect a marker by a click is added using the callback function assigned to the click option. When a marker is selected, it is drawn in a color specified by the selectedColor option.


                                    

                                    

borderColor

Specifies a color for the marker border.

Type: String
Default Value: '#ffffff'

This option supports the following colors.

  • hexadecimal colors
  • RGB colors
  • RGBA colors (not supported in Internet Explorer 8)
  • predefined/cross-browser color names
  • predefined SVG colors (not supported in Internet Explorer 8)
Show Example:
jQuery

In this example, the marker's border is colored in 'mistyrose' using the borderColor option.


                                    

                                    

click

Specifies the function that is called when a marker has been clicked.

Type: function
Function parameters:
marker: Marker

The clicked marker.

When implementing a callback function for this option, use the object that represents the marker, which has been clicked. To access this object, use the function's parameter or the this object. The accessible fields and methods of this object are documented in the Marker class description within the Map Elements reference section.

Show Example:
jQuery

In this example, you can select/deselect a marker by a click. The function that performs the selection is assigned to the click option of the markerSettings configuration object.


                                    

                                    

color

Specifies a color for a marker.

Type: String
Default Value: '#ba4d51'

This option supports the following colors.

  • hexadecimal colors
  • RGB colors
  • RGBA colors (not supported in Internet Explorer 8)
  • predefined/cross-browser color names
  • predefined SVG colors (not supported in Internet Explorer 8)
Show Example:
jQuery

In this example, markers are colored in 'seagreen' using the color option.


                                    

                                    

customize

Specifies the function that customizes each marker individually.

Type: function
Function parameters:
marker: Marker

Defines the marker to be customized.

Return Value: Marker configuration

A configuration object for the marker.

When implementing a function for this option, use the fields of the object that represent a marker from the data source specified by the markers option. To access this object, use the function's parameter or the this object.

The customize function should return the object that contains options to be changed for a certain area. These options are represented in the list below.

Show Example:
jQuery

In this example, the callback function assigned to the customize option is used to specify text for markers. Note that the 'Springfield' marker is selected when the widget loads, because for this marker the customize function returns a different object with the isSelected field set to true.


                                    

                                    

font

Specifies font options for the text that accompanies a marker.

Type: String
Default Value: '#ba4d51'

Show Example:
jQuery

In this example, several font options for markers are changed.


                                    

                                    

hoveredBorderColor

Specifies a color for the marker border when the marker is hovered over.

Type: String
Default Value: '#ffffff'

This option supports the following colors.

  • hexadecimal colors
  • RGB colors
  • RGBA colors (not supported in Internet Explorer 8)
  • predefined/cross-browser color names
  • predefined SVG colors (not supported in Internet Explorer 8)

NOTE: Make sure that the hoverEnabled option is set to true, so that the hoveredBorderColor option takes effect.

Show Example:
jQuery

In this example, when a marker is hovered over, its border is colored in 'midnightblue' using the hoveredBorderColor option.


                                    

                                    

hoveredColor

Specifies a color for a marker when this marker is hovered over.

Type: String
Default Value: '#ba4d51'

This option supports the following colors.

  • hexadecimal colors
  • RGB colors
  • RGBA colors (not supported in Internet Explorer 8)
  • predefined/cross-browser color names
  • predefined SVG colors (not supported in Internet Explorer 8)

NOTE: Make sure that the hoverEnabled option is set to true, so that the hoveredColor option takes effect.

Show Example:
jQuery

In this example, when a marker is hovered over, it is colored in 'royalblue' using the hoveredColor option.


                                    

                                    

hoverEnabled

Specifies whether or not to change the appearance of a marker when it is hovered over.

Type: Boolean
Default Value: true
Accepted Values: true | false

If this option is set to true, you can specify colors for the hovered marker and its border using the hoveredColor and hoveredBorderColor options respectively.

Show Example:
jQuery

Toggle the check box below to enable/disable the hover capability for markers. Hover over a marker to see the effect.


                                    

                                    

selectedBorderColor

Specifies a color for the marker border when the marker is selected.

Type: String
Default Value: '#ffffff'

This option supports the following colors.

  • hexadecimal colors
  • RGB colors
  • RGBA colors (not supported in Internet Explorer 8)
  • predefined/cross-browser color names
  • predefined SVG colors (not supported in Internet Explorer 8)
Show Example:
jQuery

In this example, you can select a marker by a click. The border of the selected marker is colored in 'gold' using the selectedBorderColor option.


                                    

                                    

selectedColor

Specifies a color for a marker when this marker is selected.

Type: String
Default Value: '#ba4d51'

This option supports the following colors.

  • hexadecimal colors
  • RGB colors
  • RGBA colors (not supported in Internet Explorer 8)
  • predefined/cross-browser color names
  • predefined SVG colors (not supported in Internet Explorer 8)
Show Example:
jQuery

In this example, you can select a marker by a click. The selected marker is colored in 'royalblue' using the selectedColor option.


                                    

                                    

selectionChanged

Specifies the function that is called when the selection state of a marker has been changed.

Type: function
Function parameters:
marker: Marker

The marker that was selected or unselected.

When implementing a callback function for this option, use the object that represents the marker, which has been selected or deselected. To access this object, use the function's parameter or the this object. The accessible fields and methods of this object are documented in the Marker class description within the Map Elements reference section.

To identify whether a marker has been selected or deselected, call the selected() method of this area. Pass true or false to this method to select or deselect the area.

Show Example:
jQuery

In this example, you can select/deselect markers by a click. When the selection state of a marker changes, the corresponding message appears under the map.


                                    

                                    

selectionMode

Specifies whether a single or multiple markers can be selected on a vector map.

Type: String
Default Value: 'single'
Accepted Values: 'single' | 'multiple' | 'none'

Several options and methods are connected with the selection operation. To specify whether a single or multiple markers can be selected at a time, use the selectionMode option. To determine whether a certain marker is selected when the widget is created, use the isSelected field of the object returned by the customize callback function.

At runtime, you can do the following operations.

  • Obtain the current selection state of a marker using its selected() method.

  • Change the current selection state of a marker using its selected(state) method. Pass true or false to this method.

  • Deselect all the selected markers using the clearMarkerSelection() method of the map instance.

The change of the selection state envokes the callback function assigned to the selectionChanged option. Within this function you can handle the selection event in the manner you require.

Show Example:
jQuery

Use the drop-down menu below to change the selectionMode option for markers. To see the effect, click one or more map markers.