From 4124ebf04a426f6f87515c63bfcd1bff28712587 Mon Sep 17 00:00:00 2001 From: Ihor Dykhta Date: Wed, 20 Sep 2023 06:33:14 +0300 Subject: [PATCH] [fix] When editing a custom basemap style do not unintentionally drop extra properties Signed-off-by: Ihor Dykhta --- src/reducers/src/map-style-updaters.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/reducers/src/map-style-updaters.ts b/src/reducers/src/map-style-updaters.ts index 89535c4681..15b2565430 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()