-
Notifications
You must be signed in to change notification settings - Fork 7
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
Support for Offline Maps #1259
base: main
Are you sure you want to change the base?
Support for Offline Maps #1259
Conversation
Signed-off-by: Steve Cassidy <[email protected]>
Signed-off-by: Steve Cassidy <[email protected]>
Signed-off-by: Steve Cassidy <[email protected]>
Signed-off-by: Steve Cassidy <[email protected]>
Signed-off-by: Steve Cassidy <[email protected]>
…onents Signed-off-by: Steve Cassidy <[email protected]>
Signed-off-by: Steve Cassidy <[email protected]>
Signed-off-by: Steve Cassidy <[email protected]>
Signed-off-by: Steve Cassidy <[email protected]>
Signed-off-by: Steve Cassidy <[email protected]>
Signed-off-by: Steve Cassidy <[email protected]>
Signed-off-by: Steve Cassidy <[email protected]>
Signed-off-by: Steve Cassidy <[email protected]>
Signed-off-by: Steve Cassidy <[email protected]>
Signed-off-by: Steve Cassidy <[email protected]>
Signed-off-by: Steve Cassidy <[email protected]>
Signed-off-by: Steve Cassidy <[email protected]>
Signed-off-by: Steve Cassidy <[email protected]>
Signed-off-by: Steve Cassidy <[email protected]>
Signed-off-by: Steve Cassidy <[email protected]>
Signed-off-by: Steve Cassidy <[email protected]>
Signed-off-by: Steve Cassidy <[email protected]>
Signed-off-by: Steve Cassidy <[email protected]>
Signed-off-by: Steve Cassidy <[email protected]>
Signed-off-by: Steve Cassidy <[email protected]>
Signed-off-by: Steve Cassidy <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed, it seems this needs more thought. I did manage to accelerate the download initially using a pool of promises which work concurrently, but the API throttles your downloads after around 10-20MB.
Even after downloading the region, the UX is a bit tricky and would need more thought since you can end up in positions where you can't find your way to a downloaded area, and it's unclear which regions are/aren't downloaded. I understand this was a technical PoC so not knocking that just noting it's not ready for the big time yet.
I think we'll need to consider a vector based approach, and maybe use some sort of pre-packaged single files for regions rather than spamming an API for thousands of tiles. Then have an intelligent handler in the form which tries to do a nice job of selecting which downloaded region the user is closest to/in when offline, then use online tiles when online.
Support for Offline Maps
JIRA Ticket
BSS-143
BSS-630
Description
We need to support offline data collection with maps. This PR adds support for pre-loading
and using map tiles to display maps rather than requiring an online connection.
Proposed Changes
This has been a journey, and I don't think it's finished. Current state is close to being usable but
will likely need more work before it is field ready.
OSM as a tile source does not allow bulk downloads so we switch to a commercial provider (MapTiler).
How to Test
Configuration needed, ask @stevecassidy for a maptiler key or make your own free account.
In the app, go to the hamburger menu and select "Offline Maps" This provides the interface
to download regions for offline use. Pan/Zoom the map to a region of interest and click
Download. Note the Estimate Size button, suggest you test with very small areas so the
download isn't too big.
Downloaded regions are listed below the form and will update as tiles are downloaded.
You should be able to leave the page and return and see the download continue.
Click on "Show Download Area" for a region to jump to it.
Go offline (browser tools > Network) and you should still be able to zoom to your downloaded
area and see the map up to a max zoom level of 20.
Now go to a survey and view a map field (it will need to be centered close to the map you downloaded). You should
be able to browse the map that was downloaded while offline.
Checklist