Vector Map Tiles on Bing Map Control

ⅰ亾dé卋堺 提交于 2019-12-04 22:58:27

This won't be easy, but can be done. There are two key things you will need to do. The first is parse the PBF data into something you can work with. PBF is a binary file format. You can find the spec for this file format here. Here are a few open source projects that can read PBF file format:

https://github.com/motz-art/OSM-pbf-convert

https://github.com/bertt/mapbox-vector-tile-cs

https://github.com/OsmSharp/VectorTileToBitmapRenderer

Once you re able to read the vector data out of the PBF file you will then need to generate an image from the data. Once you are able to do this then you can create a CustomMapTileDataSource.

I have a sample of how to create a CustomMapTileDataSource here: https://code.msdn.microsoft.com/Adding-Opacity-and-WMS-cf6773f1/sourcecode?fileId=124374&pathId=1999022414

I faced the same issue. So I ended up writing my very own vector map rendering engine in C#. It supports the mapbox vector tile specification and styles.

The project repository contains demos for Mapsui and Gmap.Net integration, check it out and let me know what you think about it.

You can find it here:

https://github.com/AliFlux/VectorTileRenderer

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!