The DevExpress Map Control (WinForms & WPF) ships 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: