Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable side panel when exporting Kepler.gl map?

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?

like image 725
guyts Avatar asked Dec 27 '25 14:12

guyts


1 Answers

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

like image 76
guyts Avatar answered Dec 31 '25 17:12

guyts



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!