Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(landing): hide label button on debug page as its broken BM-20 #3341

Merged
merged 2 commits into from
Sep 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.isDebug && Config.map.config) return true;
Wentao-Kuang marked this conversation as resolved.
Show resolved Hide resolved

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
Loading