简体   繁体   English

在 NASA Worldwind 中实现 XYZ 平铺层

[英]Implement XYZ tile layer in NASA Worldwind

I'm using the NASA Worldwind API to put a virtual globe in my Android app.我正在使用 NASA Worldwind API 在我的 Android 应用程序中放置一个虚拟地球仪。 I would like to be able to implement an XYZ tile layer in my application, but there are no examples that I can find of this.我希望能够在我的应用程序中实现一个 XYZ 平铺层,但是我找不到这方面的示例。 The only examples I have found for adding layers are for WMS and WMTS.我发现添加图层的唯一示例是 WMS 和 WMTS。 Here is an example of a layer i would like to add:这是我要添加的图层的示例:

https://a.tile.openstreetmap.org/${z}/${x}/${y}.png 

Is this possible to add this type of layer in Worldwind?是否可以在 Worldwind 中添加这种类型的图层?

Edit 12/20/2019: After researching this for a while, I found out that this isn't possible out of the box.编辑 2019 年 12 月 20 日:在研究了一段时间后,我发现这不可能开箱即用。 It seems that the Android version capabilities are lagging a good bit behind the Web and Java versions. Android 版本的功能似乎落后于 Web 和 Java 版本。

I did get this working after pulling in some code from the the community edition fork.在从社区版分支中提取一些代码后,我确实得到了这个工作。 If anyone else needs to do this, check out this pull request in the community edition: https://github.com/WorldWindEarth/WorldWindAndroid/pull/17如果其他人需要这样做,请查看社区版中的此拉取请求: https://github.com/WorldWindEarth/WorldWindAndroid/pull/17

Take a look at the OSMMapnikLayer in the gov.nasa.worldwind.layers.Earth package.看看OSMMapnikLayer中的gov.nasa.worldwind.layers.Earth It provides an example of how to implement a custom Mercator-layer (which is what you're looking for).它提供了一个示例,说明如何实现自定义墨卡托层(这是您正在寻找的)。 In fact, the OSMMapnikLayer already uses https://a.tile.openstreetmap.org as a server.事实上, OSMMapnikLayer已经使用https://a.tile.openstreetmap.org作为服务器。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM