Skip to content

Text symbol with placement line placed along wrong feature #6306

@madoci

Description

@madoci

maplibre-gl-js version: 5.7.0

browser: Firefox & Chrome

Steps to Trigger Behavior

  1. Add a source with at least two LineString touching each other.
  2. Add a symbol layer with placement "line" and a text field that evaluates to the same value for both LineString (a constant 'text-field' can do).
  3. Some text symbols of one LineString appear on the other LineString. It can be visible either by applying a different color to each feature, or by adding a listener to the symbol layer and looking a the event feature (with some kind of id to differentiate the two feature).

From my tests, it seems the problem doesn't occur if :

  • 'symbol-placement' is 'line-center' or 'point'
  • the lines do not touch
  • the evaluated labels are different

Link to Demonstration

https://jsbin.com/nobehezina/edit?html,console,output

Expected Behavior

The text symbol displayed alongside a LineString feature should always be tied to that specific feature.

Actual Behavior

The text symbol displayed alongside a LineString feature can sometimes belong to another feature.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions