Skip to main content
A newer version of this page is available. .

UriBasedVectorTileDataProvider Class

Provides map data from a set of PBF or MVT files.

Namespace: DevExpress.XtraMap

Assembly: DevExpress.XtraMap.v21.1.dll

NuGet Packages: DevExpress.Win.Design, DevExpress.Win.Map

Declaration

public class UriBasedVectorTileDataProvider :
    VectorTileDataProviderBase

Remarks

You can use UriBasedVectorTileDataProvider to draw a map based on a set of .PBF or .MVT files that store vector tiles in binary format.

  1. Create an image layer and add it to the MapControl.Layers collection.
  2. Create a UriBasedVectorTileDataProvider instance and assign it to the ImageLayer.DataProvider property.
  3. Specify the UriBasedVectorTileDataProvider.TileUriTemplate property.
ImageLayer layer = new ImageLayer();
UriBasedVectorTileDataProvider dataProvider = new UriBasedVectorTileDataProvider();            
dataProvider.TileUriTemplate = @"D:\PbfFiles\{x}-{y}-{level}.pbf";
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