mapbox / mapbox/mapbox-maps-android
Point annotations are tinted black
Nobody has claimed this yet.
- Dominant language
- Kotlin
- Stars
- 578
- Forks
- 161
- PR merge metrics
- No merged PRs in 30d
Description
## Environment
- Android OS version: All(?) Tested on APIs 24-31
- Devices affected: All(?) Tested on multiple OnePlus and Pixel devices, Motorola Moto One (2018) and the official Android Emulator
- Maps SDK Version: 10.2.0
## Observed behavior and steps to reproduce
After deleting a point annotation, all point annotation created after are tinted black. The issue also occurs if the original annotation is updated with a new point, instead of deleting and recreating.
1. Create a point annotation on a map view
2. Delete the point annotation
3. Create a new point annotation with the same bitmap (not necessarily the same object, the issue also occurs if the bitmap is created from a drawable res each time)
My specific use case is calling the following code segment in an `OnMapLongClickListener` so a user can select a specific location on a map.
```
// Setup annotation manager if we haven't
if (annotationManager == null) {
val annotationApi = mapView?.annotations
annotationManager = annotationApi?.createPointAnnotationManager(mapView!!)
}
// Build marker annotation at point
val pointAnnotationOptions: PointAnnotationOptions = PointAnnotationOptions()
.withPoint(point)
.withIconImage(pin)
// Replace any existing marker with the new marker
marker?.let {
it.point = point
annotationManager?.update(it)
}
if (marker == null) {
marker = annotationManager?.create(pointAnnotationOptions)
}
```
## Expected behavior
Annotation icon should be the correct colors.
## Notes / preliminary analysis
none
## Additional links and references
First created annotation/Expected behavior:

After deleting/creating or updating point:

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
Reproduce the issue using the OnMapLongClickListener flow and the annotation manager: create a point annotation, delete or update it, then create another with the same bitmap. Compare the first and later icons, and consider the work done when recreated or updated point annotations retain their correct colors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, kotlin
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100