mapbox / mapbox-gl-js

Interactive, thoroughly customizable maps in the browser, powered by vector tiles and WebGL
https://docs.mapbox.com/mapbox-gl-js/
Other
11.2k stars 2.22k forks source link

Line disappears when zooming closer than 18th zoom level #5171

Closed NameFILIP closed 4 years ago

NameFILIP commented 7 years ago

mapbox-gl-js version: 0.39.1

Steps to Trigger Behavior

  1. Open JSBin Example
  2. Set accessToken variable to your token
  3. Zoom in and see the grey line disappear

Expected Behavior

Line should be visible

Actual Behavior

Line disappears

P.S. Looks like duplicated points with a different floating point precision is the root of the issue

mourner commented 7 years ago

Yeah, that looks like some kind of bug. Meanwhile, as a workaround, you can set maxzoom: 24 in the source config — this seems to fix the issue.

CombesA commented 7 years ago

Hey there !

I wanted to add some informations about this bug.

When drawing a LineString, no matter how many points there are, if the last two are duplicated, the line before those point will disappear when reaching the 18th zoom level. For example, if we draw a LineString between A, B and B, the line between A and B will disappear, and I think it shouldn't.

Though I noticed some things :

I made a JSFiddle as an example, there is two lines, one with three points, where the last two are duplicated, and another line with three point, where the first two are duplicated. here it is : https://jsfiddle.net//9f5t5jcp/2/

Thank you in advance for your answer, keep up the good work !

sumbulalvi commented 6 years ago

Is there any update on this issue? Running into this as well. Can confirm @CombesA 's bug is occurring for me as well. (Last two points are duplicated = only a piece of the line gets drawn after zoom level 18) Was not fixed by setting maxZoom for map to 24.

benheb commented 6 years ago

I am setting minzoom on the source config and this still doesn't seem to work. If vector tiles are generated through zoom 11, they always disappear when I hit 12. This did not use to be the case...

bart-1990 commented 6 years ago

I'm experiencing the same issue and I couldn't fix it by setting maxzoom for the source to 24, also removing duplicate points didn't help. In our case the issue was fixed by reducing the amount of decimals of the coordinates.

qeternity commented 6 years ago

We're seeing this as well. Linestrings become very distorted at high zoom levels.

EDIT: 64 bit rendering solved most of the issues. Still minor clipping.

mnutsch commented 6 years ago

Hi, Is there any update on this issue? I would like to be able to zoom in further and still see all polygon lines. Thanks.

Edit: I came up with a work around for this. Instead of drawing a single line, draw a polygon where the last segment of the polygon lays exactly on top of the first segment. The last segment will not display due to the Mapbox GL Js bug. However, the first segment will still display and the polygon will look complete to the user.

mourner commented 4 years ago

Fix for the issue coming in #9218. Apologies for addressing this so late! And thanks a lot to @CombesA for such a clear test case.