All docs
V20.1
20.1
19.2
The page you are viewing does not exist in version 19.2. This link will take you to the root page.
19.1
The page you are viewing does not exist in version 19.1. This link will take you to the root page.
18.2
The page you are viewing does not exist in version 18.2. This link will take you to the root page.
18.1
The page you are viewing does not exist in version 18.1. This link will take you to the root page.
17.2
The page you are viewing does not exist in version 17.2. This link will take you to the root page.

MapboxDataProvider Class

A data provider that obtains vector tiles from Mapbox Service

Namespace: DevExpress.XtraMap

Assembly: DevExpress.XtraMap.v20.1.dll

Declaration

public class MapboxDataProvider :
    UriBasedVectorTileDataProvider
Public Class MapboxDataProvider
    Inherits UriBasedVectorTileDataProvider

Remarks

Mapbox Service provides vector tilesets. The Map Control receives tiles as PBF files.

IMPORTANT

Before you use the Mapbox Service, read the Invoices and billing and Terms of service pages.

Follow the steps below to connect to the Mapbox Tile Service and load the Mapbox Streets tileset (mapbox.mapbox-streets-v8):

  1. Create an image layer and add it to the MapControl.Layers collection.
  2. Create a MapboxDataProvider instance and assign it to the ImageLayer.DataProvider property.
  3. Specify the MapboxDataProvider.AccessToken property. For more information on how to get the key, visit the access token page.
private void Form1_Load(object sender, EventArgs e) {
    ImageLayer layer = new ImageLayer();
    MapboxDataProvider dataProvider = new MapboxDataProvider();

    dataProvider.AccessToken = "Your_access_token_here.";

    layer.DataProvider = dataProvider;
    mapControl1.Layers.Add(layer);
}

Load a Specific Tileset

You can use the MapboxDataProvider.Tileset property to select a tileset:

dataProvider.Tileset = MapboxTileset.Terrain;

Apply a Custom Style

If a default vector tile style does not meet your requirements, you can apply a custom style. Use the VectorTileDataProviderBase.StyleFileUri property to define a path to a style file. See Vector Tile Providers: Vector Tile Styles for more information about styles.

dataProvider.StyleFileUri = new Uri(@"D:\style.json", UriKind.Absolute);
See Also