GPlates / gplates-app

GPlates Mobile App
https://www.gplates.org
2 stars 0 forks source link

save files locally for offline usage #64

Open nickywright opened 2 years ago

nickywright commented 2 years ago

Hi,

I think it would be really useful if we could have an option to download files for offline usage, e.g. similar to how Google Maps allows you to download maps of X size for offline usage, and you can delete them when you want that space back. Or how media players (Netflix, Spotify, YouTube music etc) lets you download videos/songs, and at low/normal/high quality (with YouTube music at least)

This would be really handy for those times when you have unreliable internet (i.e., Madsen building today!) and you wanted to ensure your lesson didn't get derailed by slow or intermittent internet.

It would also helpful if someone was travelling (conference/voyage/etc) and was not going to have reliable internet but might want to use the app to show a nice reconstruction.

@michaelchin told me the super high resolution rasters would take up an unreasonable amount of storage, but an option to download some up to X level would be really nice.

Thoughts?

No clue how feasible or difficult this is.

matthew-merkas commented 2 years ago

I've recently had a look at the feasibility of downloading tiles. I have a system in place for the single tiles (low resolution) used for animations, however the higher resolution web map tiles seem trickier. I've tried interfacing with Cesium through custom fetchRequest functions or Proxy classes but these don't work for various reasons. The only way I see this being possible is to extend/inherit from the stock WebMapTileServiceImageryProvider and override whatever method(s) are responsible for fetching the tiles so we can try to grab the images locally before going to the geoserver.

michaelchin commented 2 years ago

@matthewmerkas

Here is an example of the customised imagery provider. I did it ages ago. Not sure if it still work with the current version Cesium.

We cannot cache all the tiles. it will take up too much storage on users' devices. you will need a strategy to refresh cache

GPlatesImageryProvider.txt

michaelchin commented 2 years ago

I am doing this.