mapbox / mapbox/mapbox-maps-flutter
PointAnnotation disappear on update [Example app]
Nobody has claimed this yet.
- Dominant language
- Dart
- Stars
- 380
- Forks
- 204
- PR merge metrics
- No merged PRs in 30d
Description
In example app point_annotation page.
When I try and update PointAnnotation as per below code in example app then PointAnnotation disappears.
```
class AnnotationClickListener extends OnPointAnnotationClickListener {
AnnotationClickListener(this.pointAnnotationManager);
final PointAnnotationManager pointAnnotationManager;
@override
void onPointAnnotationClick(PointAnnotation annotation) async {
print("onAnnotationClick, id: ${annotation.id}");
if (annotation.textField == null) {
annotation.textField = "Test data";
annotation.textOffset = [0.0, -2.0];
annotation.textColor = Colors.red.value;
annotation.iconSize = 1.3;
annotation.iconOffset = [0.0, -5.0];
} else {
annotation.textField = null;
}
await pointAnnotationManager.update(annotation);
}
}
```
What i am trying to do here is if no text is being displayed then show text, if text is displayed then hide text.
Text show and hide works fine, but it also hide marker icon.
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 point_annotation page in the example app and reproduce the issue using the shown AnnotationClickListener and PointAnnotationManager.update call. Check why updating text and offsets also removes the marker icon, then verify that toggling the text leaves the icon visible in both states.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- dart, flutter
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100