deck.gl
deck.gl copied to clipboard
layers visibility from props
Hey, How can you change the visibility of an element when it depends on what you get in response, here small example:
new TileLayer({
id: 'tile_layer_data_assets',
getTileData: () => {
// response from geoserver
},
minZoom,
renderSubLayers: (props: any) => {
return new IconLayer({
id: `${props.id}-icon`,
data: props.data,
iconAtlas: pin,
iconMapping: ICON_MAPPING,
pickable: true,
getIcon: () => 'marker',
getPosition: (d: any) => d.geometry.coordinates,
});
},
});
in the example above, in elements e.g. getColor I have access (prop) => props.properties, but how to do it with visible?
The visibility of tiles are controlled by the TileLayer. You can return an empty array [] if you don't want to render anything for this tile.