0

我正在寻找一种解决方案,可以使移动浏览器从服务器加载平铺图像的集合并将它们存储在本地移动设备中,然后即使在离线模式下也可以显示它们。

我通过在 HTML5 中使用 CacheManifest 和 LocalStorage 进行了一些研究,但似乎它们只能处理少量数据。此外,WebSql 似乎是一个潜在的解决方案,但我无法真正理解如何实现它。

基本上,我想要的功能是:在在线模式下从远程服务器加载->将它们存储在本地内存中->在离线模式下显示它们

感谢您的任何提示!

4

2 回答 2

0

I've had similar requirements on http://bluedot.mobi/td. Setting aside the caching issue for a moment, having a mapping framework that can be used offline is tricky - the best I'm aware of is the open source API OpenLayers.org. They have recently done significant work on enabling mobile device support. The big mapping APIs such as Google's javascript API restrict offline use and caching.

There is some work currently being done with OpenLayers to utilize either localStorage and/or websql. A working example is here. You can drill down to the source from there to see the different implementation methods.

Note that with OpenLayers you'll likely want to tap into the svn trunk to get the latest developments. It's a fast moving project.

于 2011-06-22T17:34:00.070 回答
0

我们在最近的 iOS DevCamp(7 月)上的开源项目正是专注于这个问题。我们非常接近一个可行的解决方案:

https://github.com/pdxgene/iDCMapsLite

亮点: -“在线”选项卡浏览地图(当前设置为从 OpenStreetMaps、IIRC 抓取图块) -“保存”将地图图块保存到核心数据存储,并在第二个选项卡的列表中添加“离线地图”;- “已保存地图”选项卡包含已保存地图的列表。选择一个从 Core Data 存储中抓取它的图块并显示它们。

仍然需要工作的区域: - 我们的目的是递归地对地图图块进行快照,同时放大和缩小。我相信作为概念证明,我们降低了一级和一级。

我希望这有帮助。随意尝试让它为你工作:-)

于 2011-08-11T16:41:17.723 回答