mapbox / mapbox/mapbox-maps-flutter

Custom Assets partially displayed

Abierto
#233 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Lenguaje dominante
Dart
Estrellas
380
Forks
204
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

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

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Línea de trabajo

Comienza con la página de la aplicación de ejemplo descrita en el issue y el Debug.txt adjunto; después, reproduce la secuencia usando style.addStyleImage, getSource y updateGeoJSON. Rastrea cómo afecta la sustitución de un asset existente al mapa visible actualmente; se considera terminado cuando el nuevo asset aparece sin hacer zoom ni enviar GeoJSON sin cambios.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
dart, flutter
Área
mobile
Tipo de issue
Error
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
38/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.