mapbox / mapbox/mapbox-gl-draw
How could I style only specific points, for example the first point in a vertex and the rest.
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 1.1k
- Forks
- 612
- Avg merge
- 8d 9h
- Merged PRs (30d)
- 5
Description
I would like to style only the first point in a vertex, as well as the remaining.
I understand is using something like this:
// vertex points HERE IS WHERE WE NEED TO FILTER THE POINT.
{
id: "gl-draw-polygon-and-line-vertex-active",
type: "circle",
filter: [
"all",
["==", "meta", "vertex"],
["==", "$type", "Point"],
["!=", "mode", "static"],
],
paint: {
"circle-radius": 8,
"circle-color": "#D20C0C",
},
},
but I can't find any example of being able to filter particular points ie: the first only, the remaining, second third... so forth.
Any help thank you ahead of time
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 `gl-draw-polygon-and-line-vertex-active` layer filter shown in the issue and inspect how vertex point properties are exposed to Mapbox GL styling. Determine whether point order can be used for filtering, then establish a supported way to style the first vertex separately from the remaining vertices and verify both styles in a drawing.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend, web-dev
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 32/100