mapbox / mapbox/mapbox-gl-js

Suggestion : Allow text-variable-anchor to be data driven

Open
#10,101 0 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

https://github.com/mapbox/mapbox-gl-js/blob/12991995fa1bb62c5ecdb0282c7c142578b897e5/src/style/style_layer/symbol_style_layer_properties.js#L56

The set of anchor positions should be able to vary based on the type of icon being displayed. e.g., for a circular icon, [top, bottom, left, right] may be suitable choices, but for a pushpin icon with the icon's anchor point at the bottom, only [top, left, right] are desired. Since the choice of icon to show within a layer is data-driven, so should the choice of text anchors for the associated labels.

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 src/style/style_layer/symbol_style_layer_properties.js at line 56, where text-variable-anchor is defined. Trace how icon selection and associated label properties are represented and determine how anchor choices could vary with the displayed icon type. Done means the text anchors can be data-driven so different icon shapes support appropriate anchor sets.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.