Skip to content

Commit

Permalink
fix for cluster layer z-fighting; fix - render 3d building map style …
Browse files Browse the repository at this point in the history
…only once (#1874)

Signed-off-by: Ihor Dykhta <dikhta.igor@gmail.com>
Co-authored-by: Shan He <heshan0131@gmail.com>
  • Loading branch information
igorDykhta and heshan0131 committed Jul 26, 2022
1 parent a983be7 commit ceb23e2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/components/map-container.tsx
Expand Up @@ -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,
Expand Down Expand Up @@ -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',
Expand Down Expand Up @@ -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}
Expand Down
3 changes: 3 additions & 0 deletions src/deckgl-layers/src/cluster-layer/cluster-layer.ts
Expand Up @@ -242,6 +242,9 @@ export default class ClusterLayer extends AggregationLayer<
autoHighlight,
highlightColor,
updateTriggers,
parameters: {
depthMask: false
},
...accessors
});
}
Expand Down

0 comments on commit ceb23e2

Please sign in to comment.