尝试在 Osmdroid 中覆盖自定义图块

发布于 2024-12-25 05:21:01 字数 783 浏览 2 评论 0原文

我有一个 Geotiff,我想将其放在 osm 底图之上。 我通过maptiler平铺了Geotiff - 输出是一个具有文件结构resourcename/zoom/x/y.png的文件夹

然后我将此文件结构上传到我的网络空间并尝试将其放入我的代码中,如下所示:

final MapTileProviderBasic tileProvider = new MapTileProviderBasic(
    getApplicationContext());
final ITileSource tileSource = new XYTileSource(
    "myGeotiff", null, 14, 16, 256, ".png", "http://mysite.com/");
tileProvider.setTileSource(tileSource);
final TilesOverlay tilesOverlay = new TilesOverlay(
    tileProvider, this.getBaseContext());
tilesOverlay.setLoadingBackgroundColor(Color.TRANSPARENT);
osmv.getOverlays().add(tilesOverlay);

当我启动应用程序并尝试添加叠加层时,logcat 一遍又一遍地说:

SkImageDecoder::Factory returned null

并且我的图块未显示。

有人有这方面的经验并且可以提供帮助吗?

I have a Geotiff I want to put on top of a osm base map.
I tiled the Geotiff via maptiler - the output is a folder with the file structure resourcename/zoom/x/y.png

Then I uploaded this filestructure to my webspace and tried to put it in my code like this:

final MapTileProviderBasic tileProvider = new MapTileProviderBasic(
    getApplicationContext());
final ITileSource tileSource = new XYTileSource(
    "myGeotiff", null, 14, 16, 256, ".png", "http://mysite.com/");
tileProvider.setTileSource(tileSource);
final TilesOverlay tilesOverlay = new TilesOverlay(
    tileProvider, this.getBaseContext());
tilesOverlay.setLoadingBackgroundColor(Color.TRANSPARENT);
osmv.getOverlays().add(tilesOverlay);

When I start the app and try to add my overlay logcat says this over and over:

SkImageDecoder::Factory returned null

And my tiles are not displayed.

Does anybody have experience with this and can help?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文