mapbox / mapbox/mapbox-maps-android

PointAnnotations are not visible until the online mode is enabled on the map screen at least once

Aperta
#2,397 4 commenti 1 reazione 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

auto-triaged bug :beetle:
Lingua principale
Kotlin
Stelle
578
Fork
161
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

Environment

  • Android OS version: 13
  • Devices affected: OnePlus 8
  • Maps SDK Version: 11.4

Observed behavior and steps to reproduce

PointAnnotations are not visible in offline mode until the online mode is enabled on the map screen at least once. CircleAnnotations at the same time show just fine.

It happens when you open maps in offline mode. It is enough to turn the network on for a short period of time on the screen with MapViews to make it work fine and keep working even if you restart the app or reboot the device.

The easiest way to reproduce is to take OfflineActivity from example application from Mapbox Android SDK (see links at the bottom) and modify it to add some PointAnnotations together with CircleAnnotation it is already adding. After tapping on "VIEW MAP" button CircleAnnotation shows but PointAnnotations don't.

Expected behavior

Point annotations should be visible anytime.

Notes / preliminary analysis

I have used slightly modified OfflineActivity from MapBox Android SDK example application. Modifications introduce adding several Points (or single one) as PointAnnotation. When you press "VIEW MAP" button, map shows with red CircleAnnotation in Tokyo area showing but none of PointAnnotations is visible.

Additional modification allows to verify that after entering online mode PointAnnotations immediately appear on the screen. You just need to:

  1. Remove "OfflineSwitch.getInstance().isMapboxStackConnected = false" line (https://github.com/mapbox/mapbox-maps-android/blob/main/app/src/main/java/com/mapbox/maps/testapp/examples/OfflineActivity.kt#L85)
  2. Before tapping on "VIEW MAP" button remember to turn on flight mode on your device.
  3. Tap on "VIEW MAP" button, verify if PointAnnotations and CircleAnnotation are visible. Focus map on the area where PointAnnotations should be present.
  4. Turn off flight mode. PointAnnotations should pop up immediately after network is connected.

Remark: Image for PointAnnotation iconImage is loaded from app's resources as Bitmap.

Additional links and references

File which I have used for testing the feature:
https://github.com/mapbox/mapbox-maps-android/blob/main/app/src/main/java/com/mapbox/maps/testapp/examples/OfflineActivity.kt

Place where you should add your PointAnnotations (e.g. after creation of CircleAnnotation):
https://github.com/mapbox/mapbox-maps-android/blob/main/app/src/main/java/com/mapbox/maps/testapp/examples/OfflineActivity.kt#L101

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia con app/src/main/java/com/mapbox/maps/testapp/examples/OfflineActivity.kt e riproduci il problema usando il relativo flusso offline, aggiungendo PointAnnotations accanto alla CircleAnnotation esistente. Confronta le annotazioni prima e dopo aver abilitato brevemente l’accesso alla rete, quindi segui i percorsi rilevanti delle annotazioni Android e dell’inizializzazione offline. Il lavoro è completato quando le PointAnnotations sono visibili all’apertura della mappa offline e rimangono visibili dopo il riavvio senza entrare prima nella modalità online.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
android, kotlin
Ambito
mobile
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Specificata chiaramente
Idoneità per principianti
45/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.