mapbox / mapbox/mapbox-gl-js

Symbols on bottom or right edge of vector tile edge are not drawn

Open
#12,115 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

needs discussion :speech_balloon:
Dominant language
TypeScript
Stars
12.4k
Forks
2.4k
PR merge metrics
No merged PRs in 30d

Description

This is due to code to prevent double drawing symbols, such as https://github.com/mapbox/mapbox-gl-js/blob/b73229ccfc93aa792090425fd484f3150d72330f/src/symbol/symbol_layout.js#L422
which includes symbols on the top and left edges, but not the bottom and right ones. This point geom is only being returned in one vector tile however, since it only intersects one tile, so it is not drawn at all. I think this is fairly normal behavior for a vector tile server, so it seems like a bug.

**mapbox-gl-js version**: 2.9.2, 1.13.2

**browser**: Any

### Steps to Trigger Behavior

1. Create point data that will be included in a vector tile and that will have geometry with x or y coordinates of EXTENT at some zoom in mapbox. For example, an mvt tile containing a point geom of (10, 4096) and default extent. (example for tile 17/22840/52786, {"type":"Point","coordinates":[-117.266871679,33.020179249]} in EPSG:4326 encoded in a vector tile with extent 4096).
2. Have mapbox render this vector tile source as a symbol layer.
3. View map at zoom level 17 where the point is.

### Link to Demonstration
https://user-images.githubusercontent.com/1109069/180867648-921e6a7b-396a-4523-b4a1-a5470def0b96.mov

### Expected Behavior
Point is visible.

### Actual Behavior
Point is not visible at this zoom level.

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/symbol/symbol_layout.js around the linked line 422 and reproduce the issue using a vector tile containing a point at an x or y coordinate of 4096 in a symbol layer. Check how edge symbols are handled when the point intersects only one tile. Done means the point is visible at the relevant zoom level without causing duplicate symbol drawing.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
frontend, web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.