Bing地图控件上的矢量地图图块 [英] Vector Map Tiles on Bing Map Control
问题描述
您好,我正在研究基于UWP地图的应用程序.我目前正在使用Raster Tiles
数据删除必应地图"默认图块.我现在想转到在Bing地图控件上使用Vector Tiles
.对于栅格图块,我知道有两种方法:
Hello I am working on a UWP map based application. I am currently using Raster Tiles
data to remove the Bing Map default tiles. I Want to now shift to using Vector Tiles
on the Bing map control. For Raster Tiles I know there are two ways:
- 通过
HTTPTileSource
设置图块数据
- 通过
BitMapTileSource
设置图块数据
- Set Tile data via the
HTTPTileSource
- Set Tile data via the
BitMapTileSource
我想知道如何在bing地图控件上实现Vector Tiles.我得到的Vector切片的范围为.pbf
.我必须点击URL并获取.pbf
文件,如何将磁贴放置在地图上?
I want to know how can I implement Vector Tiles on the bing map control. The Vector tiles I get are of the extention .pbf
. I have to hit the URL and get the .pbf
file now how do I place the tile on the map?
推荐答案
这并不容易,但是可以做到.您需要做两件事.首先是将PBF数据解析为可以使用的数据. PBF是二进制文件格式.您可以在此处找到该文件格式的规范.以下是一些可以读取PBF文件格式的开源项目:
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
一旦您能够从PBF文件中读取矢量数据,则需要从该数据生成图像.一旦能够执行此操作,则可以创建 CustomMapTileDataSource .
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.
我有一个有关如何在此处创建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
这篇关于Bing地图控件上的矢量地图图块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!