mapbox / mapbox/mapbox-maps-flutter

Custom Assets partially displayed

Aperta
#233 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

Here is the issue :

When we need to use some custom assets to display some symbol in the map, then we first need to declare the asset in the style using
```
mapboxMap.style.addStyleImage(...)
```

When we want to update a layer with some new data, we use some code like that :
```
final GeoJsonSource source = await mapboxMap.style.getSource(symbolSourceId) as GeoJsonSource;
source.updateGeoJSON(geoJsonData);
```

---

Most of the time we declare the asset before we use them by calling updateGoeJson. Everything is fine.
But in case you want to Overwrite an asset data ( so push new data using an already existing id ) then the asset are correctly display on the map only if we zoom in/out . the currently display part of the map is not updating.
It works fine as soon as we call back the UpdateGeoJson. (but in case the geojson do not change, it's like only updating with the exact same data.)

----

**My question is** : Is it Expected ( for performance related topic ? ) or is it something that can be fixed ?
I would like to not force refresh my layer with the same data.

----

here is some pieces of code to play with (I simply created a new page in the sample app ):


[Debug.txt](https://github.com/mapbox/mapbox-maps-flutter/files/12599920/Debug.txt)

and the result in a video:
1 - start the empty map - declare the first custom assets ( dark blue vehicle icon )
2 - click on the arrow floating button to generate some data to display
3 - click on the red bug floating button to Replace the custom assets by a new one ( mapBox icon asset )
4 - play with the zoom :
the icon asset change while playing with the zoom
5 - finally click on the arrow again to update the layer data and always get the mapbox asset.

https://github.com/mapbox/mapbox-maps-flutter/assets/24452432/e8a6b97b-b0f1-4d79-9b5c-b418f5cb1285

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 dalla pagina dell’app di esempio descritta nell’issue e dal Debug.txt allegato, quindi riproduci la sequenza usando style.addStyleImage, getSource e updateGeoJSON. Traccia l’effetto della sostituzione di un asset esistente sulla mappa attualmente visibile; l’attività è completata quando il nuovo asset appare senza eseguire lo zoom né inviare GeoJSON invariato.

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

Valutazione

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

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.