Skip to content

Commit

Permalink
Drop sublayers with no data even if the _subLayerProps prop contains (v…
Browse files Browse the repository at this point in the history
  • Loading branch information
fifzteen authored Sep 3, 2021
1 parent 5fa5dde commit 202caeb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/api-reference/core/composite-layer.md
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ Parameters:
* `id` (String) - the sublayer id
* `data` (Array) - the sublayer data

Returns `true` if the sublayer should be rendered. The base class implementation returns `true` if either `data` is not empty or the `_subLayerProps` prop contains override for this sublayer.
Returns `true` if the sublayer should be rendered. The base class implementation returns `true` if `data` is not empty.


##### `getSubLayerClass`
Expand Down
4 changes: 1 addition & 3 deletions modules/core/src/lib/composite-layer.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,7 @@ export default class CompositeLayer extends Layer {

// Returns true if sub layer needs to be rendered
shouldRenderSubLayer(id, data) {
const {_subLayerProps: overridingProps} = this.props;

return (data && data.length) || (overridingProps && overridingProps[id]);
return data && data.length;
}

// Returns sub layer class for a specific sublayer
Expand Down

0 comments on commit 202caeb

Please sign in to comment.