Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Sep 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/reducers/src/map-style-updaters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down