-
-
Notifications
You must be signed in to change notification settings - Fork 860
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Preload tiles from an array of latlngs ? #170
Comments
Have you checked out the offline tile example? I suspect that will work for your use-case. |
Yes, I checked that, but if I read that right, it needs to be done manually, rather than something integrated. I'll take a look separately and feed back if I manage something. |
I think that a sort of preloading and casching is a good think. So offline map are good only for limited zone where tiles are very light under 100mb. So i m thinking something like:
What about start using cachednetworkimage plugin? |
Am going to close this, although I still think it would be useful, especially using flutter_cache_manager, but it became too fiddly for me. Just for info, I've gone with my own solution which lets me select an area via latlngs, download the tiles in advance (after deleting old set from a custom directory) using http.get & Io.File..writeAsBytesSync, and then if the app detects no data available, it changes fluttermap offline mode and uses a local urlTemplate, if there is data it uses a remote urlTemplate. |
I can see in the code there is a call to load an image/url depending on a point in the tilemap layer.
One thing I was wondering about, was the ability to preload a set of images, based on an array of latlongs, or an area (eg topleft, bottomright).
Reasoning is, I'm developing an app where offline is needed, and currently before I go ofline, I drag around a certain area to load the images into cache. Then the map works offline.
I'm unsure if this should be part of the core flutter_map though, as it feels like it could easily be abused (downloading too many tiles). Maybe there could be a delay added to be kind to the tileservers and a max tiles restriction ? I looked a the plugin lib, but didn't see how I could manage via that to access the tilelayer code.
Completely understand if it's not desirable.
The text was updated successfully, but these errors were encountered: