Skip to content

Commit

Permalink
[Chore]: layer-utils, map-utils refactor (#1923)
Browse files Browse the repository at this point in the history
  • Loading branch information
igorDykhta committed Aug 16, 2022
1 parent 5c38f85 commit 4fc8596
Show file tree
Hide file tree
Showing 13 changed files with 297 additions and 141 deletions.
32 changes: 11 additions & 21 deletions src/components/kepler-gl.tsx
Expand Up @@ -134,24 +134,17 @@ export const mapFieldsSelector = (props: KeplerGLProps) => ({
mapStateActions: props.mapStateActions,

// visState
editor: props.visState.editor,
datasets: props.visState.datasets,
layers: props.visState.layers,
layerOrder: props.visState.layerOrder,
layerData: props.visState.layerData,
layerBlending: props.visState.layerBlending,
filters: props.visState.filters,
interactionConfig: props.visState.interactionConfig,
hoverInfo: props.visState.hoverInfo,
clicked: props.visState.clicked,
mousePos: props.visState.mousePos,
animationConfig: props.visState.animationConfig,
visState: props.visState,

// uiState
activeSidePanel: props.uiState.activeSidePanel,
mapControls: props.uiState.mapControls,
readOnly: props.uiState.readOnly,
locale: props.uiState.locale
locale: props.uiState.locale,

// mapStyle
topMapContainerProps: props.topMapContainerProps,
bottomMapContainerProps: props.bottomMapContainerProps
});

export function getVisibleDatasets(datasets) {
Expand Down Expand Up @@ -294,6 +287,9 @@ type KeplerGLBasicProps = {

localeMessages?: {[key: string]: {[key: string]: string}};
dispatch: Dispatch<any>;

topMapContainerProps?: object;
bottomMapContainerProps?: object;
};

type KeplerGLProps = KeplerGlState & KeplerGlActions & KeplerGLBasicProps;
Expand Down Expand Up @@ -451,15 +447,9 @@ function KeplerGlFactory(
const notificationPanelFields = notificationPanelSelector(this.props);

const mapContainers = !isSplit
? [<MapContainer primary={true} key={0} index={0} {...mapFields} mapLayers={null} />]
? [<MapContainer primary={true} key={0} index={0} {...mapFields} />]
: splitMaps.map((settings, index) => (
<MapContainer
key={index}
index={index}
primary={index === 1}
{...mapFields}
mapLayers={splitMaps[index].layers}
/>
<MapContainer key={index} index={index} primary={index === 1} {...mapFields} />
));

return (
Expand Down

0 comments on commit 4fc8596

Please sign in to comment.