Skip to content

Commit

Permalink
[fix] 3d buildings aren't rendered without layers (#1931)
Browse files Browse the repository at this point in the history
  • Loading branch information
igorDykhta committed Aug 24, 2022
1 parent f21afd8 commit 50eda73
Showing 1 changed file with 34 additions and 34 deletions.
68 changes: 34 additions & 34 deletions src/reducers/layer-utils.ts
Expand Up @@ -286,42 +286,42 @@ export function computeDeckLayers(

const {mapIndex, mapboxApiAccessToken, mapboxApiUrl, primaryMap, layersForDeck} = options || {};

if (!layerData || !layerData.length) {
return [];
let dataLayers: any[] = [];

if (layerData && layerData.length) {
const mapLayers = getMapLayersFromSplitMaps(splitMaps, mapIndex || 0);

const currentLayersForDeck = layersForDeck || prepareLayersForDeck(layers, layerData);

dataLayers = layerOrder
.slice()
.reverse()
.filter(idx => currentLayersForDeck[layers[idx].id])
.reduce((overlays, idx) => {
const layerCallbacks = onSetLayerDomain
? {
onSetLayerDomain: val => onSetLayerDomain(idx, val)
}
: {};
const layerOverlay = renderDeckGlLayer(
{
datasets,
layers,
layerData,
hoverInfo,
clicked,
mapState,
interactionConfig,
animationConfig,
mapLayers
},
layerCallbacks,
idx
);
return overlays.concat(layerOverlay || []);
}, []);
}

const mapLayers = getMapLayersFromSplitMaps(splitMaps, mapIndex || 0);

const currentLayersForDeck = layersForDeck || prepareLayersForDeck(layers, layerData);

const dataLayers = layerOrder
.slice()
.reverse()
.filter(idx => currentLayersForDeck[layers[idx].id])
.reduce((overlays, idx) => {
const layerCallbacks = onSetLayerDomain
? {
onSetLayerDomain: val => onSetLayerDomain(idx, val)
}
: {};
const layerOverlay = renderDeckGlLayer(
{
datasets,
layers,
layerData,
hoverInfo,
clicked,
mapState,
interactionConfig,
animationConfig,
mapLayers
},
layerCallbacks,
idx
);
return overlays.concat(layerOverlay || []);
}, []);

if (!primaryMap) {
return dataLayers;
}
Expand Down

0 comments on commit 50eda73

Please sign in to comment.