mapbox / mapbox/mapbox-gl-js

Placeholder areas

Open
#4,173 7 comments 1 reaction 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

_From @kkaefer on January 20, 2017 15:1_

I'm proposing to introduce placeholder areas: Annotations are currently located in a layer that is above all other layers, meaning that annotations will always cover existing features, such as labels. Similarly, when adding new layers, you'll have to explicitly name an existing layer as the beforeLayerID parameter to have the layer inserted below that layer.

Placeholder areas would be named regions within a style that can be referenced when inserting new layers, or adding annotations (i.e. every placeholder area would have its own annotation layer). An example JSON excerpt would look like this:

"layers": [
// background layer
// water layer
{
"area": "landmass"
},
// ... other layers ...
{
"area": "overlay"
},
// ... label layers ...
]

We'd have to establish some convention for style authors to follow, but it'll help the common case of a user inserting some annotations that cover up the labels.

There might be some way we could reuse Studio metadata (which has layer groups) to accomplish this as well.

/cc @lucaswoj @kronick @jfirebaugh @1ec5 @tmcw

_Copied from original issue: mapbox/mapbox-gl-style-spec#658_

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

The issue names no files, tests, or entry points. Start by locating the style-spec handling for layer insertion and annotation placement, then review how existing layer groups or Studio metadata are represented. Done requires an agreed placeholder-area convention, implementation across the affected paths, and tests for inserting layers and annotations into those areas.

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.