markerSettings 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.

<div id="mapContainer" style="height:500px; max-width:800px; margin: 0 auto"></div>
var markers = [
    {
        coordinates: [-121.2808, 38.3320],
        attributes: { name: 'Sacramento' }
    }, {
        coordinates: [-97.75, 30.25],
        attributes: { name: 'Austin' }
    }, {
        coordinates: [-73.7572, 42.6525],
        attributes: { name: 'Albany' }
    }, {
        coordinates: [-84.2533, 30.455],
        attributes: { name: 'Tallahassee' }
    }, {
        coordinates: [-89.65, 39.783],
        attributes: { name: 'Springfield' }
    }
];

$(function () {
    $('#mapContainer').dxVectorMap({
        mapData: '/Content/data/vectorMap-sources/usa.txt',
        markers: markers,
        bounds: {
            minLon: -135, maxLon: -65,
            minLat: 20, maxLat: 60
        },
        zoomFactor: 1.25,
        areaSettings: { hoverEnabled: false },
        markerSettings: {
            customize: function (m) {
                return {
                    text: m.attributes.name
                }
            },
            font: {
                color: 'midnightblue',
                family: 'Verdana',
                opacity: 0.9,
                weight: 100,
                size: 11
            }
        }
    });
});

color

Specifies a font color for the text that accompanies a marker.

Type: String
Default Value: '#2b2b2b'

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 font color for markers is set to 'green' using the color option.

<div id="mapContainer" style="height:500px; max-width:800px; margin: 0 auto"></div>
var markers = [
    {
        coordinates: [-121.2808, 38.3320],
        attributes: { name: 'Sacramento' }
    }, {
        coordinates: [-97.75, 30.25],
        attributes: { name: 'Austin' }
    }, {
        coordinates: [-73.7572, 42.6525],
        attributes: { name: 'Albany' }
    }, {
        coordinates: [-84.2533, 30.455],
        attributes: { name: 'Tallahassee' }
    }, {
        coordinates: [-89.65, 39.783],
        attributes: { name: 'Springfield' }
    }
];

$(function () {
    $('#mapContainer').dxVectorMap({
        mapData: '/Content/data/vectorMap-sources/usa.txt',
        markers: markers,
        bounds: {
            minLon: -135, maxLon: -65,
            minLat: 20, maxLat: 60
        },
        zoomFactor: 1.25,
        areaSettings: { hoverEnabled: false },
        markerSettings: {
            customize: function (m) {
                return {
                    text: m.attributes.name
                }
            },
            font: {
                color: 'green'
            }
        }
    });
});

family

Specifies a font family for the text that accompanies a marker.

Type: String
Default Value: "'Segoe UI', 'Helvetica Neue', 'Trebuchet MS', Verdana"

For details on acceptable values, refer to the Font family article.

Show Example:
jQuery

In this example, the font family for markers is changed using the family option.

<div id="mapContainer" style="height:500px; max-width:800px; margin: 0 auto"></div>
var markers = [
    {
        coordinates: [-121.2808, 38.3320],
        attributes: { name: 'Sacramento' }
    }, {
        coordinates: [-97.75, 30.25],
        attributes: { name: 'Austin' }
    }, {
        coordinates: [-73.7572, 42.6525],
        attributes: { name: 'Albany' }
    }, {
        coordinates: [-84.2533, 30.455],
        attributes: { name: 'Tallahassee' }
    }, {
        coordinates: [-89.65, 39.783],
        attributes: { name: 'Springfield' }
    }
];

$(function () {
    $('#mapContainer').dxVectorMap({
        mapData: '/Content/data/vectorMap-sources/usa.txt',
        markers: markers,
        bounds: {
            minLon: -135, maxLon: -65,
            minLat: 20, maxLat: 60
        },
        zoomFactor: 1.25,
        areaSettings: { hoverEnabled: false },
        markerSettings: {
            customize: function (m) {
                return {
                    text: m.attributes.name
                }
            },
            font: {
                family: 'Helvetica Neue'
            }
        }
    });
});

opacity

Specifies a font opacity for the text that accompanies a marker.

Type: Number
Default Value: undefined

Show Example:
jQuery

In this example, the font opacity for markers is specified using the opacity option.

<div id="mapContainer" style="height:500px; max-width:800px; margin: 0 auto"></div>
var markers = [
    {
        coordinates: [-121.2808, 38.3320],
        attributes: { name: 'Sacramento' }
    }, {
        coordinates: [-97.75, 30.25],
        attributes: { name: 'Austin' }
    }, {
        coordinates: [-73.7572, 42.6525],
        attributes: { name: 'Albany' }
    }, {
        coordinates: [-84.2533, 30.455],
        attributes: { name: 'Tallahassee' }
    }, {
        coordinates: [-89.65, 39.783],
        attributes: { name: 'Springfield' }
    }
];

$(function () {
    $('#mapContainer').dxVectorMap({
        mapData: '/Content/data/vectorMap-sources/usa.txt',
        markers: markers,
        bounds: {
            minLon: -135, maxLon: -65,
            minLat: 20, maxLat: 60
        },
        zoomFactor: 1.25,
        areaSettings: { hoverEnabled: false },
        markerSettings: {
            customize: function (m) {
                return {
                    text: m.attributes.name
                }
            },
            font: {
                opacity: 0.8
            }
        }
    });
});

size

Specifies a font size for the text that accompanies a marker.

Type: Number
Default Value: 12

For details on acceptable values, refer to the Font size article.

Show Example:
jQuery

In this example, the font size for markers is set to 9 using the size option.

<div id="mapContainer" style="height:500px; max-width:800px; margin: 0 auto"></div>
var markers = [
    {
        coordinates: [-121.2808, 38.3320],
        attributes: { name: 'Sacramento' }
    }, {
        coordinates: [-97.75, 30.25],
        attributes: { name: 'Austin' }
    }, {
        coordinates: [-73.7572, 42.6525],
        attributes: { name: 'Albany' }
    }, {
        coordinates: [-84.2533, 30.455],
        attributes: { name: 'Tallahassee' }
    }, {
        coordinates: [-89.65, 39.783],
        attributes: { name: 'Springfield' }
    }
];

$(function () {
    $('#mapContainer').dxVectorMap({
        mapData: '/Content/data/vectorMap-sources/usa.txt',
        markers: markers,
        bounds: {
            minLon: -135, maxLon: -65,
            minLat: 20, maxLat: 60
        },
        zoomFactor: 1.25,
        areaSettings: { hoverEnabled: false },
        markerSettings: {
            customize: function (m) {
                return {
                    text: m.attributes.name
                }
            },
            font: {
                size: 9
            }
        }
    });
});

weight

Specifies a font weight for the text that accompanies a marker.

Type: Number
Default Value: 400

Show Example:
jQuery

In this example, the font weight for markers is set to 700 using the size option.

<div id="mapContainer" style="height:500px; max-width:800px; margin: 0 auto"></div>
var markers = [
    {
        coordinates: [-121.2808, 38.3320],
        attributes: { name: 'Sacramento' }
    }, {
        coordinates: [-97.75, 30.25],
        attributes: { name: 'Austin' }
    }, {
        coordinates: [-73.7572, 42.6525],
        attributes: { name: 'Albany' }
    }, {
        coordinates: [-84.2533, 30.455],
        attributes: { name: 'Tallahassee' }
    }, {
        coordinates: [-89.65, 39.783],
        attributes: { name: 'Springfield' }
    }
];

$(function () {
    $('#mapContainer').dxVectorMap({
        mapData: '/Content/data/vectorMap-sources/usa.txt',
        markers: markers,
        bounds: {
            minLon: -135, maxLon: -65,
            minLat: 20, maxLat: 60
        },
        zoomFactor: 1.25,
        areaSettings: { hoverEnabled: false },
        markerSettings: {
            customize: function (m) {
                return {
                    text: m.attributes.name
                }
            },
            font: {
                weight: 700
            }
        }
    });
});