Back to Devexpress

MapboxDataProvider Class

wpf-devexpress-dot-xpf-dot-map-b11a1249.md

latest4.4 KB
Original Source

MapboxDataProvider Class

A data provider that obtains vector tiles from Mapbox Service.

Namespace : DevExpress.Xpf.Map

Assembly : DevExpress.Xpf.Map.v25.2.dll

NuGet Package : DevExpress.Wpf.Map

Declaration

csharp
public class MapboxDataProvider :
    UriBasedVectorTileDataProvider
vb
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. Note that the MapControl.Layers is a content property. You can declare layers in XAML directly after a map control’s declaration without wrapping them in opening and closing MapControl.Layers tags.

  2. Create a MapboxDataProvider instance and assign it to the ImageLayer.DataProvider property. Note that the ImageLayer.DataProvider is a content property. You can declare a provider in XAML directly after a layer’s declaration without wrapping it in opening and closing ImageLayer.DataProvider tags.

  3. Specify the MapboxDataProvider.AccessToken property. For more information on how to get the key, visit the access token page.

xaml
<dxm:MapControl>
    <dxm:ImageLayer>
        <dxm:MapboxDataProvider AccessToken="Your_Access_Token" />
    </dxm:ImageLayer>
</dxm:MapControl>

Load a Specific Tileset

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

xaml
<dxm:MapboxDataProvider ... Tileset="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.

xaml
<dxm:MapboxDataProvider ... StyleFileUri="D:\Styles\basic-style.json"/>

Inheritance

Show 11 items

Object DispatcherObject DependencyObject Freezable MapDependencyObject MapImageDataProviderBase DevExpress.Xpf.Map.MapTileDataProviderBase ImageTileDataProvider VectorTileDataProviderBase UriBasedVectorTileDataProvider MapboxDataProvider

See Also

MapboxDataProvider Members

DevExpress.Xpf.Map Namespace