Skip to content
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

OPFS-based offline-first PMTile basemaps #1395

Merged
merged 11 commits into from
Mar 27, 2024
Merged

Conversation

spwoodcock
Copy link
Member

What type of PR is this? (check all applicable)

  • πŸ• Feature
  • πŸ› Bug Fix
  • πŸ“ Documentation Update
  • 🎨 Style
  • πŸ§‘β€πŸ’» Code Refactor
  • πŸ”₯ Performance Improvements
  • βœ… Test
  • πŸ€– Build
  • πŸ” CI
  • πŸ“¦ Chore (Release)
  • ⏩ Revert

Related Issues

None

Describe this PR

  • Started work on loading PMTile files into browser OPFS storage, then reading when offline.

Finished

  • Loading the PMTiles archive into OPFS.
  • Reading the PMTiles into OPFS.
  • Parsing the PMTiles file as a PMTiles object.

To Do

  • Assess if the user is offline or not (likely via PWA functionalities).
  • If user is offline, load the tiles from OPFS to render.
  • Render the PMTiles in OpenLayers.

@varun2948 @NSUWAL123

Notes

  • OPFS is unique per domain, so there is no chance of file mixup.
  • The pmtile archives are for the entire project area, stored under PROJECT_ID/all.pmtiles.

Screenshots

image

  • The lightning bolt icon button will download the tiles to OPFS, instead of download directory on filesystem.

Checklist before requesting a review

[optional] What gif best describes this PR or how it makes you feel?

@varun2948
Copy link
Collaborator

Looks good, now we have to test it in dev inorder to confirm if everything is fine or not !

@spwoodcock
Copy link
Member Author

Works locally for me! Great work, merging πŸ‘
Part of the fix seems to be not using a WebGL layer - to be investigated in the future!

@spwoodcock spwoodcock merged commit bad8fbe into development Mar 27, 2024
6 checks passed
@spwoodcock spwoodcock deleted the feat/opfs-pmtiles-v2 branch March 27, 2024 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

None yet

2 participants