本文介绍了导出Kepler.gl地图时禁用侧面板吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将数据加载到kepler.gl()中,并创建了一个我想通过将代码嵌入博客文章来在线发布。
但是,我希望读者/用户不能看到和访问侧面板,而只能看到地图的主视图。

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.

推荐答案

要解决此问题,必须解决以下问题:替换 reducers 块:

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));

具有以下内容:

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

最后,使用 addDataToMap 到:
store.dispatch(keplerGl.addDataToMap(loadedData,{readOnly:true}));

这篇关于导出Kepler.gl地图时禁用侧面板吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-27 13:55