Skip to content

Different line-offset values for start and end of line segments #10374

@dellisd

Description

@dellisd

Motivation

The main purpose of this feature would be to enable smooth transitions between line segments with different line-offset values. By using a separate line segment that could have different offset values for the start and end of the line, the offset of the separate line segment could be interpolated from the start and end values along the length of the line to join the line segments that have different line-offset values.

This would be very useful for mapping transit networks where different routes/lines overlap and diverge throughout the network.

Design

A line-offset-start and line-offset-end paint property could be provided. If used, it could just override the value being supplied through line-offset (if any).

Mock-Up

From a developer perspective, it would ideally look just like a normal line-offset

const paint = {
  "line-offset-start": 5,
  "line-offset-end": 0
}

Using the above example^, to an end user it would look like a smooth transition between two lines with different offsets. compared to now where there would have to be an abrupt jump.

Implementation

Polygons may be a special case since line-offsets behave as inset/outsets.

How the offset is interpolated may affect how this appears to end users.
For example:
image

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions