deck.gl icon indicating copy to clipboard operation
deck.gl copied to clipboard

layers visibility from props

Open MacieJCzarkowskI opened this issue 6 years ago • 1 comments

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?

MacieJCzarkowskI avatar Jun 18 '20 11:06 MacieJCzarkowskI

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.

Pessimistress avatar Jun 18 '20 21:06 Pessimistress