Skip to content

Commit

Permalink
color and sort layer
Browse files Browse the repository at this point in the history
  • Loading branch information
satellitestudiodesign committed Aug 28, 2024
1 parent e371752 commit 36256a5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions libs/deck-layer-composer/src/resolvers/dataviews.ts
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ const HEATMAP_ANIMATED_CATEGORIES_ORDER: DataviewCategory[] = [
DataviewCategory.Environment,
DataviewCategory.Detections,
DataviewCategory.Activity,
DataviewCategory.VesselGroups,
]

export function getDataviewsSorted(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ export class FourwingsFootprintLayer extends CompositeLayer<FourwingsFootprintLa
cellStartOffsets: feature.properties.startOffsets,
})
feature.aggregatedValues = aggregatedCellValues
if (aggregatedCellValues[0] > 0 && color) {
target = hexToDeckColor(color)
if (aggregatedCellValues[0] > 0) {
target = hexToDeckColor(color!, Math.min(0.5 + aggregatedCellValues[0] * 0.01, 1))
} else {
target = EMPTY_CELL_COLOR
}
Expand Down Expand Up @@ -123,7 +123,8 @@ export class FourwingsFootprintLayer extends CompositeLayer<FourwingsFootprintLa
getPickingInfo: this.getPickingInfo,
getFillColor: this._getFillColor,
getPolygon: (d: FourwingsFeature) => d.geometry.coordinates[0],
getPolygonOffset: (params: any) => getLayerGroupOffset(LayerGroup.Heatmap, params),
getPolygonOffset: (params: any) =>
getLayerGroupOffset(LayerGroup.HeatmapFootprint, params),
updateTriggers: {
getFillColor: [startTime, endTime],
},
Expand Down
2 changes: 2 additions & 0 deletions libs/deck-layers/src/utils/sort.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export enum LayerGroup {
Bathymetry = 'bathymetry', // 4Wings Bathymetry layer
HeatmapStatic = 'heatmapStatic', // Fill/gradient-based heatmaps
Heatmap = 'heatmap', // Fill/gradient-based temporal heatmaps
HeatmapFootprint = 'heatmapFootprint', // Fill/gradient-based temporal heatmaps
OutlinePolygons = 'outlinePolygons', // Context layers with an outlined/hollow style such as RFMOs, MPAs, etc
OutlinePolygonsFill = 'outlinePolygonsFill', // User context layers with a filled styles, below OutlinePolygons
BasemapFill = 'basemapFill', // Landmass
Expand All @@ -32,6 +33,7 @@ export const LAYER_GROUP_ORDER = [
LayerGroup.Bathymetry,
LayerGroup.HeatmapStatic,
LayerGroup.Heatmap,
LayerGroup.HeatmapFootprint,
LayerGroup.OutlinePolygonsFill,
LayerGroup.OutlinePolygons,
LayerGroup.BasemapFill,
Expand Down

0 comments on commit 36256a5

Please sign in to comment.