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.

Bug: TextLayer rendered behind other layers

See original GitHub issue

I have multiple layers that I pass to my DeckGL component. The last of which is a TextLayer.

Actual Result

The Scatterplot and GeoJsonLayers that preceed the TextLayer in the layers array overlay the TextLayer. The IconLayer which is also passed in after the ScatterplotLayer and GeoJsonLayer is rendered correctly. grafik

Expected Result

As the TextLayer is the last item in the Array, it should be rendered on top of all other layers. So the white text should appear in front of the grey dot and the grey lines.

Code Example

Here’s the generation of the layer array passed to the DeckGL component

return [
      new ScatterplotLayer({
      id: 'grey-dots',
      data: greyDots,
      getPosition: d => d.geometry.coordinates,
      getRadius: 20,
    }),
    new GeoJsonLayer({
      id: 'lines',
      data: lines
      getLineColor: [129, 134, 145],
    }),
      new IconLayer({
        id: 'icon',
        data: markerPoints,
        wrapLongitude: true,
        getIcon: d => 'marker',
        getPosition: d => d.geometry.coordinates,
        getColor: d => getColor(d),
        getSize: d => 5,
        iconAtlas: '/icon-atlas.png',
        iconMapping: {
          marker: {
            x: 0,
            y: 0,
            width: 128,
            height: 128,
            anchorY: 128,
            mask: true,
          },
        },
      }),
      new TextLayer({
        id: 'icon-texts',
        data: texts,
        getText: d => `My Text`,
        getPosition: d => d.geometry.coordinates,
        getColor: d => [256, 256, 256], 
        getSize: d => 20,
        sizeScale: 1,
        getPixelOffset: [0, 15],
      }),
    ];

Is there a bug or am I doing something wrong?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
ibgreencommented, Dec 3, 2018

Maybe disable depth testing for the text layer, or add a small Z offset?

0reactions
tgorkincommented, Jan 8, 2019

Closing issue, please re-open if necessary and provide more details to help isolate the issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

TextLayer rendered behind other layers #2460 - visgl/deck.gl
I have multiple layers that I pass to my DeckGL component. ... Bug: TextLayer rendered behind other layers #2460.
Read more >
Text layer playback/render glitch
Hi, I'm working on some text for a video and when attempting to play back or render the video with the text layers,...
Read more >
22 Easy Fixes to Common Problems in After Effects (2022)
Thats what the pan behind tool is for. Why 22? because it is 2022 ... 6 I want to move all my layers...
Read more >
Unity TextMeshPro UGUI object is hidden behind other ...
My Game uses the Sorting Layer elements on all of my sprites, so that they don't get hidden behind others. I'm trying to...
Read more >
CALayer Tutorial for iOS: Getting Started
The Layer Player app demonstrates nine different CALayer capabilities. ... All layer classes, not just CATextLayer , render at a scale ...
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