mapbox / mapbox/mapbox-gl-js

enhancement: line-rendering overlapping lines

Open
#7,623 13 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug :lady_beetle:
Dominant language
TypeScript
Stars
12.4k
Forks
2.4k
PR merge metrics
No merged PRs in 30d

Description

Motivation

Example Here

(NOTE: the experiment currently only exists in Utah for demonstration purposes, just click a point to see it working)

right now I am using the cpu to render the polygons to ensure clean polylines / polygons.

I was hoping to draw this via the GPU so that during movement and zoom you could still enjoy the visual.

currently the line/fill apis from mapbox has issues with overlapping geometry:

screen shot 2018-11-26 at 7 28 04 am screen shot 2018-11-26 at 7 26 40 am

Is this an easy fix? If not, I would say just drop it.
My theory is that when points are too close together, the current tessellation algorithm gets confused.

If it is fixable, I was just going to copy paste your solution into a custom with proper alpha filtering to blend like i did as you see in the example link.

Design Alternatives

I said enhancement rather then bug because it's not an issue for >95% map use cases.

Design

see link above

Mock-Up

see link above

Concepts
Implementation

WebGL

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 by reproducing the overlapping-line behavior in the linked isochrones.regia.io example, then trace the line and fill rendering paths and the tessellation behavior for closely spaced points. Done would mean GPU-rendered polylines or polygons remain visually clean during map movement and zoom without the reported overlap artifacts.

Written by the indexing model from the issue text.

Assessment

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