code: function closeSpecificMapAtIndex(state, action) {
    // retrieve layers meta data from the remaining map that we need to keep
    const indexToRetrieve = 1 - action.payload;
  
    const metaSettings = state.splitMaps[indexToRetrieve];
    if (!metaSettings || !metaSettings.layers) {
      // if we can't find the meta settings we simply clean up splitMaps and
      // keep global state as it is
      // but why does this ever happen?
      return {
        ...state,
        splitMaps: []
      };
    }
  
    const {layers} = state;
  
    // update layer visibility
    const newLayers = layers.map(layer =>
      layer.updateLayerConfig({
        isVisible: metaSettings.layers[layer.id]
          ? metaSettings.layers[layer.id].isVisible
          : layer.config.isVisible
      })
    );
  
    // delete map
    return {
      ...state,
      layers: newLayers,
      splitMaps: []
    };
  }
docs: When a user clicks on the specific map closing icon
  the application will close the selected map
  and will merge the remaining one with the global state
  TODO: i think in the future this action should be called merge map layers with global settings
  @param {Object} state `visState`
  @param {Object} action action
  @returns {Object} nextState