Skip to content

line-gradient colours are inconsistent when zooming into a geojson line #8969

Closed

Description

@brendan33

I noticed as you zoom into a single geojson line with line-gradient styling that the style seems to 'reset'.
I first noticed this in my application, but it is also present on the examples page on the Mapbox site with all browsers I've tried:
image
The above gif is just an example, but this behaviour occurs all along the line. e.g zoom into the bridge.

mapbox-gl-js version: v1.5.0

browsers:
Chrome 73.0.3683.86
Firefox 69.03
Edge 41.16299.1419.0

Steps to Trigger Behavior

  1. Zoom into line > level 14

Link to Demonstration

https://docs.mapbox.com/mapbox-gl-js/example/line-gradient/
https://output.jsbin.com/kesogobuvu (as above, but with buttons to zoom to problem areas)

Expected Behavior

Line-gradient colours should be consistent across all zoom levels for a single line.

Actual Behavior

Colour gradient gets reset at multiple points along line as you zoom in.

Activity

  1. ryanhamley commented on Nov 12, 2019

    @ryanhamley
    Contributor

    Thanks for the thorough report @LR-brendan! I was able to reproduce the problem in your examples. On a hunch, in JSBin I set map.showTileBoundaries = true and this is happening at tile boundaries as shown below.

    Screen Shot 2019-11-12 at 11 38 34 AM

    @mourner This is a regression which I tracked to #8303 where the way we calculate line distance is changed.

  2. self-assigned this
    on Nov 13, 2019
  3. mourner commented on Nov 13, 2019

    @mourner
    Member

    @ryanhamley Yeah, looks like this broke for overscaled tiles. Thanks for tracking down the offending PR!

    @LR-brendan for now, a workaround might be to bump GeoJSON maxzoom to some higher number.

  4. brendan33 commented on Nov 13, 2019

    @brendan33
    Author

    Thanks @mourner and @ryanhamley for identifying the issue so quickly.
    In the meantime I'll try the maxzoom workaround , cheers.

  5. self-assigned this
    on Jan 21, 2020
  6. added a commit that references this issue on Jan 22, 2020
    313e42b
  7. added a commit that references this issue on Jan 23, 2020
    980d1fb
  8. added 2 commits that reference this issue on Mar 18, 2020
    2e4a4e5
    b5b95de
  9. added a commit that references this issue on Apr 30, 2020
    7296a81
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions