wpf-401715-controls-and-libraries-map-control-vector-data-providing-data-vector-tile-providers.md
Use a vector data tile source with the Map Control to optimize your application’s performance. When the control is bound to a vector provider, it only downloads shape definitions (geometries) and applies styles on the client-side. (Raster providers require more bandwidth to download pre-rendered tiles.)
Refer to the following sections for more information on supported vector tile sources and styles:
Mapbox Service provides vector tilesets. Each tileset consists of vector tiles in PBF format.
Important
Before you use the Mapbox Service, read the Invoices and billing and Terms of service pages.
You should register an access token to use this service. See the access token page for more information.
Use MapboxDataProvider to connect to Mapbox Tile Service and load the Mapbox Streets tileset to a map. To choose between available tilesets, use the MapboxDataProvider.Tileset property.
<dxm:MapControl>
<dxm:ImageLayer>
<dxm:MapboxDataProvider AccessToken="Your_Access_Token" />
</dxm:ImageLayer>
</dxm:MapControl>
See the MapboxDataProvider page in the API Reference section for more information.
Vector tiles can be stored as MbTiles files (wrapped SQLite databases). Use MbTilesDataProvider to load a MbTiles file stored locally or on a server.
<dxm:MapControl>
<dxm:ImageLayer>
<dxm:MbTilesDataProvider FileUri="D:\MapTiles\countries.mbtiles"/>
</dxm:ImageLayer>
</dxm:MapControl>
See the MbTilesDataProvider page in the API Reference section for more information.
To load vector tiles in .PBF or .MVT format, use UriBasedVectorTileDataProvider. Specify its UriBasedVectorTileDataProvider.TileUriTemplate property to set a template that the Map Control uses to obtain tiles.
<dxm:MapControl>
<dxm:ImageLayer>
<dxm:UriBasedVectorTileDataProvider TileUriTemplate="D:\PbfFiles\{x}-{y}-{level}.pbf"/>
</dxm:ImageLayer>
</dxm:MapControl>
See the UriBasedVectorTileDataProvider page in the API Reference section for more information.
Follow the steps below to implement a provider that loads tiles from a custom source.
If a default vector tile style does not meet your requirements, you can apply your style to vector tiles. Styles apply on a client’s side before rendering the map.
A style must be a valid JSON file. The Map Control supports layers and their properties:
filter
paint
layout
Property values can be set directly (for example, “text-size”: 10) or via an interpolation syntax (for example, “line-width”: {“base”: 1.2, “stops”: [[15, 1], [17, 4]]}).
The following color formats are supported: hsl, rgb, rgba, hsla, hex. You can use web color names, such as red or yellow.
DevExpress.Map.Native.VectorTileStyleParser.ProcessingLibrary property to NewtonsoftJson to use the Newtonsoft.Json library instead.<dxm:MbTilesDataProvider ... StyleFileUri="D:\Styles\basic-style.json"/>