VectorMap

The VectorMap is a widget that visualizes 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({
});

                    

DevExtreme widgets are integrated with many popular libraries and frameworks. See the Installation section (for JavaScript libraries) or the Prerequisites and Installation section (for ASP.NET MVC framework) to find details on setting up DevExtreme with a particular library or framework.

The following code shows how to create the VectorMap widget using every supported library and framework. For more details on working with widgets in these libraries and frameworks, see the Widget Basics topic for jQuery, Angular, AngularJS, Knockout or ASP.NET MVC.

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
TypeScript
<dx-vector-map>
    <dxi-layer
        type="area"
        [dataSource]="worldMap">
        <dxo-label
            [enabled]="true"
            dataField="name">
        </dxo-label>
    </dxi-layer>
</dx-vector-map>
import { DxVectorMapModule } from 'devextreme-angular';
import * as maps from 'vectormap-data/world.js';
// ...
export class AppComponent {
    worldMap: any = maps.world;
}
@NgModule({
    imports: [
        // ...
        DxVectorMapModule
    ],
    // ...
})
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)
)

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 describes vector map elements.