Collect One: Native offline imagery download on Android and iOS
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 30/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Ambito
- mobile, mobile-dev
Direzione di ricerca
Start by reading the platform-neutral OfflineRegionStore API in shared/map, then inspect the Android entry points in shared/map/src/androidMain and the iOS bridge pattern in shared/map/src/iosMain and iosApp. Verify on a device or simulator using the stated Mapbox token and user data service URL; done means the acceptance criteria for downloads, offline rendering, cancellation, resume, and removal pass on both platforms.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Collect One mobile is getting a Save for offline flow:
- Collectors pan and zoom to frame an area of up to 50 km² and choose Satellite, Terrain, or both.
- They see the estimated size and the free space on the device, then save the imagery with a progress bar.
- Saved areas are named by reverse geocoding and listed under Offline maps, with each imagery type shown as a separate layer.
- The layers sheet gets two switches: Downloaded satellite and Downloaded terrain.
The shared UX, state and persistence are on branch feat/offline-area-download. Downloads go through a data-layer port, OfflineRegionClient (shared/app/data/.../client/offline/). Each host app supplies its implementation through platformModule(offlineRegionClient = …):
- The browser build uses
SimulatedOfflineRegionClient, with placeholder area names and a "Simulated download" notice, because Mapbox GL JS has no offline API. - Android and iOS default to
UnavailableOfflineRegionClient, which hides the "Save an area" entry points.
This issue tracks real NATIVE clients for Android and iOS.
Scope
Android (shared/map/src/androidMain + androidApp)
- Implement a
NATIVEOfflineRegionClientwith the Mapbox Maps SDK v11TileStoreandOfflineManager. The SDK lives inshared/map, so put the implementation there and adapt it to the port inandroidApp(MobileSyncRuntime→platformModule(offlineRegionClient = …)):- Create one tile region per saved layer, using one style per layer:
- Satellite:
mapbox://styles/mapbox/satellite-streets-v12 - Terrain:
mapbox://styles/mapbox/outdoors-v12
- Satellite:
- Download each region for zoom 6–16 (always full zoom 16 detail), with
pixelRatioset to the display density. - Store the area metadata on each region: area id, name, bounds, layer type, creation time and schema version.
- Load a layer's style pack the first time that layer type is saved. Remove the style pack once no region uses it.
- Estimate each layer with
TileStore.estimateTileRegion(storage size, transfer size, error margin). - Report progress from
TileRegionLoadProgress. Cancel throughCancelable, and resume by loading the same region id again. - List regions, including partial ones, so layers can be grouped into areas at launch.
- Set
MapboxOptions.accessTokenfrom the app's configured token if no map has set it yet. - Map
TileRegionErrortypes to user-facing failures: tile-pack limit reached, disk full, access denied, and network unavailable.
- Create one tile region per saved layer, using one style per layer:
- First run the Android app on an emulator or device with a Mapbox token and a user data service URL. Then run the spike:
- Confirm
estimateTileRegionexists in 11.31.1. - Confirm the bounded
mapbox://mapbox.satelliteraster and the contour line overlay render from TileStore while offline. - Measure tile packs and bytes for a 50 km² save, then calibrate the simulated estimates and the area limit.
- Confirm
- Verify against the acceptance criteria below.
iOS (shared/map/src/iosMain and iosApp)
- Add a callback-based
MapboxIosOfflineBridgeinterface that passes JSON in and out, following the existingMapboxIosViewpattern. - Implement it in Swift with
TileStore.defaultandOfflineManager, register it onGroundMapIosiniOSApp.init, and pass the adapter toplatformModulefromGroundMobileSyncIos. - Verify on a device or simulator once the iOS build is running again.
Acceptance criteria
- Saving an area downloads the selected layers for zoom 6–16. The progress bar reaches 100%, and the area appears in Offline maps with each layer's size on disk.
- With airplane mode on, and after force-stopping and reopening the app, each saved layer's basemap renders inside the area.
- Downloaded satellite outlines satellite areas. On the Terrain basemap, it also shows the saved satellite imagery inside them.
- Downloaded terrain outlines terrain areas. On the Satellite basemap, it also draws contour lines from the saved terrain data inside them.
- Cancel removes partial data. Killing the app mid-save leaves the layer Paused, and Resume completes it.
- Removing a layer frees its unshared data. Removing an area's last layer removes the area.
- Area names come from Mapbox Geocoding v6 reverse lookups with
permanent=true. If the lookup fails, a coordinate label is used instead. - Saving is blocked when the area exceeds 50 km² (about 7 × 7 km), or when the estimate plus a 500 MB reserve exceeds free space. Reaching Mapbox's tile-pack limit shows a clear message.
Constraints
- Mapbox offline tile packs stop at zoom 16; imagery beyond zoom 16 is upscaled.
- Mapbox allows 750 unique tile packs per device by default, shared across all saved layers.
- Saved tiles render only for the exact style URIs and source URLs that were downloaded, so the overlays must reuse the styles' source URLs.
- Satellite and Terrain share Mapbox's street tiles, so per-layer sizes can overlap.
Free-space measurement (DeviceStorageClient: StatFs on Android, NSFileManager on iOS) and the saved-areas table (SQLDelight) already exist on the branch.
- Lingua principale
- TypeScript
- Stelle
- 254
- Fork
- 114
- Merge medio
- 2g 3h
- PR unite (30g)
- 20
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di google/ground-platform
-
collect-one type: fr
Difficoltà 5/5 Più di una settimana Idoneità per principianti 15/100
google/ground-platform#2664 ·
I maintainer di solito rispondono entro 1 giorno
-
Fix security issues reported by AlfonsoForse già presa @rfontanarosa l’ha presa 1 giorno fa. Apertatype: bug
google/ground-platform#2661 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
collect-one type: fr
Difficoltà 5/5 Più di una settimana Idoneità per principianti 12/100
google/ground-platform#2660 ·
I maintainer di solito rispondono entro 1 giorno
-
collect-one type: fr
Difficoltà 5/5 Più di una settimana Idoneità per principianti 15/100
google/ground-platform#2659 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
collect-one type: fr web
Difficoltà 4/5 3-5 giorni Idoneità per principianti 30/100
google/ground-platform#2658 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di google/ground-platform
Issue simili
-
account bug communication lecture
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
area:tui bug platform:macos
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
anthropics/claude-code#109005 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 87/100
openedx/end-to-end-tests#196 ·
I maintainer di solito rispondono entro 1 giorno
-
area:tooling good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
interledger/publisher-tools#1007 ·
I maintainer di solito rispondono entro 1 giorno
-
priority/medium roadmap/v1.1.1 stakeholder/rapr type/bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
databrickslabs/ontos#1420 ·
I maintainer di solito rispondono entro 3 giorni