mapbox / mapbox/mapbox-maps-flutter
Custom Assets partially displayed
Nobody has claimed this yet.
- Dominant language
- Dart
- Stars
- 380
- Forks
- 204
- PR merge metrics
- No merged PRs in 30d
Description
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the sample app page described in the issue and the attached Debug.txt, then reproduce the sequence using style.addStyleImage, getSource, and updateGeoJSON. Trace how replacing an existing asset affects the currently visible map; done means the new asset appears without zooming or sending unchanged GeoJSON.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- dart, flutter
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100