mapbox / mapbox/mapbox-maps-flutter

SDF image and PointAnnotation

Open
#121 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Dart
Stars
380
Forks
204
PR merge metrics
No merged PRs in 30d

Description

I'm trying to add an SDF image using:

```
Uint8List _markerSdf = (await rootBundle.load('assets/map/marker_sdf.png')).buffer.asUint8List();

PointAnnotationOptions(
geometry: geometry,
iconSize: 1,
iconOffset: [0, 4],
symbolSortKey: 10,
image: _markerSdf,
iconColor: Colors.red.value,
iconOpacity: 255,
iconHaloColor: Colors.black.value,
iconHaloWidth: .5,
iconAnchor: IconAnchor.BOTTOM,
)
```

... but the colors aren't working, I'm getting a blurry white image in the shape of my icon. Is there something else I need to do to make this work?

![Screenshot_20230316_154409](https://user-images.githubusercontent.com/101229198/225736521-fc0d2e8b-ab1c-4a14-8f57-5514729d74e1.png)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with PointAnnotationOptions and the loaded marker_sdf.png asset, focusing on how the image, iconColor, iconOpacity, and halo options are expected to interact. Reproduce the provided Flutter example and compare the result with the SDF image requirements; done means identifying whether the behavior is supported and documenting or validating the required usage.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart, flutter
Domain
mobile-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.