Skip to content

text-max-width is not correctly enforced #11088

@riastrad

Description

@riastrad

mapbox-gl-js version: v2.5.0
browser: Firefox v92.0.1 (MacOS v11.6)

Steps to Trigger Behavior

  1. Make the map div width 350px
  2. Add a symbol layer to a map that uses the text-max-width property & references long text data
  3. Set the text-max-width to the equivalent of 300px

Link to Demonstration

https://codepen.io/riastrad/pen/powXqxP

Expected Behavior

The label text should only be 300px wide, maximum - and should not extend past the width of the map div.

Actual Behavior

The label extends much further than the proscribed text-max-width, and overflows even on a map that is +50px wider than the max width.

cc/ @mapbox/gl-js

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