Skip to content

Kepler.gl is a powerful open source geospatial analysis tool for large-scale data sets.

[fix] When editing a custom basemap style do not unintentionally drop extra properties (#2327)

Igor D6fd7f7a90770
diff --git a/src/reducers/src/map-style-updaters.ts b/src/reducers/src/map-style-updaters.ts
index 89535c468..15b256543 100644
--- a/src/reducers/src/map-style-updaters.ts
+++ b/src/reducers/src/map-style-updaters.ts
@@ -773,7 +773,10 @@ function getNewStateWithCustomMapStyle(state: MapStyle): MapStyle {
// @ts-expect-error Property 'layerGroups' is missing in type 'InputStyle' but required in type 'BaseMapStyle'. Legacy case?
mapStyles: {
...state.mapStyles,
- [styleId]: state.inputStyle
+ [styleId]: {
+ ...state.mapStyles[styleId], // do not unintentionally drop any additional properties
+ ...state.inputStyle
+ }
},
// set to default
inputStyle: getInitialInputStyle()