mapbox / mapbox/mapbox-gl-js

how to use vector-icons?

Open
#13,499 1 comment 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature :green_apple:
Dominant language
TypeScript
Stars
12.4k
Forks
2.4k
PR merge metrics
No merged PRs in 30d

Description

Im interested into the experimental vector-icons which are described here https://docs.mapbox.com/mapbox-gl-js/example/custom-colorized-vector-icons/.

Like it is described in the example, the color `flag_color` is defined in the `m:metadata` which is in the root of the svg and not used inside some elements. So the color can only be used for the whole svg and not partial?
If we are working with svg why not useing multiple variables for some svg elements and not only for the whole svg?

example:
```

```

We are using `symbol` layer with images on `icon` and on `text-field` to style it as flexible as possible. The problem is the overlapping of the text-images because they are rendered after icon. So i hope we can replace this by this vector-icons to solve it.
For now only color is supported like i understood, but maybe also other styling-attributes like showing some dynamic text or show/hide elements would also be nice.

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 the linked custom-colorized vector-icons example and the SVG’s m:metadata parameters, then compare the requested per-element colors with the current symbol-layer icon and text-field usage. Done would clarify or support multiple color parameters within one SVG, including the scope of any additional dynamic styling requested.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.