0

I have added a layer in my React app with kepler.gl.

But the visibility of the layer is turned off. I can manually toggle the visibility in the map but not able to do so using React.

enter image description here

This is my config which I am passing in addDataToMap:

    visState: {
        layerBlending: "normal",
        layers: [{
            id: "hty62yd",
            type: "point",
            config: {
                dataId: "dataset1",
                label: "label1",
                color: [
                    192,
                    192,
                    23
                ],
                columns: {
                    lat: "lat",
                    lng: "lon"
                }
            },
            isVisible: true,
            radius: 80
        }]
    }
};

1 Answer 1

0

The isVisible parameter was in wrong place.

Correct config is:

config: {
            dataId: "dataset1",
            label: "dataset1",
            color: [
                192,
                192,
                23
            ],
            columns: {
                lat: "lat",
                lng: "lon",
                altitude: ""
            },
            isVisible: true
        }

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.