mapbox / mapbox/mapbox-maps-flutter
Custom Assets partially displayed
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Dart
- Sterne
- 380
- Forks
- 204
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
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
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne mit der im Issue beschriebenen Beispiel-App-Seite und der angehängten Debug.txt und reproduziere dann die Abfolge mit style.addStyleImage, getSource und updateGeoJSON. Verfolge, wie sich das Ersetzen eines vorhandenen Assets auf die aktuell sichtbare Karte auswirkt; abgeschlossen ist die Aufgabe, wenn das neue Asset angezeigt wird, ohne dass gezoomt oder unverändertes GeoJSON gesendet wird.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- dart, flutter
- Bereich
- mobile
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 38/100