OSMdroid:如何从 zip 存档加载离线地图 - MapTileFileArchiveProvider [英] OSMdroid : How to load offline map from zip archive - MapTileFileArchiveProvider

查看:26
本文介绍了OSMdroid:如何从 zip 存档加载离线地图 - MapTileFileArchiveProvider的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我真的需要一些有关 OSMdroid 库的帮助.将地图作为 zip 文件存储在 sdcard 中很有用.此外,地图可以解压缩,图像文件可以直接使用以加快渲染速度.

I really need some help with the OSMdroid library. It is useful to have maps stored in sdcard as zip files. Also, maps can be unzipped and the image files may be used directly for faster rendering.

当图块解压缩、具有.tile扩展名并且存储在文件夹中时,我设法从我的sdcard加载了图块>/sdcard/osmdroid/tiles/Mapnik/...为了创建我的地图,我使用了 Mobile Atlas CreatorOSMAND 切片存储 格式.

I managed to load tiles from my sdcard when the tiles are unziiped, have .tile extension and are stored in the folder /sdcard/osmdroid/tiles/Mapnik/... To create my map I used the Mobile Atlas Creator and OSMAND tile storage format.

我在网上阅读了一些教程,声称将包含切片的 zip 文件存储在 /sdcard/osmdroid 中,然后将从 zip 加载离线地图.但它对我不起作用.

I read some tutorials on the web that claim storing zip files containing tiles are stored in /sdcard/osmdroid then the offline map will be loaded from the zip. But it does not work for me.

  1. 有人设法让它工作吗?如果是这样怎么办?

  1. Did anybody managed to make it work? If so how?

我需要实例化我自己的 MapTileFileArchiveProvider 吗?如果是这样,我该怎么做?有什么例子吗?

Do I need to instantiate my own MapTileFileArchiveProvider? If so, how can I do that? Any examples?

推荐答案

ZIP 中的文件需要采用以下形式:

The files in your ZIP need to be in the form of:

Z/X/Y.png

如果您将 Y.tile 文件重命名为 Y.png,请将它们压缩并将 zip 文件放在/sdcard/osmdroid/中,这应该可以工作.

If you rename your Y.tile files to Y.png, zip them up and put the zip file in /sdcard/osmdroid/, that should work.

这篇关于OSMdroid:如何从 zip 存档加载离线地图 - MapTileFileArchiveProvider的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆