mapbox / mapbox/mapbox-gl-js

non-mercator projections add extra vertices when line geometry used in circle layer

Open
#11,247 0 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

Non-mercator projections introduce extra circles when a line geometry is used for a circle layer.

Most commonly users would use Point or MultiPoint geometries with circle layers, but it is possible to use polygon or line geometries. We should disable resampling when we load a geometry that will be used as points.

**mapbox-gl-js version**: v2.6.0 / main

**browser**: all

### Steps to Trigger Behavior

1. open http://localhost:9966/debug/animate.html
2. `map.setProjection('albers')

### Link to Demonstration

http://localhost:9966/debug/animate.html

### Expected Behavior

Vertices drawn only at ends of line. But also draw in the correct projection.

![Screen Shot 2021-11-05 at 2 59 39 PM](https://user-images.githubusercontent.com/1421652/140564331-2172011d-fae2-47a2-ac3e-f5bab2135663.png)

### Actual Behavior

Line's resample vertices are drawn.

![Screen Shot 2021-11-05 at 2 56 59 PM](https://user-images.githubusercontent.com/1421652/140564215-f12516ba-d18f-48c5-8191-31ac22b2eddd.png)

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 issue in debug/animate.html with map.setProjection('albers'), then trace how line geometry is loaded and resampled for a circle layer. Done means only the line's endpoint vertices are drawn and they appear in the correct non-Mercator projection.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
computer-graphics, frontend
Issue type
Bug
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.