Skip to content

Commit

Permalink
fix(landing): hide label button on debug page as its broken
Browse files Browse the repository at this point in the history
  • Loading branch information
blacha committed Sep 16, 2024
1 parent 406b3eb commit 710329c
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion packages/landing/src/components/map.label.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,22 @@ export class MapLabelControl implements IControl {
Config.map.setLabels(labelState);
};

/** Is the label button hidden from view */
isDisabled(): boolean {
// Most vector styles have overlaps with the labels and make them useless
if (Config.map.style && LabelsDisabledLayers.has(Config.map.style)) return true;
// Labels use the merge style feature and need the production configuration to work
if (Config.map.config) return true;

return false;
}

updateLabelIcon = (): void => {
if (this.button == null) return;
this.button.classList.remove('maplibregl-ctrl-labels-enabled');

// Topographic style disables the button
if (Config.map.style && LabelsDisabledLayers.has(Config.map.style)) {
if (this.isDisabled()) {
this.button.classList.add('display-none');
this.button.title = 'Topographic style does not support layers';
return;
Expand Down

0 comments on commit 710329c

Please sign in to comment.