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 #1348

Closed
wants to merge 92 commits into from

Conversation

spwoodcock
Copy link
Member

@spwoodcock spwoodcock commented Mar 13, 2024

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?

@spwoodcock spwoodcock self-assigned this Mar 13, 2024
@github-actions github-actions bot added the frontend Related to frontend code label Mar 13, 2024
@github-actions github-actions bot added backend Related to backend code devops Related to deployment or configuration labels Mar 18, 2024
@spwoodcock
Copy link
Member Author

spwoodcock commented Mar 18, 2024

@NSUWAL123 this probably needs a rebase to development to fix the backend πŸ‘

You will also need to docker compose build for it to work!

@spwoodcock spwoodcock assigned NSUWAL123 and unassigned spwoodcock Mar 18, 2024
NSUWAL123 and others added 6 commits March 18, 2024 14:10
* feat commonUtils: empty input field validation function

* feat projectDetailsValidation: empty input field validation

* feat: commonUtils: null & undefined text check

* fix organizationDetailsValidation: blank space validation

* fix editProjectDetailsValidation: blank space validation
* fix organization: add id to search-organization, skeleton loader bug fix

* feat taskSectionPopup: tooltip title add

* feat mapControlComponent: tooltip title add

* fix generateBasemap: table min width set for mobile view
@varun2948
Copy link
Contributor

I am not used to doing a rebase and u suggested to do a rebase πŸ˜† so i don't know what went wrong i have the same commit going on multiple times .

@varun2948 varun2948 marked this pull request as ready for review March 27, 2024 11:09
@spwoodcock
Copy link
Member Author

Sorry about that! Sticking with merge is absolutely fine πŸ˜„

I'll try and take a look tonight!

Otherwise, in this situation the easiest option may be to just copy the content of the files you have edited to a temp file outside the repo, then reset to the latest development and copy the files back over the top:

# A hard reset will discard files, so be careful with that
# Instead a soft reset will just remove the changes and move them back to staging, which is safer to then delete the files yourself 
git reset --soft development

@varun2948
Copy link
Contributor

will wait for you to do things, if it shows issue will do the one you said. Let me know on anything

@spwoodcock
Copy link
Member Author

spwoodcock commented Mar 27, 2024

Replaced by #1395 πŸ‘
I kept this branch / PR in case I missed any thing to cherry-pick in.

@spwoodcock spwoodcock closed this Mar 27, 2024
@spwoodcock spwoodcock deleted the feat/opfs-pmtiles branch June 7, 2024 11:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Related to backend code devops Related to deployment or configuration docs Improvements or additions to documentation frontend Related to frontend code
Projects
Development

Successfully merging this pull request may close these issues.

4 participants