Skip to content

Commit 115e8dd

Browse files
committed
Address Claude review feedback
- Move onBackgroundVisibilityChange / onBackgroundOpacityChange after the ...layerControlConfig spread so the wired basemap callbacks can never be silently overridden by a future key in the config object.
1 parent 4a60087 commit 115e8dd

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

packages/map/src/map-controller.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1071,16 +1071,17 @@ export class MapController {
10711071
panelWidth: 340,
10721072
panelMinWidth: 240,
10731073
panelMaxWidth: 450,
1074+
...layerControlConfig,
10741075
// The control toggles the basemap internally; mirror the change into the
10751076
// store (the source of truth) so external basemap UI — e.g. the left
10761077
// layer panel's visibility icon and opacity slider — stays in sync.
1078+
// Placed after the spread so these wired callbacks always win.
10771079
onBackgroundVisibilityChange: (visible) => {
10781080
useAppStore.getState().setBasemapVisible(visible);
10791081
},
10801082
onBackgroundOpacityChange: (opacity) => {
10811083
useAppStore.getState().setBasemapOpacity(opacity);
10821084
},
1083-
...layerControlConfig,
10841085
});
10851086
this.map.addControl(
10861087
this.layerControl,

0 commit comments

Comments
 (0)