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.

MbTilesDataProvider Class

A data provider that loads vector tiles from a MbTiles database.

Namespace: DevExpress.XtraMap

Assembly: DevExpress.XtraMap.v20.1.dll

Declaration

public class MbTilesDataProvider :
    VectorTileDataProviderBase
Public Class MbTilesDataProvider
    Inherits VectorTileDataProviderBase

Remarks

A set of tiles can be packaged in MbTiles files (wrapped SQLite databases) stored locally or on a server. MbTiles can also contain raster tiles.

Follow the steps below to load data from a MbTiles file:

  1. Install the System.Data.SQLite.Core package if your application does not reference this library.
  2. Create an image layer and add it to the MapControl.Layers collection.
  3. Create an MbTilesDataProvider instance and assign it to the ImageLayer.DataProvider property.
  4. Use the MbTilesDataProvider.FileUri property to specify a path to an MbTiles file.
private void Form1_Load(object sender, EventArgs e) {
    ImageLayer layer = new ImageLayer();
    MbTilesDataProvider dataProvider = new MbTilesDataProvider();
    dataProvider.FileUri = new Uri(@"D:\countries.mbtiles", UriKind.Absolute);
    layer.DataProvider = dataProvider;
    mapControl1.Layers.Add(layer);
}            

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