question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Interleaved Buffer With IconLayer and TextLayer?

See original GitHub issue

I was looking at the interleaved-buffer example as a way to increase rendering performance…

The example provides mockups of using the PathLayer, SolidPolygonLayer and ScatterPlotLayer. Was curious if perhaps you have a mockup of this approach using an IconLayer and TextLayer?

For the IconLayer specifically, I am trying to determine how I could best pass back the getIcon attributes (i.e., width, height, url) as apart of the buffer.

For the TextLayer specifically, I am trying to determine how I could best pass back the getText (i.e., string) as apart of the buffer.

Any help as always is really appreciated!

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9

github_iconTop GitHub Comments

1reaction
jfuehnercommented, Feb 9, 2020

@Pessimistress I thought about my use-case a bit more. With the layer details being passed back in the event handlers (onHover, onClick, etc) I can simply use the layer id and object index to locate the full object within my dataSources array…

0reactions
jfuehnercommented, Feb 8, 2020

@Pessimistress sorry, let me better explain what I believe my perceived problem is with only having access to the object index when using the binary layer configuration.

In my app I receive an array of objects that looks similar to…

        const dataSources = [
            {
                index: 0,
                id: 1,
                layers: [
                    {
                        index: 0,
                        id: 11,
                        polygonLayer: true,
                        data: [
                            { index: 0, id: 111, position: [...] },
                            { index: 1, id: 112, position: [...] }
                        ]
                    },
                    {
                        index: 1,
                        id: 12,
                        polygonLayer: true,
                        data: [
                            { indes: 0, id: 121, position: [...] },
                            { index: 1, id: 122, position: [...] }
                        ]
                    },
                    {
                        index: 2,
                        id: 13,
                        textLayer: true,
                        data: [
                            { index: 0, id: 131, position: [...] },
                            { index: 1, id: 132, position: [...] }
                        ]
                    }
                ]
            },
            {
                index: 1,
                id: 2,
                layers: [
                    {
                        index: 0,
                        id: 21,
                        polygonLayer: true,
                        data: [
                            { index: 0, id: 211, position: [...] },
                            { index: 1, id: 212, position: [...] }
                        ]
                    }
                ]
            }
        ]
    }

The above structure is then translated into respective deck layers…

With the non-binary layer configuration when an object is picked I have full access to the entire object. With the entire object I would have the object id which I could use to find within the array object structure above…

onClick: (info) => info.object.id;

With the binary layer configuration it sounds as though I would have access only to the object index.

onClick: (info) => info.index;

With the object index I wouldn’t have a way to locate within the array object structure above the corresponding object that was picked as the index would not be unique.

Hope that helps…

Read more comments on GitHub >

github_iconTop Results From Across the Web

Interleaved Buffer With IconLayer and TextLayer? · Issue #4244
I was looking at the interleaved-buffer example as a way to increase rendering performance... The example provides mockups of using the ...
Read more >
Performance Optimization - deck.gl
This object defines the buffer from which PointCloudLayer should access its positions data. See the base Layer class' data prop for details. It...
Read more >
5.9 - Interleaved Buffers — LearnWebGL
Interleaved data puts all model data into a single 1-dimensional array and uploads the data to a single buffer object. When you link...
Read more >
deck.gl v8.8 - Yarn
Use deck.gl layers as custom mapbox layers, enabling seamless interleaving of mapbox and deck.gl layers. See deck.gl for documentation.
Read more >
heliware-js - npm Package Health Analysis - Snyk
heliware-js is a library for 3D Geo-Spatial data visualization & analytics built by Heliware (https://heliware.co.in) using three js & webgl ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found