简体   繁体   English

展开地图库:从提供者处获取地图图块以供离线使用

[英]unfolding map library: get map tiles from provider for offline use

I'm using UCSD's starter code to make a visualization of earthquake location and magnitudes overlayed on a map.我正在使用 UCSD 的入门代码对叠加在地图上的地震位置和震级进行可视化。

The starter code uses google as a provider for the map tiles when working online, but you are only allowed to make a certain number of calls to Google per day, before it locks you out for 24 hours.在线工作时,入门代码使用 google 作为地图图块的提供者,但您每天只能向 Google 拨打一定数量的电话,然后它会将您锁定 24 小时。 Obviously, as a new coder I'm running my code a lot as I make little changes.显然,作为一名新的编码员,我经常运行我的代码,因为我只做很少的改动。

However, the starter project also comes with some data files that contain map tiles for working offline.但是,初始项目还附带一些包含用于离线工作的地图图块的数据文件。 They are very old (2015 or earlier).它们非常古老(2015 年或更早)。 What I'd like to do is write a little helper class or method that downloads the most recent tiles from Google and stores them for offline use.我想做的是编写一个小助手类或方法,从 Google 下载最新的图块并将它们存储起来以供离线使用。 That way, I can work offline and run my code all day without getting locked out.这样,我就可以离线工作并整天运行我的代码而不会被锁定。

I've been searching unfolding's docs and the two pertinent classes seem to be:我一直在搜索展开的文档,两个相关的类似乎是:

de.fhpotsdam.unfolding.providers.Google; (online)
de.fhpotsdam.unfolding.providers.MBTilesMapProvider; (offline)

What I can't figure out is what kind of object will give me what I need to write the tiles to a .mbtiles file.我无法弄清楚什么样的对象会给我什么我需要将瓷砖写入 .mbtiles 文件。 The docs are pretty sparse, and it's hard to tell if this is even possible.文档非常稀少,很难说这是否可能。

Any ideas?有任何想法吗?

Unfortunately I can't provide a tested answer at the moment, however here are a couple things I spotted:不幸的是,我目前无法提供经过测试的答案,但是我发现了以下几点:

  1. MBTilesLoaderUtils docs points to an outdated TileMill utility link (which InternetArchive helps with) MBTilesLoaderUtils 文档指向一个过时的TileMill 实用程序链接(InternetArchive 可以提供帮助)
  2. Looking at the current TileMill documentation there's an MBTile export guide查看当前的 TileMill 文档,有一个MBTile 导出指南

I recommend installing TileMill and giving it's export feature a shot.我建议安装 TileMill 并尝试一下它的导出功能。

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

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