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] fix exported html map #2918

Merged
merged 7 commits into from
Jan 15, 2025
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/utils/src/export-map-html.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ export const exportMapToHTML = (options, version = KEPLER_GL_VERSION) => {
<!--Uber Font-->
<link rel="stylesheet" href="https://d1a3f4spazzrp4.cloudfront.net/kepler.gl/uber-fonts/4.0.0/superfine.css">

<!--Kepler css-->
<link href="https://unpkg.com/kepler.gl@${version}/umd/keplergl.min.css" rel="stylesheet">

<!--MapBox css-->
<link href="https://api.tiles.mapbox.com/mapbox-gl-js/v1.1.1/mapbox-gl.css" rel="stylesheet">
<link href="https://unpkg.com/maplibre-gl@^3/dist/maplibre-gl.css" rel="stylesheet">
Expand Down Expand Up @@ -103,7 +106,7 @@ export const exportMapToHTML = (options, version = KEPLER_GL_VERSION) => {

/** STORE **/
const reducers = (function createReducers(redux, keplerGl) {
return redux.combineReducers({
const demoReducer = redux.combineReducers({
// mount keplerGl reducer
keplerGl: keplerGl.keplerGlReducer.initialState({
uiState: {
Expand All @@ -112,6 +115,9 @@ export const exportMapToHTML = (options, version = KEPLER_GL_VERSION) => {
}
})
});
return redux.combineReducers({
demo: demoReducer,
});
}(Redux, KeplerGl));

const middleWares = (function createMiddlewares(keplerGl) {
Expand All @@ -136,6 +142,7 @@ export const exportMapToHTML = (options, version = KEPLER_GL_VERSION) => {
/** END STORE **/

/** COMPONENTS **/
const getState = state => state.demo.keplerGl;
var KeplerElement = (function makeKeplerElement(react, keplerGl, mapboxToken) {
var LogoSvg = function LogoSvg() {
return react.createElement(
Expand Down Expand Up @@ -192,6 +199,7 @@ export const exportMapToHTML = (options, version = KEPLER_GL_VERSION) => {
{style: {position: 'absolute', left: 0, width: '100vw', height: '100vh'}},
${options.mode === EXPORT_HTML_MAP_MODES.READ ? 'LogoSvg(),' : ''}
react.createElement(keplerGl.KeplerGl, {
getState,
mapboxApiAccessToken: mapboxToken,
id: "map",
width: windowDimension.width,
Expand Down
Loading