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.


                                    

                                    

borderWidth

Specifies the width of the marker border in pixels.

Type:

Number

Default Value: 2

Show Example:
jQuery

In this example, the marker borders are increased in width up to 4 pixels using the borderWidth option.


                                    

                                    

click

Deprecated

Use the onMarkerClick option instead.

color

Specifies a color for a marker of the dot or bubble type.

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.


                                    

                                    

colorGroupingField

Specifies the field that provides data to be used for coloring markers.

Type:

String

Default Value: undefined

If you need for the color of a specific map marker to depend on the value of one of its attributes, assign the name of this attribute to the colorGroupingField option. The attribute must contain numeric values. After that, specify groups into which attribute values must be classified. For this purpose, assign an array to the colorGroups option. Each group in this array will be assigned a color from the palette.

colorGroups

Allows you to paint markers with similar attributes in the same color.

Type:

Array

Default Value: undefined

If you have specified the field that provides marker-coloring data, you need to specify groups into which this data must be classified. For this purpose, assign an array of numbers to the colorGroups option. Each pair of numbers in this array defines a range of data values.

For example, consider that the colorGroups array contains four items: [0, 1, 2, 3]. This array specifies three ranges, or groups: 0-1, 1-2 and 2-3. Thus, data values will be split up into three groups. Each group will be assigned a color from the palette in order to paint the corresponding markers. Markers of those data values that do not match either group will be drawn in a default color.

customize

Specifies the function that customizes each marker individually.

Type:

function

Function parameters:
marker:

Marker

The marker to be customized.

Return Value:

Marker configuration

A configuration object for the marker.

Cannot be used in themes.

When implementing a function for this option, use the fields of the Marker object. 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 listed 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

Deprecated

Use the font option instead.

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.


                                    

                                    

hoveredBorderWidth

Specifies the pixel-measured width of the marker border when the marker is hovered over.

Type:

Number

Default Value: 2

Show Example:
jQuery

In this example, when a marker is hovered over, its border has a 4-pixel width.


                                    

                                    

hoveredColor

Specifies a color for a marker of the dot or bubble type 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

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.


                                    

                                    

label

Specifies marker label options.

Type:

Object

A marker label is a text that accompanies a map marker. Usually, a marker label displays the name of a certain geographical point. To specify a text for a marker label, assign it to the text field of an object from the markers array when you provide data for markers.

Show Example:
jQuery

In this example, markers are accompanied by labels. Texts for these labels are provided by the text field of objects in the markers array. In addition, font options of marker labels are changed.


                                    

                                    

maxSize

Specifies the pixel-measured diameter of the marker that represents the biggest value. Setting this option makes sense only if you use markers of the bubble type.

Type:

Number

Default Value: 50

When you use bubble markers on your map, their sizes depend on their values. The biggest value will be represented by the largest bubble. Similarly, the smallest value will be represented by the smallest bubble. Bubbles that represent values in between will have sizes proportional to the represented values. To specify the sizes of the largest and smallest bubbles, use the maxSize and minSize properties of the markerSettings object.

View Demo

minSize

Specifies the pixel-measured diameter of the marker that represents the smallest value. Setting this option makes sense only if you use markers of the bubble type.

Type:

Number

Default Value: 20

When you use bubble markers on your map, their sizes depend on their values. The biggest value will be represented by the largest bubble. Similarly, the smallest value will be represented by the smallest bubble. Bubbles that represent values in between will have sizes proportional to the represented values. To specify the sizes of the largest and smallest bubbles, use the maxSize and minSize properties of the markerSettings object.

View Demo

opacity

Specifies the opacity of markers. Setting this option makes sense only if you use markers of the bubble type.

Type:

Number

Default Value: 1

Show Example:
jQuery

In this example, markers of the bubble type are used. Their opacity is set to 0.6 using the opacity option.


                                    

                                    

palette

Specifies the name of a palette or a custom set of colors to be used for coloring markers of the pie type.

Type:

Array

|

String

Default Value: 'default'
Accepted Values: 'Default' | 'Soft Pastel' | 'Harmony Light' | 'Pastel' | 'Bright' | 'Soft' | 'Ocean' | 'Vintage' | 'Violet'

If you define markers of the pie type on your map, use the palette option to colorize them. Assign a set of colors or the name of one of the predefined palettes to this option. The colors listed in the palette will be used to paint pie slices. If the number of slices is greater than the number of colors in a palette, the colors are repeated, but slightly modified.

Show Example:
jQuery

Use the drop-down menu below to choose which palette to use for coloring pie markers on the map.


                                    

                                    

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.


                                    

                                    

selectedBorderWidth

Specifies the pixel-measured width of the marker border when the marker is selected.

Type:

Number

Default Value: 2

Show Example:
jQuery

In this example, you can select a marker by a click. When a marker is selected, its border has a 4-pixel width.


                                    

                                    

selectedColor

Specifies a color for a marker of the dot or bubble type 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

Deprecated

Use the onMarkerSelectionChanged option instead.

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 invokes the callback function assigned to the onMarkerSelectionChanged 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.


                                    

                                    

size

Specifies the size of markers. Setting this option makes sense for any type of marker except bubble.

Type:

Number

Default Value: 8

sizeGroupingField

Specifies the field that provides data to be used for sizing bubble markers.

Type:

String

Default Value: undefined

If you need for the size of a bubble marker to depend on the value of one of its attributes, assign the name of this attribute to the sizeGroupingField option. The attribute must contain numeric values. After that, specify groups into which attribute values must be classified. For this purpose, assign an array to the sizeGroups option.

NOTE
If you need to classify a bubble by its value, leave the sizeGroupingField option unassigned.

sizeGroups

Allows you to display bubbles with similar attributes in the same size.

Type:

Array

Default Value: undefined

If you have specified the field that provides marker-sizing data, you need to specify groups into which this data must be classified. For this purpose, assign an array of numbers to the sizeGroups option. Each pair of numbers in this array defines a range of data values.

For example, consider that the sizeGroups array contains four items: [0, 1, 2, 3]. This array specifies three ranges, or groups: 0-1, 1-2 and 2-3. Thus, data values will be split up into three groups. Each group will be assigned a size correlating with the group values. This size will be calculated automatically taking into account the minSize and maxSize values. Markers of those data values that does not match neither group will have a default size.

View Demo

type

Specifies the type of markers to be used on the map.

Type:

String

Default Value: 'dot'
Accepted Values: 'dot' | 'bubble' | 'pie' | 'image'

dxVectorMap supports markers of the following types.

  • dot
    Markers are represented by dots bordered with a white line.
  • bubble
    Markers are represented by bubbles of different sizes. The size of a bubble depends on the value of the value field specified in the object of the markers array.
  • pie
    Markers are represented by pie charts. To specify values for pie slices, assign an array to the values field specified in the object of the markers array.
  • image
    Markers are represented by custom images. To specify an image for a marker, assign a URL of this image to the url field specified in the object of the markers array.

View Demo

Show Example:
jQuery

In this example, you can spot the difference between marker types. Change the type of markers using the drop-down menu below the map. Note that to provide data for markers of a bubble and pie type, the value and values fields must be specified in each data object.