WinForms and WPF Maps – Vector Tile Providers (v20.1)

The following v20.1 feature is available in both our WinForms and WPF Map Controls. 

The DevExpress WinForms Map Controls & WPF Map Controls both ship with built in support for Bing Maps and OpenStreetMap. In both instances, maps are built from a set of tile images at multiple zoom levels. When an end user zooms or pans the current map view port area, a new set of raster tiles are downloaded from the server. 

As you may already know, a few issues exist with use of raster files, including inability to modify map styles or captions in a client application. To address this, many map services also offer vector tile maps. Unlike raster tiles, vector tiles do not contain an actual map image – instead, they include a set of vector shapes (geometries) that are processed on the client. This makes it possible to apply custom map styles and change map content based on regional settings and screen resolution.

If you currently use vector maps in a Shapefile format, you may want to use a third-party tools to convert your existing Shapefile maps to a vector tile map for better rendering performance.

You can also use vector tile packages in offline environments where it’s impossible to load tiles from online map providers. 

Supported formats 

 v20.1 includes support for the following vector tile formats and providers: 

  • MVT or PBF files (see UriBasedVectorTileDataProvider and the TileUriTemplate property).  
  • Mapbox online tile provider service (see MapboxDataProvider and the AccessToken property).  
  • MBTILES files (see MbTilesDataProvider and the FileUri property).  

You can certainly implement your own custom tile provider as needed. Simply inherit it from the VectorTileDataProviderBase class and define your own tile delivery method. 

Code Example 

Use the following syntax to assign a selected provider to a map:  

WinForms MapControl

ImageLayer layer = new ImageLayer() {
DataProvider = new MbTilesDataProvider() { FileUri = new Uri(“your file path.mbtiles”) }
 };
this.mapControl1.Layers.Add(layer);

WPF MapControl

<dxm:MapControl>
<dxm:ImageLayer>
<dxm:MbTilesDataProvider FileUri="your file path.mbtiles" />
</dxm:ImageLayer>
</dxm:MapControl>

Custom Styles 

The MapBox team developed a common style specification (JSON) that is currently used by many vector map suppliers. Our MapControl supports multiple style definitions specified in the MapBox style standard. 

To apply a custom map style, specify the style file’s URI using the adapter’s StyleFileUri property. 

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

You will find a complete list of supported style elements in the following help topics: 

Vector Tile Styles (WinForms)Vector Tile Styles (WPF)

What’s Next

Our Map Control currently uses a hybrid rendering engine to render tiles displayed on screen. We are considering a dedicated vector map rendering engine for the ultimate map experience in future updates. Please give the Map Control a try and let us know about your specific usage scenarios so we can evolve the control in future builds.

For additional information and code examples, please refer to following help topics: 

Showcase Your Apps on DevExpress.com

Highlight your business app and share your development experiences with the DevExpress community. To include your app in our upcoming App Showcase, please forward an application screenshot to clientservices@devexpress.com and tell us which DevExpress products you currently use within your organization.
2 comment(s)
CRM-48072708-3269-4580-8510-390573ae1482
Kiryl Y

Hi DX team, 

When do you plan to support drawing labels over lines and polygons in vector tile sources? 


4 May 2020
Alex (DevExpress Support)
Alex (DevExpress Support)
At present, we support horizontal labels linked to geographical objects and we also expect to support labels with complex geometries (printed across lines and polygons, such as street names) in a future update. Thanks for your patience - I realize this is important and we'll do everything we can to make it happen.
8 May 2020

Please login or register to post comments.