Repository navigation
feat(formulus): observations map view with offline support - #1043
Draft
najuna-brian wants to merge 3 commits into
Draft
najuna-brian wants to merge 3 commits into
najuna-brian wants to merge 3 commits into
Conversation
Reads only the stored geolocation (never data) with the same filters as the observations table, caps the result, and reports how many matches have no usable location. Refs OpenDataEnsemble#553
Native MapLibre map with GPU clustering; cluster counts are bundled images so they render without map fonts or network. Basemap comes from app.config.json maps, bundled mbtiles/pmtiles or style in the app bundle, with OpenStreetMap as the online default. Everything shown is read from the device; the network is only probed in the background. Refs OpenDataEnsemble#553
…tions Map view shares the table's filters, loads lazily, unmounts when the screen is not focused, and explains when the background is unavailable offline. Area downloads are only offered for tile providers that allow them. Strings in en/pt/fr/sw. Refs OpenDataEnsemble#553
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #553
What this adds
A Map view on the Formulus Observations screen, next to the existing table (the compact table half of #553 already landed in
ObservationListTable).@maplibre/maplibre-react-native11.5.1, BSD, no Google Play Services): observations are clustered on the GPU and coloured by form type (colour-blind-safe palette). Unsynced observations have an orange outline.Offline behaviour (Formulus is offline-first)
maps/*.mbtiles,*.pmtiles, ormaps/style.json) → areas MapLibre has cached from earlier online use → a plain background with a short "offline" notice.app.config.json→mapsat another tile provider or style URL. A style URL is cached on the device so it still loads offline.Performance
form_type/deletedindexes and never reads observationdata. It does not touchobservation_index.libmaplibre.sois about 10.8 MB (arm64-v8a) / 7.9 MB (armeabi-v7a) uncompressed; the existing per-ABI APK splits keep each device to one copy.Not in this PR
Testing
pnpm run test: 67 suites / 533 tests pass (new: map query, basemap resolution, cluster badges)../gradlew app:installDebug -PabiFilters=x86_64 -PreactNativeArchitectures=x86_64; the second flag is needed solibNitroSound.sois built for the emulator).formulus/scripts/generate-map-cluster-badges.pyregenerates the cluster badge images (Pillow ≥ 10.1).