mapbox / mapbox/mapbox-gl-js

Polygon distortions on high zoom levels

Open
#12,825 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

I am facing the following. At high zoom levels (e.g. 24) i see distortions in data loaded as draw elements (using draw.add()). The first image shows the data in QGIS. The second image shows the data in Leaflet. The last image shows the data for mabox-gl-js with mapbox-gl-draw.
The QGIS image has no distortions (desktop app).
The Leaflet setup (also web context) has almost no distortions (default CRS EPSG:3857 used).
The mabox-gl-js/draw setup has quite significant distortions (the polygons are walls of a building). In multiple places lines are misplaced or not straight. This is only happening in some places of the full map. I tried all available projections with lambertConformalConic (with proper center and parallels) giving the best result (the one in the last image), all the others led to more distortion. The data is in CRS4326/WGS84 format.
So the question is if I have reached the maximum precision of mapbox-gl, or if there are other things to try. Also I am not sure if this question might be more suitable to ask in mabox-gl-draw issues.
Thanks for any thoughts.

**mapbox-gl-js version**: 2.15.0
**mapbox-gl-draw**: 1.4.0

**browser**: Chrome version 114.0.5735.198

### Expected Behavior

### Actual Behavior

Screenshot 2023-08-02 at 12 54 50

![Screenshot 2023-08-02 at 12 54 39](https://github.com/mapbox/mapbox-gl-js/assets/103726718/68ebdda6-9e3e-4bde-9b57-b3d218c0eba5)

![Screenshot 2023-08-02 at 12 49 11](https://github.com/mapbox/mapbox-gl-js/assets/103726718/f60daab7-267b-473f-9a07-3721685cd47b)

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 report names no repository file or test entry point. Start by reproducing the distortion with mapbox-gl-js 2.15.0, mapbox-gl-draw 1.4.0, draw.add(), WGS84 data, and zoom level 24, then compare the projection and polygon geometry against the reported images. Done requires identifying whether the distortion is reproducible in mapbox-gl-js or belongs to mapbox-gl-draw, with a focused regression case or a documented limitation.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
computer-graphics, frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.