mapbox / mapbox/mapbox-maps-flutter

iOS App Crashing When Loading RasterLayer

Aperta
#718 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

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

Descrizione

I'm trying to show a heatmap in my Flutter app with the help of RasterSource/Layers. It was working fine in 0.5.0 but after migrating to 2.3.0 it started crashing on iOS. The error thrown in xCode is:

Generate Mipmaps For Texture Validation [tex mipmapLevelCount](1) must be > 1

After some investigation I found that there is an issue when the loaded tiles have a size of 1x1. This is also confirmed in one of the comments on this StackOverflow post .

This is the code I'm using in Flutter just in case.

await style.addSource(
      RasterSource(
        id: 'overall_heatmap',
        tiles: heatmap.tiles,
        tileSize: 256,
        scheme: Scheme.XYZ,
        minzoom: heatmap.minZoom,
        maxzoom: heatmap.maxZoom,
        bounds: heatmap.bounds,
      ),
    );

    await style.addLayer(
      RasterLayer(
        id: 'heatmap',
        sourceId: 'overall_heatmap',
        rasterResampling: RasterResampling.LINEAR,
      ),
    );

And this is my Flutter doctor result:

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.24.3, on macOS 14.6.1 23G93 darwin-arm64, locale en-CO)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 15.4)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2024.1)
[✓] Connected device (4 available)            
[✓] Network resources

• No issues found!

Thanks in advance for any help you can provide!

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 riproducendo il crash con la configurazione RasterSource e RasterLayer fornita su iOS, concentrandoti su un tile raster caricato di dimensioni 1x1. Quindi traccia la gestione nativa delle texture raster o dei mipmap utilizzata da questa integrazione Flutter; il lavoro è completato quando la configurazione non causa più un crash durante il caricamento di un tile di questo tipo e la regressione è coperta da un test appropriato, se il repository ne fornisce uno.

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

Valutazione

Stack tecnologico
dart, flutter, ios
Ambito
mobile-dev
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
25/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.