mapbox / mapbox/mapbox-maps-android
Add more Image Types (other than Bitmap)
Nobody has claimed this yet.
- Dominant language
- Kotlin
- Stars
- 578
- Forks
- 161
- PR merge metrics
- No merged PRs in 30d
Description
New Feature
I have a RasterLayer with an ImageSource. ImagesSource gets updated via: updateimage
This function takes a Bitmap or an Image (which is in itself a Bitmap)
It would be nice if we could also add other types (e.g. PNG) to the ImageSource
Why
A common case where this would be useful is when we want to show external images as a quad on the map. These external images are almost never Bitmaps but most of the time base64 encoded PNGs. So the current workflow is:
- Get Base64 Image
- Decode Base64 Image into PNG
- Create Bitmap from PNG
- Pass Bitmap bytes to Imagesource
I would really like to avoid converting images from one common type to another.
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 ImageSource.updateImage API linked in the issue and trace how a RasterLayer consumes its image data. Define what additional image types, such as PNG or base64-encoded PNGs, should be accepted and verify that external images can reach the ImageSource without an unnecessary Bitmap conversion.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, kotlin
- Domain
- mobile
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100