Skip to content

Commit

Permalink
feat(landing): track label button clicks
Browse files Browse the repository at this point in the history
  • Loading branch information
blacha committed Aug 26, 2024
1 parent 49524c0 commit a799c0e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/landing/src/components/map.label.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { IControl } from 'maplibre-gl';

import { Config } from '../config.js';
import { Config, GaEvent, gaEvent } from '../config.js';

const LabelsDisabledLayers = new Set(['topographic', 'topolite']);

Expand Down Expand Up @@ -42,7 +42,9 @@ export class MapLabelControl implements IControl {
}

toggleLabels = (): void => {
Config.map.setLabels(!Config.map.labels);
const labelState = !Config.map.labels;
gaEvent(GaEvent.Ui, `labels:${labelState}`);
Config.map.setLabels(labelState);
};

updateLabelIcon = (): void => {
Expand Down

0 comments on commit a799c0e

Please sign in to comment.