Skip to content

Commit

Permalink
Fix layer browser (#9140)
Browse files Browse the repository at this point in the history
  • Loading branch information
felixpalmer authored Sep 4, 2024
1 parent eb9af5f commit 8421929
Showing 1 changed file with 2 additions and 31 deletions.
33 changes: 2 additions & 31 deletions examples/layer-browser/src/examples/aggregation-layers.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import {
GridLayer,
GPUGridLayer,
CPUGridLayer,
HexagonLayer,
ContourLayer,
ScreenGridLayer,
Expand Down Expand Up @@ -70,22 +68,6 @@ function getMax(pts, key) {
: null;
}

const CPUGridLayerExample = {
layer: CPUGridLayer,
props: {
id: 'gridLayer',
data: dataSamples.points,
cellSize: 200,
opacity: 1,
extruded: true,
pickable: true,
colorScaleType: 'quantize',
getPosition: d => d.COORDINATES,
getColorValue: points => getMean(points, 'SPACES'),
getElevationValue: points => getMax(points, 'SPACES')
}
};

const HexagonLayerExample = {
layer: HexagonLayer,
props: {
Expand Down Expand Up @@ -114,20 +96,11 @@ const GRID_LAYER_PROPS_OBJECT = {
getPosition: d => d.COORDINATES
};

const GPU_GRID_LAYER_PROPS_OBJECT = Object.assign({}, GRID_LAYER_PROPS_OBJECT, {
id: 'gpu-grid-layer'
});

const GRID_LAYER_PROPS = {
getData: () => dataSamples.points,
props: GRID_LAYER_PROPS_OBJECT
};

const GPU_GRID_LAYER_PROPS = {
getData: () => dataSamples.points,
props: GPU_GRID_LAYER_PROPS_OBJECT
};

const HEAT_LAYER_PROPS = {
getData: () => dataSamples.points,
props: {
Expand All @@ -138,12 +111,12 @@ const HEAT_LAYER_PROPS = {
}
};

const GPUGridLayerExample = Object.assign({}, {layer: GPUGridLayer}, GPU_GRID_LAYER_PROPS);
const GridLayerExample = Object.assign({}, {layer: GridLayer}, GRID_LAYER_PROPS);
const HeatmapLayerExample = Object.assign({}, {layer: HeatmapLayer}, HEAT_LAYER_PROPS);

const GPUGridLayerPerfExample = (id, getData) => ({
layer: GPUGridLayer,
layer: GridLayer,
gpuAggregation: true,
getData,
props: {
id: `gpuGridLayerPerf-${id}`,
Expand All @@ -158,12 +131,10 @@ const GPUGridLayerPerfExample = (id, getData) => ({
/* eslint-disable quote-props */
export default {
'Aggregation Layers': {
CPUGridLayer: CPUGridLayerExample,
ScreenGridLayer: ScreenGridLayerExample,
HexagonLayer: HexagonLayerExample,
ContourLayer: ContourLayerExample,
'ContourLayer (Bands)': ContourLayerBandsExample,
GPUGridLayer: GPUGridLayerExample,
GridLayer: GridLayerExample,
HeatmapLayer: HeatmapLayerExample,
'GPUGridLayer (1M)': GPUGridLayerPerfExample('1M', dataSamples.getPoints1M),
Expand Down

0 comments on commit 8421929

Please sign in to comment.