Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

All existing annotations are re-sent and redrawn on every update (causes flicker/lag)

Aperta Adatta ai principianti
#92 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
84/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
dart, flutter

Direzione di ricerca

Leggi lib/src/annotation_updates.dart e verifica come vengono confrontate le annotazioni precedenti e attuali durante la creazione di annotationsToChange. Conferma il comportamento consultando l’implementazione dell’uguaglianza delle annotazioni, poi aggiungi o aggiorna test mirati per le annotazioni invariate. Il lavoro è completato quando le annotazioni invariate sono escluse dagli aggiornamenti, mentre quelle modificate continuano a raggiungere il lato nativo.

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

Descrizione

Describe the bug
Every time AppleMap.annotations changes, every annotation that is still on the map is sent to the native side as "changed", even if nothing about it changed. On iOS each of them is then rebuilt and redrawn (with a 0.32 s animation), so with a few dozen annotations the map visibly flickers and stutters on every update. This is probably the cause of #57.

Cause

  1. lib/src/annotation_updates.dart builds annotationsToChange from the intersection of previous and current ids without comparing them:
    final Set<Annotation> _annotationsToChange = currentAnnotationIds
        .intersection(prevAnnotationIds)
        .map(idToCurrentAnnotation)
        .toSet();
    
    (google_maps_flutter filters these with .where(hasChanged).)
  2. On iOS, annotationsToChange creates a new FlutterAnnotation from the dictionary (decoding the icon bytes into a new UIImage) and compares it with !=. AnnotationIcon == compares image by reference, so it is always "different" and updateAnnotation runs for every annotation.

Fix (one line, Dart side). Annotation == already ignores onTap, so unchanged annotations compare equal if the app reuses the same BitmapDescriptor instance:

final Set<Annotation> _annotationsToChange = currentAnnotationIds
    .intersection(prevAnnotationIds)
    .where((AnnotationId id) => previousAnnotations[id] != currentAnnotations[id])
    .map(idToCurrentAnnotation)
    .toSet();

With this change, in our app (≈ 50 annotations re-grouped on every zoom/pan) the flicker on a real iPhone 16 Pro is gone.

Version: apple_maps_flutter 1.4.0, iOS 27, Flutter 3.32.1.

Happy to open a PR with this change.

Lingua principale
Dart
Stelle
84
Fork
120
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

  • Nessun Dockerfile né file Docker Compose
  • Ha un modello di pull request
  • Nessuna 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.

Altre issue di fluttercommunity/apple_maps_flutter

Tutte le issue di fluttercommunity/apple_maps_flutter

Issue simili

Altre issue su Dart

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.