Display dynamic symbol label with viewport
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 12.4k
- Forks
- 2.4k
- PR merge metrics
- No merged PRs in 30d
Description
## Motivation
When adding a symbol label the label is by default in the center of the layer polygon but not each time in the viewport of the user. Is a function or an option could dynamically change the "point" coordinates" to match the part of the polygon which is display on the map?
I try to find something but I only found a old post from 2018 https://medium.com/@yixu0215/dynamic-label-placement-with-mapbox-gl-js-turf-polylabel-1f84f1d4bf6b talking about this dynamic feature.
### Mock-Up
with a label

And when the user zoom in the map the label is not visible:

### Implementation
Can it be an option in the addLayer?
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
The issue names addLayer, symbol labels, and viewport-based placement but no source files or tests. Start by tracing symbol-layer label placement and how viewport changes are handled; done would require a defined option or behavior that keeps the label visible in the displayed part of the polygon.
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