mapbox / mapbox/mapbox-gl-js

Support user-specified feature z-indexing / sorting across layers

Open
#1,349 18 comments 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

In Mapnik, [group rendering](https://github.com/mapnik/mapnik/wiki/Grouped-Rendering) is used to render roads in the correct z-order. For background: [@kkaefer's PR](https://github.com/mapnik/mapnik/pull/916). This grouping is declared in Mapbox Studio projects in the yml:

``` yml
_properties:
bridge:
"group-by": layer
```

We are currently ignoring the z-ordering, which is affecting mainly the bridges layers:

![streets](https://cloud.githubusercontent.com/assets/1231218/8400448/66a4a996-1dd3-11e5-96f3-d6a41351bccf.PNG)

What would it take to implement something like this in GL? What would be the performance implications? I'm assuming this also requires a style-spec change. A `group-by` property would need to be defined by data layer, though, not by style layer.

/cc @kkaefer @ansis @1ec5 @jfirebaugh @mourner @ajashton

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 Mapnik grouped-rendering documentation and PR #916, then compare the Mapbox Studio YAML example with the proposed style-spec change. Define the required data-layer `group-by` behavior, cross-layer rendering order, and performance criteria before implementation; the issue is done only when these requirements are specified and validated.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
computer-graphics, web-dev
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.