unfolding map library: get map tiles from provider for offline use

308 views Asked by At

I'm using UCSD's starter code to make a visualization of earthquake location and magnitudes overlayed on a map.

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. 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). 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. 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. The docs are pretty sparse, and it's hard to tell if this is even possible.

Any ideas?

1

There are 1 answers

0
George Profenza On BEST ANSWER

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)
  2. Looking at the current TileMill documentation there's an MBTile export guide

I recommend installing TileMill and giving it's export feature a shot.