Skip to content

Commit

Permalink
clean up names
Browse files Browse the repository at this point in the history
  • Loading branch information
Pessimistress committed Aug 21, 2024
1 parent 5fb0786 commit 826cb88
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 18 deletions.
4 changes: 2 additions & 2 deletions modules/aggregation-layers/src/grid-layer/grid-cell-layer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const defaultProps: DefaultProps<_GridCellLayerProps> = {
elevationRange: [0, 1000]
};

/** Proprties added by ScreenGridCellLayer. */
/** Proprties added by GridCellLayer. */
export type _GridCellLayerProps = {
cellSizeCommon: [number, number];
cellOriginCommon: [number, number];
Expand All @@ -44,7 +44,7 @@ export default class GridCellLayer<ExtraPropsT extends {} = {}> extends ColumnLa
null,
ExtraPropsT & Required<_GridCellLayerProps>
> {
static layerName = 'ScreenGridCellLayer';
static layerName = 'GridCellLayer';
static defaultProps = defaultProps as any;

state!: ColumnLayer['state'] & {
Expand Down
29 changes: 14 additions & 15 deletions modules/aggregation-layers/src/grid-layer/grid-layer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ const defaultProps: DefaultProps<GridLayerProps> = {
material: true
};

/** All properties supported by CPUGridLayer. */
/** All properties supported by GridLayer. */
export type GridLayerProps<DataT = unknown> = _GridLayerProps<DataT> & CompositeLayerProps;

/** Properties added by CPUGridLayer. */
/** Properties added by GridLayer. */
type _GridLayerProps<DataT> = {
/**
* Size of each cell in meters.
Expand Down Expand Up @@ -336,18 +336,6 @@ export default class GridLayer<DataT = any, ExtraPropsT extends {} = {}> extends
in float colorWeights;
in float elevationWeights;
vec4 _project_position(vec4 position, vec3 position64Low) {
if (project.coordinateSystem == COORDINATE_SYSTEM_LNGLAT) {
return vec4(
project_mercator_(position.xy),
project_size_at_latitude(position.z, position.y),
position.w
);
}
return project_position(position, position64Low);
}
void getBin(out ivec2 binId) {
vec2 positionCommon;
if (project.coordinateSystem == COORDINATE_SYSTEM_LNGLAT && (
Expand Down Expand Up @@ -534,13 +522,14 @@ export default class GridLayer<DataT = any, ExtraPropsT extends {} = {}> extends

renderLayers(): LayersList | Layer | null {
const {aggregator, cellOriginCommon, cellSizeCommon} = this.state;
const {elevationScale, colorRange, elevationRange, extruded, coverage, material, transitions} =
this.props;
const CellLayerClass = this.getSubLayerClass('cells', GridCellLayer);
const binAttribute = aggregator.getBins();
const colorsAttribute = aggregator.getResult(0);
const elevationsAttribute = aggregator.getResult(1);

return new CellLayerClass(
this.props,
this.getSubLayerProps({
id: 'cells'
}),
Expand All @@ -562,9 +551,19 @@ export default class GridLayer<DataT = any, ExtraPropsT extends {} = {}> extends
},
cellOriginCommon,
cellSizeCommon,
elevationScale,
colorRange,
elevationRange,
extruded,
coverage,
material,
// Evaluate domain at draw() time
colorDomain: () => this.props.colorDomain || aggregator.getResultDomain(0),
elevationDomain: () => this.props.elevationDomain || aggregator.getResultDomain(1),
transitions: transitions && {
getFillColor: transitions.getColorValue || transitions.getColorWeight,
getElevation: transitions.getElevationValue || transitions.getElevationWeight
},
// Extensions are already handled by the GPUAggregator, do not pass it down
extensions: []
}
Expand Down
5 changes: 4 additions & 1 deletion modules/aggregation-layers/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@ export type {ContourLayerProps} from './contour-layer/contour-layer';
export type {HeatmapLayerProps} from './heatmap-layer/heatmap-layer';
export type {HexagonLayerProps} from './hexagon-layer/hexagon-layer';
export type {CPUGridLayerProps} from './cpu-grid-layer/cpu-grid-layer';
export type {GridLayerProps} from './grid-layer/grid-layer';
export type {
GridLayerProps,
GridLayerPickingInfo
} from './grid-layer/grid-layer';
export type {GPUGridLayerProps} from './gpu-grid-layer/gpu-grid-layer';
export type {
ScreenGridLayerProps,
Expand Down

0 comments on commit 826cb88

Please sign in to comment.