Skip to content

Commit f06c643

Browse files
Ihor DykhtaIhor Dykhta
authored andcommitted
fix: exported map - preseed basemap
Signed-off-by: Ihor Dykhta <ihordykhta@Ihors-MacBook-Pro.local>
1 parent 0f377f8 commit f06c643

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/utils/src/export-map-html.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,12 @@ export const exportMapToHTML = (options, version = KEPLER_GL_VERSION) => {
237237
}(Redux, middleWares));
238238
239239
const store = (function createStore(redux, enhancers) {
240-
const initialState = {};
240+
// Pre-seed the map style so the correct basemap is active from the
241+
// very first render, avoiding a flash of the default dark basemap.
242+
const savedStyleType = ${JSON.stringify(options.config?.mapStyle?.styleType ?? null)};
243+
const initialState = savedStyleType
244+
? {keplerGl: {map: {mapStyle: {styleType: savedStyleType}}}}
245+
: {};
241246
242247
return redux.createStore(
243248
reducers,

0 commit comments

Comments
 (0)