mapbox / mapbox/mapbox-maps-flutter
To make a draggable icon of a layer I need to remove source and layer and add back a new source and layer with updated values. Is this the way to do it?
Nobody has claimed this yet.
- Dominant language
- Dart
- Stars
- 380
- Forks
- 204
- PR merge metrics
- No merged PRs in 30d
Description
Future<void> onTap(ScreenCoordinate value) async {
await mapboxMap.style.removeStyleLayer('layer');
mapboxMap.style.removeStyleSource('point-source');
final geojson = loadGeoJson(coords: [value.y, value.x]);
await addPointSource(geojson);
addLayer();
}
Per example. If I want to update the icon position onTap I remove the source, then layer, then I create a new geojson with updated coordinates and then I add source and layer again. Is this how we should do it?
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 onTap handler shown in the issue and review the style.removeStyleLayer and removeStyleSource calls, along with the referenced example. Determine whether updating the icon position requires rebuilding the source and layer or whether the SDK provides another documented path. Done means a maintainer-confirmed usage recommendation or a clearly scoped API change.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- dart, flutter
- Domain
- mobile
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100