Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
NameFILIP opened this issue Aug 18, 2017 · 8 comments · Fixed by #9218
Closed

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

NameFILIP opened this issue Aug 18, 2017 · 8 comments · Fixed by #9218
Assignees
Labels

Comments

@NameFILIP
Copy link

NameFILIP commented Aug 18, 2017

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
Copy link
Member

mourner commented Aug 22, 2017

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.

@mourner mourner self-assigned this Aug 22, 2017
@CombesA
Copy link

CombesA commented Oct 3, 2017

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 :

  • That behavior happens when there's at least 3 digits after the decimal point on the coordinates numbers.
    When there's less than 3 digits after the decimal point, only a part of the line disappears, near the second duplicated point.

  • That behavior does not occur if the duplicated points are not the last two.

  • Even though the previous line disappears, there is apparently a bit of a line drawn. I guess it's the one between the two last points.

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
Copy link

sumbulalvi commented Dec 8, 2017

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
Copy link

benheb commented Jan 3, 2018

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
Copy link

bart-1990 commented Feb 9, 2018

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
Copy link

qeternity commented May 20, 2018

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
Copy link

mnutsch commented Jul 18, 2018

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
Copy link
Member

mourner commented Jan 22, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants