Mapbox-gl-js: Symbols with `icon-text-fit` and `text-offset`

Created on 3 Sep 2019  路  5Comments  路  Source: mapbox/mapbox-gl-js

Expected Behavior

I would expect collision rules to be governed by text-offset when a symbol layer is using icon-text-fit.

Actual Behavior

Here's an example of a layer using text-offset vs a layer using text-offset and icon-text-fit. I would expect the text-offset value to continue to not force a collision with the icon below:

text-offset-with-icon-fit


mapbox-gl-js version: v1.2.0
browser: Chrome Version 76.0.3809.132 (Official Build) (64-bit)

Link to Demonstration

https://api.mapbox.com/styles/v1/tristen/cjzu99z8h00qp1co0srxwywwn.html?fresh=true&title=true&access_token={TOKEN}#7.9/43.797847/-79.658695

bug

All 5 comments

We discovered that we weren't manipulating the collision boxes correctly when icon-text-fit was used with text-variable-anchor and text-writing-mode when working on the fix for https://github.com/mapbox/mapbox-gl-js/issues/8583.

It looks like we didn't add a render test for text-offset (https://github.com/mapbox/mapbox-gl-js/pull/8625/files); thus, I'm not sure that we can confirm whether https://github.com/mapbox/mapbox-gl-native/pull/15367 fixes this issue too. (@ansis is working on the JS port.)

@alexshalamov could you add two render tests: one for using icon-text-fit with text-offset and another one for icon-text-fit with text-variable-anchor and text-radial-offset ?

@chloekraw What's the ETA for this?

@lukasmartinelli There is a potential fix for this already in GL-Native, and the JS port is in progress. Confirmation is needed that they correctly address this issue as well.

Both those should be available in the upcoming release.

@chloekraw added new render tests in https://github.com/mapbox/mapbox-gl-js/pull/8747

Was this page helpful?
0 / 5 - 0 ratings