mapbox-gl-js icon indicating copy to clipboard operation
mapbox-gl-js copied to clipboard

line-trim-offset without lineMetrics available makes line disappear

Open ansis opened this issue 3 years ago • 0 comments

line-trim-offset works only if lineMetrics is set for geojson sources. When it isn't set, the line disappears completely. It shouldn't disappear and a warning should be logged.

mapbox-gl-js version: v2.9.1

browser: all

Steps to Trigger Behavior

  1. open debug/debug.html
  2. map.setPaintProperty('route', 'line-trim-offset', [0, 0.5])

Link to Demonstration

http://localhost:9966/debug/debug.html#12.5/38.88894/-77.01842

Expected Behavior

The route line is still rendered without clipping. A warning is logged once explaining that lineMetrics needs to be set for the property to work correctly.

Actual Behavior

Line disappears.

ansis avatar Jul 11 '22 22:07 ansis