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

WIP: Pitched label legibility #4682

Closed
wants to merge 41 commits into from
Closed

Commits on May 1, 2017

  1. Introduce 'text/icon-pitch-scale' property which controls how

     symbols scale relative to the rest of the map as tiles are tilted and
     panned.
     - '1' = previous behavior (symbols have same scale as the surrounding
       features)
     - '0' = symbols maintain the same size no matter what distance they're
       at
     - fraction values = split the difference
    - Curved labels currently use a broken approximation to determine glyph
      position.
    - This approach makes collision detection much more expensive because we
      pre-calculate collisions over a much greater scale range to account
      for pan operations changing the effective scale of tiles.
    ChrisLoer committed May 1, 2017
    Configuration menu
    Copy the full SHA
    a3f39be View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    c0a7232 View commit details
    Browse the repository at this point in the history
  3. 'text-pitch-scaling' calculations must be based on label anchors

     instead of glyph anchors in order to keep all glyphs in sync.
    ChrisLoer committed May 1, 2017
    Configuration menu
    Copy the full SHA
    0fa7793 View commit details
    Browse the repository at this point in the history
  4. Fix "labelMinScale" logic in getGlyphQuads:

    No glyph should be able to show if any one of the glyphs in the label
    can't show.
    ChrisLoer committed May 1, 2017
    Configuration menu
    Copy the full SHA
    59e8768 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    ffb62e1 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    d16998a View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    de939ae View commit details
    Browse the repository at this point in the history
  8. Calculate line collision boxes over a wider range to account for label

     expansion in the distance.
    ChrisLoer committed May 1, 2017
    Configuration menu
    Copy the full SHA
    fe33752 View commit details
    Browse the repository at this point in the history
  9. Make pitched collision detection more conservative:

     When doing collision detection, assume all labels are scaled the same
     as the least scaled label in the tile.
    ChrisLoer committed May 1, 2017
    Configuration menu
    Copy the full SHA
    eaa05d9 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    27fd05a View commit details
    Browse the repository at this point in the history
  11. Adjust collision tile scale range based on tile distance from camera.

    Update collision tiles whenever the map moves because tile distance changes.
    ChrisLoer committed May 1, 2017
    Configuration menu
    Copy the full SHA
    3ca25e0 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    0495a31 View commit details
    Browse the repository at this point in the history
  13. 'max-camera-distance' style property allows selective hiding of labels

     as they move into the distance.
    ChrisLoer committed May 1, 2017
    Configuration menu
    Copy the full SHA
    f726efa View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    0e34868 View commit details
    Browse the repository at this point in the history
  15. Remove extra semicolon.

    ChrisLoer committed May 1, 2017
    Configuration menu
    Copy the full SHA
    5921f93 View commit details
    Browse the repository at this point in the history
  16. Explain obscure difference between collision grid bounding boxes

     and boxes for collision scale calculation.
    ChrisLoer committed May 1, 2017
    Configuration menu
    Copy the full SHA
    1e33272 View commit details
    Browse the repository at this point in the history
  17. Make render test summary failures searchable

     (and accessible to color blind folk)
    ChrisLoer committed May 1, 2017
    Configuration menu
    Copy the full SHA
    d382d55 View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    894b071 View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    413fd99 View commit details
    Browse the repository at this point in the history
  20. Fix some tests: we create more line collision boxes now at the edge of

     labels now, but make sure the position of the central boxes doesn't
     change.
    ChrisLoer committed May 1, 2017
    Configuration menu
    Copy the full SHA
    259ba28 View commit details
    Browse the repository at this point in the history
  21. Configuration menu
    Copy the full SHA
    8fbadd2 View commit details
    Browse the repository at this point in the history
  22. Keep track of "maximum pitch scaling" as well as minimum pitch scaling

    Necessary so that we can make collision detection conservative in the
    near field as well as the far field.
    ChrisLoer committed May 1, 2017
    Configuration menu
    Copy the full SHA
    b32aa68 View commit details
    Browse the repository at this point in the history
  23. min/max pitch scaling needs to be calculated over the whole tile

     before placement starts.
    ChrisLoer committed May 1, 2017
    Configuration menu
    Copy the full SHA
    792f1c8 View commit details
    Browse the repository at this point in the history
  24. Get debug collision boxes closer in sync with actual labels:

     Must do pitch scaling based on label anchor point, not box anchor point.
    ChrisLoer committed May 1, 2017
    Configuration menu
    Copy the full SHA
    4bc4c26 View commit details
    Browse the repository at this point in the history
  25. Configuration menu
    Copy the full SHA
    efa1f6a View commit details
    Browse the repository at this point in the history
  26. Bring collision debug boxes into line with symbols that aren't added …

    …to buffers because their placementScale is above the maxScale for the collision tile.
    ChrisLoer committed May 1, 2017
    Configuration menu
    Copy the full SHA
    20c5502 View commit details
    Browse the repository at this point in the history
  27. Eliminate major source of label flicker: "minimum pitch scale" setting

    was unpredictably shared across tiles.
    ChrisLoer committed May 1, 2017
    Configuration menu
    Copy the full SHA
    f45f304 View commit details
    Browse the repository at this point in the history
  28. Update collision debug tests:

     - Don't show boxes over maxScale (it was getting too confusing)
     - Use green background for test so white boxes are visible.
    ChrisLoer committed May 1, 2017
    Configuration menu
    Copy the full SHA
    be194a8 View commit details
    Browse the repository at this point in the history
  29. Configuration menu
    Copy the full SHA
    cf50802 View commit details
    Browse the repository at this point in the history
  30. Configuration menu
    Copy the full SHA
    7d759f7 View commit details
    Browse the repository at this point in the history

Commits on May 2, 2017

  1. Fix 'symbol-avoid-edges', which relies on edge collision boxes being

    inserted before first CollisionFeature is added to a CollisionBoxArray.
    ChrisLoer committed May 2, 2017
    Configuration menu
    Copy the full SHA
    a8f0316 View commit details
    Browse the repository at this point in the history
  2. Temporarily fix tests by rolling back extended collision boxes for

    line labels. This could lead to label collisions in the distant field.
    ChrisLoer committed May 2, 2017
    Configuration menu
    Copy the full SHA
    e98af15 View commit details
    Browse the repository at this point in the history

Commits on May 3, 2017

  1. Configuration menu
    Copy the full SHA
    5e06300 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    6e66906 View commit details
    Browse the repository at this point in the history

Commits on May 4, 2017

  1. Standardizing vertex shader precision on "highp" following discussion…

    … in:
    
    #2096
    Change some variable names from camel-case to underscore-separated.
    ChrisLoer committed May 4, 2017
    Configuration menu
    Copy the full SHA
    47f02f1 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    a8c7969 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    0a7e169 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    f96db38 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    c293dbc View commit details
    Browse the repository at this point in the history
  6. Only redo placement on pan operations if the map is tilted enough for

    perspective to make a significant difference in collision detection.
    ChrisLoer committed May 4, 2017
    Configuration menu
    Copy the full SHA
    f167af0 View commit details
    Browse the repository at this point in the history
  7. New approach to tilted curved labels with viewport pitch alignment:

     - Lay out glyphs in tile space so we can use existing curve following
        logic
     - Space glyphs out based on the incidence angle of the middle of the
        label and the orientation of the middle of the label
       (So that a vertical line in the distance gets spaced out a lot)
     - Apply glyph rotation in projected space.
    
    Significant problems:
     - "We're out of space on this line" logic is mixed with collision
       detection logic, and they no longer stay in sync perfectly, so it's
       possible to have individual glyphs clipped before the whole label is
       clipped.
     - The spacing approximation doesn't work for highly curved labels, and
       you end up with silly looking results.
    ChrisLoer committed May 4, 2017
    Configuration menu
    Copy the full SHA
    5f02a52 View commit details
    Browse the repository at this point in the history