Skip to content

Kepler.gl is a powerful open source geospatial analysis tool for large-scale data sets.

fix for cluster layer z-fighting; fix - render 3d building map style only once (#1874)

Igor Dykhtaceb23e21b372
diff --git a/src/components/map-container.tsx b/src/components/map-container.tsx
index f1ca90ee3..19c648896 100644
--- a/src/components/map-container.tsx
+++ b/src/components/map-container.tsx
@@ -426,7 +426,7 @@ export default function MapContainerFactory(
return screenCoord && {x: screenCoord[0], y: screenCoord[1]};
}
- _renderDeckOverlay(layersForDeck) {
+ _renderDeckOverlay(layersForDeck, options = {primaryMap: false}) {
const {
mapState,
mapStyle,
@@ -458,7 +458,7 @@ export default function MapContainerFactory(
deckGlLayers = deckGlLayers.concat(dataLayers);
}
- if (mapStyle.visibleLayerGroups['3d building']) {
+ if (mapStyle.visibleLayerGroups['3d building'] && options.primaryMap) {
deckGlLayers.push(
new ThreeDBuildingLayer({
id: '_keplergl_3d-building',
@@ -632,14 +632,14 @@ export default function MapContainerFactory(
getCursor={this.props.hoverInfo ? () => 'pointer' : undefined}
onMouseMove={this.props.visStateActions.onMouseMove}
>
- {this._renderDeckOverlay(layersForDeck)}
+ {this._renderDeckOverlay(layersForDeck, {primaryMap: true})}
{this._renderMapboxOverlays()}
{this._renderDrawEditor()}
</MapComponent>
{mapStyle.topMapStyle || hasGeocoderLayer ? (
<div style={MAP_STYLE.top}>
<MapComponent {...mapProps} key="top" mapStyle={mapStyle.topMapStyle}>
- {this._renderDeckOverlay({[GEOCODER_LAYER_ID]: true})}
+ {this._renderDeckOverlay({[GEOCODER_LAYER_ID]: hasGeocoderLayer})}
</MapComponent>
</div>
) : null}
diff --git a/src/deckgl-layers/src/cluster-layer/cluster-layer.ts b/src/deckgl-layers/src/cluster-layer/cluster-layer.ts
index 7a5d05f49..d9f3894ea 100644
--- a/src/deckgl-layers/src/cluster-layer/cluster-layer.ts
+++ b/src/deckgl-layers/src/cluster-layer/cluster-layer.ts
@@ -242,6 +242,9 @@ export default class ClusterLayer extends AggregationLayer<
autoHighlight,
highlightColor,
updateTriggers,
+ parameters: {
+ depthMask: false
+ },
...accessors
});
}