<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic How to render multiple deck.gl layers at once? in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-render-multiple-deck-gl-layers-at-once/m-p/1477641#M84699</link>
    <description>&lt;P&gt;Hello!&lt;/P&gt;&lt;P&gt;I'm trying to visualize multiple data sets on top of Esri basemaps using deck.gl. The issue is that the two ways I have tried to plot all of my data either allow me to see all the data in one layer or separate the layers out and see only one data set at a time. Can't I have both? See all the data and have them as separate items in the layerList?&lt;/P&gt;&lt;P&gt;Pseudo code of each case: (all in one deck layer, then separate)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// All in one deck layer
    const deckLayer = new DeckLayer({
      'title': "Two data sets",
      'deck.layers': [
        new ScatterplotLayer({
          id: 'Points',
          data: pointData,
          getPosition: d =&amp;gt; [d.x_longitude, d.y_latitude],
          getFillColor: [255, 255, 255],
          radiusMinPixels: 7,
          radiusMaxPixels: 21,
          autoHighlight: true,
          pickable: true,
          extensions: [new CollisionFilterExtension()],
        }),
        new HeatmapLayer({
          id: 'Heat',
          data: heatData,
          aggregation: 'SUM',
          getPosition: d =&amp;gt; [d.Longitude_deg, d.Latitude_deg],
          colorRange: [[46,172,102],[126,188,87],[179,205,65],[223,221,25],[255,237,0]]
        })
      ]
    });
    map.add(deckLayer);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// Separate deck layers
    const pointLayer= new DeckLayer({
      'title': "Points",
      'deck.layers': [
        new ScatterplotLayer({
          id: 'Points',
          data: pointData,
          getPosition: d =&amp;gt; [d.x_longitude, d.y_latitude],
          getFillColor: [255, 255, 255],
          radiusMinPixels: 7,
          radiusMaxPixels: 21,
          autoHighlight: true,
          pickable: true,
          extensions: [new CollisionFilterExtension()],
        })
      ]
    });
    map.add(pointLayer);

    const heatLayer = new DeckLayer({
      'title': "Heat Data",
      'deck.layers': [
        new HeatmapLayer({
          id: 'Heat',
          data: heatData,
          aggregation: 'SUM',
          getPosition: d =&amp;gt; [d.Longitude_deg, d.Latitude_deg],
          colorRange: [[46,172,102],[126,188,87],[179,205,65],[223,221,25],[255,237,0]]
        })
      ]
    })
    map.add(heatLayer);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 23 May 2024 13:37:56 GMT</pubDate>
    <dc:creator>Lyonford</dc:creator>
    <dc:date>2024-05-23T13:37:56Z</dc:date>
    <item>
      <title>How to render multiple deck.gl layers at once?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-render-multiple-deck-gl-layers-at-once/m-p/1477641#M84699</link>
      <description>&lt;P&gt;Hello!&lt;/P&gt;&lt;P&gt;I'm trying to visualize multiple data sets on top of Esri basemaps using deck.gl. The issue is that the two ways I have tried to plot all of my data either allow me to see all the data in one layer or separate the layers out and see only one data set at a time. Can't I have both? See all the data and have them as separate items in the layerList?&lt;/P&gt;&lt;P&gt;Pseudo code of each case: (all in one deck layer, then separate)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// All in one deck layer
    const deckLayer = new DeckLayer({
      'title': "Two data sets",
      'deck.layers': [
        new ScatterplotLayer({
          id: 'Points',
          data: pointData,
          getPosition: d =&amp;gt; [d.x_longitude, d.y_latitude],
          getFillColor: [255, 255, 255],
          radiusMinPixels: 7,
          radiusMaxPixels: 21,
          autoHighlight: true,
          pickable: true,
          extensions: [new CollisionFilterExtension()],
        }),
        new HeatmapLayer({
          id: 'Heat',
          data: heatData,
          aggregation: 'SUM',
          getPosition: d =&amp;gt; [d.Longitude_deg, d.Latitude_deg],
          colorRange: [[46,172,102],[126,188,87],[179,205,65],[223,221,25],[255,237,0]]
        })
      ]
    });
    map.add(deckLayer);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// Separate deck layers
    const pointLayer= new DeckLayer({
      'title': "Points",
      'deck.layers': [
        new ScatterplotLayer({
          id: 'Points',
          data: pointData,
          getPosition: d =&amp;gt; [d.x_longitude, d.y_latitude],
          getFillColor: [255, 255, 255],
          radiusMinPixels: 7,
          radiusMaxPixels: 21,
          autoHighlight: true,
          pickable: true,
          extensions: [new CollisionFilterExtension()],
        })
      ]
    });
    map.add(pointLayer);

    const heatLayer = new DeckLayer({
      'title': "Heat Data",
      'deck.layers': [
        new HeatmapLayer({
          id: 'Heat',
          data: heatData,
          aggregation: 'SUM',
          getPosition: d =&amp;gt; [d.Longitude_deg, d.Latitude_deg],
          colorRange: [[46,172,102],[126,188,87],[179,205,65],[223,221,25],[255,237,0]]
        })
      ]
    })
    map.add(heatLayer);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 May 2024 13:37:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-render-multiple-deck-gl-layers-at-once/m-p/1477641#M84699</guid>
      <dc:creator>Lyonford</dc:creator>
      <dc:date>2024-05-23T13:37:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to render multiple deck.gl layers at once?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-render-multiple-deck-gl-layers-at-once/m-p/1570349#M86284</link>
      <description>&lt;P&gt;Did you ever figure out why this is happening? I'm running into the same thing and wondering if I'm doomed to live with a single DeckLayer, or if it's possible to use more than one at a time. Let me know if you've solved this (thanks in advance)!&lt;/P&gt;</description>
      <pubDate>Thu, 19 Dec 2024 20:37:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-render-multiple-deck-gl-layers-at-once/m-p/1570349#M86284</guid>
      <dc:creator>ToddRunstein</dc:creator>
      <dc:date>2024-12-19T20:37:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to render multiple deck.gl layers at once?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-render-multiple-deck-gl-layers-at-once/m-p/1593379#M86641</link>
      <description>&lt;P&gt;We got around this!&lt;BR /&gt;Apologies for the late reply, but it has been a while since I worked on that bit of code. I'll amend this response with more details later. In summary we created dummy layers to go in the layer list, created a 'catalog' of the component layers that we added or subtracted layers based upon the selections in the layer list (via listening to the layer list), and there was a separate useEffect() that would destroy the DeckLayer and redraw it based on the catalog.&lt;BR /&gt;Why I say I'll need to review before sharing is that I don't recall whether the dummy layers ended up being necessary with the destroy/redraw effect among other things. The idea was that the layers you are turning on and off in the list are not real layers, they're just for controlling the components of the DeckLayer (which itself is always on and not listed in the layer list).&lt;/P&gt;</description>
      <pubDate>Fri, 07 Mar 2025 16:11:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-render-multiple-deck-gl-layers-at-once/m-p/1593379#M86641</guid>
      <dc:creator>Lyonford</dc:creator>
      <dc:date>2025-03-07T16:11:30Z</dc:date>
    </item>
  </channel>
</rss>

