Skip to content

Commit f1424a0

Browse files
authored
fix(landing): hide label button on debug page as its broken BM-20 (#3341)
### Motivation the labels view requires the "labels" style to exist, this generally does not exist inside of custom configs. ### Modifications Hide the label button when custom configs on the debug page. ### Verification Manually tested with current debug page.
1 parent 406b3eb commit f1424a0

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

packages/landing/src/components/map.label.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,22 @@ export class MapLabelControl implements IControl {
4747
Config.map.setLabels(labelState);
4848
};
4949

50+
/** Is the label button hidden from view */
51+
isDisabled(): boolean {
52+
// Most vector styles have overlaps with the labels and make them useless
53+
if (Config.map.style && LabelsDisabledLayers.has(Config.map.style)) return true;
54+
// Labels use the merge style feature and need the production configuration to work
55+
if (Config.map.isDebug && Config.map.config) return true;
56+
57+
return false;
58+
}
59+
5060
updateLabelIcon = (): void => {
5161
if (this.button == null) return;
5262
this.button.classList.remove('maplibregl-ctrl-labels-enabled');
5363

5464
// Topographic style disables the button
55-
if (Config.map.style && LabelsDisabledLayers.has(Config.map.style)) {
65+
if (this.isDisabled()) {
5666
this.button.classList.add('display-none');
5767
this.button.title = 'Topographic style does not support layers';
5868
return;

0 commit comments

Comments
 (0)