areaSettings

An object specifying options for the map areas.

Type: Object

The map areas usually represent geographical objects, such as countries, continents, etc. The appearance of these areas is specified by the options of the areaSettings configuration object. If these options are defined on the first level of the areaSettings object, they are applied to all the map areas at once. However, you can specify several of these options for certain areas exclusively. See the customize option description to learn how.

Show Example:
jQuery

In this example, areas are painted using the 'Vintage' palette. To specify different colors from this palette for the areas, the customize function returns an object that contains the specified palleteIndex field.


                                    

                                    

borderColor

Specifies a color for the area border.

Type: String
Default Value: '#9d9d9d'

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, area borders are colored in 'indianred' using the borderColor option.


                                    

                                    

borderWidth

Specifies the width of the area border in pixels.

Type: Number
Default Value: 1

Show Example:
jQuery

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


                                    

                                    

click

Deprecated

Use the onAreaClick option instead.

color

Specifies a color for an area.

Type: String
Default Value: '#d2d2d2'

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 top ten most populated countries are indicated by the 'yellowgreen' color.


                                    

                                    

colorGroupingField

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

Type: String
Default Value: undefined

If you need for the color of a specific map area 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.

View Demo

colorGroups

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

Type: Array
Default Value: undefined

If you have specified the field that provides area-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, imagine 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 areas. Areas of those data values that do not match neither group will be drawn in a default color.

View Demo

customize

Specifies the function that customizes each area individually.

Type: function(area)
Function parameters:
area: Area

The area to be customized.

Return Value: Area configuration

A configuration object for the area.

Cannot be used in themes.

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

View Demo

Show Example:
jQuery

In this example, the top ten most populated countries are colored in 'dodgerblue' using the color option of the object returned by the customize function. The other countries are colored in 'lightskyblue' using the color option of the areaSettings object.


                                    

                                    

hoveredBorderColor

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

Type: String
Default Value: '#303030'

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 an area is hovered over, its border is colored in 'lightcoral'.


                                    

                                    

hoveredBorderWidth

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

Type: Number
Default Value: 1

Show Example:
jQuery

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


                                    

                                    

hoveredColor

Specifies a color for an area when this area is hovered over.

Type: String
Default Value: '#d2d2d2'

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 an area is hovered over, it is colored in 'plum'.


                                    

                                    

hoverEnabled

Specifies whether or not to change the appearance of an area when it is hovered over.

Type: Boolean
Default Value: true

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

Show Example:
jQuery

Toggle the check box below to enable/disable the hovering capability.


                                    

                                    

label

Configures area labels.

Type: Object

An area label is a text that accompanies a map area. Usually, an area label displays the name of a certain geographical object, such as a country, a continent, etc.

Texts for area labels are provided by one of the fields of the attributes object. This object must be declared in the map data source, while the required field must be assigned to the dataField option of the label object.

If you have provided data for area labels, enable them on your map by assigning true to the enabled option of the label object.

In addition, you can change the appearance of area labels using the label | font object.

View Demo

palette

Specifies the name of the palette or a custom range of colors to be used for coloring a map.

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

A palette defines a range of colors that are used to paint areas on a map. This range is divided into segments using the value assigned to the paletteSize option. Each segment contributes a color into a resulting array of colors. The more of these segments, the greater the variety of colors in this array. All available palettes are listed in the accepted values.

In order to apply a palette to a map, follow the next steps.

  • Assign the name of the required palette (or an array of two colors) to the palette option.
  • Use the paletteSize option to define how many colors should be produced from the palette or array specified in the previous step.
  • Specify the index of the color from the colors array, which should be used for coloring an area, using the paletteIndex field of the object returned by the customize callback function.

View Demo

Show Example:
jQuery

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


                                    

                                    

paletteSize

Specifies the number of colors in a palette.

Type: Number
Default Value: 0

Assign a number that is greater than 0 to this option in order to use palettes.

Show Example:
jQuery

In this example, the paletteSize option is set to 7. The map contains only seven different colors.


                                    

                                    

selectedBorderColor

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

Type: String
Default Value: '#303030'

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 an area by a click. When the area is selected, its border is colored in 'dodgerblue'.


                                    

                                    

selectedBorderWidth

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

Type: Number
Default Value: 2

Show Example:
jQuery

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


                                    

                                    

selectedColor

Specifies a color for an area when this area is selected.

Type: String
Default Value: '#d2d2d2'

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 an area by a click. When the area is selected, it is colored in 'lightseagreen'.


                                    

                                    

selectionChanged

Deprecated

Use the onAreaSelectionChanged option instead.

selectionMode

Specifies whether single or multiple areas 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 single or multiple areas can be selected at a time, use the selectionMode option. To determine whether a certain area 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 an area using its selected() method.

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

  • Deselect all the selected areas using the clearAreaSelection() method of the map instance.

The change of the selection state invokes the callback function assigned to the onAreaSelectionChanged 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. To see the effect, click one or more map areas.