Skip to content

Commit

Permalink
fix(landing): put back the sourceId tracking logic BM-1062 (#3325)
Browse files Browse the repository at this point in the history
### Motivation

Source id tracking logic was broken in commit
07b8aeb with
07b8aeb#diff-935afb39a4daeb9c30850cda3e20eecf1fb8f5086b9172fef9a5e8539e5e99f5R529

### Modifications

return the state name back to `featureSource` and `featureCog`

### Verification

Tested locally hover is now working as expected.
  • Loading branch information
blacha authored Aug 12, 2024
1 parent 6ff7d14 commit c25486c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/landing/src/components/debug.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ function debugSourceDropdown(ctx: DropDownContext): ReactNode {
);
}

/** Upper case the first character of the string */
function upperCaseFirstChar(c: string): string {
return c[0].toUpperCase() + c.slice(1);
}

function debugSlider(label: 'osm' | 'linz-topographic' | 'linz-aerial', onInput: FormEventHandler): ReactNode {
return (
<input
Expand Down Expand Up @@ -564,7 +569,8 @@ export class Debug extends Component<{ map: maplibregl.Map }, DebugState> {
const map = this.props.map;

let lastFeatureId: string | number | undefined;
const stateName = type.name === `feature-${type.name}`;
// State names are `featureSource` or `featureCog` etc.
const stateName = `feature${upperCaseFirstChar(type.name)}`;

// Onclick copy the location into the clipboard
map.on('click', layerFillId, (e) => {
Expand Down

0 comments on commit c25486c

Please sign in to comment.