-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathSatelliteLayer.ts
32 lines (30 loc) · 986 Bytes
/
SatelliteLayer.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/* eslint-disable @typescript-eslint/no-explicit-any */
import { BitmapLayer } from '@deck.gl/layers';
import { CompositeLayer, LayerContext } from '@deck.gl/core';
import { TileLayer } from '@deck.gl/geo-layers';
export class SatelliteLayer extends CompositeLayer {
static layerName = 'SatelliteLayer';
initializeState(context: LayerContext): void {
super.initializeState(context);
}
renderLayers() {
return new TileLayer({
id: 'basemap-satellite',
data: 'https://gateway.api.dev.globalfishingwatch.org/v3/tileset/sat/tile?x={x}&y={y}&z={z}',
minZoom: 0,
maxRequests: 100,
debounceTime: 800,
onDataLoad: this.props.onDataLoad,
renderSubLayers: (props: any) => {
const {
bbox: { west, south, east, north },
} = props.tile;
return new BitmapLayer(props, {
data: undefined,
image: props.data,
bounds: [west, south, east, north],
});
},
});
}
}