[英]how to use Openmap vector tiles with mapbox android Sdk
I am very new to Android development, but I managed to make bellow link work 我对Android开发非常陌生,但是我设法使波纹管链接工作了
https://www.mapbox.com/android-docs/map-sdk/overview/ https://www.mapbox.com/android-docs/map-sdk/overview/
Now I can load map by using mapbox API. 现在,我可以使用mapbox API加载地图。
I just need one help , how can i use openmap vector tiles with this SDK, what do i need to change ? 我只需要一个帮助,该SDK如何使用openmap矢量图块,我需要更改什么?
I have installed vector tiles like this http://mydomain:9090/styles/osm-bright/?vector#8/22.615/90.344 我已经安装了矢量瓷砖,例如http:// mydomain:9090 / styles / osm-bright /?vector#8 / 22.615 / 90.344
I did not find any documentation for this Can any one please help me . 我没有为此找到任何文档。任何人都可以帮助我。
In order to use tiles hosted by a third-party, you need to set up a TileSet
and then a VectorSource
out of that set. 为了使用第三方托管的图块,您需要设置一个
TileSet
,然后从该集合中设置一个VectorSource
。
TileSet tileSet = new TileSet("2.1.0", TILE_SET_URL);
VectorSource source = new VectorSource(ID_SOURCE, tileSet);
Also important to note is, that when using vector tiles you need to define a source layer. 还要注意的重要一点是,在使用矢量切片时,需要定义源图层。
LineLayer lineLayer = new LineLayer(ID_LINE_LAYER, ID_SOURCE);
lineLayer.setSourceLayer("source-layer");
More on the source layer here , and a more elaborate example can be found in the Mapbox Demo App's repository . 可以在此处的源代码层中找到更多信息 ,并在Mapbox Demo App的存储库中找到更详细的示例。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.