Disable side panel when exporting Kepler.gl map?

别等时光非礼了梦想. 提交于 2019-12-12 23:13:01

问题


I loaded my data into kepler.gl (https://kepler.gl/) and created a visual I would like to post online by embedding the code into a blogpost. However, I want the readers/users not to be able to see and access the side panel, but rather only with the main view of the map.

Is there any way to do so or any parameters I can change when exporting the html?


回答1:


To solve the issue, one must replace the reducers block:

const reducers = (function createReducers(redux, keplerGl) {
            return redux.combineReducers({
              // mount keplerGl reducer
              keplerGl: keplerGl.keplerGlReducer
            });
          }(Redux, KeplerGl));

With the following:

      const reducers = (function createReducers(redux, keplerGl) {
        const customizedKeplerGlReducer = keplerGl.keplerGlReducer.initialState({
           uiState: {readOnly: true}
        });            
        return redux.combineReducers({
          // mount keplerGl reducer
          keplerGl: customizedKeplerGlReducer
        });
      }(Redux, KeplerGl));

And in the end, change the line with addDataToMap to: store.dispatch(keplerGl.addDataToMap(loadedData, {readOnly: true}));



来源:https://stackoverflow.com/questions/57364050/disable-side-panel-when-exporting-kepler-gl-map

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!