Skip to content

Commit 4cac6f8

Browse files
ibesoragithub-actions[bot]
authored andcommitted
Disable text-variable-anchor when appearances are present
GitOrigin-RevId: a7785fa278c74ea263b8fc1b7ece21c37fab9cb3
1 parent 730bbfc commit 4cac6f8

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

src/style/style_layer/symbol_style_layer.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,16 @@ class SymbolStyleLayer extends StyleLayer {
106106
});
107107
}
108108

109+
if (this.appearances.length !== 0) {
110+
// When text-variable-anchor is present, a proper unified bbox for appearances would be very large as it
111+
// needs to cover texts for all appearances for all anchors.
112+
// A better solution might be to have a separate bbox for each anchor, but it requires significant changes
113+
// in stored data and placement logic.
114+
// For now we disable text-variable-anchor when appearances are present.
115+
// Deleting it here makes it use the default value
116+
delete this.layout._values['text-variable-anchor'];
117+
}
118+
109119
if (this.layout.get('icon-rotation-alignment') === 'auto') {
110120
if (this.layout.get('symbol-placement') !== 'point') {
111121
this.layout._values['icon-rotation-alignment'] = 'map';

test/integration/render-tests/appearance/text-variable-anchor/style.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"width": 256,
88
"collisionDebug": true,
99
"skip-test": [
10-
{"platform-tag-contains": "web", "reason": "Doesn't work correctly"},
10+
{"platform-tag-contains": "web", "reason": "At the moment we don't support this combination and act as if there is no `text-variable-anchor`"},
1111
{"platform-tag-contains": "native", "reason": "At the moment we don't support this combination and act as if there is no `text-variable-anchor`"}
1212
]
1313
}

0 commit comments

Comments
 (0)