VectorMap

The VectorMap is a widget that visualize geographical locations. This widget represents a geographical map that contains areas and markers. Areas embody continents and countries. Markers flag specific points on the map, for example, towns, cities or capitals.

Included in: dx.viz.js, dx.viz-web.js, dx.all.js
Module: viz/vector_map
Export: default
VectorMap interactive configuration
Copy Code
Copy to Codepen
$("#vectormap").dxVectorMap({
});

You can create the widget using one of the following approaches.

jQuery
JavaScript
HTML
$(function() {
    $("#vectorMap").dxVectorMap({
        layers: [{
            type: 'area',
            dataSource: DevExpress.viz.map.sources.world,
            label: {
                enabled: true,
                dataField: 'name'
            }
        }]
    });
});
<div id="vectorMap"></div>
Angular
HTML
<dx-vector-map>
    <dxi-layer
        type="area"
        [dataSource]="DevExpress.viz.map.sources.world">
        <dxo-label
            [enabled]="true"
            dataField="name">
        </dxo-label>
    </dxi-layer>
</dx-vector-map>
AngularJS
HTML
<div dx-vector-map="{
    layers: [{
        type: 'area',
        dataSource: DevExpress.viz.map.sources.world,
        label: {
            enabled: true,
            dataField: 'name'
        }
    }]
}"></div>
Knockout
HTML
<div data-bind="dxVectorMap: {
    layers: [{
        type: 'area',
        dataSource: DevExpress.viz.map.sources.world,
        label: {
            enabled: true,
            dataField: 'name'
        }
    }],
}"></div>
ASP.NET MVC Controls
Razor C#
Razor VB
@(Html.DevExtreme().VectorMap()
    .Layers(layers => {
        layers.Add()
            .DataSource(new JS("DevExpress.viz.map.sources.world"))
            .Label(l => l
                .Enabled(true)
                .DataField("name")
            );
    })
)
@(Html.DevExtreme().VectorMap() _
    .Layers(Sub(layers)
        layers.Add() _
            .DataSource(New JS("DevExpress.viz.map.sources.world")) _
            .Label(Sub(l)
                l.Enabled(true) _
                    .DataField("name")
            End Sub)
    End Sub)
)

Note that DevExtreme widgets require you to link the jQuery library to your application. If you use the Knockout or AngularJS approach, the Knockout or AngularJS library is also required. For detailed information on linking these libraries to your project, refer to the topics in the Installation section.

Start Tutorial View Demo Watch Video

See Also

Configuration

An object that specifies configuration options for the widget.

Methods

This section describes the methods that can be used in code to manipulate objects related to the widget.

Events

This section describes events fired by this widget.

See Also

Map Elements

This section lists the methods and fields of the map elements.