From c4c213989eac294eee4605f7cdfc4472705573ed Mon Sep 17 00:00:00 2001 From: Chris Gervang Date: Tue, 11 Jun 2024 14:29:25 -0700 Subject: [PATCH 1/5] docs(core) replace glOptions with deviceProps Signed-off-by: Chris Gervang --- docs/api-reference/core/deck.md | 14 +++++++++----- docs/upgrade-guide.md | 1 + modules/core/src/lib/deck.ts | 7 +------ modules/google-maps/src/google-maps-overlay.ts | 2 +- showcases/wind/src/wind-demo.js | 1 - .../mapbox-layers-react/mapbox-layers-react.jsx | 2 +- .../mapbox-overlay-react/mapbox-overlay-react.jsx | 2 +- 7 files changed, 14 insertions(+), 15 deletions(-) diff --git a/docs/api-reference/core/deck.md b/docs/api-reference/core/deck.md index 2c2c94fbbea..9c6d7d0daa4 100644 --- a/docs/api-reference/core/deck.md +++ b/docs/api-reference/core/deck.md @@ -48,13 +48,17 @@ The following properties are used to initialize a `Deck` instance. Any custom va The canvas to render into. Can be either a HTMLCanvasElement or the element id. Will be auto-created if not supplied. -#### `gl` (WebGLContext) {#gl} +#### `device` ([Device](https://luma.gl/docs/api-reference/core/device)) + +luma.gl Device used to manage the application's connection with the GPU. Will be auto-created if not supplied. -WebGL context. Will be auto-created if not supplied. +#### `deviceProps` ([DeviceProps](https://luma.gl/docs/api-reference/core/device#deviceprops) | [WebGLDeviceProps](https://luma.gl/docs/api-reference/webgl/#webgldeviceprops)) {#deviceprops} -#### `glOptions` (object) {#gloptions} +Additional options used when creating the luma.gl [Device](https://luma.gl/docs/api-reference/core/device). When using WebGL, see [WebGL context attributes](https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/getContext#contextattributes). + +#### `gl` (WebGLContext) {#gl} -Additional options used when creating the WebGLContext. See [WebGL context attributes](https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/getContext). +WebGL context. Will be auto-created if not supplied. Deprecated, use `device`. #### `id` (string) {#id} @@ -434,7 +438,7 @@ Called once the [Device](https://luma.gl/docs/api-reference/core/device) context Receives arguments: -* `device` (Device) - a `WEBGLDevice` or `WebGPUDevice`. +* `device` (Device) - a `WebGLDevice` or `WebGPUDevice`. #### `onViewStateChange` (Function) {#onviewstatechange} diff --git a/docs/upgrade-guide.md b/docs/upgrade-guide.md index 1685ac1655c..da33229e239 100644 --- a/docs/upgrade-guide.md +++ b/docs/upgrade-guide.md @@ -19,6 +19,7 @@ The biggest changes in deck.gl v9 are due to the upgrade to the luma.gl v9 API. Quick summary: - All references to `gl: WebGLRenderingContext` should be replaced with `device`: [Device](https://luma.gl/docs/api-reference/core/device). +- All references to `glOptions: WebGLContextAttributes` should be replaced with `deviceProps: {type: 'webgl', ...glOptions}`: [WebGLDeviceProps](https://luma.gl/docs/api-reference/webgl/#webgldeviceprops) - Layer props `parameters` and `textureParameters` no longer use WebGL constants, but instead use (WebGPU style) [string constants](https://luma.gl/docs/api-reference/core/parameters/). - Deck class prop `onWebGLInitialized` is now `onDeviceInitialized`. - When providing [binary data attributes](./api-reference/core/layer.md#data), `type` is now a WebGPU-style [string format](https://luma.gl/docs/api-guide/gpu/gpu-attributes#vertexformat) instead of a GL constant. diff --git a/modules/core/src/lib/deck.ts b/modules/core/src/lib/deck.ts index 63f81c6f543..1b59bce93b1 100644 --- a/modules/core/src/lib/deck.ts +++ b/modules/core/src/lib/deck.ts @@ -135,8 +135,6 @@ export type DeckProps = { /** WebGL context @deprecated Use props.device */ gl?: WebGL2RenderingContext | null; - /** Options used when creating a WebGL context. @deprecated Use props.deviceProps */ - glOptions?: WebGLContextAttributes; /** * The array of Layer instances to be rendered. @@ -248,7 +246,6 @@ const defaultProps = { device: null, deviceProps: {type: 'webgl'} as DeviceProps, gl: null, - glOptions: {}, canvas: null, layers: [], effects: [], @@ -466,7 +463,7 @@ export default class Deck { this._setCanvasSize(this.props); // We need to overwrite CSS style width and height with actual, numeric values - const resolvedProps: Omit, 'glOptions'> & { + const resolvedProps: Required & { width: number; height: number; views: View[]; @@ -794,8 +791,6 @@ export default class Deck { // width, // height, gl, - // deviceProps, - // glOptions, // debug, onError, // onBeforeRender, diff --git a/modules/google-maps/src/google-maps-overlay.ts b/modules/google-maps/src/google-maps-overlay.ts index c6e5450838a..e8abbcc0cf8 100644 --- a/modules/google-maps/src/google-maps-overlay.ts +++ b/modules/google-maps/src/google-maps-overlay.ts @@ -32,7 +32,7 @@ export type GoogleMapsOverlayProps = Omit< | 'width' | 'height' | 'gl' - | 'glOptions' + | 'deviceProps' | 'parent' | 'canvas' | '_customRender' diff --git a/showcases/wind/src/wind-demo.js b/showcases/wind/src/wind-demo.js index c46d3d7a07e..8e0e07d2e5c 100644 --- a/showcases/wind/src/wind-demo.js +++ b/showcases/wind/src/wind-demo.js @@ -160,7 +160,6 @@ export default class WindDemo extends Component { return ( {glContext && ( diff --git a/test/apps/mapbox-integration/mapbox-overlay-react/mapbox-overlay-react.jsx b/test/apps/mapbox-integration/mapbox-overlay-react/mapbox-overlay-react.jsx index eefe779ce53..ff0308a0c41 100644 --- a/test/apps/mapbox-integration/mapbox-overlay-react/mapbox-overlay-react.jsx +++ b/test/apps/mapbox-integration/mapbox-overlay-react/mapbox-overlay-react.jsx @@ -93,7 +93,7 @@ function App() { interleaved layers={layers} views={[mapboxView, widgetView]} - glOptions={{stencil: true}} + deviceProps={{type: 'webgl', stencil: true}} layerFilter={layerFilter} /> From 5a8f2357d108a06ad87698c7876ab447faa2c1db Mon Sep 17 00:00:00 2001 From: Chris Gervang Date: Sat, 15 Jun 2024 10:18:29 -0700 Subject: [PATCH 2/5] Update deck.md Co-authored-by: Xiaoji Chen --- docs/api-reference/core/deck.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/api-reference/core/deck.md b/docs/api-reference/core/deck.md index 9c6d7d0daa4..6f5930e1f9b 100644 --- a/docs/api-reference/core/deck.md +++ b/docs/api-reference/core/deck.md @@ -58,7 +58,7 @@ Additional options used when creating the luma.gl [Device](https://luma.gl/docs/ #### `gl` (WebGLContext) {#gl} -WebGL context. Will be auto-created if not supplied. Deprecated, use `device`. +WebGL context to use. This prop is deprecated and replaced by `device`. #### `id` (string) {#id} From cdd6454dcdd5505487dfd0729cd50f14890d4771 Mon Sep 17 00:00:00 2001 From: Chris Gervang Date: Sat, 15 Jun 2024 10:18:45 -0700 Subject: [PATCH 3/5] Update deck.md Co-authored-by: Xiaoji Chen --- docs/api-reference/core/deck.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/api-reference/core/deck.md b/docs/api-reference/core/deck.md index 6f5930e1f9b..bb46d380960 100644 --- a/docs/api-reference/core/deck.md +++ b/docs/api-reference/core/deck.md @@ -54,7 +54,7 @@ luma.gl Device used to manage the application's connection with the GPU. Will be #### `deviceProps` ([DeviceProps](https://luma.gl/docs/api-reference/core/device#deviceprops) | [WebGLDeviceProps](https://luma.gl/docs/api-reference/webgl/#webgldeviceprops)) {#deviceprops} -Additional options used when creating the luma.gl [Device](https://luma.gl/docs/api-reference/core/device). When using WebGL, see [WebGL context attributes](https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/getContext#contextattributes). +Additional options used when creating the luma.gl [Device](https://luma.gl/docs/api-reference/core/device). When using WebGL, can be used to specify [WebGL context attributes](https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/getContext#contextattributes). #### `gl` (WebGLContext) {#gl} From 23a76b1ef28c62637cf359d2d647fc13fa9abb5d Mon Sep 17 00:00:00 2001 From: Chris Gervang Date: Sat, 6 Jul 2024 14:10:41 -0700 Subject: [PATCH 4/5] Use CreateDeviceProps Signed-off-by: Chris Gervang --- modules/core/src/lib/deck.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/core/src/lib/deck.ts b/modules/core/src/lib/deck.ts index 1b59bce93b1..ca0d7b16a2c 100644 --- a/modules/core/src/lib/deck.ts +++ b/modules/core/src/lib/deck.ts @@ -58,6 +58,7 @@ import type {PickByPointOptions, PickByRectOptions} from './deck-picker'; import type {LayersList} from './layer-manager'; import type {TooltipContent} from './tooltip'; import type {ViewStateMap, AnyViewStateOf, ViewOrViews, ViewStateObject} from './view-manager'; +import {CreateDeviceProps} from '@luma.gl/core/dist/lib/luma'; /* global document */ @@ -131,7 +132,7 @@ export type DeckProps = { /** luma.gl GPU device. A device will be auto-created if not supplied. */ device?: Device | null; /** A device will be auto-created if not supplied using these props. */ - deviceProps?: DeviceProps; + deviceProps?: CreateDeviceProps; /** WebGL context @deprecated Use props.device */ gl?: WebGL2RenderingContext | null; From bde6e90906330359495628bb50015bf55e5da0f8 Mon Sep 17 00:00:00 2001 From: Ib Green Date: Sat, 21 Dec 2024 15:32:34 -0500 Subject: [PATCH 5/5] review --- docs/api-reference/core/deck.md | 4 +- docs/upgrade-guide.md | 11 +- .../typed/aggregation-layer.d.ts | 48 +++ .../typed/aggregation-layer.d.ts.map | 1 + .../typed/contour-layer/contour-layer.d.ts | 86 ++++ .../contour-layer/contour-layer.d.ts.map | 1 + .../typed/contour-layer/contour-utils.d.ts | 24 ++ .../contour-layer/contour-utils.d.ts.map | 1 + .../contour-layer/marching-squares-codes.d.ts | 34 ++ .../marching-squares-codes.d.ts.map | 1 + .../typed/contour-layer/marching-squares.d.ts | 10 + .../contour-layer/marching-squares.d.ts.map | 1 + .../typed/cpu-grid-layer/cpu-grid-layer.d.ts | 155 +++++++ .../cpu-grid-layer/cpu-grid-layer.d.ts.map | 1 + .../typed/cpu-grid-layer/grid-aggregator.d.ts | 27 ++ .../cpu-grid-layer/grid-aggregator.d.ts.map | 1 + .../gpu-grid-cell-layer-fragment.glsl.d.ts | 3 + ...gpu-grid-cell-layer-fragment.glsl.d.ts.map | 1 + .../gpu-grid-cell-layer-vertex.glsl.d.ts | 3 + .../gpu-grid-cell-layer-vertex.glsl.d.ts.map | 1 + .../gpu-grid-layer/gpu-grid-cell-layer.d.ts | 34 ++ .../gpu-grid-cell-layer.d.ts.map | 1 + .../typed/gpu-grid-layer/gpu-grid-layer.d.ts | 107 +++++ .../gpu-grid-layer/gpu-grid-layer.d.ts.map | 1 + .../typed/grid-aggregation-layer.d.ts | 37 ++ .../typed/grid-aggregation-layer.d.ts.map | 1 + .../typed/grid-layer/grid-layer.d.ts | 42 ++ .../typed/grid-layer/grid-layer.d.ts.map | 1 + .../heatmap-layer/heatmap-layer-utils.d.ts | 22 + .../heatmap-layer-utils.d.ts.map | 1 + .../typed/heatmap-layer/heatmap-layer.d.ts | 135 +++++++ .../heatmap-layer/heatmap-layer.d.ts.map | 1 + .../typed/heatmap-layer/max-fs.glsl.d.ts | 3 + .../typed/heatmap-layer/max-fs.glsl.d.ts.map | 1 + .../typed/heatmap-layer/max-vs.glsl.d.ts | 3 + .../typed/heatmap-layer/max-vs.glsl.d.ts.map | 1 + .../triangle-layer-fragment.glsl.d.ts | 3 + .../triangle-layer-fragment.glsl.d.ts.map | 1 + .../triangle-layer-vertex.glsl.d.ts | 3 + .../triangle-layer-vertex.glsl.d.ts.map | 1 + .../typed/heatmap-layer/triangle-layer.d.ts | 26 ++ .../heatmap-layer/triangle-layer.d.ts.map | 1 + .../typed/heatmap-layer/weights-fs.glsl.d.ts | 3 + .../heatmap-layer/weights-fs.glsl.d.ts.map | 1 + .../typed/heatmap-layer/weights-vs.glsl.d.ts | 3 + .../heatmap-layer/weights-vs.glsl.d.ts.map | 1 + .../hexagon-layer/hexagon-aggregator.d.ts | 30 ++ .../hexagon-layer/hexagon-aggregator.d.ts.map | 1 + .../typed/hexagon-layer/hexagon-layer.d.ts | 175 ++++++++ .../hexagon-layer/hexagon-layer.d.ts.map | 1 + modules/aggregation-layers/typed/index.d.ts | 20 + .../aggregation-layers/typed/index.d.ts.map | 1 + .../screen-grid-cell-layer.d.ts | 47 +++ .../screen-grid-cell-layer.d.ts.map | 1 + .../screen-grid-layer-fragment.glsl.d.ts | 3 + .../screen-grid-layer-fragment.glsl.d.ts.map | 1 + .../screen-grid-layer-vertex.glsl.d.ts | 3 + .../screen-grid-layer-vertex.glsl.d.ts.map | 1 + .../screen-grid-layer/screen-grid-layer.d.ts | 107 +++++ .../screen-grid-layer.d.ts.map | 1 + modules/aggregation-layers/typed/types.d.ts | 11 + .../aggregation-layers/typed/types.d.ts.map | 1 + .../utils/aggregation-operation-utils.d.ts | 26 ++ .../aggregation-operation-utils.d.ts.map | 1 + .../typed/utils/bin-sorter.d.ts | 55 +++ .../typed/utils/bin-sorter.d.ts.map | 1 + .../typed/utils/color-utils.d.ts | 7 + .../typed/utils/color-utils.d.ts.map | 1 + .../typed/utils/cpu-aggregator.d.ts | 180 +++++++++ .../typed/utils/cpu-aggregator.d.ts.map | 1 + .../aggregate-all-fs.glsl.d.ts | 3 + .../aggregate-all-fs.glsl.d.ts.map | 1 + .../aggregate-all-vs.glsl.d.ts | 3 + .../aggregate-all-vs.glsl.d.ts.map | 1 + .../aggregate-to-grid-fs.glsl.d.ts | 3 + .../aggregate-to-grid-fs.glsl.d.ts.map | 1 + .../aggregate-to-grid-vs.glsl.d.ts | 3 + .../aggregate-to-grid-vs.glsl.d.ts.map | 1 + .../gpu-grid-aggregator-constants.d.ts | 38 ++ .../gpu-grid-aggregator-constants.d.ts.map | 1 + .../gpu-grid-aggregator-utils.d.ts | 1 + .../gpu-grid-aggregator-utils.d.ts.map | 1 + .../gpu-grid-aggregator.d.ts | 72 ++++ .../gpu-grid-aggregator.d.ts.map | 1 + .../transform-mean-vs.glsl.d.ts | 3 + .../transform-mean-vs.glsl.d.ts.map | 1 + .../typed/utils/grid-aggregation-utils.d.ts | 42 ++ .../utils/grid-aggregation-utils.d.ts.map | 1 + .../typed/utils/prop-utils.d.ts | 2 + .../typed/utils/prop-utils.d.ts.map | 1 + .../typed/utils/resource-utils.d.ts | 15 + .../typed/utils/resource-utils.d.ts.map | 1 + .../typed/utils/scale-utils.d.ts | 15 + .../typed/utils/scale-utils.d.ts.map | 1 + modules/carto/typed/api/carto-api-error.d.ts | 24 ++ .../carto/typed/api/carto-api-error.d.ts.map | 1 + modules/carto/typed/api/index.d.ts | 7 + modules/carto/typed/api/index.d.ts.map | 1 + modules/carto/typed/api/layer-map.d.ts | 127 ++++++ modules/carto/typed/api/layer-map.d.ts.map | 1 + modules/carto/typed/api/maps-api-common.d.ts | 84 ++++ .../carto/typed/api/maps-api-common.d.ts.map | 1 + modules/carto/typed/api/maps-client.d.ts | 22 + modules/carto/typed/api/maps-client.d.ts.map | 1 + modules/carto/typed/api/maps-v3-client.d.ts | 89 ++++ .../carto/typed/api/maps-v3-client.d.ts.map | 1 + modules/carto/typed/api/parseMap.d.ts | 12 + modules/carto/typed/api/parseMap.d.ts.map | 1 + modules/carto/typed/api/types.d.ts | 87 ++++ modules/carto/typed/api/types.d.ts.map | 1 + modules/carto/typed/basemap.d.ts | 10 + modules/carto/typed/basemap.d.ts.map | 1 + modules/carto/typed/config.d.ts | 28 ++ modules/carto/typed/config.d.ts.map | 1 + modules/carto/typed/index.d.ts | 23 ++ modules/carto/typed/index.d.ts.map | 1 + modules/carto/typed/layers/carto-layer.d.ts | 101 +++++ .../carto/typed/layers/carto-layer.d.ts.map | 1 + .../carto/typed/layers/carto-tile-layer.d.ts | 55 +++ .../typed/layers/carto-tile-layer.d.ts.map | 1 + modules/carto/typed/layers/h3-tile-layer.d.ts | 31 ++ .../carto/typed/layers/h3-tile-layer.d.ts.map | 1 + modules/carto/typed/layers/h3-tileset-2d.d.ts | 28 ++ .../carto/typed/layers/h3-tileset-2d.d.ts.map | 1 + modules/carto/typed/layers/quadbin-layer.d.ts | 27 ++ .../carto/typed/layers/quadbin-layer.d.ts.map | 1 + .../typed/layers/quadbin-tile-layer.d.ts | 37 ++ .../typed/layers/quadbin-tile-layer.d.ts.map | 1 + .../typed/layers/quadbin-tileset-2d.d.ts | 14 + .../typed/layers/quadbin-tileset-2d.d.ts.map | 1 + modules/carto/typed/layers/quadbin-utils.d.ts | 3 + .../carto/typed/layers/quadbin-utils.d.ts.map | 1 + .../schema/carto-spatial-tile-loader.d.ts | 4 + .../schema/carto-spatial-tile-loader.d.ts.map | 1 + .../layers/schema/carto-spatial-tile.d.ts | 21 + .../layers/schema/carto-spatial-tile.d.ts.map | 1 + .../carto/typed/layers/schema/carto-tile.d.ts | 60 +++ .../typed/layers/schema/carto-tile.d.ts.map | 1 + .../schema/carto-vector-tile-loader.d.ts | 4 + .../schema/carto-vector-tile-loader.d.ts.map | 1 + .../layers/schema/spatialjson-utils.d.ts | 28 ++ .../layers/schema/spatialjson-utils.d.ts.map | 1 + .../layers/schema/tile-loader-utils.d.ts | 5 + .../layers/schema/tile-loader-utils.d.ts.map | 1 + .../layers/spatial-index-tile-layer.d.ts | 31 ++ .../layers/spatial-index-tile-layer.d.ts.map | 1 + .../carto/typed/style/color-bins-style.d.ts | 33 ++ .../typed/style/color-bins-style.d.ts.map | 1 + .../typed/style/color-categories-style.d.ts | 36 ++ .../style/color-categories-style.d.ts.map | 1 + .../typed/style/color-continuous-style.d.ts | 33 ++ .../style/color-continuous-style.d.ts.map | 1 + modules/carto/typed/style/palette.d.ts | 7 + modules/carto/typed/style/palette.d.ts.map | 1 + modules/carto/typed/style/utils.d.ts | 8 + modules/carto/typed/style/utils.d.ts.map | 1 + modules/carto/typed/utils.d.ts | 2 + modules/carto/typed/utils.d.ts.map | 1 + modules/core/src/lib/deck.ts | 10 +- .../core/typed/controllers/controller.d.ts | 175 ++++++++ .../typed/controllers/controller.d.ts.map | 1 + .../controllers/first-person-controller.d.ts | 119 ++++++ .../first-person-controller.d.ts.map | 1 + .../typed/controllers/globe-controller.d.ts | 17 + .../controllers/globe-controller.d.ts.map | 1 + .../typed/controllers/map-controller.d.ts | 160 ++++++++ .../typed/controllers/map-controller.d.ts.map | 1 + .../typed/controllers/orbit-controller.d.ts | 130 ++++++ .../controllers/orbit-controller.d.ts.map | 1 + .../controllers/orthographic-controller.d.ts | 19 + .../orthographic-controller.d.ts.map | 1 + .../typed/controllers/transition-manager.d.ts | 59 +++ .../controllers/transition-manager.d.ts.map | 1 + .../core/typed/controllers/view-state.d.ts | 71 ++++ .../typed/controllers/view-state.d.ts.map | 1 + modules/core/typed/debug/index.d.ts | 3 + modules/core/typed/debug/index.d.ts.map | 1 + modules/core/typed/debug/loggers.d.ts | 3 + modules/core/typed/debug/loggers.d.ts.map | 1 + .../typed/effects/lighting/ambient-light.d.ts | 19 + .../effects/lighting/ambient-light.d.ts.map | 1 + .../typed/effects/lighting/camera-light.d.ts | 6 + .../effects/lighting/camera-light.d.ts.map | 1 + .../effects/lighting/directional-light.d.ts | 31 ++ .../lighting/directional-light.d.ts.map | 1 + .../effects/lighting/lighting-effect.d.ts | 43 ++ .../effects/lighting/lighting-effect.d.ts.map | 1 + .../typed/effects/lighting/point-light.d.ts | 32 ++ .../effects/lighting/point-light.d.ts.map | 1 + .../typed/effects/lighting/sun-light.d.ts | 27 ++ .../typed/effects/lighting/sun-light.d.ts.map | 1 + .../core/typed/effects/lighting/suncalc.d.ts | 14 + .../typed/effects/lighting/suncalc.d.ts.map | 1 + .../core/typed/effects/mask/mask-effect.d.ts | 43 ++ .../typed/effects/mask/mask-effect.d.ts.map | 1 + modules/core/typed/effects/mask/utils.d.ts | 22 + .../core/typed/effects/mask/utils.d.ts.map | 1 + .../typed/effects/post-process-effect.d.ts | 16 + .../effects/post-process-effect.d.ts.map | 1 + modules/core/typed/index.d.ts | 82 ++++ modules/core/typed/index.d.ts.map | 1 + .../lib/attribute/attribute-manager.d.ts | 126 ++++++ .../lib/attribute/attribute-manager.d.ts.map | 1 + .../attribute-transition-manager.d.ts | 42 ++ .../attribute-transition-manager.d.ts.map | 1 + .../attribute/attribute-transition-utils.d.ts | 60 +++ .../attribute-transition-utils.d.ts.map | 1 + .../core/typed/lib/attribute/attribute.d.ts | 99 +++++ .../typed/lib/attribute/attribute.d.ts.map | 1 + .../core/typed/lib/attribute/data-column.d.ts | 93 +++++ .../typed/lib/attribute/data-column.d.ts.map | 1 + .../core/typed/lib/attribute/gl-utils.d.ts | 3 + .../typed/lib/attribute/gl-utils.d.ts.map | 1 + .../typed/lib/attribute/shader-attribute.d.ts | 17 + .../lib/attribute/shader-attribute.d.ts.map | 1 + modules/core/typed/lib/composite-layer.d.ts | 57 +++ .../core/typed/lib/composite-layer.d.ts.map | 1 + modules/core/typed/lib/constants.d.ts | 79 ++++ modules/core/typed/lib/constants.d.ts.map | 1 + modules/core/typed/lib/deck-picker.d.ts | 166 ++++++++ modules/core/typed/lib/deck-picker.d.ts.map | 1 + modules/core/typed/lib/deck-renderer.d.ts | 23 ++ modules/core/typed/lib/deck-renderer.d.ts.map | 1 + modules/core/typed/lib/deck.d.ts | 382 ++++++++++++++++++ modules/core/typed/lib/deck.d.ts.map | 1 + modules/core/typed/lib/effect-manager.d.ts | 14 + .../core/typed/lib/effect-manager.d.ts.map | 1 + modules/core/typed/lib/effect.d.ts | 19 + modules/core/typed/lib/effect.d.ts.map | 1 + modules/core/typed/lib/init.d.ts | 3 + modules/core/typed/lib/init.d.ts.map | 1 + modules/core/typed/lib/layer-extension.d.ts | 27 ++ .../core/typed/lib/layer-extension.d.ts.map | 1 + modules/core/typed/lib/layer-manager.d.ts | 87 ++++ modules/core/typed/lib/layer-manager.d.ts.map | 1 + modules/core/typed/lib/layer-state.d.ts | 56 +++ modules/core/typed/lib/layer-state.d.ts.map | 1 + modules/core/typed/lib/layer.d.ts | 189 +++++++++ modules/core/typed/lib/layer.d.ts.map | 1 + modules/core/typed/lib/picking/pick-info.d.ts | 68 ++++ .../core/typed/lib/picking/pick-info.d.ts.map | 1 + .../core/typed/lib/picking/query-object.d.ts | 47 +++ .../typed/lib/picking/query-object.d.ts.map | 1 + .../typed/lib/resource/resource-manager.d.ts | 45 +++ .../lib/resource/resource-manager.d.ts.map | 1 + modules/core/typed/lib/resource/resource.d.ts | 24 ++ .../core/typed/lib/resource/resource.d.ts.map | 1 + modules/core/typed/lib/tooltip.d.ts | 17 + modules/core/typed/lib/tooltip.d.ts.map | 1 + .../typed/lib/uniform-transition-manager.d.ts | 11 + .../lib/uniform-transition-manager.d.ts.map | 1 + modules/core/typed/lib/view-manager.d.ts | 98 +++++ modules/core/typed/lib/view-manager.d.ts.map | 1 + .../core/typed/lifecycle/component-state.d.ts | 32 ++ .../typed/lifecycle/component-state.d.ts.map | 1 + modules/core/typed/lifecycle/component.d.ts | 23 ++ .../core/typed/lifecycle/component.d.ts.map | 1 + modules/core/typed/lifecycle/constants.d.ts | 14 + .../core/typed/lifecycle/constants.d.ts.map | 1 + .../core/typed/lifecycle/create-props.d.ts | 7 + .../typed/lifecycle/create-props.d.ts.map | 1 + modules/core/typed/lifecycle/prop-types.d.ts | 94 +++++ .../core/typed/lifecycle/prop-types.d.ts.map | 1 + modules/core/typed/lifecycle/props.d.ts | 40 ++ modules/core/typed/lifecycle/props.d.ts.map | 1 + .../core/typed/passes/draw-layers-pass.d.ts | 5 + .../typed/passes/draw-layers-pass.d.ts.map | 1 + modules/core/typed/passes/layers-pass.d.ts | 57 +++ .../core/typed/passes/layers-pass.d.ts.map | 1 + modules/core/typed/passes/mask-pass.d.ts | 24 ++ modules/core/typed/passes/mask-pass.d.ts.map | 1 + modules/core/typed/passes/pass.d.ts | 16 + modules/core/typed/passes/pass.d.ts.map | 1 + .../core/typed/passes/pick-layers-pass.d.ts | 46 +++ .../typed/passes/pick-layers-pass.d.ts.map | 1 + modules/core/typed/passes/screen-pass.d.ts | 31 ++ .../core/typed/passes/screen-pass.d.ts.map | 1 + modules/core/typed/passes/shadow-pass.d.ts | 21 + .../core/typed/passes/shadow-pass.d.ts.map | 1 + modules/core/typed/shaderlib/index.d.ts | 28 ++ modules/core/typed/shaderlib/index.d.ts.map | 1 + .../core/typed/shaderlib/misc/geometry.d.ts | 4 + .../typed/shaderlib/misc/geometry.d.ts.map | 1 + .../core/typed/shaderlib/picking/picking.d.ts | 14 + .../typed/shaderlib/picking/picking.d.ts.map | 1 + .../shaderlib/project/project-functions.d.ts | 43 ++ .../project/project-functions.d.ts.map | 1 + .../core/typed/shaderlib/project/project.d.ts | 5 + .../typed/shaderlib/project/project.d.ts.map | 1 + .../typed/shaderlib/project/project.glsl.d.ts | 3 + .../shaderlib/project/project.glsl.d.ts.map | 1 + .../shaderlib/project/viewport-uniforms.d.ts | 61 +++ .../project/viewport-uniforms.d.ts.map | 1 + .../typed/shaderlib/project32/project32.d.ts | 4 + .../shaderlib/project32/project32.d.ts.map | 1 + .../core/typed/shaderlib/shadow/shadow.d.ts | 17 + .../typed/shaderlib/shadow/shadow.d.ts.map | 1 + .../cpu-interpolation-transition.d.ts | 7 + .../cpu-interpolation-transition.d.ts.map | 1 + .../transitions/cpu-spring-transition.d.ts | 8 + .../cpu-spring-transition.d.ts.map | 1 + .../transitions/fly-to-interpolator.d.ts | 37 ++ .../transitions/fly-to-interpolator.d.ts.map | 1 + .../gpu-interpolation-transition.d.ts | 31 ++ .../gpu-interpolation-transition.d.ts.map | 1 + .../transitions/gpu-spring-transition.d.ts | 33 ++ .../gpu-spring-transition.d.ts.map | 1 + .../typed/transitions/gpu-transition.d.ts | 11 + .../typed/transitions/gpu-transition.d.ts.map | 1 + .../transitions/linear-interpolator.d.ts | 51 +++ .../transitions/linear-interpolator.d.ts.map | 1 + .../transitions/transition-interpolator.d.ts | 55 +++ .../transition-interpolator.d.ts.map | 1 + .../core/typed/transitions/transition.d.ts | 46 +++ .../typed/transitions/transition.d.ts.map | 1 + modules/core/typed/types/layer-props.d.ts | 246 +++++++++++ modules/core/typed/types/layer-props.d.ts.map | 1 + modules/core/typed/types/types.d.ts | 13 + modules/core/typed/types/types.d.ts.map | 1 + modules/core/typed/utils/array-utils.d.ts | 16 + modules/core/typed/utils/array-utils.d.ts.map | 1 + modules/core/typed/utils/assert.d.ts | 2 + modules/core/typed/utils/assert.d.ts.map | 1 + modules/core/typed/utils/color.d.ts | 14 + modules/core/typed/utils/color.d.ts.map | 1 + modules/core/typed/utils/count.d.ts | 9 + modules/core/typed/utils/count.d.ts.map | 1 + modules/core/typed/utils/deep-equal.d.ts | 2 + modules/core/typed/utils/deep-equal.d.ts.map | 1 + modules/core/typed/utils/flatten.d.ts | 29 ++ modules/core/typed/utils/flatten.d.ts.map | 1 + modules/core/typed/utils/iterable-utils.d.ts | 26 ++ .../core/typed/utils/iterable-utils.d.ts.map | 1 + modules/core/typed/utils/json-loader.d.ts | 4 + modules/core/typed/utils/json-loader.d.ts.map | 1 + modules/core/typed/utils/log.d.ts | 4 + modules/core/typed/utils/log.d.ts.map | 1 + modules/core/typed/utils/math-utils.d.ts | 44 ++ modules/core/typed/utils/math-utils.d.ts.map | 1 + modules/core/typed/utils/memoize.d.ts | 7 + modules/core/typed/utils/memoize.d.ts.map | 1 + modules/core/typed/utils/positions.d.ts | 7 + modules/core/typed/utils/positions.d.ts.map | 1 + modules/core/typed/utils/range.d.ts | 4 + modules/core/typed/utils/range.d.ts.map | 1 + modules/core/typed/utils/shader.d.ts | 2 + modules/core/typed/utils/shader.d.ts.map | 1 + modules/core/typed/utils/tesselator.d.ts | 68 ++++ modules/core/typed/utils/tesselator.d.ts.map | 1 + modules/core/typed/utils/texture.d.ts | 5 + modules/core/typed/utils/texture.d.ts.map | 1 + .../core/typed/utils/typed-array-manager.d.ts | 39 ++ .../typed/utils/typed-array-manager.d.ts.map | 1 + .../viewports/first-person-viewport.d.ts | 43 ++ .../viewports/first-person-viewport.d.ts.map | 1 + .../core/typed/viewports/globe-viewport.d.ts | 55 +++ .../typed/viewports/globe-viewport.d.ts.map | 1 + .../core/typed/viewports/orbit-viewport.d.ts | 47 +++ .../typed/viewports/orbit-viewport.d.ts.map | 1 + .../viewports/orthographic-viewport.d.ts | 34 ++ .../viewports/orthographic-viewport.d.ts.map | 1 + modules/core/typed/viewports/viewport.d.ts | 189 +++++++++ .../core/typed/viewports/viewport.d.ts.map | 1 + .../viewports/web-mercator-viewport.d.ts | 105 +++++ .../viewports/web-mercator-viewport.d.ts.map | 1 + .../core/typed/views/first-person-view.d.ts | 40 ++ .../typed/views/first-person-view.d.ts.map | 1 + modules/core/typed/views/globe-view.d.ts | 32 ++ modules/core/typed/views/globe-view.d.ts.map | 1 + modules/core/typed/views/map-view.d.ts | 49 +++ modules/core/typed/views/map-view.d.ts.map | 1 + modules/core/typed/views/orbit-view.d.ts | 43 ++ modules/core/typed/views/orbit-view.d.ts.map | 1 + .../core/typed/views/orthographic-view.d.ts | 29 ++ .../typed/views/orthographic-view.d.ts.map | 1 + modules/core/typed/views/view.d.ts | 86 ++++ modules/core/typed/views/view.d.ts.map | 1 + .../extensions/typed/brushing/brushing.d.ts | 44 ++ .../typed/brushing/brushing.d.ts.map | 1 + .../typed/brushing/shader-module.d.ts | 12 + .../typed/brushing/shader-module.d.ts.map | 1 + modules/extensions/typed/clip/clip.d.ts | 29 ++ modules/extensions/typed/clip/clip.d.ts.map | 1 + .../typed/data-filter/aggregator.d.ts | 16 + .../typed/data-filter/aggregator.d.ts.map | 1 + .../typed/data-filter/data-filter.d.ts | 97 +++++ .../typed/data-filter/data-filter.d.ts.map | 1 + .../typed/data-filter/shader-module.d.ts | 9 + .../typed/data-filter/shader-module.d.ts.map | 1 + .../typed/fill-style/fill-style.d.ts | 97 +++++ .../typed/fill-style/fill-style.d.ts.map | 1 + .../typed/fill-style/shaders.glsl.d.ts | 14 + .../typed/fill-style/shaders.glsl.d.ts.map | 1 + modules/extensions/typed/fp64/fp64.d.ts | 8 + modules/extensions/typed/fp64/fp64.d.ts.map | 1 + modules/extensions/typed/fp64/project64.d.ts | 7 + .../extensions/typed/fp64/project64.d.ts.map | 1 + .../extensions/typed/fp64/project64.glsl.d.ts | 3 + .../typed/fp64/project64.glsl.d.ts.map | 1 + modules/extensions/typed/index.d.ts | 15 + modules/extensions/typed/index.d.ts.map | 1 + modules/extensions/typed/mask/mask.d.ts | 25 ++ modules/extensions/typed/mask/mask.d.ts.map | 1 + .../extensions/typed/mask/shader-module.d.ts | 8 + .../typed/mask/shader-module.d.ts.map | 1 + .../typed/path-style/path-style.d.ts | 74 ++++ .../typed/path-style/path-style.d.ts.map | 1 + .../typed/path-style/shaders.glsl.d.ts | 17 + .../typed/path-style/shaders.glsl.d.ts.map | 1 + .../typed/geo-cell-layer/GeoCellLayer.d.ts | 15 + .../geo-cell-layer/GeoCellLayer.d.ts.map | 1 + .../typed/geohash-layer/geohash-layer.d.ts | 24 ++ .../geohash-layer/geohash-layer.d.ts.map | 1 + .../typed/geohash-layer/geohash-utils.d.ts | 3 + .../geohash-layer/geohash-utils.d.ts.map | 1 + .../great-circle-layer.d.ts | 12 + .../great-circle-layer.d.ts.map | 1 + .../typed/h3-layers/h3-cluster-layer.d.ts | 27 ++ .../typed/h3-layers/h3-cluster-layer.d.ts.map | 1 + .../typed/h3-layers/h3-hexagon-layer.d.ts | 75 ++++ .../typed/h3-layers/h3-hexagon-layer.d.ts.map | 1 + modules/geo-layers/typed/index.d.ts | 28 ++ modules/geo-layers/typed/index.d.ts.map | 1 + .../mesh-layer/mesh-layer-fragment.glsl.d.ts | 3 + .../mesh-layer-fragment.glsl.d.ts.map | 1 + .../mesh-layer/mesh-layer-vertex.glsl.d.ts | 3 + .../mesh-layer-vertex.glsl.d.ts.map | 1 + .../typed/mesh-layer/mesh-layer.d.ts | 42 ++ .../typed/mesh-layer/mesh-layer.d.ts.map | 1 + .../typed/mvt-layer/coordinate-transform.d.ts | 4 + .../mvt-layer/coordinate-transform.d.ts.map | 1 + .../typed/mvt-layer/find-index-binary.d.ts | 17 + .../mvt-layer/find-index-binary.d.ts.map | 1 + .../geo-layers/typed/mvt-layer/mvt-layer.d.ts | 94 +++++ .../typed/mvt-layer/mvt-layer.d.ts.map | 1 + .../typed/quadkey-layer/quadkey-layer.d.ts | 25 ++ .../quadkey-layer/quadkey-layer.d.ts.map | 1 + .../typed/quadkey-layer/quadkey-utils.d.ts | 3 + .../quadkey-layer/quadkey-utils.d.ts.map | 1 + .../typed/s2-layer/s2-geometry.d.ts | 18 + .../typed/s2-layer/s2-geometry.d.ts.map | 1 + .../geo-layers/typed/s2-layer/s2-layer.d.ts | 24 ++ .../typed/s2-layer/s2-layer.d.ts.map | 1 + .../geo-layers/typed/s2-layer/s2-utils.d.ts | 9 + .../typed/s2-layer/s2-utils.d.ts.map | 1 + .../typed/terrain-layer/terrain-layer.d.ts | 86 ++++ .../terrain-layer/terrain-layer.d.ts.map | 1 + .../typed/tile-3d-layer/tile-3d-layer.d.ts | 76 ++++ .../tile-3d-layer/tile-3d-layer.d.ts.map | 1 + .../typed/tile-layer/tile-2d-header.d.ts | 40 ++ .../typed/tile-layer/tile-2d-header.d.ts.map | 1 + .../typed/tile-layer/tile-2d-traversal.d.ts | 9 + .../tile-layer/tile-2d-traversal.d.ts.map | 1 + .../typed/tile-layer/tile-layer.d.ts | 129 ++++++ .../typed/tile-layer/tile-layer.d.ts.map | 1 + .../typed/tile-layer/tileset-2d.d.ts | 127 ++++++ .../typed/tile-layer/tileset-2d.d.ts.map | 1 + .../geo-layers/typed/tile-layer/types.d.ts | 30 ++ .../typed/tile-layer/types.d.ts.map | 1 + .../geo-layers/typed/tile-layer/utils.d.ts | 74 ++++ .../typed/tile-layer/utils.d.ts.map | 1 + .../typed/trips-layer/trips-layer.d.ts | 40 ++ .../typed/trips-layer/trips-layer.d.ts.map | 1 + .../typed/google-maps-overlay.d.ts | 35 ++ .../typed/google-maps-overlay.d.ts.map | 1 + modules/google-maps/typed/index.d.ts | 3 + modules/google-maps/typed/index.d.ts.map | 1 + modules/google-maps/typed/utils.d.ts | 74 ++++ modules/google-maps/typed/utils.d.ts.map | 1 + .../json/typed/helpers/convert-functions.d.ts | 2 + .../typed/helpers/convert-functions.d.ts.map | 1 + .../json/typed/helpers/execute-function.d.ts | 2 + .../typed/helpers/execute-function.d.ts.map | 1 + .../json/typed/helpers/instantiate-class.d.ts | 2 + .../typed/helpers/instantiate-class.d.ts.map | 1 + .../helpers/parse-expression-string.d.ts | 2 + .../helpers/parse-expression-string.d.ts.map | 1 + modules/json/typed/helpers/parse-json.d.ts | 2 + .../json/typed/helpers/parse-json.d.ts.map | 1 + modules/json/typed/index.d.ts | 7 + modules/json/typed/index.d.ts.map | 1 + modules/json/typed/json-configuration.d.ts | 18 + .../json/typed/json-configuration.d.ts.map | 1 + modules/json/typed/json-converter.d.ts | 19 + modules/json/typed/json-converter.d.ts.map | 1 + modules/json/typed/syntactic-sugar.d.ts | 6 + modules/json/typed/syntactic-sugar.d.ts.map | 1 + modules/json/typed/transports/transport.d.ts | 35 ++ .../json/typed/transports/transport.d.ts.map | 1 + modules/json/typed/utils/assert.d.ts | 2 + modules/json/typed/utils/assert.d.ts.map | 1 + modules/json/typed/utils/get.d.ts | 9 + modules/json/typed/utils/get.d.ts.map | 1 + .../typed/utils/shallow-equal-objects.d.ts | 2 + .../utils/shallow-equal-objects.d.ts.map | 1 + .../arc-layer/arc-layer-fragment.glsl.d.ts | 3 + .../arc-layer-fragment.glsl.d.ts.map | 1 + .../arc-layer/arc-layer-vertex.glsl.d.ts | 3 + .../arc-layer/arc-layer-vertex.glsl.d.ts.map | 1 + modules/layers/typed/arc-layer/arc-layer.d.ts | 95 +++++ .../layers/typed/arc-layer/arc-layer.d.ts.map | 1 + .../bitmap-layer/bitmap-layer-fragment.d.ts | 3 + .../bitmap-layer-fragment.d.ts.map | 1 + .../bitmap-layer/bitmap-layer-vertex.d.ts | 3 + .../bitmap-layer/bitmap-layer-vertex.d.ts.map | 1 + .../typed/bitmap-layer/bitmap-layer.d.ts | 101 +++++ .../typed/bitmap-layer/bitmap-layer.d.ts.map | 1 + .../typed/bitmap-layer/create-mesh.d.ts | 17 + .../typed/bitmap-layer/create-mesh.d.ts.map | 1 + .../typed/column-layer/column-geometry.d.ts | 13 + .../column-layer/column-geometry.d.ts.map | 1 + .../column-layer-fragment.glsl.d.ts | 3 + .../column-layer-fragment.glsl.d.ts.map | 1 + .../column-layer-vertex.glsl.d.ts | 3 + .../column-layer-vertex.glsl.d.ts.map | 1 + .../typed/column-layer/column-layer.d.ts | 176 ++++++++ .../typed/column-layer/column-layer.d.ts.map | 1 + .../typed/column-layer/grid-cell-layer.d.ts | 23 ++ .../column-layer/grid-cell-layer.d.ts.map | 1 + .../typed/geojson-layer/geojson-binary.d.ts | 25 ++ .../geojson-layer/geojson-binary.d.ts.map | 1 + .../geojson-layer/geojson-layer-props.d.ts | 26 ++ .../geojson-layer-props.d.ts.map | 1 + .../typed/geojson-layer/geojson-layer.d.ts | 267 ++++++++++++ .../geojson-layer/geojson-layer.d.ts.map | 1 + .../layers/typed/geojson-layer/geojson.d.ts | 38 ++ .../typed/geojson-layer/geojson.d.ts.map | 1 + .../typed/geojson-layer/sub-layer-map.d.ts | 119 ++++++ .../geojson-layer/sub-layer-map.d.ts.map | 1 + .../icon-layer/icon-layer-fragment.glsl.d.ts | 3 + .../icon-layer-fragment.glsl.d.ts.map | 1 + .../icon-layer/icon-layer-vertex.glsl.d.ts | 3 + .../icon-layer-vertex.glsl.d.ts.map | 1 + .../layers/typed/icon-layer/icon-layer.d.ts | 106 +++++ .../typed/icon-layer/icon-layer.d.ts.map | 1 + .../layers/typed/icon-layer/icon-manager.d.ts | 146 +++++++ .../typed/icon-layer/icon-manager.d.ts.map | 1 + modules/layers/typed/index.d.ts | 31 ++ modules/layers/typed/index.d.ts.map | 1 + .../line-layer/line-layer-fragment.glsl.d.ts | 3 + .../line-layer-fragment.glsl.d.ts.map | 1 + .../line-layer/line-layer-vertex.glsl.d.ts | 3 + .../line-layer-vertex.glsl.d.ts.map | 1 + .../layers/typed/line-layer/line-layer.d.ts | 73 ++++ .../typed/line-layer/line-layer.d.ts.map | 1 + .../path-layer/path-layer-fragment.glsl.d.ts | 3 + .../path-layer-fragment.glsl.d.ts.map | 1 + .../path-layer/path-layer-vertex.glsl.d.ts | 3 + .../path-layer-vertex.glsl.d.ts.map | 1 + .../layers/typed/path-layer/path-layer.d.ts | 106 +++++ .../typed/path-layer/path-layer.d.ts.map | 1 + .../typed/path-layer/path-tesselator.d.ts | 37 ++ .../typed/path-layer/path-tesselator.d.ts.map | 1 + modules/layers/typed/path-layer/path.d.ts | 18 + modules/layers/typed/path-layer/path.d.ts.map | 1 + .../point-cloud-layer-fragment.glsl.d.ts | 3 + .../point-cloud-layer-fragment.glsl.d.ts.map | 1 + .../point-cloud-layer-vertex.glsl.d.ts | 3 + .../point-cloud-layer-vertex.glsl.d.ts.map | 1 + .../point-cloud-layer/point-cloud-layer.d.ts | 69 ++++ .../point-cloud-layer.d.ts.map | 1 + .../typed/polygon-layer/polygon-layer.d.ts | 179 ++++++++ .../polygon-layer/polygon-layer.d.ts.map | 1 + .../scatterplot-layer-fragment.glsl.d.ts | 3 + .../scatterplot-layer-fragment.glsl.d.ts.map | 1 + .../scatterplot-layer-vertex.glsl.d.ts | 3 + .../scatterplot-layer-vertex.glsl.d.ts.map | 1 + .../scatterplot-layer/scatterplot-layer.d.ts | 127 ++++++ .../scatterplot-layer.d.ts.map | 1 + .../polygon-tesselator.d.ts | 53 +++ .../polygon-tesselator.d.ts.map | 1 + .../typed/solid-polygon-layer/polygon.d.ts | 44 ++ .../solid-polygon-layer/polygon.d.ts.map | 1 + .../solid-polygon-layer-fragment.glsl.d.ts | 3 + ...solid-polygon-layer-fragment.glsl.d.ts.map | 1 + .../solid-polygon-layer-vertex-main.glsl.d.ts | 3 + ...id-polygon-layer-vertex-main.glsl.d.ts.map | 1 + .../solid-polygon-layer-vertex-side.glsl.d.ts | 3 + ...id-polygon-layer-vertex-side.glsl.d.ts.map | 1 + .../solid-polygon-layer-vertex-top.glsl.d.ts | 3 + ...lid-polygon-layer-vertex-top.glsl.d.ts.map | 1 + .../solid-polygon-layer.d.ts | 104 +++++ .../solid-polygon-layer.d.ts.map | 1 + .../typed/text-layer/font-atlas-manager.d.ts | 75 ++++ .../text-layer/font-atlas-manager.d.ts.map | 1 + .../layers/typed/text-layer/lru-cache.d.ts | 19 + .../typed/text-layer/lru-cache.d.ts.map | 1 + .../multi-icon-layer-fragment.glsl.d.ts | 3 + .../multi-icon-layer-fragment.glsl.d.ts.map | 1 + .../multi-icon-layer/multi-icon-layer.d.ts | 31 ++ .../multi-icon-layer.d.ts.map | 1 + .../text-background-layer-fragment.glsl.d.ts | 3 + ...xt-background-layer-fragment.glsl.d.ts.map | 1 + .../text-background-layer-vertex.glsl.d.ts | 3 + ...text-background-layer-vertex.glsl.d.ts.map | 1 + .../text-background-layer.d.ts | 45 +++ .../text-background-layer.d.ts.map | 1 + .../layers/typed/text-layer/text-layer.d.ts | 177 ++++++++ .../typed/text-layer/text-layer.d.ts.map | 1 + modules/layers/typed/text-layer/utils.d.ts | 105 +++++ .../layers/typed/text-layer/utils.d.ts.map | 1 + modules/layers/typed/utils.d.ts | 18 + modules/layers/typed/utils.d.ts.map | 1 + modules/main/typed/index.d.ts | 146 +++++++ modules/main/typed/index.d.ts.map | 1 + modules/mapbox/typed/deck-utils.d.ts | 29 ++ modules/mapbox/typed/deck-utils.d.ts.map | 1 + modules/mapbox/typed/index.d.ts | 4 + modules/mapbox/typed/index.d.ts.map | 1 + modules/mapbox/typed/mapbox-layer.d.ts | 21 + modules/mapbox/typed/mapbox-layer.d.ts.map | 1 + modules/mapbox/typed/mapbox-overlay.d.ts | 57 +++ modules/mapbox/typed/mapbox-overlay.d.ts.map | 1 + modules/mapbox/typed/resolve-layers.d.ts | 10 + modules/mapbox/typed/resolve-layers.d.ts.map | 1 + modules/mesh-layers/typed/index.d.ts | 5 + modules/mesh-layers/typed/index.d.ts.map | 1 + .../typed/scenegraph-layer/gltf-utils.d.ts | 3 + .../scenegraph-layer/gltf-utils.d.ts.map | 1 + .../scenegraph-layer-fragment.glsl.d.ts | 3 + .../scenegraph-layer-fragment.glsl.d.ts.map | 1 + .../scenegraph-layer-vertex.glsl.d.ts | 3 + .../scenegraph-layer-vertex.glsl.d.ts.map | 1 + .../scenegraph-layer/scenegraph-layer.d.ts | 143 +++++++ .../scenegraph-layer.d.ts.map | 1 + .../simple-mesh-layer-fragment.glsl.d.ts | 3 + .../simple-mesh-layer-fragment.glsl.d.ts.map | 1 + .../simple-mesh-layer-vertex.glsl.d.ts | 3 + .../simple-mesh-layer-vertex.glsl.d.ts.map | 1 + .../simple-mesh-layer/simple-mesh-layer.d.ts | 105 +++++ .../simple-mesh-layer.d.ts.map | 1 + modules/mesh-layers/typed/utils/matrix.d.ts | 34 ++ .../mesh-layers/typed/utils/matrix.d.ts.map | 1 + modules/react/typed/deckgl.d.ts | 32 ++ modules/react/typed/deckgl.d.ts.map | 1 + modules/react/typed/index.d.ts | 5 + modules/react/typed/index.d.ts.map | 1 + .../react/typed/utils/evaluate-children.d.ts | 7 + .../typed/utils/evaluate-children.d.ts.map | 1 + .../react/typed/utils/extract-jsx-layers.d.ts | 17 + .../typed/utils/extract-jsx-layers.d.ts.map | 1 + modules/react/typed/utils/extract-styles.d.ts | 14 + .../react/typed/utils/extract-styles.d.ts.map | 1 + modules/react/typed/utils/inherits-from.d.ts | 2 + .../react/typed/utils/inherits-from.d.ts.map | 1 + .../utils/position-children-under-views.d.ts | 19 + .../position-children-under-views.d.ts.map | 1 + .../utils/use-isomorphic-layout-effect.d.ts | 4 + .../use-isomorphic-layout-effect.d.ts.map | 1 + .../mapbox-layers-react.jsx | 2 +- .../mapbox-overlay-react.jsx | 2 +- 651 files changed, 13133 insertions(+), 12 deletions(-) create mode 100644 modules/aggregation-layers/typed/aggregation-layer.d.ts create mode 100644 modules/aggregation-layers/typed/aggregation-layer.d.ts.map create mode 100644 modules/aggregation-layers/typed/contour-layer/contour-layer.d.ts create mode 100644 modules/aggregation-layers/typed/contour-layer/contour-layer.d.ts.map create mode 100644 modules/aggregation-layers/typed/contour-layer/contour-utils.d.ts create mode 100644 modules/aggregation-layers/typed/contour-layer/contour-utils.d.ts.map create mode 100644 modules/aggregation-layers/typed/contour-layer/marching-squares-codes.d.ts create mode 100644 modules/aggregation-layers/typed/contour-layer/marching-squares-codes.d.ts.map create mode 100644 modules/aggregation-layers/typed/contour-layer/marching-squares.d.ts create mode 100644 modules/aggregation-layers/typed/contour-layer/marching-squares.d.ts.map create mode 100644 modules/aggregation-layers/typed/cpu-grid-layer/cpu-grid-layer.d.ts create mode 100644 modules/aggregation-layers/typed/cpu-grid-layer/cpu-grid-layer.d.ts.map create mode 100644 modules/aggregation-layers/typed/cpu-grid-layer/grid-aggregator.d.ts create mode 100644 modules/aggregation-layers/typed/cpu-grid-layer/grid-aggregator.d.ts.map create mode 100644 modules/aggregation-layers/typed/gpu-grid-layer/gpu-grid-cell-layer-fragment.glsl.d.ts create mode 100644 modules/aggregation-layers/typed/gpu-grid-layer/gpu-grid-cell-layer-fragment.glsl.d.ts.map create mode 100644 modules/aggregation-layers/typed/gpu-grid-layer/gpu-grid-cell-layer-vertex.glsl.d.ts create mode 100644 modules/aggregation-layers/typed/gpu-grid-layer/gpu-grid-cell-layer-vertex.glsl.d.ts.map create mode 100644 modules/aggregation-layers/typed/gpu-grid-layer/gpu-grid-cell-layer.d.ts create mode 100644 modules/aggregation-layers/typed/gpu-grid-layer/gpu-grid-cell-layer.d.ts.map create mode 100644 modules/aggregation-layers/typed/gpu-grid-layer/gpu-grid-layer.d.ts create mode 100644 modules/aggregation-layers/typed/gpu-grid-layer/gpu-grid-layer.d.ts.map create mode 100644 modules/aggregation-layers/typed/grid-aggregation-layer.d.ts create mode 100644 modules/aggregation-layers/typed/grid-aggregation-layer.d.ts.map create mode 100644 modules/aggregation-layers/typed/grid-layer/grid-layer.d.ts create mode 100644 modules/aggregation-layers/typed/grid-layer/grid-layer.d.ts.map create mode 100644 modules/aggregation-layers/typed/heatmap-layer/heatmap-layer-utils.d.ts create mode 100644 modules/aggregation-layers/typed/heatmap-layer/heatmap-layer-utils.d.ts.map create mode 100644 modules/aggregation-layers/typed/heatmap-layer/heatmap-layer.d.ts create mode 100644 modules/aggregation-layers/typed/heatmap-layer/heatmap-layer.d.ts.map create mode 100644 modules/aggregation-layers/typed/heatmap-layer/max-fs.glsl.d.ts create mode 100644 modules/aggregation-layers/typed/heatmap-layer/max-fs.glsl.d.ts.map create mode 100644 modules/aggregation-layers/typed/heatmap-layer/max-vs.glsl.d.ts create mode 100644 modules/aggregation-layers/typed/heatmap-layer/max-vs.glsl.d.ts.map create mode 100644 modules/aggregation-layers/typed/heatmap-layer/triangle-layer-fragment.glsl.d.ts create mode 100644 modules/aggregation-layers/typed/heatmap-layer/triangle-layer-fragment.glsl.d.ts.map create mode 100644 modules/aggregation-layers/typed/heatmap-layer/triangle-layer-vertex.glsl.d.ts create mode 100644 modules/aggregation-layers/typed/heatmap-layer/triangle-layer-vertex.glsl.d.ts.map create mode 100644 modules/aggregation-layers/typed/heatmap-layer/triangle-layer.d.ts create mode 100644 modules/aggregation-layers/typed/heatmap-layer/triangle-layer.d.ts.map create mode 100644 modules/aggregation-layers/typed/heatmap-layer/weights-fs.glsl.d.ts create mode 100644 modules/aggregation-layers/typed/heatmap-layer/weights-fs.glsl.d.ts.map create mode 100644 modules/aggregation-layers/typed/heatmap-layer/weights-vs.glsl.d.ts create mode 100644 modules/aggregation-layers/typed/heatmap-layer/weights-vs.glsl.d.ts.map create mode 100644 modules/aggregation-layers/typed/hexagon-layer/hexagon-aggregator.d.ts create mode 100644 modules/aggregation-layers/typed/hexagon-layer/hexagon-aggregator.d.ts.map create mode 100644 modules/aggregation-layers/typed/hexagon-layer/hexagon-layer.d.ts create mode 100644 modules/aggregation-layers/typed/hexagon-layer/hexagon-layer.d.ts.map create mode 100644 modules/aggregation-layers/typed/index.d.ts create mode 100644 modules/aggregation-layers/typed/index.d.ts.map create mode 100644 modules/aggregation-layers/typed/screen-grid-layer/screen-grid-cell-layer.d.ts create mode 100644 modules/aggregation-layers/typed/screen-grid-layer/screen-grid-cell-layer.d.ts.map create mode 100644 modules/aggregation-layers/typed/screen-grid-layer/screen-grid-layer-fragment.glsl.d.ts create mode 100644 modules/aggregation-layers/typed/screen-grid-layer/screen-grid-layer-fragment.glsl.d.ts.map create mode 100644 modules/aggregation-layers/typed/screen-grid-layer/screen-grid-layer-vertex.glsl.d.ts create mode 100644 modules/aggregation-layers/typed/screen-grid-layer/screen-grid-layer-vertex.glsl.d.ts.map create mode 100644 modules/aggregation-layers/typed/screen-grid-layer/screen-grid-layer.d.ts create mode 100644 modules/aggregation-layers/typed/screen-grid-layer/screen-grid-layer.d.ts.map create mode 100644 modules/aggregation-layers/typed/types.d.ts create mode 100644 modules/aggregation-layers/typed/types.d.ts.map create mode 100644 modules/aggregation-layers/typed/utils/aggregation-operation-utils.d.ts create mode 100644 modules/aggregation-layers/typed/utils/aggregation-operation-utils.d.ts.map create mode 100644 modules/aggregation-layers/typed/utils/bin-sorter.d.ts create mode 100644 modules/aggregation-layers/typed/utils/bin-sorter.d.ts.map create mode 100644 modules/aggregation-layers/typed/utils/color-utils.d.ts create mode 100644 modules/aggregation-layers/typed/utils/color-utils.d.ts.map create mode 100644 modules/aggregation-layers/typed/utils/cpu-aggregator.d.ts create mode 100644 modules/aggregation-layers/typed/utils/cpu-aggregator.d.ts.map create mode 100644 modules/aggregation-layers/typed/utils/gpu-grid-aggregation/aggregate-all-fs.glsl.d.ts create mode 100644 modules/aggregation-layers/typed/utils/gpu-grid-aggregation/aggregate-all-fs.glsl.d.ts.map create mode 100644 modules/aggregation-layers/typed/utils/gpu-grid-aggregation/aggregate-all-vs.glsl.d.ts create mode 100644 modules/aggregation-layers/typed/utils/gpu-grid-aggregation/aggregate-all-vs.glsl.d.ts.map create mode 100644 modules/aggregation-layers/typed/utils/gpu-grid-aggregation/aggregate-to-grid-fs.glsl.d.ts create mode 100644 modules/aggregation-layers/typed/utils/gpu-grid-aggregation/aggregate-to-grid-fs.glsl.d.ts.map create mode 100644 modules/aggregation-layers/typed/utils/gpu-grid-aggregation/aggregate-to-grid-vs.glsl.d.ts create mode 100644 modules/aggregation-layers/typed/utils/gpu-grid-aggregation/aggregate-to-grid-vs.glsl.d.ts.map create mode 100644 modules/aggregation-layers/typed/utils/gpu-grid-aggregation/gpu-grid-aggregator-constants.d.ts create mode 100644 modules/aggregation-layers/typed/utils/gpu-grid-aggregation/gpu-grid-aggregator-constants.d.ts.map create mode 100644 modules/aggregation-layers/typed/utils/gpu-grid-aggregation/gpu-grid-aggregator-utils.d.ts create mode 100644 modules/aggregation-layers/typed/utils/gpu-grid-aggregation/gpu-grid-aggregator-utils.d.ts.map create mode 100644 modules/aggregation-layers/typed/utils/gpu-grid-aggregation/gpu-grid-aggregator.d.ts create mode 100644 modules/aggregation-layers/typed/utils/gpu-grid-aggregation/gpu-grid-aggregator.d.ts.map create mode 100644 modules/aggregation-layers/typed/utils/gpu-grid-aggregation/transform-mean-vs.glsl.d.ts create mode 100644 modules/aggregation-layers/typed/utils/gpu-grid-aggregation/transform-mean-vs.glsl.d.ts.map create mode 100644 modules/aggregation-layers/typed/utils/grid-aggregation-utils.d.ts create mode 100644 modules/aggregation-layers/typed/utils/grid-aggregation-utils.d.ts.map create mode 100644 modules/aggregation-layers/typed/utils/prop-utils.d.ts create mode 100644 modules/aggregation-layers/typed/utils/prop-utils.d.ts.map create mode 100644 modules/aggregation-layers/typed/utils/resource-utils.d.ts create mode 100644 modules/aggregation-layers/typed/utils/resource-utils.d.ts.map create mode 100644 modules/aggregation-layers/typed/utils/scale-utils.d.ts create mode 100644 modules/aggregation-layers/typed/utils/scale-utils.d.ts.map create mode 100644 modules/carto/typed/api/carto-api-error.d.ts create mode 100644 modules/carto/typed/api/carto-api-error.d.ts.map create mode 100644 modules/carto/typed/api/index.d.ts create mode 100644 modules/carto/typed/api/index.d.ts.map create mode 100644 modules/carto/typed/api/layer-map.d.ts create mode 100644 modules/carto/typed/api/layer-map.d.ts.map create mode 100644 modules/carto/typed/api/maps-api-common.d.ts create mode 100644 modules/carto/typed/api/maps-api-common.d.ts.map create mode 100644 modules/carto/typed/api/maps-client.d.ts create mode 100644 modules/carto/typed/api/maps-client.d.ts.map create mode 100644 modules/carto/typed/api/maps-v3-client.d.ts create mode 100644 modules/carto/typed/api/maps-v3-client.d.ts.map create mode 100644 modules/carto/typed/api/parseMap.d.ts create mode 100644 modules/carto/typed/api/parseMap.d.ts.map create mode 100644 modules/carto/typed/api/types.d.ts create mode 100644 modules/carto/typed/api/types.d.ts.map create mode 100644 modules/carto/typed/basemap.d.ts create mode 100644 modules/carto/typed/basemap.d.ts.map create mode 100644 modules/carto/typed/config.d.ts create mode 100644 modules/carto/typed/config.d.ts.map create mode 100644 modules/carto/typed/index.d.ts create mode 100644 modules/carto/typed/index.d.ts.map create mode 100644 modules/carto/typed/layers/carto-layer.d.ts create mode 100644 modules/carto/typed/layers/carto-layer.d.ts.map create mode 100644 modules/carto/typed/layers/carto-tile-layer.d.ts create mode 100644 modules/carto/typed/layers/carto-tile-layer.d.ts.map create mode 100644 modules/carto/typed/layers/h3-tile-layer.d.ts create mode 100644 modules/carto/typed/layers/h3-tile-layer.d.ts.map create mode 100644 modules/carto/typed/layers/h3-tileset-2d.d.ts create mode 100644 modules/carto/typed/layers/h3-tileset-2d.d.ts.map create mode 100644 modules/carto/typed/layers/quadbin-layer.d.ts create mode 100644 modules/carto/typed/layers/quadbin-layer.d.ts.map create mode 100644 modules/carto/typed/layers/quadbin-tile-layer.d.ts create mode 100644 modules/carto/typed/layers/quadbin-tile-layer.d.ts.map create mode 100644 modules/carto/typed/layers/quadbin-tileset-2d.d.ts create mode 100644 modules/carto/typed/layers/quadbin-tileset-2d.d.ts.map create mode 100644 modules/carto/typed/layers/quadbin-utils.d.ts create mode 100644 modules/carto/typed/layers/quadbin-utils.d.ts.map create mode 100644 modules/carto/typed/layers/schema/carto-spatial-tile-loader.d.ts create mode 100644 modules/carto/typed/layers/schema/carto-spatial-tile-loader.d.ts.map create mode 100644 modules/carto/typed/layers/schema/carto-spatial-tile.d.ts create mode 100644 modules/carto/typed/layers/schema/carto-spatial-tile.d.ts.map create mode 100644 modules/carto/typed/layers/schema/carto-tile.d.ts create mode 100644 modules/carto/typed/layers/schema/carto-tile.d.ts.map create mode 100644 modules/carto/typed/layers/schema/carto-vector-tile-loader.d.ts create mode 100644 modules/carto/typed/layers/schema/carto-vector-tile-loader.d.ts.map create mode 100644 modules/carto/typed/layers/schema/spatialjson-utils.d.ts create mode 100644 modules/carto/typed/layers/schema/spatialjson-utils.d.ts.map create mode 100644 modules/carto/typed/layers/schema/tile-loader-utils.d.ts create mode 100644 modules/carto/typed/layers/schema/tile-loader-utils.d.ts.map create mode 100644 modules/carto/typed/layers/spatial-index-tile-layer.d.ts create mode 100644 modules/carto/typed/layers/spatial-index-tile-layer.d.ts.map create mode 100644 modules/carto/typed/style/color-bins-style.d.ts create mode 100644 modules/carto/typed/style/color-bins-style.d.ts.map create mode 100644 modules/carto/typed/style/color-categories-style.d.ts create mode 100644 modules/carto/typed/style/color-categories-style.d.ts.map create mode 100644 modules/carto/typed/style/color-continuous-style.d.ts create mode 100644 modules/carto/typed/style/color-continuous-style.d.ts.map create mode 100644 modules/carto/typed/style/palette.d.ts create mode 100644 modules/carto/typed/style/palette.d.ts.map create mode 100644 modules/carto/typed/style/utils.d.ts create mode 100644 modules/carto/typed/style/utils.d.ts.map create mode 100644 modules/carto/typed/utils.d.ts create mode 100644 modules/carto/typed/utils.d.ts.map create mode 100644 modules/core/typed/controllers/controller.d.ts create mode 100644 modules/core/typed/controllers/controller.d.ts.map create mode 100644 modules/core/typed/controllers/first-person-controller.d.ts create mode 100644 modules/core/typed/controllers/first-person-controller.d.ts.map create mode 100644 modules/core/typed/controllers/globe-controller.d.ts create mode 100644 modules/core/typed/controllers/globe-controller.d.ts.map create mode 100644 modules/core/typed/controllers/map-controller.d.ts create mode 100644 modules/core/typed/controllers/map-controller.d.ts.map create mode 100644 modules/core/typed/controllers/orbit-controller.d.ts create mode 100644 modules/core/typed/controllers/orbit-controller.d.ts.map create mode 100644 modules/core/typed/controllers/orthographic-controller.d.ts create mode 100644 modules/core/typed/controllers/orthographic-controller.d.ts.map create mode 100644 modules/core/typed/controllers/transition-manager.d.ts create mode 100644 modules/core/typed/controllers/transition-manager.d.ts.map create mode 100644 modules/core/typed/controllers/view-state.d.ts create mode 100644 modules/core/typed/controllers/view-state.d.ts.map create mode 100644 modules/core/typed/debug/index.d.ts create mode 100644 modules/core/typed/debug/index.d.ts.map create mode 100644 modules/core/typed/debug/loggers.d.ts create mode 100644 modules/core/typed/debug/loggers.d.ts.map create mode 100644 modules/core/typed/effects/lighting/ambient-light.d.ts create mode 100644 modules/core/typed/effects/lighting/ambient-light.d.ts.map create mode 100644 modules/core/typed/effects/lighting/camera-light.d.ts create mode 100644 modules/core/typed/effects/lighting/camera-light.d.ts.map create mode 100644 modules/core/typed/effects/lighting/directional-light.d.ts create mode 100644 modules/core/typed/effects/lighting/directional-light.d.ts.map create mode 100644 modules/core/typed/effects/lighting/lighting-effect.d.ts create mode 100644 modules/core/typed/effects/lighting/lighting-effect.d.ts.map create mode 100644 modules/core/typed/effects/lighting/point-light.d.ts create mode 100644 modules/core/typed/effects/lighting/point-light.d.ts.map create mode 100644 modules/core/typed/effects/lighting/sun-light.d.ts create mode 100644 modules/core/typed/effects/lighting/sun-light.d.ts.map create mode 100644 modules/core/typed/effects/lighting/suncalc.d.ts create mode 100644 modules/core/typed/effects/lighting/suncalc.d.ts.map create mode 100644 modules/core/typed/effects/mask/mask-effect.d.ts create mode 100644 modules/core/typed/effects/mask/mask-effect.d.ts.map create mode 100644 modules/core/typed/effects/mask/utils.d.ts create mode 100644 modules/core/typed/effects/mask/utils.d.ts.map create mode 100644 modules/core/typed/effects/post-process-effect.d.ts create mode 100644 modules/core/typed/effects/post-process-effect.d.ts.map create mode 100644 modules/core/typed/index.d.ts create mode 100644 modules/core/typed/index.d.ts.map create mode 100644 modules/core/typed/lib/attribute/attribute-manager.d.ts create mode 100644 modules/core/typed/lib/attribute/attribute-manager.d.ts.map create mode 100644 modules/core/typed/lib/attribute/attribute-transition-manager.d.ts create mode 100644 modules/core/typed/lib/attribute/attribute-transition-manager.d.ts.map create mode 100644 modules/core/typed/lib/attribute/attribute-transition-utils.d.ts create mode 100644 modules/core/typed/lib/attribute/attribute-transition-utils.d.ts.map create mode 100644 modules/core/typed/lib/attribute/attribute.d.ts create mode 100644 modules/core/typed/lib/attribute/attribute.d.ts.map create mode 100644 modules/core/typed/lib/attribute/data-column.d.ts create mode 100644 modules/core/typed/lib/attribute/data-column.d.ts.map create mode 100644 modules/core/typed/lib/attribute/gl-utils.d.ts create mode 100644 modules/core/typed/lib/attribute/gl-utils.d.ts.map create mode 100644 modules/core/typed/lib/attribute/shader-attribute.d.ts create mode 100644 modules/core/typed/lib/attribute/shader-attribute.d.ts.map create mode 100644 modules/core/typed/lib/composite-layer.d.ts create mode 100644 modules/core/typed/lib/composite-layer.d.ts.map create mode 100644 modules/core/typed/lib/constants.d.ts create mode 100644 modules/core/typed/lib/constants.d.ts.map create mode 100644 modules/core/typed/lib/deck-picker.d.ts create mode 100644 modules/core/typed/lib/deck-picker.d.ts.map create mode 100644 modules/core/typed/lib/deck-renderer.d.ts create mode 100644 modules/core/typed/lib/deck-renderer.d.ts.map create mode 100644 modules/core/typed/lib/deck.d.ts create mode 100644 modules/core/typed/lib/deck.d.ts.map create mode 100644 modules/core/typed/lib/effect-manager.d.ts create mode 100644 modules/core/typed/lib/effect-manager.d.ts.map create mode 100644 modules/core/typed/lib/effect.d.ts create mode 100644 modules/core/typed/lib/effect.d.ts.map create mode 100644 modules/core/typed/lib/init.d.ts create mode 100644 modules/core/typed/lib/init.d.ts.map create mode 100644 modules/core/typed/lib/layer-extension.d.ts create mode 100644 modules/core/typed/lib/layer-extension.d.ts.map create mode 100644 modules/core/typed/lib/layer-manager.d.ts create mode 100644 modules/core/typed/lib/layer-manager.d.ts.map create mode 100644 modules/core/typed/lib/layer-state.d.ts create mode 100644 modules/core/typed/lib/layer-state.d.ts.map create mode 100644 modules/core/typed/lib/layer.d.ts create mode 100644 modules/core/typed/lib/layer.d.ts.map create mode 100644 modules/core/typed/lib/picking/pick-info.d.ts create mode 100644 modules/core/typed/lib/picking/pick-info.d.ts.map create mode 100644 modules/core/typed/lib/picking/query-object.d.ts create mode 100644 modules/core/typed/lib/picking/query-object.d.ts.map create mode 100644 modules/core/typed/lib/resource/resource-manager.d.ts create mode 100644 modules/core/typed/lib/resource/resource-manager.d.ts.map create mode 100644 modules/core/typed/lib/resource/resource.d.ts create mode 100644 modules/core/typed/lib/resource/resource.d.ts.map create mode 100644 modules/core/typed/lib/tooltip.d.ts create mode 100644 modules/core/typed/lib/tooltip.d.ts.map create mode 100644 modules/core/typed/lib/uniform-transition-manager.d.ts create mode 100644 modules/core/typed/lib/uniform-transition-manager.d.ts.map create mode 100644 modules/core/typed/lib/view-manager.d.ts create mode 100644 modules/core/typed/lib/view-manager.d.ts.map create mode 100644 modules/core/typed/lifecycle/component-state.d.ts create mode 100644 modules/core/typed/lifecycle/component-state.d.ts.map create mode 100644 modules/core/typed/lifecycle/component.d.ts create mode 100644 modules/core/typed/lifecycle/component.d.ts.map create mode 100644 modules/core/typed/lifecycle/constants.d.ts create mode 100644 modules/core/typed/lifecycle/constants.d.ts.map create mode 100644 modules/core/typed/lifecycle/create-props.d.ts create mode 100644 modules/core/typed/lifecycle/create-props.d.ts.map create mode 100644 modules/core/typed/lifecycle/prop-types.d.ts create mode 100644 modules/core/typed/lifecycle/prop-types.d.ts.map create mode 100644 modules/core/typed/lifecycle/props.d.ts create mode 100644 modules/core/typed/lifecycle/props.d.ts.map create mode 100644 modules/core/typed/passes/draw-layers-pass.d.ts create mode 100644 modules/core/typed/passes/draw-layers-pass.d.ts.map create mode 100644 modules/core/typed/passes/layers-pass.d.ts create mode 100644 modules/core/typed/passes/layers-pass.d.ts.map create mode 100644 modules/core/typed/passes/mask-pass.d.ts create mode 100644 modules/core/typed/passes/mask-pass.d.ts.map create mode 100644 modules/core/typed/passes/pass.d.ts create mode 100644 modules/core/typed/passes/pass.d.ts.map create mode 100644 modules/core/typed/passes/pick-layers-pass.d.ts create mode 100644 modules/core/typed/passes/pick-layers-pass.d.ts.map create mode 100644 modules/core/typed/passes/screen-pass.d.ts create mode 100644 modules/core/typed/passes/screen-pass.d.ts.map create mode 100644 modules/core/typed/passes/shadow-pass.d.ts create mode 100644 modules/core/typed/passes/shadow-pass.d.ts.map create mode 100644 modules/core/typed/shaderlib/index.d.ts create mode 100644 modules/core/typed/shaderlib/index.d.ts.map create mode 100644 modules/core/typed/shaderlib/misc/geometry.d.ts create mode 100644 modules/core/typed/shaderlib/misc/geometry.d.ts.map create mode 100644 modules/core/typed/shaderlib/picking/picking.d.ts create mode 100644 modules/core/typed/shaderlib/picking/picking.d.ts.map create mode 100644 modules/core/typed/shaderlib/project/project-functions.d.ts create mode 100644 modules/core/typed/shaderlib/project/project-functions.d.ts.map create mode 100644 modules/core/typed/shaderlib/project/project.d.ts create mode 100644 modules/core/typed/shaderlib/project/project.d.ts.map create mode 100644 modules/core/typed/shaderlib/project/project.glsl.d.ts create mode 100644 modules/core/typed/shaderlib/project/project.glsl.d.ts.map create mode 100644 modules/core/typed/shaderlib/project/viewport-uniforms.d.ts create mode 100644 modules/core/typed/shaderlib/project/viewport-uniforms.d.ts.map create mode 100644 modules/core/typed/shaderlib/project32/project32.d.ts create mode 100644 modules/core/typed/shaderlib/project32/project32.d.ts.map create mode 100644 modules/core/typed/shaderlib/shadow/shadow.d.ts create mode 100644 modules/core/typed/shaderlib/shadow/shadow.d.ts.map create mode 100644 modules/core/typed/transitions/cpu-interpolation-transition.d.ts create mode 100644 modules/core/typed/transitions/cpu-interpolation-transition.d.ts.map create mode 100644 modules/core/typed/transitions/cpu-spring-transition.d.ts create mode 100644 modules/core/typed/transitions/cpu-spring-transition.d.ts.map create mode 100644 modules/core/typed/transitions/fly-to-interpolator.d.ts create mode 100644 modules/core/typed/transitions/fly-to-interpolator.d.ts.map create mode 100644 modules/core/typed/transitions/gpu-interpolation-transition.d.ts create mode 100644 modules/core/typed/transitions/gpu-interpolation-transition.d.ts.map create mode 100644 modules/core/typed/transitions/gpu-spring-transition.d.ts create mode 100644 modules/core/typed/transitions/gpu-spring-transition.d.ts.map create mode 100644 modules/core/typed/transitions/gpu-transition.d.ts create mode 100644 modules/core/typed/transitions/gpu-transition.d.ts.map create mode 100644 modules/core/typed/transitions/linear-interpolator.d.ts create mode 100644 modules/core/typed/transitions/linear-interpolator.d.ts.map create mode 100644 modules/core/typed/transitions/transition-interpolator.d.ts create mode 100644 modules/core/typed/transitions/transition-interpolator.d.ts.map create mode 100644 modules/core/typed/transitions/transition.d.ts create mode 100644 modules/core/typed/transitions/transition.d.ts.map create mode 100644 modules/core/typed/types/layer-props.d.ts create mode 100644 modules/core/typed/types/layer-props.d.ts.map create mode 100644 modules/core/typed/types/types.d.ts create mode 100644 modules/core/typed/types/types.d.ts.map create mode 100644 modules/core/typed/utils/array-utils.d.ts create mode 100644 modules/core/typed/utils/array-utils.d.ts.map create mode 100644 modules/core/typed/utils/assert.d.ts create mode 100644 modules/core/typed/utils/assert.d.ts.map create mode 100644 modules/core/typed/utils/color.d.ts create mode 100644 modules/core/typed/utils/color.d.ts.map create mode 100644 modules/core/typed/utils/count.d.ts create mode 100644 modules/core/typed/utils/count.d.ts.map create mode 100644 modules/core/typed/utils/deep-equal.d.ts create mode 100644 modules/core/typed/utils/deep-equal.d.ts.map create mode 100644 modules/core/typed/utils/flatten.d.ts create mode 100644 modules/core/typed/utils/flatten.d.ts.map create mode 100644 modules/core/typed/utils/iterable-utils.d.ts create mode 100644 modules/core/typed/utils/iterable-utils.d.ts.map create mode 100644 modules/core/typed/utils/json-loader.d.ts create mode 100644 modules/core/typed/utils/json-loader.d.ts.map create mode 100644 modules/core/typed/utils/log.d.ts create mode 100644 modules/core/typed/utils/log.d.ts.map create mode 100644 modules/core/typed/utils/math-utils.d.ts create mode 100644 modules/core/typed/utils/math-utils.d.ts.map create mode 100644 modules/core/typed/utils/memoize.d.ts create mode 100644 modules/core/typed/utils/memoize.d.ts.map create mode 100644 modules/core/typed/utils/positions.d.ts create mode 100644 modules/core/typed/utils/positions.d.ts.map create mode 100644 modules/core/typed/utils/range.d.ts create mode 100644 modules/core/typed/utils/range.d.ts.map create mode 100644 modules/core/typed/utils/shader.d.ts create mode 100644 modules/core/typed/utils/shader.d.ts.map create mode 100644 modules/core/typed/utils/tesselator.d.ts create mode 100644 modules/core/typed/utils/tesselator.d.ts.map create mode 100644 modules/core/typed/utils/texture.d.ts create mode 100644 modules/core/typed/utils/texture.d.ts.map create mode 100644 modules/core/typed/utils/typed-array-manager.d.ts create mode 100644 modules/core/typed/utils/typed-array-manager.d.ts.map create mode 100644 modules/core/typed/viewports/first-person-viewport.d.ts create mode 100644 modules/core/typed/viewports/first-person-viewport.d.ts.map create mode 100644 modules/core/typed/viewports/globe-viewport.d.ts create mode 100644 modules/core/typed/viewports/globe-viewport.d.ts.map create mode 100644 modules/core/typed/viewports/orbit-viewport.d.ts create mode 100644 modules/core/typed/viewports/orbit-viewport.d.ts.map create mode 100644 modules/core/typed/viewports/orthographic-viewport.d.ts create mode 100644 modules/core/typed/viewports/orthographic-viewport.d.ts.map create mode 100644 modules/core/typed/viewports/viewport.d.ts create mode 100644 modules/core/typed/viewports/viewport.d.ts.map create mode 100644 modules/core/typed/viewports/web-mercator-viewport.d.ts create mode 100644 modules/core/typed/viewports/web-mercator-viewport.d.ts.map create mode 100644 modules/core/typed/views/first-person-view.d.ts create mode 100644 modules/core/typed/views/first-person-view.d.ts.map create mode 100644 modules/core/typed/views/globe-view.d.ts create mode 100644 modules/core/typed/views/globe-view.d.ts.map create mode 100644 modules/core/typed/views/map-view.d.ts create mode 100644 modules/core/typed/views/map-view.d.ts.map create mode 100644 modules/core/typed/views/orbit-view.d.ts create mode 100644 modules/core/typed/views/orbit-view.d.ts.map create mode 100644 modules/core/typed/views/orthographic-view.d.ts create mode 100644 modules/core/typed/views/orthographic-view.d.ts.map create mode 100644 modules/core/typed/views/view.d.ts create mode 100644 modules/core/typed/views/view.d.ts.map create mode 100644 modules/extensions/typed/brushing/brushing.d.ts create mode 100644 modules/extensions/typed/brushing/brushing.d.ts.map create mode 100644 modules/extensions/typed/brushing/shader-module.d.ts create mode 100644 modules/extensions/typed/brushing/shader-module.d.ts.map create mode 100644 modules/extensions/typed/clip/clip.d.ts create mode 100644 modules/extensions/typed/clip/clip.d.ts.map create mode 100644 modules/extensions/typed/data-filter/aggregator.d.ts create mode 100644 modules/extensions/typed/data-filter/aggregator.d.ts.map create mode 100644 modules/extensions/typed/data-filter/data-filter.d.ts create mode 100644 modules/extensions/typed/data-filter/data-filter.d.ts.map create mode 100644 modules/extensions/typed/data-filter/shader-module.d.ts create mode 100644 modules/extensions/typed/data-filter/shader-module.d.ts.map create mode 100644 modules/extensions/typed/fill-style/fill-style.d.ts create mode 100644 modules/extensions/typed/fill-style/fill-style.d.ts.map create mode 100644 modules/extensions/typed/fill-style/shaders.glsl.d.ts create mode 100644 modules/extensions/typed/fill-style/shaders.glsl.d.ts.map create mode 100644 modules/extensions/typed/fp64/fp64.d.ts create mode 100644 modules/extensions/typed/fp64/fp64.d.ts.map create mode 100644 modules/extensions/typed/fp64/project64.d.ts create mode 100644 modules/extensions/typed/fp64/project64.d.ts.map create mode 100644 modules/extensions/typed/fp64/project64.glsl.d.ts create mode 100644 modules/extensions/typed/fp64/project64.glsl.d.ts.map create mode 100644 modules/extensions/typed/index.d.ts create mode 100644 modules/extensions/typed/index.d.ts.map create mode 100644 modules/extensions/typed/mask/mask.d.ts create mode 100644 modules/extensions/typed/mask/mask.d.ts.map create mode 100644 modules/extensions/typed/mask/shader-module.d.ts create mode 100644 modules/extensions/typed/mask/shader-module.d.ts.map create mode 100644 modules/extensions/typed/path-style/path-style.d.ts create mode 100644 modules/extensions/typed/path-style/path-style.d.ts.map create mode 100644 modules/extensions/typed/path-style/shaders.glsl.d.ts create mode 100644 modules/extensions/typed/path-style/shaders.glsl.d.ts.map create mode 100644 modules/geo-layers/typed/geo-cell-layer/GeoCellLayer.d.ts create mode 100644 modules/geo-layers/typed/geo-cell-layer/GeoCellLayer.d.ts.map create mode 100644 modules/geo-layers/typed/geohash-layer/geohash-layer.d.ts create mode 100644 modules/geo-layers/typed/geohash-layer/geohash-layer.d.ts.map create mode 100644 modules/geo-layers/typed/geohash-layer/geohash-utils.d.ts create mode 100644 modules/geo-layers/typed/geohash-layer/geohash-utils.d.ts.map create mode 100644 modules/geo-layers/typed/great-circle-layer/great-circle-layer.d.ts create mode 100644 modules/geo-layers/typed/great-circle-layer/great-circle-layer.d.ts.map create mode 100644 modules/geo-layers/typed/h3-layers/h3-cluster-layer.d.ts create mode 100644 modules/geo-layers/typed/h3-layers/h3-cluster-layer.d.ts.map create mode 100644 modules/geo-layers/typed/h3-layers/h3-hexagon-layer.d.ts create mode 100644 modules/geo-layers/typed/h3-layers/h3-hexagon-layer.d.ts.map create mode 100644 modules/geo-layers/typed/index.d.ts create mode 100644 modules/geo-layers/typed/index.d.ts.map create mode 100644 modules/geo-layers/typed/mesh-layer/mesh-layer-fragment.glsl.d.ts create mode 100644 modules/geo-layers/typed/mesh-layer/mesh-layer-fragment.glsl.d.ts.map create mode 100644 modules/geo-layers/typed/mesh-layer/mesh-layer-vertex.glsl.d.ts create mode 100644 modules/geo-layers/typed/mesh-layer/mesh-layer-vertex.glsl.d.ts.map create mode 100644 modules/geo-layers/typed/mesh-layer/mesh-layer.d.ts create mode 100644 modules/geo-layers/typed/mesh-layer/mesh-layer.d.ts.map create mode 100644 modules/geo-layers/typed/mvt-layer/coordinate-transform.d.ts create mode 100644 modules/geo-layers/typed/mvt-layer/coordinate-transform.d.ts.map create mode 100644 modules/geo-layers/typed/mvt-layer/find-index-binary.d.ts create mode 100644 modules/geo-layers/typed/mvt-layer/find-index-binary.d.ts.map create mode 100644 modules/geo-layers/typed/mvt-layer/mvt-layer.d.ts create mode 100644 modules/geo-layers/typed/mvt-layer/mvt-layer.d.ts.map create mode 100644 modules/geo-layers/typed/quadkey-layer/quadkey-layer.d.ts create mode 100644 modules/geo-layers/typed/quadkey-layer/quadkey-layer.d.ts.map create mode 100644 modules/geo-layers/typed/quadkey-layer/quadkey-utils.d.ts create mode 100644 modules/geo-layers/typed/quadkey-layer/quadkey-utils.d.ts.map create mode 100644 modules/geo-layers/typed/s2-layer/s2-geometry.d.ts create mode 100644 modules/geo-layers/typed/s2-layer/s2-geometry.d.ts.map create mode 100644 modules/geo-layers/typed/s2-layer/s2-layer.d.ts create mode 100644 modules/geo-layers/typed/s2-layer/s2-layer.d.ts.map create mode 100644 modules/geo-layers/typed/s2-layer/s2-utils.d.ts create mode 100644 modules/geo-layers/typed/s2-layer/s2-utils.d.ts.map create mode 100644 modules/geo-layers/typed/terrain-layer/terrain-layer.d.ts create mode 100644 modules/geo-layers/typed/terrain-layer/terrain-layer.d.ts.map create mode 100644 modules/geo-layers/typed/tile-3d-layer/tile-3d-layer.d.ts create mode 100644 modules/geo-layers/typed/tile-3d-layer/tile-3d-layer.d.ts.map create mode 100644 modules/geo-layers/typed/tile-layer/tile-2d-header.d.ts create mode 100644 modules/geo-layers/typed/tile-layer/tile-2d-header.d.ts.map create mode 100644 modules/geo-layers/typed/tile-layer/tile-2d-traversal.d.ts create mode 100644 modules/geo-layers/typed/tile-layer/tile-2d-traversal.d.ts.map create mode 100644 modules/geo-layers/typed/tile-layer/tile-layer.d.ts create mode 100644 modules/geo-layers/typed/tile-layer/tile-layer.d.ts.map create mode 100644 modules/geo-layers/typed/tile-layer/tileset-2d.d.ts create mode 100644 modules/geo-layers/typed/tile-layer/tileset-2d.d.ts.map create mode 100644 modules/geo-layers/typed/tile-layer/types.d.ts create mode 100644 modules/geo-layers/typed/tile-layer/types.d.ts.map create mode 100644 modules/geo-layers/typed/tile-layer/utils.d.ts create mode 100644 modules/geo-layers/typed/tile-layer/utils.d.ts.map create mode 100644 modules/geo-layers/typed/trips-layer/trips-layer.d.ts create mode 100644 modules/geo-layers/typed/trips-layer/trips-layer.d.ts.map create mode 100644 modules/google-maps/typed/google-maps-overlay.d.ts create mode 100644 modules/google-maps/typed/google-maps-overlay.d.ts.map create mode 100644 modules/google-maps/typed/index.d.ts create mode 100644 modules/google-maps/typed/index.d.ts.map create mode 100644 modules/google-maps/typed/utils.d.ts create mode 100644 modules/google-maps/typed/utils.d.ts.map create mode 100644 modules/json/typed/helpers/convert-functions.d.ts create mode 100644 modules/json/typed/helpers/convert-functions.d.ts.map create mode 100644 modules/json/typed/helpers/execute-function.d.ts create mode 100644 modules/json/typed/helpers/execute-function.d.ts.map create mode 100644 modules/json/typed/helpers/instantiate-class.d.ts create mode 100644 modules/json/typed/helpers/instantiate-class.d.ts.map create mode 100644 modules/json/typed/helpers/parse-expression-string.d.ts create mode 100644 modules/json/typed/helpers/parse-expression-string.d.ts.map create mode 100644 modules/json/typed/helpers/parse-json.d.ts create mode 100644 modules/json/typed/helpers/parse-json.d.ts.map create mode 100644 modules/json/typed/index.d.ts create mode 100644 modules/json/typed/index.d.ts.map create mode 100644 modules/json/typed/json-configuration.d.ts create mode 100644 modules/json/typed/json-configuration.d.ts.map create mode 100644 modules/json/typed/json-converter.d.ts create mode 100644 modules/json/typed/json-converter.d.ts.map create mode 100644 modules/json/typed/syntactic-sugar.d.ts create mode 100644 modules/json/typed/syntactic-sugar.d.ts.map create mode 100644 modules/json/typed/transports/transport.d.ts create mode 100644 modules/json/typed/transports/transport.d.ts.map create mode 100644 modules/json/typed/utils/assert.d.ts create mode 100644 modules/json/typed/utils/assert.d.ts.map create mode 100644 modules/json/typed/utils/get.d.ts create mode 100644 modules/json/typed/utils/get.d.ts.map create mode 100644 modules/json/typed/utils/shallow-equal-objects.d.ts create mode 100644 modules/json/typed/utils/shallow-equal-objects.d.ts.map create mode 100644 modules/layers/typed/arc-layer/arc-layer-fragment.glsl.d.ts create mode 100644 modules/layers/typed/arc-layer/arc-layer-fragment.glsl.d.ts.map create mode 100644 modules/layers/typed/arc-layer/arc-layer-vertex.glsl.d.ts create mode 100644 modules/layers/typed/arc-layer/arc-layer-vertex.glsl.d.ts.map create mode 100644 modules/layers/typed/arc-layer/arc-layer.d.ts create mode 100644 modules/layers/typed/arc-layer/arc-layer.d.ts.map create mode 100644 modules/layers/typed/bitmap-layer/bitmap-layer-fragment.d.ts create mode 100644 modules/layers/typed/bitmap-layer/bitmap-layer-fragment.d.ts.map create mode 100644 modules/layers/typed/bitmap-layer/bitmap-layer-vertex.d.ts create mode 100644 modules/layers/typed/bitmap-layer/bitmap-layer-vertex.d.ts.map create mode 100644 modules/layers/typed/bitmap-layer/bitmap-layer.d.ts create mode 100644 modules/layers/typed/bitmap-layer/bitmap-layer.d.ts.map create mode 100644 modules/layers/typed/bitmap-layer/create-mesh.d.ts create mode 100644 modules/layers/typed/bitmap-layer/create-mesh.d.ts.map create mode 100644 modules/layers/typed/column-layer/column-geometry.d.ts create mode 100644 modules/layers/typed/column-layer/column-geometry.d.ts.map create mode 100644 modules/layers/typed/column-layer/column-layer-fragment.glsl.d.ts create mode 100644 modules/layers/typed/column-layer/column-layer-fragment.glsl.d.ts.map create mode 100644 modules/layers/typed/column-layer/column-layer-vertex.glsl.d.ts create mode 100644 modules/layers/typed/column-layer/column-layer-vertex.glsl.d.ts.map create mode 100644 modules/layers/typed/column-layer/column-layer.d.ts create mode 100644 modules/layers/typed/column-layer/column-layer.d.ts.map create mode 100644 modules/layers/typed/column-layer/grid-cell-layer.d.ts create mode 100644 modules/layers/typed/column-layer/grid-cell-layer.d.ts.map create mode 100644 modules/layers/typed/geojson-layer/geojson-binary.d.ts create mode 100644 modules/layers/typed/geojson-layer/geojson-binary.d.ts.map create mode 100644 modules/layers/typed/geojson-layer/geojson-layer-props.d.ts create mode 100644 modules/layers/typed/geojson-layer/geojson-layer-props.d.ts.map create mode 100644 modules/layers/typed/geojson-layer/geojson-layer.d.ts create mode 100644 modules/layers/typed/geojson-layer/geojson-layer.d.ts.map create mode 100644 modules/layers/typed/geojson-layer/geojson.d.ts create mode 100644 modules/layers/typed/geojson-layer/geojson.d.ts.map create mode 100644 modules/layers/typed/geojson-layer/sub-layer-map.d.ts create mode 100644 modules/layers/typed/geojson-layer/sub-layer-map.d.ts.map create mode 100644 modules/layers/typed/icon-layer/icon-layer-fragment.glsl.d.ts create mode 100644 modules/layers/typed/icon-layer/icon-layer-fragment.glsl.d.ts.map create mode 100644 modules/layers/typed/icon-layer/icon-layer-vertex.glsl.d.ts create mode 100644 modules/layers/typed/icon-layer/icon-layer-vertex.glsl.d.ts.map create mode 100644 modules/layers/typed/icon-layer/icon-layer.d.ts create mode 100644 modules/layers/typed/icon-layer/icon-layer.d.ts.map create mode 100644 modules/layers/typed/icon-layer/icon-manager.d.ts create mode 100644 modules/layers/typed/icon-layer/icon-manager.d.ts.map create mode 100644 modules/layers/typed/index.d.ts create mode 100644 modules/layers/typed/index.d.ts.map create mode 100644 modules/layers/typed/line-layer/line-layer-fragment.glsl.d.ts create mode 100644 modules/layers/typed/line-layer/line-layer-fragment.glsl.d.ts.map create mode 100644 modules/layers/typed/line-layer/line-layer-vertex.glsl.d.ts create mode 100644 modules/layers/typed/line-layer/line-layer-vertex.glsl.d.ts.map create mode 100644 modules/layers/typed/line-layer/line-layer.d.ts create mode 100644 modules/layers/typed/line-layer/line-layer.d.ts.map create mode 100644 modules/layers/typed/path-layer/path-layer-fragment.glsl.d.ts create mode 100644 modules/layers/typed/path-layer/path-layer-fragment.glsl.d.ts.map create mode 100644 modules/layers/typed/path-layer/path-layer-vertex.glsl.d.ts create mode 100644 modules/layers/typed/path-layer/path-layer-vertex.glsl.d.ts.map create mode 100644 modules/layers/typed/path-layer/path-layer.d.ts create mode 100644 modules/layers/typed/path-layer/path-layer.d.ts.map create mode 100644 modules/layers/typed/path-layer/path-tesselator.d.ts create mode 100644 modules/layers/typed/path-layer/path-tesselator.d.ts.map create mode 100644 modules/layers/typed/path-layer/path.d.ts create mode 100644 modules/layers/typed/path-layer/path.d.ts.map create mode 100644 modules/layers/typed/point-cloud-layer/point-cloud-layer-fragment.glsl.d.ts create mode 100644 modules/layers/typed/point-cloud-layer/point-cloud-layer-fragment.glsl.d.ts.map create mode 100644 modules/layers/typed/point-cloud-layer/point-cloud-layer-vertex.glsl.d.ts create mode 100644 modules/layers/typed/point-cloud-layer/point-cloud-layer-vertex.glsl.d.ts.map create mode 100644 modules/layers/typed/point-cloud-layer/point-cloud-layer.d.ts create mode 100644 modules/layers/typed/point-cloud-layer/point-cloud-layer.d.ts.map create mode 100644 modules/layers/typed/polygon-layer/polygon-layer.d.ts create mode 100644 modules/layers/typed/polygon-layer/polygon-layer.d.ts.map create mode 100644 modules/layers/typed/scatterplot-layer/scatterplot-layer-fragment.glsl.d.ts create mode 100644 modules/layers/typed/scatterplot-layer/scatterplot-layer-fragment.glsl.d.ts.map create mode 100644 modules/layers/typed/scatterplot-layer/scatterplot-layer-vertex.glsl.d.ts create mode 100644 modules/layers/typed/scatterplot-layer/scatterplot-layer-vertex.glsl.d.ts.map create mode 100644 modules/layers/typed/scatterplot-layer/scatterplot-layer.d.ts create mode 100644 modules/layers/typed/scatterplot-layer/scatterplot-layer.d.ts.map create mode 100644 modules/layers/typed/solid-polygon-layer/polygon-tesselator.d.ts create mode 100644 modules/layers/typed/solid-polygon-layer/polygon-tesselator.d.ts.map create mode 100644 modules/layers/typed/solid-polygon-layer/polygon.d.ts create mode 100644 modules/layers/typed/solid-polygon-layer/polygon.d.ts.map create mode 100644 modules/layers/typed/solid-polygon-layer/solid-polygon-layer-fragment.glsl.d.ts create mode 100644 modules/layers/typed/solid-polygon-layer/solid-polygon-layer-fragment.glsl.d.ts.map create mode 100644 modules/layers/typed/solid-polygon-layer/solid-polygon-layer-vertex-main.glsl.d.ts create mode 100644 modules/layers/typed/solid-polygon-layer/solid-polygon-layer-vertex-main.glsl.d.ts.map create mode 100644 modules/layers/typed/solid-polygon-layer/solid-polygon-layer-vertex-side.glsl.d.ts create mode 100644 modules/layers/typed/solid-polygon-layer/solid-polygon-layer-vertex-side.glsl.d.ts.map create mode 100644 modules/layers/typed/solid-polygon-layer/solid-polygon-layer-vertex-top.glsl.d.ts create mode 100644 modules/layers/typed/solid-polygon-layer/solid-polygon-layer-vertex-top.glsl.d.ts.map create mode 100644 modules/layers/typed/solid-polygon-layer/solid-polygon-layer.d.ts create mode 100644 modules/layers/typed/solid-polygon-layer/solid-polygon-layer.d.ts.map create mode 100644 modules/layers/typed/text-layer/font-atlas-manager.d.ts create mode 100644 modules/layers/typed/text-layer/font-atlas-manager.d.ts.map create mode 100644 modules/layers/typed/text-layer/lru-cache.d.ts create mode 100644 modules/layers/typed/text-layer/lru-cache.d.ts.map create mode 100644 modules/layers/typed/text-layer/multi-icon-layer/multi-icon-layer-fragment.glsl.d.ts create mode 100644 modules/layers/typed/text-layer/multi-icon-layer/multi-icon-layer-fragment.glsl.d.ts.map create mode 100644 modules/layers/typed/text-layer/multi-icon-layer/multi-icon-layer.d.ts create mode 100644 modules/layers/typed/text-layer/multi-icon-layer/multi-icon-layer.d.ts.map create mode 100644 modules/layers/typed/text-layer/text-background-layer/text-background-layer-fragment.glsl.d.ts create mode 100644 modules/layers/typed/text-layer/text-background-layer/text-background-layer-fragment.glsl.d.ts.map create mode 100644 modules/layers/typed/text-layer/text-background-layer/text-background-layer-vertex.glsl.d.ts create mode 100644 modules/layers/typed/text-layer/text-background-layer/text-background-layer-vertex.glsl.d.ts.map create mode 100644 modules/layers/typed/text-layer/text-background-layer/text-background-layer.d.ts create mode 100644 modules/layers/typed/text-layer/text-background-layer/text-background-layer.d.ts.map create mode 100644 modules/layers/typed/text-layer/text-layer.d.ts create mode 100644 modules/layers/typed/text-layer/text-layer.d.ts.map create mode 100644 modules/layers/typed/text-layer/utils.d.ts create mode 100644 modules/layers/typed/text-layer/utils.d.ts.map create mode 100644 modules/layers/typed/utils.d.ts create mode 100644 modules/layers/typed/utils.d.ts.map create mode 100644 modules/main/typed/index.d.ts create mode 100644 modules/main/typed/index.d.ts.map create mode 100644 modules/mapbox/typed/deck-utils.d.ts create mode 100644 modules/mapbox/typed/deck-utils.d.ts.map create mode 100644 modules/mapbox/typed/index.d.ts create mode 100644 modules/mapbox/typed/index.d.ts.map create mode 100644 modules/mapbox/typed/mapbox-layer.d.ts create mode 100644 modules/mapbox/typed/mapbox-layer.d.ts.map create mode 100644 modules/mapbox/typed/mapbox-overlay.d.ts create mode 100644 modules/mapbox/typed/mapbox-overlay.d.ts.map create mode 100644 modules/mapbox/typed/resolve-layers.d.ts create mode 100644 modules/mapbox/typed/resolve-layers.d.ts.map create mode 100644 modules/mesh-layers/typed/index.d.ts create mode 100644 modules/mesh-layers/typed/index.d.ts.map create mode 100644 modules/mesh-layers/typed/scenegraph-layer/gltf-utils.d.ts create mode 100644 modules/mesh-layers/typed/scenegraph-layer/gltf-utils.d.ts.map create mode 100644 modules/mesh-layers/typed/scenegraph-layer/scenegraph-layer-fragment.glsl.d.ts create mode 100644 modules/mesh-layers/typed/scenegraph-layer/scenegraph-layer-fragment.glsl.d.ts.map create mode 100644 modules/mesh-layers/typed/scenegraph-layer/scenegraph-layer-vertex.glsl.d.ts create mode 100644 modules/mesh-layers/typed/scenegraph-layer/scenegraph-layer-vertex.glsl.d.ts.map create mode 100644 modules/mesh-layers/typed/scenegraph-layer/scenegraph-layer.d.ts create mode 100644 modules/mesh-layers/typed/scenegraph-layer/scenegraph-layer.d.ts.map create mode 100644 modules/mesh-layers/typed/simple-mesh-layer/simple-mesh-layer-fragment.glsl.d.ts create mode 100644 modules/mesh-layers/typed/simple-mesh-layer/simple-mesh-layer-fragment.glsl.d.ts.map create mode 100644 modules/mesh-layers/typed/simple-mesh-layer/simple-mesh-layer-vertex.glsl.d.ts create mode 100644 modules/mesh-layers/typed/simple-mesh-layer/simple-mesh-layer-vertex.glsl.d.ts.map create mode 100644 modules/mesh-layers/typed/simple-mesh-layer/simple-mesh-layer.d.ts create mode 100644 modules/mesh-layers/typed/simple-mesh-layer/simple-mesh-layer.d.ts.map create mode 100644 modules/mesh-layers/typed/utils/matrix.d.ts create mode 100644 modules/mesh-layers/typed/utils/matrix.d.ts.map create mode 100644 modules/react/typed/deckgl.d.ts create mode 100644 modules/react/typed/deckgl.d.ts.map create mode 100644 modules/react/typed/index.d.ts create mode 100644 modules/react/typed/index.d.ts.map create mode 100644 modules/react/typed/utils/evaluate-children.d.ts create mode 100644 modules/react/typed/utils/evaluate-children.d.ts.map create mode 100644 modules/react/typed/utils/extract-jsx-layers.d.ts create mode 100644 modules/react/typed/utils/extract-jsx-layers.d.ts.map create mode 100644 modules/react/typed/utils/extract-styles.d.ts create mode 100644 modules/react/typed/utils/extract-styles.d.ts.map create mode 100644 modules/react/typed/utils/inherits-from.d.ts create mode 100644 modules/react/typed/utils/inherits-from.d.ts.map create mode 100644 modules/react/typed/utils/position-children-under-views.d.ts create mode 100644 modules/react/typed/utils/position-children-under-views.d.ts.map create mode 100644 modules/react/typed/utils/use-isomorphic-layout-effect.d.ts create mode 100644 modules/react/typed/utils/use-isomorphic-layout-effect.d.ts.map diff --git a/docs/api-reference/core/deck.md b/docs/api-reference/core/deck.md index 6f0a9a8dba3..8baa4375f84 100644 --- a/docs/api-reference/core/deck.md +++ b/docs/api-reference/core/deck.md @@ -54,7 +54,9 @@ luma.gl Device used to manage the application's connection with the GPU. Will be #### `deviceProps` ([DeviceProps](https://luma.gl/docs/api-reference/core/device#deviceprops) | [WebGLDeviceProps](https://luma.gl/docs/api-reference/webgl/#webgldeviceprops)) {#deviceprops} -Additional options used when creating the luma.gl [Device](https://luma.gl/docs/api-reference/core/device). When using WebGL, can be used to specify [WebGL context attributes](https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/getContext#contextattributes). +Options used for creating a new luma.gl GPU [Device](https://luma.gl/docs/api-reference/core/device). + +Note that when using WebGL, `props.deviceProps.webgl` can be used to specify [WebGL context attributes](https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/getContext#contextattributes). #### `gl` (WebGLContext) {#gl} diff --git a/docs/upgrade-guide.md b/docs/upgrade-guide.md index 16529231e46..a94ff0b7811 100644 --- a/docs/upgrade-guide.md +++ b/docs/upgrade-guide.md @@ -50,12 +50,13 @@ The biggest changes in deck.gl v9 are due to the upgrade to the luma.gl v9 API. Quick summary: -- All references to `gl: WebGLRenderingContext` should be replaced with `device`: [Device](https://luma.gl/docs/api-reference/core/device). -- All references to `glOptions: WebGLContextAttributes` should be replaced with `deviceProps: {type: 'webgl', ...glOptions}`: [WebGLDeviceProps](https://luma.gl/docs/api-reference/webgl/#webgldeviceprops) -- Layer props `parameters` and `textureParameters` no longer use WebGL constants, but instead use (WebGPU style) [string constants](https://luma.gl/docs/api-reference/core/parameters/). -- Deck class prop `onWebGLInitialized` is now `onDeviceInitialized`. +- `DeckProps.gl (WebGLRenderingContext)` should be replaced with `device`: [Device](https://luma.gl/docs/api-reference/core/device). +- `DeckProps.glOptions (WebGLContextAttributes)` should be replaced with `DeckProps.deviceProps.webgl`: `deviceProps: {type: 'webgl', webgl: ...glOptions}`: [WebGLDeviceProps](https://luma.gl/docs/api-reference/webgl/#webgldeviceprops) +- `DeckProps.glOptions.preserveDrawingBuffers` is now set by default, and does not need to be overridden. +- `DeckProps.onWebGLInitialized` callback is now `DeckProps.onDeviceInitialized`. +- `LayerProps.parameters` and `LayerProps.textureParameters` no longer use WebGL constants, but instead use (WebGPU style) [string constants](https://luma.gl/docs/api-reference/core/parameters/). - When providing [binary data attributes](./api-reference/core/layer.md#data), `type` is now a WebGPU-style [string format](https://luma.gl/docs/api-guide/gpu/gpu-attributes#vertexformat) instead of a GL constant. -- GPU resources should no longer be initiated from classes. For example, instead of `new Buffer()` use `device.createBuffer()`, instead of `new Texture()` use `device.createTexture()`. See [Device methods](https://luma.gl/docs/api-reference/core/device#methods). +- GPU resources should no longer be created by directly instantiating classes. For example, instead of `new Buffer(gl)` use `device.createBuffer()`, instead of `new Texture()` use `device.createTexture()`. See [Device methods](https://luma.gl/docs/api-reference/core/device#methods). #### Custom Layers diff --git a/modules/aggregation-layers/typed/aggregation-layer.d.ts b/modules/aggregation-layers/typed/aggregation-layer.d.ts new file mode 100644 index 00000000000..a3000f28a57 --- /dev/null +++ b/modules/aggregation-layers/typed/aggregation-layer.d.ts @@ -0,0 +1,48 @@ +import { + CompositeLayer, + AttributeManager, + UpdateParameters, + CompositeLayerProps +} from '@deck.gl/core'; +export declare type AggregationLayerProps = CompositeLayerProps; +export default abstract class AggregationLayer< + ExtraPropsT = {} +> extends CompositeLayer { + static layerName: string; + state: CompositeLayer['state'] & { + ignoreProps?: Record; + dimensions?: any; + }; + initializeAggregationLayer(dimensions: any): void; + updateState(opts: UpdateParameters): void; + updateAttributes(changedAttributes: any): void; + getAttributes(): { + [id: string]: import('modules/core/src/lib/attribute/shader-attribute').IShaderAttribute; + }; + getModuleSettings(): any; + updateShaders(shaders: any): void; + /** + * Checks if aggregation is dirty + * @param {Object} updateOpts - object {props, oldProps, changeFlags} + * @param {Object} params - object {dimension, compareAll} + * @param {Object} params.dimension - {props, accessors} array of props and/or accessors + * @param {Boolean} params.compareAll - when `true` it will include non layer props for comparision + * @returns {Boolean} - returns true if dimensions' prop or accessor is changed + **/ + isAggregationDirty( + updateOpts: any, + params?: { + compareAll?: boolean; + dimension?: any; + } + ): string | boolean; + /** + * Checks if an attribute is changed + * @param {String} name - name of the attribute + * @returns {Boolean} - `true` if attribute `name` is changed, `false` otherwise, + * If `name` is not passed or `undefiend`, `true` if any attribute is changed, `false` otherwise + **/ + isAttributeChanged(name?: string): boolean; + _getAttributeManager(): AttributeManager; +} +// # sourceMappingURL=aggregation-layer.d.ts.map diff --git a/modules/aggregation-layers/typed/aggregation-layer.d.ts.map b/modules/aggregation-layers/typed/aggregation-layer.d.ts.map new file mode 100644 index 00000000000..f9d28a2b28c --- /dev/null +++ b/modules/aggregation-layers/typed/aggregation-layer.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"aggregation-layer.d.ts","sourceRoot":"","sources":["../src/aggregation-layer.ts"],"names":[],"mappings":"AAoBA,OAAO,EACL,cAAc,EACd,gBAAgB,EAEhB,gBAAgB,EAChB,mBAAmB,EACpB,MAAM,eAAe,CAAC;AAGvB,oBAAY,qBAAqB,CAAC,KAAK,GAAG,GAAG,IAAI,mBAAmB,CAAC,KAAK,CAAC,CAAC;AAE5E,MAAM,CAAC,OAAO,CAAC,QAAQ,OAAO,gBAAgB,CAC5C,WAAW,GAAG,EAAE,CAChB,SAAQ,cAAc,CAAC,WAAW,CAAC;IACnC,MAAM,CAAC,SAAS,SAAsB;IAEtC,KAAK,EAAG,cAAc,CAAC,OAAO,CAAC,GAAG;QAChC,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QAClC,UAAU,CAAC,EAAE,GAAG,CAAC;KAClB,CAAC;IAEF,0BAA0B,CAAC,UAAU,EAAE,GAAG;IAU1C,WAAW,CAAC,IAAI,EAAE,gBAAgB,CAAC,IAAI,CAAC;IAexC,gBAAgB,CAAC,iBAAiB,KAAA;IAMlC,aAAa;;;IAIb,iBAAiB;IAcjB,aAAa,CAAC,OAAO,KAAA;IAIrB;;;;;;;QAOI;IACJ,kBAAkB,CAChB,UAAU,KAAA,EACV,MAAM,GAAE;QAAC,UAAU,CAAC,EAAE,OAAO,CAAC;QAAC,SAAS,CAAC,EAAE,GAAG,CAAA;KAAM,GACnD,MAAM,GAAG,OAAO;IAyCnB;;;;;QAKI;IACJ,kBAAkB,CAAC,IAAI,CAAC,EAAE,MAAM;IAYhC,oBAAoB;CAMrB"} \ No newline at end of file diff --git a/modules/aggregation-layers/typed/contour-layer/contour-layer.d.ts b/modules/aggregation-layers/typed/contour-layer/contour-layer.d.ts new file mode 100644 index 00000000000..576edec9995 --- /dev/null +++ b/modules/aggregation-layers/typed/contour-layer/contour-layer.d.ts @@ -0,0 +1,86 @@ +import { + Accessor, + AccessorFunction, + Color, + Layer, + Position, + UpdateParameters, + DefaultProps +} from '@deck.gl/core'; +import GridAggregationLayer, {GridAggregationLayerProps} from '../grid-aggregation-layer'; +/** All properties supported by ContourLayer. */ +export declare type ContourLayerProps = _ContourLayerProps & + GridAggregationLayerProps; +/** Properties added by ContourLayer. */ +export declare type _ContourLayerProps = { + /** + * Size of each cell in meters. + * @default 1000 + */ + cellSize?: number; + /** + * When set to true, aggregation is performed on GPU, provided other conditions are met. + * @default true + */ + gpuAggregation?: boolean; + /** + * Defines the type of aggregation operation, valid values are 'SUM', 'MEAN', 'MIN' and 'MAX'. + * @default 'SUM' + */ + aggregation?: 'SUM' | 'MEAN' | 'MIN' | 'MAX'; + /** + * Definition of contours to be drawn. + * @default [{threshold: 1}] + */ + contours: { + /** + * Isolines: `threshold` value must be a single `Number`, Isolines are generated based on this threshold value. + * + * Isobands: `threshold` value must be an Array of two `Number`s. Isobands are generated using `[threshold[0], threshold[1])` as threshold range, i.e area that has values `>= threshold[0]` and `< threshold[1]` are rendered with corresponding color. NOTE: `threshold[0]` is inclusive and `threshold[1]` is not inclusive. + */ + threshold: number | number[]; + /** + * RGBA color array to be used to render the contour. + * @default [255, 255, 255, 255] + */ + color?: Color; + /** + * Applicable for `Isoline`s only, width of the Isoline in pixels. + * @default 1 + */ + strokeWidth?: number; + /** Defines z order of the contour. */ + zIndex?: number; + }[]; + /** + * A very small z offset that is added for each vertex of a contour (Isoline or Isoband). + * @default 0.005 + */ + zOffset?: number; + /** + * Method called to retrieve the position of each object. + * @default object => object.position + */ + getPosition?: AccessorFunction; + /** + * The weight of each object. + * @default 1 + */ + getWeight?: Accessor; +}; +/** Aggregate data into iso-lines or iso-bands for a given threshold and cell size. */ +export default class ContourLayer extends GridAggregationLayer< + ExtraPropsT & Required<_ContourLayerProps> +> { + static layerName: string; + static defaultProps: DefaultProps>; + initializeState(): void; + updateState(opts: UpdateParameters): void; + renderLayers(): Layer[]; + updateAggregationState(opts: any): void; + private _updateAccessors; + private _resetResults; + private _generateContours; + private _updateThresholdData; +} +// # sourceMappingURL=contour-layer.d.ts.map diff --git a/modules/aggregation-layers/typed/contour-layer/contour-layer.d.ts.map b/modules/aggregation-layers/typed/contour-layer/contour-layer.d.ts.map new file mode 100644 index 00000000000..1cb8b42c620 --- /dev/null +++ b/modules/aggregation-layers/typed/contour-layer/contour-layer.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"contour-layer.d.ts","sourceRoot":"","sources":["../../src/contour-layer/contour-layer.ts"],"names":[],"mappings":"AAuBA,OAAO,EACL,QAAQ,EACR,gBAAgB,EAChB,KAAK,EACL,KAAK,EAEL,QAAQ,EACR,gBAAgB,EAChB,YAAY,EACb,MAAM,eAAe,CAAC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AAC,IAAI,EAAE,gBAAgB,CAAC,IAAI,CAAC,GAAG,IAAI;IAgB/C,YAAY,IAAI,KAAK,EAAE;IA4CvB,sBAAsB,CAAC,IAAI,KAAA;IAyE3B,OAAO,CAAC,gBAAgB;IAUxB,OAAO,CAAC,aAAa;IASrB,OAAO,CAAC,iBAAiB;IAsBzB,OAAO,CAAC,oBAAoB;CAc7B"} \ No newline at end of file diff --git a/modules/aggregation-layers/typed/contour-layer/contour-utils.d.ts b/modules/aggregation-layers/typed/contour-layer/contour-utils.d.ts new file mode 100644 index 00000000000..add0d1e6257 --- /dev/null +++ b/modules/aggregation-layers/typed/contour-layer/contour-utils.d.ts @@ -0,0 +1,24 @@ +export declare function generateContours({ + thresholdData, + cellWeights, + gridSize, + gridOrigin, + cellSize +}: { + thresholdData: any; + cellWeights: Float32Array; + gridSize: number[]; + gridOrigin: number[]; + cellSize: number[]; +}): { + contourSegments: { + start: number[]; + end: number[]; + contour: any; + }[]; + contourPolygons: { + vertices: number[][]; + contour: any; + }[]; +}; +// # sourceMappingURL=contour-utils.d.ts.map diff --git a/modules/aggregation-layers/typed/contour-layer/contour-utils.d.ts.map b/modules/aggregation-layers/typed/contour-layer/contour-utils.d.ts.map new file mode 100644 index 00000000000..926fb4dda37 --- /dev/null +++ b/modules/aggregation-layers/typed/contour-layer/contour-utils.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"contour-utils.d.ts","sourceRoot":"","sources":["../../src/contour-layer/contour-utils.ts"],"names":[],"mappings":"AAIA,wBAAgB,gBAAgB,CAAC,EAC/B,aAAa,EACb,WAAW,EACX,QAAQ,EACR,UAAU,EACV,QAAQ,EACT,EAAE;IACD,aAAa,EAAE,GAAG,CAAC;IACnB,WAAW,EAAE,YAAY,CAAC;IAC1B,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;;eACgC,MAAM,EAAE;aAAO,MAAM,EAAE;iBAAW,GAAG;;;kBAClC,MAAM,EAAE,EAAE;iBAAW,GAAG;;EAyD3D"} \ No newline at end of file diff --git a/modules/aggregation-layers/typed/contour-layer/marching-squares-codes.d.ts b/modules/aggregation-layers/typed/contour-layer/marching-squares-codes.d.ts new file mode 100644 index 00000000000..ef41c266d25 --- /dev/null +++ b/modules/aggregation-layers/typed/contour-layer/marching-squares-codes.d.ts @@ -0,0 +1,34 @@ +export declare const ISOLINES_CODE_OFFSET_MAP: { + 0: any[]; + 1: number[][][]; + 2: number[][][]; + 3: number[][][]; + 4: number[][][]; + 5: { + 0: number[][][]; + 1: number[][][]; + }; + 6: number[][][]; + 7: number[][][]; + 8: number[][][]; + 9: number[][][]; + 10: { + 0: number[][][]; + 1: number[][][]; + }; + 11: number[][][]; + 12: number[][][]; + 13: number[][][]; + 14: number[][][]; + 15: any[]; +}; +export declare const ISOBANDS_CODE_OFFSET_MAP: { + [x: number]: + | number[][][] + | { + 0: number[][][]; + 1: number[][][]; + 2: number[][][]; + }; +}; +// # sourceMappingURL=marching-squares-codes.d.ts.map diff --git a/modules/aggregation-layers/typed/contour-layer/marching-squares-codes.d.ts.map b/modules/aggregation-layers/typed/contour-layer/marching-squares-codes.d.ts.map new file mode 100644 index 00000000000..ea7b020617a --- /dev/null +++ b/modules/aggregation-layers/typed/contour-layer/marching-squares-codes.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"marching-squares-codes.d.ts","sourceRoot":"","sources":["../../src/contour-layer/marching-squares-codes.ts"],"names":[],"mappings":"AAsJA,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;CAyCpC,CAAC;AAMF,eAAO,MAAM,wBAAwB;;;;;;CAqKpC,CAAC"} \ No newline at end of file diff --git a/modules/aggregation-layers/typed/contour-layer/marching-squares.d.ts b/modules/aggregation-layers/typed/contour-layer/marching-squares.d.ts new file mode 100644 index 00000000000..a7437e018cf --- /dev/null +++ b/modules/aggregation-layers/typed/contour-layer/marching-squares.d.ts @@ -0,0 +1,10 @@ +export declare const CONTOUR_TYPE: { + ISO_LINES: number; + ISO_BANDS: number; +}; +export declare function getCode(opts: any): { + code: number; + meanCode: number; +}; +export declare function getVertices(opts: any): number[][] | number[][][]; +// # sourceMappingURL=marching-squares.d.ts.map diff --git a/modules/aggregation-layers/typed/contour-layer/marching-squares.d.ts.map b/modules/aggregation-layers/typed/contour-layer/marching-squares.d.ts.map new file mode 100644 index 00000000000..cca944b3e2f --- /dev/null +++ b/modules/aggregation-layers/typed/contour-layer/marching-squares.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"marching-squares.d.ts","sourceRoot":"","sources":["../../src/contour-layer/marching-squares.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,YAAY;;;CAGxB,CAAC;AAyBF,wBAAgB,OAAO,CAAC,IAAI,KAAA;;;EAyE3B;AAKD,wBAAgB,WAAW,CAAC,IAAI,KAAA,6BA4D/B"} \ No newline at end of file diff --git a/modules/aggregation-layers/typed/cpu-grid-layer/cpu-grid-layer.d.ts b/modules/aggregation-layers/typed/cpu-grid-layer/cpu-grid-layer.d.ts new file mode 100644 index 00000000000..7da9b671326 --- /dev/null +++ b/modules/aggregation-layers/typed/cpu-grid-layer/cpu-grid-layer.d.ts @@ -0,0 +1,155 @@ +import {Accessor, AccessorFunction, Color, Position, Material, DefaultProps} from '@deck.gl/core'; +import AggregationLayer, {AggregationLayerProps} from '../aggregation-layer'; +import {Layer, UpdateParameters, GetPickingInfoParams, PickingInfo} from '@deck.gl/core'; +import {AggregateAccessor} from '../types'; +/** All properties supported by CPUGridLayer. */ +export declare type CPUGridLayerProps = _CPUGridLayerProps & + AggregationLayerProps; +/** Properties added by CPUGridLayer. */ +export declare type _CPUGridLayerProps = { + /** + * Size of each cell in meters. + * @default 1000 + */ + cellSize?: number; + /** + * Color scale domain, default is set to the extent of aggregated weights in each cell. + * @default [min(colorWeight), max(colorWeight)] + */ + colorDomain?: [number, number] | null; + /** + * Default: [colorbrewer](http://colorbrewer2.org/#type=sequential&scheme=YlOrRd&n=6) `6-class YlOrRd` + */ + colorRange?: Color[]; + /** + * Cell size multiplier, clamped between 0 - 1. + * @default 1 + */ + coverage?: number; + /** + * Elevation scale input domain, default is set to between 0 and the max of aggregated weights in each cell. + * @default [0, max(elevationWeight)] + */ + elevationDomain?: [number, number] | null; + /** + * Elevation scale output range. + * @default [0, 1000] + */ + elevationRange?: [number, number]; + /** + * Cell elevation multiplier. + * @default 1 + */ + elevationScale?: number; + /** + * Whether to enable cell elevation. If set to false, all cell will be flat. + * @default true + */ + extruded?: boolean; + /** + * Filter cells and re-calculate color by `upperPercentile`. + * Cells with value arger than the upperPercentile will be hidden. + * @default 100 + */ + upperPercentile?: number; + /** + * Filter cells and re-calculate color by `lowerPercentile`. + * Cells with value smaller than the lowerPercentile will be hidden. + * @default 0 + */ + lowerPercentile?: number; + /** + * Filter cells and re-calculate elevation by `elevationUpperPercentile`. + * Cells with elevation value larger than the `elevationUpperPercentile` will be hidden. + * @default 100 + */ + elevationUpperPercentile?: number; + /** + * Filter cells and re-calculate elevation by `elevationLowerPercentile`. + * Cells with elevation value larger than the `elevationLowerPercentile` will be hidden. + * @default 0 + */ + elevationLowerPercentile?: number; + /** + * Scaling function used to determine the color of the grid cell, default value is 'quantize'. + * Supported Values are 'quantize', 'linear', 'quantile' and 'ordinal'. + * @default 'quantize' + */ + colorScaleType?: 'quantize' | 'linear' | 'quantile' | 'ordinal'; + /** + * Scaling function used to determine the elevation of the grid cell, only supports 'linear'. + */ + elevationScaleType?: 'linear'; + gridAggregator?: (props: any, params: any) => any; + /** + * Material settings for lighting effect. Applies if `extruded: true`. + * + * @default true + * @see https://deck.gl/docs/developer-guide/using-lighting + */ + material?: Material; + /** + * Defines the operation used to aggregate all data object weights to calculate a cell's color value. + * @default 'SUM' + */ + colorAggregation?: 'SUM' | 'MEAN' | 'MIN' | 'MAX'; + /** + * Defines the operation used to aggregate all data object weights to calculate a cell's elevation value. + * @default 'SUM' + */ + elevationAggregation?: 'SUM' | 'MEAN' | 'MIN' | 'MAX'; + /** + * Method called to retrieve the position of each object. + * @default object => object.position + */ + getPosition?: AccessorFunction; + /** + * The weight of a data object used to calculate the color value for a cell. + * @default 1 + */ + getColorWeight?: Accessor; + /** + * After data objects are aggregated into cells, this accessor is called on each cell to get the value that its color is based on. + * @default null + */ + getColorValue?: AggregateAccessor | null; + /** + * The weight of a data object used to calculate the elevation value for a cell. + * @default 1 + */ + getElevationWeight?: Accessor; + /** + * After data objects are aggregated into cells, this accessor is called on each cell to get the value that its elevation is based on. + * @default null + */ + getElevationValue?: AggregateAccessor | null; + /** + * This callback will be called when bin color domain has been calculated. + * @default () => {} + */ + onSetColorDomain?: (minMax: [number, number]) => void; + /** + * This callback will be called when bin elevation domain has been calculated. + * @default () => {} + */ + onSetElevationDomain?: (minMax: [number, number]) => void; + /** + * (Experimental) Filter data objects + */ + _filterData: null | ((d: DataT) => boolean); +}; +/** Aggregate data into a grid-based heatmap. Aggregation is performed on CPU. */ +export default class CPUGridLayer extends AggregationLayer< + ExtraPropsT & Required<_CPUGridLayerProps> +> { + static layerName: string; + static defaultProps: DefaultProps>; + initializeState(): void; + updateState(opts: UpdateParameters): void; + getPickingInfo({info}: GetPickingInfoParams): PickingInfo; + _onGetSublayerColor(cell: any): any; + _onGetSublayerElevation(cell: any): any; + _getSublayerUpdateTriggers(): any; + renderLayers(): Layer; +} +// # sourceMappingURL=cpu-grid-layer.d.ts.map diff --git a/modules/aggregation-layers/typed/cpu-grid-layer/cpu-grid-layer.d.ts.map b/modules/aggregation-layers/typed/cpu-grid-layer/cpu-grid-layer.d.ts.map new file mode 100644 index 00000000000..66410c5862e --- /dev/null +++ b/modules/aggregation-layers/typed/cpu-grid-layer/cpu-grid-layer.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"cpu-grid-layer.d.ts","sourceRoot":"","sources":["../../src/cpu-grid-layer/cpu-grid-layer.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAC,QAAQ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,KAAK,GAAG,GAAG,EAAE,WAAW,GAAG,EAAE,CAAE,SAAQ,gBAAgB,CACvF,WAAW,GAAG,QAAQ,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC,CAClD;IACC,MAAM,CAAC,SAAS,SAAkB;IAClC,MAAM,CAAC,YAAY,uCAAgB;IAEnC,eAAe,IAAI,IAAI;IAkBvB,WAAW,CAAC,IAAI,EAAE,gBAAgB,CAAC,IAAI,CAAC;IAYxC,cAAc,CAAC,EAAC,IAAI,EAAC,EAAE,oBAAoB,GAAG,WAAW;IAKzD,mBAAmB,CAAC,IAAI,KAAA;IAKxB,uBAAuB,CAAC,IAAI,KAAA;IAI5B,0BAA0B;IAI1B,YAAY,IAAI,KAAK;CA8BtB"} \ No newline at end of file diff --git a/modules/aggregation-layers/typed/cpu-grid-layer/grid-aggregator.d.ts b/modules/aggregation-layers/typed/cpu-grid-layer/grid-aggregator.d.ts new file mode 100644 index 00000000000..151c27abbb1 --- /dev/null +++ b/modules/aggregation-layers/typed/cpu-grid-layer/grid-aggregator.d.ts @@ -0,0 +1,27 @@ +/** + * Calculate density grid from an array of points + * @param {Object} props - object containing : + * @param {Iterable} [props.data] - data objects to be aggregated + * @param {Integer} [props.cellSize] - size of the grid cell + * + * @param {Object} aggregationParams - object containing : + * @param {Object} gridOffset - {xOffset, yOffset} cell size in meters + * @param {Integer} width - width of the grid + * @param {Integer} height - height of the grid + * @param {Boolean} projectPoints - `true` if doing screen space projection, `false` otherwise + * @param {Array} attributes - attributes array containing position values + * @param {Viewport} viewport - viewport to be used for projection + * @param {Array} posOffset - [xOffset, yOffset] offset to be applied to positions to get cell index + * @param {Object} boundingBox - {xMin, yMin, xMax, yMax} bounding box of input data + * + * @returns {object} - grid data, cell dimension + */ +export declare function pointToDensityGridDataCPU( + props: any, + aggregationParams: any +): { + gridHash: {}; + gridOffset: any; + data: any[]; +}; +// # sourceMappingURL=grid-aggregator.d.ts.map diff --git a/modules/aggregation-layers/typed/cpu-grid-layer/grid-aggregator.d.ts.map b/modules/aggregation-layers/typed/cpu-grid-layer/grid-aggregator.d.ts.map new file mode 100644 index 00000000000..99f91590d3b --- /dev/null +++ b/modules/aggregation-layers/typed/cpu-grid-layer/grid-aggregator.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"grid-aggregator.d.ts","sourceRoot":"","sources":["../../src/cpu-grid-layer/grid-aggregator.ts"],"names":[],"mappings":"AAuBA;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,yBAAyB,CAAC,KAAK,KAAA,EAAE,iBAAiB,KAAA;;;;EAUjE"} \ No newline at end of file diff --git a/modules/aggregation-layers/typed/gpu-grid-layer/gpu-grid-cell-layer-fragment.glsl.d.ts b/modules/aggregation-layers/typed/gpu-grid-layer/gpu-grid-cell-layer-fragment.glsl.d.ts new file mode 100644 index 00000000000..bd7adad78bd --- /dev/null +++ b/modules/aggregation-layers/typed/gpu-grid-layer/gpu-grid-cell-layer-fragment.glsl.d.ts @@ -0,0 +1,3 @@ +declare const _default: '#version 300 es\n#define SHADER_NAME gpu-grid-cell-layer-fragment-shader\n\nprecision highp float;\n\nin vec4 vColor;\n\nout vec4 fragColor;\n\nvoid main(void) {\n fragColor = vColor;\n fragColor = picking_filterColor(fragColor);\n}\n'; +export default _default; +// # sourceMappingURL=gpu-grid-cell-layer-fragment.glsl.d.ts.map diff --git a/modules/aggregation-layers/typed/gpu-grid-layer/gpu-grid-cell-layer-fragment.glsl.d.ts.map b/modules/aggregation-layers/typed/gpu-grid-layer/gpu-grid-cell-layer-fragment.glsl.d.ts.map new file mode 100644 index 00000000000..9f2a452dcc2 --- /dev/null +++ b/modules/aggregation-layers/typed/gpu-grid-layer/gpu-grid-cell-layer-fragment.glsl.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"gpu-grid-cell-layer-fragment.glsl.d.ts","sourceRoot":"","sources":["../../src/gpu-grid-layer/gpu-grid-cell-layer-fragment.glsl.ts"],"names":[],"mappings":";AAoBA,wBAcE"} \ No newline at end of file diff --git a/modules/aggregation-layers/typed/gpu-grid-layer/gpu-grid-cell-layer-vertex.glsl.d.ts b/modules/aggregation-layers/typed/gpu-grid-layer/gpu-grid-cell-layer-vertex.glsl.d.ts new file mode 100644 index 00000000000..9b39fc3356e --- /dev/null +++ b/modules/aggregation-layers/typed/gpu-grid-layer/gpu-grid-cell-layer-vertex.glsl.d.ts @@ -0,0 +1,3 @@ +declare const _default: '#version 300 es\n#define SHADER_NAME gpu-grid-cell-layer-vertex-shader\n#define RANGE_COUNT 6\n\nin vec3 positions;\nin vec3 normals;\n\nin vec4 colors;\nin vec4 elevations;\nin vec3 instancePickingColors;\n\n// Custom uniforms\nuniform vec2 offset;\nuniform bool extruded;\nuniform float cellSize;\nuniform float coverage;\nuniform float opacity;\nuniform float elevationScale;\n\nuniform ivec2 gridSize;\nuniform vec2 gridOrigin;\nuniform vec2 gridOriginLow;\nuniform vec2 gridOffset;\nuniform vec2 gridOffsetLow;\nuniform vec4 colorRange[RANGE_COUNT];\nuniform vec2 elevationRange;\n\n// Domain uniforms\nuniform vec2 colorDomain;\nuniform bool colorDomainValid;\nuniform vec2 elevationDomain;\nuniform bool elevationDomainValid;\n\nlayout(std140) uniform;\nuniform ColorData\n{\n vec4 maxMinCount;\n} colorData;\nuniform ElevationData\n{\n vec4 maxMinCount;\n} elevationData;\n\n#define EPSILON 0.00001\n\n// Result\nout vec4 vColor;\n\nvec4 quantizeScale(vec2 domain, vec4 range[RANGE_COUNT], float value) {\n vec4 outColor = vec4(0., 0., 0., 0.);\n if (value >= (domain.x - EPSILON) && value <= (domain.y + EPSILON)) {\n float domainRange = domain.y - domain.x;\n if (domainRange <= 0.) {\n outColor = colorRange[0];\n } else {\n float rangeCount = float(RANGE_COUNT);\n float rangeStep = domainRange / rangeCount;\n float idx = floor((value - domain.x) / rangeStep);\n idx = clamp(idx, 0., rangeCount - 1.);\n int intIdx = int(idx);\n outColor = colorRange[intIdx];\n }\n }\n return outColor;\n}\n\nfloat linearScale(vec2 domain, vec2 range, float value) {\n if (value >= (domain.x - EPSILON) && value <= (domain.y + EPSILON)) {\n return ((value - domain.x) / (domain.y - domain.x)) * (range.y - range.x) + range.x;\n }\n return -1.;\n}\n\nvoid main(void) {\n vec2 clrDomain = colorDomainValid ? colorDomain : vec2(colorData.maxMinCount.a, colorData.maxMinCount.r);\n vec4 color = quantizeScale(clrDomain, colorRange, colors.r);\n\n float elevation = 0.0;\n\n if (extruded) {\n vec2 elvDomain = elevationDomainValid ? elevationDomain : vec2(elevationData.maxMinCount.a, elevationData.maxMinCount.r);\n elevation = linearScale(elvDomain, elevationRange, elevations.r);\n elevation = elevation * (positions.z + 1.0) / 2.0 * elevationScale;\n }\n\n // if aggregated color or elevation is 0 do not render\n float shouldRender = float(color.r > 0.0 && elevations.r >= 0.0);\n float dotRadius = cellSize / 2. * coverage * shouldRender;\n\n int yIndex = (gl_InstanceID / gridSize[0]);\n int xIndex = gl_InstanceID - (yIndex * gridSize[0]);\n\n vec2 instancePositionXFP64 = mul_fp64(vec2(gridOffset[0], gridOffsetLow[0]), vec2(float(xIndex), 0.));\n instancePositionXFP64 = sum_fp64(instancePositionXFP64, vec2(gridOrigin[0], gridOriginLow[0]));\n vec2 instancePositionYFP64 = mul_fp64(vec2(gridOffset[1], gridOffsetLow[1]), vec2(float(yIndex), 0.));\n instancePositionYFP64 = sum_fp64(instancePositionYFP64, vec2(gridOrigin[1], gridOriginLow[1]));\n\n vec3 centroidPosition = vec3(instancePositionXFP64[0], instancePositionYFP64[0], elevation);\n vec3 centroidPosition64Low = vec3(instancePositionXFP64[1], instancePositionYFP64[1], 0.0);\n geometry.worldPosition = centroidPosition;\n vec3 pos = vec3(project_size(positions.xy + offset) * dotRadius, 0.);\n\n // Set color to be rendered to picking fbo (also used to check for selection highlight).\n picking_setPickingColor(instancePickingColors);\n\n gl_Position = project_position_to_clipspace(centroidPosition, centroidPosition64Low, pos, geometry.position);\n\n // Light calculations\n // Worldspace is the linear space after Mercator projection\n\n vec3 normals_commonspace = project_normal(normals);\n\n if (extruded) {\n vec3 lightColor = lighting_getLightColor(color.rgb, project_uCameraPosition, geometry.position.xyz, normals_commonspace);\n vColor = vec4(lightColor, color.a * opacity) / 255.;\n } else {\n vColor = vec4(color.rgb, color.a * opacity) / 255.;\n }\n}\n'; +export default _default; +// # sourceMappingURL=gpu-grid-cell-layer-vertex.glsl.d.ts.map diff --git a/modules/aggregation-layers/typed/gpu-grid-layer/gpu-grid-cell-layer-vertex.glsl.d.ts.map b/modules/aggregation-layers/typed/gpu-grid-layer/gpu-grid-cell-layer-vertex.glsl.d.ts.map new file mode 100644 index 00000000000..f121ea33b60 --- /dev/null +++ b/modules/aggregation-layers/typed/gpu-grid-layer/gpu-grid-cell-layer-vertex.glsl.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"gpu-grid-cell-layer-vertex.glsl.d.ts","sourceRoot":"","sources":["../../src/gpu-grid-layer/gpu-grid-cell-layer-vertex.glsl.ts"],"names":[],"mappings":";AAsBA,wBAwHE"} \ No newline at end of file diff --git a/modules/aggregation-layers/typed/gpu-grid-layer/gpu-grid-cell-layer.d.ts b/modules/aggregation-layers/typed/gpu-grid-layer/gpu-grid-cell-layer.d.ts new file mode 100644 index 00000000000..60b92854960 --- /dev/null +++ b/modules/aggregation-layers/typed/gpu-grid-layer/gpu-grid-cell-layer.d.ts @@ -0,0 +1,34 @@ +import {Layer, LayerProps, DefaultProps} from '@deck.gl/core'; +import {Model, Buffer} from '@luma.gl/webgl-legacy'; +import type {_GPUGridLayerProps} from './gpu-grid-layer'; +declare type _GPUGridCellLayerProps = _GPUGridLayerProps & { + offset: number[]; + gridSize: number[]; + gridOrigin: number[]; + gridOffset: number[]; + colorMaxMinBuffer: Buffer; + elevationMaxMinBuffer: Buffer; +}; +export default class GPUGridCellLayer extends Layer<_GPUGridCellLayerProps> { + static layerName: string; + static defaultProps: DefaultProps< + _GPUGridLayerProps & { + offset: number[]; + gridSize: number[]; + gridOrigin: number[]; + gridOffset: number[]; + colorMaxMinBuffer: Buffer; + elevationMaxMinBuffer: Buffer; + } & LayerProps + >; + getShaders(): any; + initializeState(): void; + _getModel(): Model; + draw({uniforms}: {uniforms: any}): void; + bindUniformBuffers(colorMaxMinBuffer: any, elevationMaxMinBuffer: any): void; + unbindUniformBuffers(colorMaxMinBuffer: any, elevationMaxMinBuffer: any): void; + getDomainUniforms(): Record; + private _setupUniformBuffer; +} +export {}; +// # sourceMappingURL=gpu-grid-cell-layer.d.ts.map diff --git a/modules/aggregation-layers/typed/gpu-grid-layer/gpu-grid-cell-layer.d.ts.map b/modules/aggregation-layers/typed/gpu-grid-layer/gpu-grid-cell-layer.d.ts.map new file mode 100644 index 00000000000..f37c9ccd4a2 --- /dev/null +++ b/modules/aggregation-layers/typed/gpu-grid-layer/gpu-grid-cell-layer.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"gpu-grid-cell-layer.d.ts","sourceRoot":"","sources":["../../src/gpu-grid-layer/gpu-grid-cell-layer.ts"],"names":[],"mappings":"AAoBA,OAAO,EACL,KAAK,EAKL,UAAU,EACV,YAAY,EACb,MAAM,eAAe,CAAC;AAGvB,OAAO,EAAK,KAAK,EAAE,MAAM,EAAC,MAAM,uBAAuB,CAAC;AAExD,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,kBAAkB,CAAC;AA8BzD,aAAK,sBAAsB,GAAG,kBAAkB,CAAC,GAAG,CAAC,GAAG;IACtD,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,qBAAqB,EAAE,MAAM,CAAC;CAC/B,CAAC;AAEF,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,KAAK,CAAC,sBAAsB,CAAC;IACzE,MAAM,CAAC,SAAS,SAAsB;IACtC,MAAM,CAAC,YAAY;;;;;;;yBAAgB;IAEnC,UAAU;IAQV,eAAe,IAAI,IAAI;IAiBvB,SAAS,IAAI,KAAK;IASlB,IAAI,CAAC,EAAC,QAAQ,EAAC;;KAAA;IAyCf,kBAAkB,CAAC,iBAAiB,KAAA,EAAE,qBAAqB,KAAA;IAK3D,oBAAoB,CAAC,iBAAiB,KAAA,EAAE,qBAAqB,KAAA;IAK7D,iBAAiB;IAkBjB,OAAO,CAAC,mBAAmB;CAS5B"} \ No newline at end of file diff --git a/modules/aggregation-layers/typed/gpu-grid-layer/gpu-grid-layer.d.ts b/modules/aggregation-layers/typed/gpu-grid-layer/gpu-grid-layer.d.ts new file mode 100644 index 00000000000..b8cdc69af86 --- /dev/null +++ b/modules/aggregation-layers/typed/gpu-grid-layer/gpu-grid-layer.d.ts @@ -0,0 +1,107 @@ +import { + Accessor, + AccessorFunction, + Color, + Material, + GetPickingInfoParams, + LayerContext, + PickingInfo, + Position, + DefaultProps +} from '@deck.gl/core'; +import GPUGridCellLayer from './gpu-grid-cell-layer'; +import GridAggregationLayer, {GridAggregationLayerProps} from '../grid-aggregation-layer'; +/** All properties supported by GPUGridLayer. */ +export declare type GPUGridLayerProps = _GPUGridLayerProps & + GridAggregationLayerProps; +/** Properties added by GPUGridLayer. */ +export declare type _GPUGridLayerProps = { + /** + * Size of each cell in meters. + * @default 1000 + */ + cellSize?: number; + /** + * Color scale domain, default is set to the extent of aggregated weights in each cell. + * @default [min(colorWeight), max(colorWeight)] + */ + colorDomain?: [number, number] | null; + /** + * Default: [colorbrewer](http://colorbrewer2.org/#type=sequential&scheme=YlOrRd&n=6) `6-class YlOrRd` + */ + colorRange?: Color[]; + /** + * Cell size multiplier, clamped between 0 - 1. + * @default 1 + */ + coverage?: number; + /** + * Elevation scale input domain, default is set to between 0 and the max of aggregated weights in each cell. + * @default [0, max(elevationWeight)] + */ + elevationDomain?: [number, number] | null; + /** + * Elevation scale output range. + * @default [0, 1000] + */ + elevationRange?: [number, number]; + /** + * Cell elevation multiplier. + * @default 1 + */ + elevationScale?: number; + /** + * Whether to enable cell elevation. If set to false, all cell will be flat. + * @default true + */ + extruded?: boolean; + /** + * Material settings for lighting effect. Applies if `extruded: true`. + * + * @default true + * @see https://deck.gl/docs/developer-guide/using-lighting + */ + material?: Material; + /** + * Defines the operation used to aggregate all data object weights to calculate a cell's color value. + * @default 'SUM' + */ + colorAggregation?: 'SUM' | 'MEAN' | 'MIN' | 'MAX'; + /** + * Defines the operation used to aggregate all data object weights to calculate a cell's elevation value. + * @default 'SUM' + */ + elevationAggregation?: 'SUM' | 'MEAN' | 'MIN' | 'MAX'; + /** + * Method called to retrieve the position of each object. + * @default object => object.position + */ + getPosition?: AccessorFunction; + /** + * The weight of a data object used to calculate the color value for a cell. + * @default 1 + */ + getColorWeight?: Accessor; + /** + * The weight of a data object used to calculate the elevation value for a cell. + * @default 1 + */ + getElevationWeight?: Accessor; +}; +/** Aggregate data into a grid-based heatmap. Aggregation is performed on GPU (WebGL2 only). */ +export default class GPUGridLayer extends GridAggregationLayer< + ExtraPropsT & Required<_GPUGridLayerProps> +> { + static layerName: string; + static defaultProps: DefaultProps>; + initializeState({device}: LayerContext): void; + updateState(opts: any): void; + getHashKeyForIndex(index: number): string; + getPositionForIndex(index: number): Position; + getPickingInfo({info, mode}: GetPickingInfoParams): PickingInfo; + renderLayers(): GPUGridCellLayer; + finalizeState(context: LayerContext): void; + updateAggregationState(opts: any): void; + _updateAccessors(opts: any): void; +} +// # sourceMappingURL=gpu-grid-layer.d.ts.map diff --git a/modules/aggregation-layers/typed/gpu-grid-layer/gpu-grid-layer.d.ts.map b/modules/aggregation-layers/typed/gpu-grid-layer/gpu-grid-layer.d.ts.map new file mode 100644 index 00000000000..f99fd2ad77e --- /dev/null +++ b/modules/aggregation-layers/typed/gpu-grid-layer/gpu-grid-layer.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"gpu-grid-layer.d.ts","sourceRoot":"","sources":["../../src/gpu-grid-layer/gpu-grid-layer.ts"],"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AAgB,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;IAEhD;;;OAGG;IACH,cAAc,CAAC,EAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IAEzC;;;OAGG;IACH,kBAAkB,CAAC,EAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;CAC9C,CAAC;AAEF,+FAA+F;AAC/F,MAAM,CAAC,OAAO,OAAO,YAAY,CAAC,KAAK,GAAG,GAAG,EAAE,WAAW,GAAG,EAAE,CAAE,SAAQ,oBAAoB,CAC3F,WAAW,GAAG,QAAQ,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC,CAClD;IACC,MAAM,CAAC,SAAS,SAAkB;IAClC,MAAM,CAAC,YAAY,uCAAgB;IAEnC,eAAe,CAAC,EAAC,MAAM,EAAC,EAAE,YAAY,GAAG,IAAI;IA+C7C,WAAW,CAAC,IAAI,KAAA;IAehB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAkBzC,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,QAAQ;IAa5C,cAAc,CAAC,EAAC,IAAI,EAAE,IAAI,EAAC,EAAE,oBAAoB,GAAG,WAAW;IAqD/D,YAAY;IAsDZ,aAAa,CAAC,OAAO,EAAE,YAAY;IAYnC,sBAAsB,CAAC,IAAI,KAAA;IAoD3B,gBAAgB,CAAC,IAAI,KAAA;CAMtB"} \ No newline at end of file diff --git a/modules/aggregation-layers/typed/grid-aggregation-layer.d.ts b/modules/aggregation-layers/typed/grid-aggregation-layer.d.ts new file mode 100644 index 00000000000..9b569dba627 --- /dev/null +++ b/modules/aggregation-layers/typed/grid-aggregation-layer.d.ts @@ -0,0 +1,37 @@ +import {LayerContext, UpdateParameters} from '@deck.gl/core'; +import AggregationLayer, {AggregationLayerProps} from './aggregation-layer'; +import BinSorter from './utils/bin-sorter'; +export declare type GridAggregationLayerProps = AggregationLayerProps; +export default abstract class GridAggregationLayer< + ExtraPropsT = {} +> extends AggregationLayer { + static layerName: string; + state: AggregationLayer['state'] & { + aggregationDataDirty?: any; + aggregationWeightsDirty?: any; + gpuAggregation?: any; + getValue?: () => any; + sortedBins?: BinSorter; + }; + initializeAggregationLayer({dimensions}: {dimensions: any}): void; + updateState(opts: UpdateParameters): void; + finalizeState(context: LayerContext): void; + updateShaders(shaders: any): void; + updateAggregationState(opts: any): void; + allocateResources(numRow: any, numCol: any): void; + updateResults({ + aggregationData, + maxMinData, + maxData, + minData + }: { + aggregationData: any; + maxMinData: any; + maxData: any; + minData: any; + }): void; + _updateAggregation(opts: any): void; + _updateWeightBins(): void; + _uploadAggregationResults(): void; +} +// # sourceMappingURL=grid-aggregation-layer.d.ts.map diff --git a/modules/aggregation-layers/typed/grid-aggregation-layer.d.ts.map b/modules/aggregation-layers/typed/grid-aggregation-layer.d.ts.map new file mode 100644 index 00000000000..e73de7a09ad --- /dev/null +++ b/modules/aggregation-layers/typed/grid-aggregation-layer.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"grid-aggregation-layer.d.ts","sourceRoot":"","sources":["../src/grid-aggregation-layer.ts"],"names":[],"mappings":"AAqBA,OAAO,EAAC,YAAY,EAAO,gBAAgB,EAAC,MAAM,eAAe,CAAC;AAClE,OAAO,gBAAgB,EAAE,EAAC,qBAAqB,EAAC,MAAM,qBAAqB,CAAC;AAE5E,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAG3C,oBAAY,yBAAyB,CAAC,KAAK,GAAG,GAAG,IAAI,qBAAqB,CAAC,KAAK,CAAC,CAAC;AAElF,MAAM,CAAC,OAAO,CAAC,QAAQ,OAAO,oBAAoB,CAChD,WAAW,GAAG,EAAE,CAChB,SAAQ,gBAAgB,CAAC,WAAW,CAAC;IACrC,MAAM,CAAC,SAAS,SAA0B;IAE1C,KAAK,EAAG,gBAAgB,CAAC,OAAO,CAAC,GAAG;QAClC,oBAAoB,CAAC,EAAE,GAAG,CAAC;QAC3B,uBAAuB,CAAC,EAAE,GAAG,CAAC;QAC9B,cAAc,CAAC,EAAE,GAAG,CAAC;QACrB,QAAQ,CAAC,EAAE,MAAM,GAAG,CAAC;QACrB,UAAU,CAAC,EAAE,SAAS,CAAC;KACxB,CAAC;IAEF,0BAA0B,CAAC,EAAC,UAAU,EAAC;;KAAA;IAYvC,WAAW,CAAC,IAAI,EAAE,gBAAgB,CAAC,IAAI,CAAC;IA8BxC,aAAa,CAAC,OAAO,EAAE,YAAY;IASnC,aAAa,CAAC,OAAO,EAAE,GAAG,GAAG,IAAI;IAQjC,sBAAsB,CAAC,IAAI,KAAA;IAK3B,iBAAiB,CAAC,MAAM,KAAA,EAAE,MAAM,KAAA;IAqBhC,aAAa,CAAC,EAAC,eAAe,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,EAAC;;;;;KAAA;IAY7D,kBAAkB,CAAC,IAAI,KAAA;IAgDvB,iBAAiB;IAOjB,yBAAyB,IAAI,IAAI;CAoBlC"} \ No newline at end of file diff --git a/modules/aggregation-layers/typed/grid-layer/grid-layer.d.ts b/modules/aggregation-layers/typed/grid-layer/grid-layer.d.ts new file mode 100644 index 00000000000..4d92696445b --- /dev/null +++ b/modules/aggregation-layers/typed/grid-layer/grid-layer.d.ts @@ -0,0 +1,42 @@ +import { + CompositeLayer, + CompositeLayerProps, + Layer, + UpdateParameters, + DefaultProps +} from '@deck.gl/core'; +import {_GPUGridLayerProps} from '../gpu-grid-layer/gpu-grid-layer'; +import {_CPUGridLayerProps} from '../cpu-grid-layer/cpu-grid-layer'; +/** All properties supported by GridLayer. */ +export declare type GridLayerProps = _GridLayerProps & + CompositeLayerProps; +/** Properties added by GridLayer. */ +declare type _GridLayerProps = _CPUGridLayerProps & + _GPUGridLayerProps & { + /** + * Whether the aggregation should be performed in high-precision 64-bit mode. + * @default false + */ + fp64?: boolean; + /** + * When set to true, aggregation is performed on GPU, provided other conditions are met. + * @default false + */ + gpuAggregation?: boolean; + }; +/** Aggregate data into a grid-based heatmap. The color and height of a cell are determined based on the objects it contains. */ +export default class GridLayer extends CompositeLayer< + ExtraPropsT & Required<_GridLayerProps> +> { + static layerName: string; + static defaultProps: DefaultProps>; + state: CompositeLayer['state'] & { + useGPUAggregation: boolean; + }; + initializeState(): void; + updateState({props}: UpdateParameters): void; + renderLayers(): Layer; + canUseGPUAggregation(props: GridLayer['props']): boolean; +} +export {}; +// # sourceMappingURL=grid-layer.d.ts.map diff --git a/modules/aggregation-layers/typed/grid-layer/grid-layer.d.ts.map b/modules/aggregation-layers/typed/grid-layer/grid-layer.d.ts.map new file mode 100644 index 00000000000..9e4b73f77ba --- /dev/null +++ b/modules/aggregation-layers/typed/grid-layer/grid-layer.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"grid-layer.d.ts","sourceRoot":"","sources":["../../src/grid-layer/grid-layer.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,mBAAmB,EACnB,KAAK,EACL,gBAAgB,EAChB,YAAY,EACb,MAAM,eAAe,CAAC;AAEvB,OAAqB,EAAC,kBAAkB,EAAC,MAAM,kCAAkC,CAAC;AAClF,OAAqB,EAAC,kBAAkB,EAAC,MAAM,kCAAkC,CAAC;AAQlF,6CAA6C;AAC7C,oBAAY,cAAc,CAAC,KAAK,GAAG,GAAG,IAAI,eAAe,CAAC,KAAK,CAAC,GAAG,mBAAmB,CAAC,KAAK,CAAC,CAAC;AAE9F,qCAAqC;AACrC,aAAK,eAAe,CAAC,KAAK,IAAI,kBAAkB,CAAC,KAAK,CAAC,GACrD,kBAAkB,CAAC,KAAK,CAAC,GAAG;IAC1B;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IAEf;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B,CAAC;AAEJ,gIAAgI;AAChI,MAAM,CAAC,OAAO,OAAO,SAAS,CAAC,KAAK,GAAG,GAAG,EAAE,WAAW,GAAG,EAAE,CAAE,SAAQ,cAAc,CAClF,WAAW,GAAG,QAAQ,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC,CAC/C;IACC,MAAM,CAAC,SAAS,SAAe;IAC/B,MAAM,CAAC,YAAY,oCAAgB;IAEnC,KAAK,EAAG,cAAc,CAAC,OAAO,CAAC,GAAG;QAChC,iBAAiB,EAAE,OAAO,CAAC;KAC5B,CAAC;IAEF,eAAe;IAMf,WAAW,CAAC,EAAC,KAAK,EAAC,EAAE,gBAAgB,CAAC,IAAI,CAAC;IAM3C,YAAY,IAAI,KAAK;IAoBrB,oBAAoB,CAAC,KAAK,EAAE,SAAS,CAAC,OAAO,CAAC;CA8B/C"} \ No newline at end of file diff --git a/modules/aggregation-layers/typed/heatmap-layer/heatmap-layer-utils.d.ts b/modules/aggregation-layers/typed/heatmap-layer/heatmap-layer-utils.d.ts new file mode 100644 index 00000000000..797eb78659b --- /dev/null +++ b/modules/aggregation-layers/typed/heatmap-layer/heatmap-layer-utils.d.ts @@ -0,0 +1,22 @@ +import {Device} from '@luma.gl/api'; +import {GL} from '@luma.gl/webgl-legacy'; +export declare function getBounds(points: number[][]): number[]; +export declare function boundsContain(currentBounds: number[], targetBounds: number[]): boolean; +export declare function packVertices(points: number[][], dimensions?: number): Float32Array; +export declare function scaleToAspectRatio( + boundingBox: number[], + width: number, + height: number +): number[]; +export declare function getTextureCoordinates(point: number[], bounds: number[]): number[]; +export declare function getTextureParams({ + device, + floatTargetSupport +}: { + device: Device; + floatTargetSupport?: boolean; +}): { + format: GL; + type: GL; +}; +// # sourceMappingURL=heatmap-layer-utils.d.ts.map diff --git a/modules/aggregation-layers/typed/heatmap-layer/heatmap-layer-utils.d.ts.map b/modules/aggregation-layers/typed/heatmap-layer/heatmap-layer-utils.d.ts.map new file mode 100644 index 00000000000..066c5f59b3c --- /dev/null +++ b/modules/aggregation-layers/typed/heatmap-layer/heatmap-layer-utils.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"heatmap-layer-utils.d.ts","sourceRoot":"","sources":["../../src/heatmap-layer/heatmap-layer-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,MAAM,EAAC,MAAM,cAAc,CAAC;AACpC,OAAO,EAAC,EAAE,EAAC,MAAM,uBAAuB,CAAC;AAEzC,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,GAAG,MAAM,EAAE,CAWtD;AAGD,wBAAgB,aAAa,CAAC,aAAa,EAAE,MAAM,EAAE,EAAE,YAAY,EAAE,MAAM,EAAE,GAAG,OAAO,CAUtF;AAKD,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE,UAAU,GAAE,MAAU,GAAG,YAAY,CAQrF;AAGD,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CA6BjG;AAGD,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,YAGtE;AAGD,wBAAgB,gBAAgB,CAAC,EAC/B,MAAM,EACN,kBAAkB,EACnB,EAAE;IACD,MAAM,EAAE,MAAM,CAAC;IACf,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B;;;EAWA"} \ No newline at end of file diff --git a/modules/aggregation-layers/typed/heatmap-layer/heatmap-layer.d.ts b/modules/aggregation-layers/typed/heatmap-layer/heatmap-layer.d.ts new file mode 100644 index 00000000000..dd4600f4063 --- /dev/null +++ b/modules/aggregation-layers/typed/heatmap-layer/heatmap-layer.d.ts @@ -0,0 +1,135 @@ +import {Buffer, Texture2D} from '@luma.gl/webgl-legacy'; +import { + Accessor, + AccessorFunction, + AttributeManager, + ChangeFlags, + Color, + Layer, + LayerContext, + LayersList, + Position, + UpdateParameters, + DefaultProps +} from '@deck.gl/core'; +import AggregationLayer, {AggregationLayerProps} from '../aggregation-layer'; +export declare type HeatmapLayerProps = _HeatmapLayerProps & + AggregationLayerProps; +declare type _HeatmapLayerProps = { + /** + * Radius of the circle in pixels, to which the weight of an object is distributed. + * + * @default 30 + */ + radiusPixels?: number; + /** + * Specified as an array of colors [color1, color2, ...]. + * + * @default `6-class YlOrRd` - [colorbrewer](http://colorbrewer2.org/#type=sequential&scheme=YlOrRd&n=6) + */ + colorRange?: Color[]; + /** + * Value that is multiplied with the total weight at a pixel to obtain the final weight. + * + * @default 1 + */ + intensity?: number; + /** + * Ratio of the fading weight to the max weight, between `0` and `1`. + * + * For example, `0.1` affects all pixels with weight under 10% of the max. + * + * Ignored when `colorDomain` is specified. + * @default 0.05 + */ + threshold?: number; + /** + * Controls how weight values are mapped to the `colorRange`, as an array of two numbers [`minValue`, `maxValue`]. + * + * @default null + */ + colorDomain?: [number, number] | null; + /** + * Defines the type of aggregation operation + * + * V valid values are 'SUM', 'MEAN'. + * + * @default 'SUM' + */ + aggregation?: 'SUM' | 'MEAN'; + /** + * Specifies the size of weight texture. + * @default 2048 + */ + weightsTextureSize?: number; + /** + * Interval in milliseconds during which changes to the viewport don't trigger aggregation. + * + * @default 500 + */ + debounceTimeout?: number; + /** + * Method called to retrieve the position of each object. + * + * @default d => d.position + */ + getPosition?: AccessorFunction; + /** + * The weight of each object. + * + * @default 1 + */ + getWeight?: Accessor; +}; +/** Visualizes the spatial distribution of data. */ +export default class HeatmapLayer extends AggregationLayer< + ExtraPropsT & Required<_HeatmapLayerProps> +> { + static layerName: string; + static defaultProps: DefaultProps>; + state: AggregationLayer['state'] & { + supported: boolean; + colorDomain?: number[]; + isWeightMapDirty?: boolean; + weightsTexture?: Texture2D; + zoom?: number; + worldBounds?: number[]; + normalizedCommonBounds?: number[]; + updateTimer?: any; + triPositionBuffer?: Buffer; + triTexCoordBuffer?: Buffer; + }; + initializeState(): void; + shouldUpdateState({changeFlags}: UpdateParameters): boolean; + updateState(opts: UpdateParameters): void; + _updateHeatmapState(opts: UpdateParameters): void; + renderLayers(): LayersList | Layer; + finalizeState(context: LayerContext): void; + _getAttributeManager(): AttributeManager; + _getChangeFlags(opts: UpdateParameters): Partial & { + boundsChanged?: boolean; + viewportZoomChanged?: boolean; + }; + _createTextures(): void; + _setupAttributes(): void; + _setupTextureParams(): void; + getShaders(type: any): any; + _createWeightsTransform(shaders?: {}): void; + _setupResources(): void; + updateShaders(shaderOptions: any): void; + _updateMaxWeightValue(): void; + _updateBounds(forceUpdate?: any): boolean; + _updateTextureRenderingBounds(): void; + _updateColorTexture(opts: any): void; + _updateWeightmap(): void; + _debouncedUpdateWeightmap(fromTimer?: boolean): void; + _worldToCommonBounds( + worldBounds: any, + opts?: { + useLayerCoordinateSystem?: boolean; + } + ): number[]; + _commonToWorldBounds(commonBounds: any): number[]; +} +export {}; +// # sourceMappingURL=heatmap-layer.d.ts.map diff --git a/modules/aggregation-layers/typed/heatmap-layer/heatmap-layer.d.ts.map b/modules/aggregation-layers/typed/heatmap-layer/heatmap-layer.d.ts.map new file mode 100644 index 00000000000..e1371b9efec --- /dev/null +++ b/modules/aggregation-layers/typed/heatmap-layer/heatmap-layer.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"heatmap-layer.d.ts","sourceRoot":"","sources":["../../src/heatmap-layer/heatmap-layer.ts"],"names":[],"mappings":"AA8BA,OAAO,EACL,MAAM,EACN,SAAS,EAMV,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,QAAQ,EACR,gBAAgB,EAChB,gBAAgB,EAChB,WAAW,EACX,KAAK,EAEL,KAAK,EACL,YAAY,EACZ,UAAU,EAEV,QAAQ,EACR,gBAAgB,EAChB,YAAY,EACb,MAAM,eAAe,CAAC;AAEvB,OAAO,gBAAgB,EAAE,EAAC,qBAAqB,EAAC,MAAM,sBAAsB,CAAC;AAsD7E,oBAAY,iBAAiB,CAAC,KAAK,GAAG,GAAG,IAAI,kBAAkB,CAAC,KAAK,CAAC,GACpE,qBAAqB,CAAC,KAAK,CAAC,CAAC;AAE/B,aAAK,kBAAkB,CAAC,KAAK,IAAI;IAC/B;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;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MAAM,CAAC;QAC3B,iBAAiB,CAAC,EAAE,MAAM,CAAC;KAC5B,CAAC;IAEF,eAAe;IAaf,iBAAiB,CAAC,EAAC,WAAW,EAAC,EAAE,gBAAgB,CAAC,IAAI,CAAC;IAMvD,WAAW,CAAC,IAAI,EAAE,gBAAgB,CAAC,IAAI,CAAC;IAQxC,mBAAmB,CAAC,IAAI,EAAE,gBAAgB,CAAC,IAAI,CAAC;IA8BhD,YAAY,IAAI,UAAU,GAAG,KAAK;IA2ClC,aAAa,CAAC,OAAO,EAAE,YAAY;IA2BnC,oBAAoB;IAOpB,eAAe,CAAC,IAAI,EAAE,gBAAgB,CAAC,IAAI,CAAC;wBAExB,OAAO;8BACD,OAAO;;IAoBjC,eAAe;IAef,gBAAgB;IAShB,mBAAmB;IAiBnB,UAAU,CAAC,IAAI,KAAA;IAcf,uBAAuB,CAAC,OAAO,KAAK;IAepC,eAAe;IAoCf,aAAa,CAAC,aAAa,KAAA;IAK3B,qBAAqB;IAarB,aAAa,CAAC,WAAW,GAAE,GAAW,GAAG,OAAO;IAkDhD,6BAA6B;IAe7B,mBAAmB,CAAC,IAAI,KAAA;IAqBxB,gBAAgB;IAwDhB,yBAAyB,CAAC,SAAS,UAAQ;IAsB3C,oBAAoB,CAAC,WAAW,KAAA,EAAE,IAAI,GAAE;QAAC,wBAAwB,CAAC,EAAE,OAAO,CAAA;KAAM;IA0CjF,oBAAoB,CAAC,YAAY,KAAA;CAQlC"} \ No newline at end of file diff --git a/modules/aggregation-layers/typed/heatmap-layer/max-fs.glsl.d.ts b/modules/aggregation-layers/typed/heatmap-layer/max-fs.glsl.d.ts new file mode 100644 index 00000000000..6fea65689e3 --- /dev/null +++ b/modules/aggregation-layers/typed/heatmap-layer/max-fs.glsl.d.ts @@ -0,0 +1,3 @@ +declare const _default: 'varying vec4 outTexture;\nvoid main() {\n gl_FragColor = outTexture;\n gl_FragColor.g = outTexture.r / max(1.0, outTexture.a);\n}\n'; +export default _default; +// # sourceMappingURL=max-fs.glsl.d.ts.map diff --git a/modules/aggregation-layers/typed/heatmap-layer/max-fs.glsl.d.ts.map b/modules/aggregation-layers/typed/heatmap-layer/max-fs.glsl.d.ts.map new file mode 100644 index 00000000000..7e2cea2cee0 --- /dev/null +++ b/modules/aggregation-layers/typed/heatmap-layer/max-fs.glsl.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"max-fs.glsl.d.ts","sourceRoot":"","sources":["../../src/heatmap-layer/max-fs.glsl.ts"],"names":[],"mappings":";AAAA,wBAME"} \ No newline at end of file diff --git a/modules/aggregation-layers/typed/heatmap-layer/max-vs.glsl.d.ts b/modules/aggregation-layers/typed/heatmap-layer/max-vs.glsl.d.ts new file mode 100644 index 00000000000..92fe01335f8 --- /dev/null +++ b/modules/aggregation-layers/typed/heatmap-layer/max-vs.glsl.d.ts @@ -0,0 +1,3 @@ +declare const _default: 'attribute vec4 inTexture;\nvarying vec4 outTexture;\n\nvoid main()\n{\noutTexture = inTexture;\ngl_Position = vec4(0, 0, 0, 1.);\n// Enforce default value for ANGLE issue (https://bugs.chromium.org/p/angleproject/issues/detail?id=3941)\ngl_PointSize = 1.0;\n}\n'; +export default _default; +// # sourceMappingURL=max-vs.glsl.d.ts.map diff --git a/modules/aggregation-layers/typed/heatmap-layer/max-vs.glsl.d.ts.map b/modules/aggregation-layers/typed/heatmap-layer/max-vs.glsl.d.ts.map new file mode 100644 index 00000000000..489035f7ac6 --- /dev/null +++ b/modules/aggregation-layers/typed/heatmap-layer/max-vs.glsl.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"max-vs.glsl.d.ts","sourceRoot":"","sources":["../../src/heatmap-layer/max-vs.glsl.ts"],"names":[],"mappings":";AAAA,wBAWE"} \ No newline at end of file diff --git a/modules/aggregation-layers/typed/heatmap-layer/triangle-layer-fragment.glsl.d.ts b/modules/aggregation-layers/typed/heatmap-layer/triangle-layer-fragment.glsl.d.ts new file mode 100644 index 00000000000..36c6dcb017f --- /dev/null +++ b/modules/aggregation-layers/typed/heatmap-layer/triangle-layer-fragment.glsl.d.ts @@ -0,0 +1,3 @@ +declare const _default: '#define SHADER_NAME triangle-layer-fragment-shader\n\nprecision highp float;\n\nuniform float opacity;\nuniform sampler2D texture;\nuniform sampler2D colorTexture;\nuniform float aggregationMode;\n\nvarying vec2 vTexCoords;\nvarying float vIntensityMin;\nvarying float vIntensityMax;\n\nvec4 getLinearColor(float value) {\n float factor = clamp(value * vIntensityMax, 0., 1.);\n vec4 color = texture2D(colorTexture, vec2(factor, 0.5));\n color.a *= min(value * vIntensityMin, 1.0);\n return color;\n}\n\nvoid main(void) {\n vec4 weights = texture2D(texture, vTexCoords);\n float weight = weights.r;\n\n if (aggregationMode > 0.5) {\n weight /= max(1.0, weights.a);\n }\n\n // discard pixels with 0 weight.\n if (weight <= 0.) {\n discard;\n }\n\n vec4 linearColor = getLinearColor(weight);\n linearColor.a *= opacity;\n gl_FragColor =linearColor;\n}\n'; +export default _default; +// # sourceMappingURL=triangle-layer-fragment.glsl.d.ts.map diff --git a/modules/aggregation-layers/typed/heatmap-layer/triangle-layer-fragment.glsl.d.ts.map b/modules/aggregation-layers/typed/heatmap-layer/triangle-layer-fragment.glsl.d.ts.map new file mode 100644 index 00000000000..f1da33993b8 --- /dev/null +++ b/modules/aggregation-layers/typed/heatmap-layer/triangle-layer-fragment.glsl.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"triangle-layer-fragment.glsl.d.ts","sourceRoot":"","sources":["../../src/heatmap-layer/triangle-layer-fragment.glsl.ts"],"names":[],"mappings":";AAoBA,wBAsCE"} \ No newline at end of file diff --git a/modules/aggregation-layers/typed/heatmap-layer/triangle-layer-vertex.glsl.d.ts b/modules/aggregation-layers/typed/heatmap-layer/triangle-layer-vertex.glsl.d.ts new file mode 100644 index 00000000000..95136f296a8 --- /dev/null +++ b/modules/aggregation-layers/typed/heatmap-layer/triangle-layer-vertex.glsl.d.ts @@ -0,0 +1,3 @@ +declare const _default: '#define SHADER_NAME heatp-map-layer-vertex-shader\n\nuniform sampler2D maxTexture;\nuniform float intensity;\nuniform vec2 colorDomain;\nuniform float threshold;\nuniform float aggregationMode;\n\nattribute vec3 positions;\nattribute vec2 texCoords;\n\nvarying vec2 vTexCoords;\nvarying float vIntensityMin;\nvarying float vIntensityMax;\n\nvoid main(void) {\n gl_Position = project_position_to_clipspace(positions, vec3(0.0), vec3(0.0));\n vTexCoords = texCoords;\n vec4 maxTexture = texture2D(maxTexture, vec2(0.5));\n float maxValue = aggregationMode < 0.5 ? maxTexture.r : maxTexture.g;\n float minValue = maxValue * threshold;\n if (colorDomain[1] > 0.) {\n // if user specified custom domain use it.\n maxValue = colorDomain[1];\n minValue = colorDomain[0];\n }\n vIntensityMax = intensity / maxValue;\n vIntensityMin = intensity / minValue;\n}\n'; +export default _default; +// # sourceMappingURL=triangle-layer-vertex.glsl.d.ts.map diff --git a/modules/aggregation-layers/typed/heatmap-layer/triangle-layer-vertex.glsl.d.ts.map b/modules/aggregation-layers/typed/heatmap-layer/triangle-layer-vertex.glsl.d.ts.map new file mode 100644 index 00000000000..4deda2f00ac --- /dev/null +++ b/modules/aggregation-layers/typed/heatmap-layer/triangle-layer-vertex.glsl.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"triangle-layer-vertex.glsl.d.ts","sourceRoot":"","sources":["../../src/heatmap-layer/triangle-layer-vertex.glsl.ts"],"names":[],"mappings":";AAsBA,wBA8BE"} \ No newline at end of file diff --git a/modules/aggregation-layers/typed/heatmap-layer/triangle-layer.d.ts b/modules/aggregation-layers/typed/heatmap-layer/triangle-layer.d.ts new file mode 100644 index 00000000000..e52667618bc --- /dev/null +++ b/modules/aggregation-layers/typed/heatmap-layer/triangle-layer.d.ts @@ -0,0 +1,26 @@ +import type {Device} from '@luma.gl/api'; +import {Model, Texture2D} from '@luma.gl/webgl-legacy'; +import {Layer, LayerContext} from '@deck.gl/core'; +declare type _TriangleLayerProps = { + colorDomain: number[]; + aggregationMode: string; + threshold: number; + intensity: number; + vertexCount: number; + colorTexture: Texture2D; + maxTexture: Texture2D; + texture: Texture2D; +}; +export default class TriangleLayer extends Layer<_TriangleLayerProps> { + static layerName: string; + getShaders(): { + vs: string; + fs: string; + modules: import('@deck.gl/core')._ShaderModule[]; + }; + initializeState({device}: LayerContext): void; + _getModel(device: Device): Model; + draw({uniforms}: {uniforms: any}): void; +} +export {}; +// # sourceMappingURL=triangle-layer.d.ts.map diff --git a/modules/aggregation-layers/typed/heatmap-layer/triangle-layer.d.ts.map b/modules/aggregation-layers/typed/heatmap-layer/triangle-layer.d.ts.map new file mode 100644 index 00000000000..3d5503baac5 --- /dev/null +++ b/modules/aggregation-layers/typed/heatmap-layer/triangle-layer.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"triangle-layer.d.ts","sourceRoot":"","sources":["../../src/heatmap-layer/triangle-layer.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,cAAc,CAAC;AACzC,OAAO,EAAK,KAAK,EAAE,SAAS,EAAC,MAAM,uBAAuB,CAAC;AAE3D,OAAO,EAAC,KAAK,EAAE,YAAY,EAAY,MAAM,eAAe,CAAC;AAI7D,aAAK,mBAAmB,GAAG;IACzB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,eAAe,EAAE,MAAM,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,SAAS,CAAC;IACxB,UAAU,EAAE,SAAS,CAAC;IACtB,OAAO,EAAE,SAAS,CAAC;CACpB,CAAC;AAEF,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,KAAK,CAAC,mBAAmB,CAAC;IACnE,MAAM,CAAC,SAAS,SAAmB;IAEnC,UAAU;;;;;IAIV,eAAe,CAAC,EAAC,MAAM,EAAC,EAAE,YAAY,GAAG,IAAI;IAW7C,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,KAAK;IAahC,IAAI,CAAC,EAAC,QAAQ,EAAC;;KAAA,GAAG,IAAI;CAmBvB"} \ No newline at end of file diff --git a/modules/aggregation-layers/typed/heatmap-layer/weights-fs.glsl.d.ts b/modules/aggregation-layers/typed/heatmap-layer/weights-fs.glsl.d.ts new file mode 100644 index 00000000000..3838f1853a2 --- /dev/null +++ b/modules/aggregation-layers/typed/heatmap-layer/weights-fs.glsl.d.ts @@ -0,0 +1,3 @@ +declare const _default: 'varying vec4 weightsTexture;\n// Epanechnikov function, keeping for reference\n// float epanechnikovKDE(float u) {\n// return 0.75 * (1.0 - u * u);\n// }\nfloat gaussianKDE(float u){\n return pow(2.71828, -u*u/0.05555)/(1.77245385*0.166666);\n}\nvoid main()\n{\n float dist = length(gl_PointCoord - vec2(0.5, 0.5));\n if (dist > 0.5) {\n discard;\n }\n gl_FragColor = weightsTexture * gaussianKDE(2. * dist);\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n'; +export default _default; +// # sourceMappingURL=weights-fs.glsl.d.ts.map diff --git a/modules/aggregation-layers/typed/heatmap-layer/weights-fs.glsl.d.ts.map b/modules/aggregation-layers/typed/heatmap-layer/weights-fs.glsl.d.ts.map new file mode 100644 index 00000000000..d1a661ce853 --- /dev/null +++ b/modules/aggregation-layers/typed/heatmap-layer/weights-fs.glsl.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"weights-fs.glsl.d.ts","sourceRoot":"","sources":["../../src/heatmap-layer/weights-fs.glsl.ts"],"names":[],"mappings":";AAAA,wBAkBE"} \ No newline at end of file diff --git a/modules/aggregation-layers/typed/heatmap-layer/weights-vs.glsl.d.ts b/modules/aggregation-layers/typed/heatmap-layer/weights-vs.glsl.d.ts new file mode 100644 index 00000000000..2a2745ddeb3 --- /dev/null +++ b/modules/aggregation-layers/typed/heatmap-layer/weights-vs.glsl.d.ts @@ -0,0 +1,3 @@ +declare const _default: 'attribute vec3 positions;\nattribute vec3 positions64Low;\nattribute float weights;\nvarying vec4 weightsTexture;\nuniform float radiusPixels;\nuniform float textureWidth;\nuniform vec4 commonBounds;\nuniform float weightsScale;\nvoid main()\n{\n weightsTexture = vec4(weights * weightsScale, 0., 0., 1.);\n\n float radiusTexels = project_pixel_size(radiusPixels) * textureWidth / (commonBounds.z - commonBounds.x);\n gl_PointSize = radiusTexels * 2.;\n\n vec3 commonPosition = project_position(positions, positions64Low);\n\n // map xy from commonBounds to [-1, 1]\n gl_Position.xy = (commonPosition.xy - commonBounds.xy) / (commonBounds.zw - commonBounds.xy) ;\n gl_Position.xy = (gl_Position.xy * 2.) - (1.);\n}\n'; +export default _default; +// # sourceMappingURL=weights-vs.glsl.d.ts.map diff --git a/modules/aggregation-layers/typed/heatmap-layer/weights-vs.glsl.d.ts.map b/modules/aggregation-layers/typed/heatmap-layer/weights-vs.glsl.d.ts.map new file mode 100644 index 00000000000..97ae9ffcc16 --- /dev/null +++ b/modules/aggregation-layers/typed/heatmap-layer/weights-vs.glsl.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"weights-vs.glsl.d.ts","sourceRoot":"","sources":["../../src/heatmap-layer/weights-vs.glsl.ts"],"names":[],"mappings":";AAAA,wBAsBE"} \ No newline at end of file diff --git a/modules/aggregation-layers/typed/hexagon-layer/hexagon-aggregator.d.ts b/modules/aggregation-layers/typed/hexagon-layer/hexagon-aggregator.d.ts new file mode 100644 index 00000000000..46c1ce842c9 --- /dev/null +++ b/modules/aggregation-layers/typed/hexagon-layer/hexagon-aggregator.d.ts @@ -0,0 +1,30 @@ +/** + * Use d3-hexbin to performs hexagonal binning from geo points to hexagons + * @param {Iterable} data - array of points + * @param {Number} radius - hexagon radius in meter + * @param {function} getPosition - get points lon lat + * @param {Object} viewport - current viewport object + + * @return {Object} - hexagons and countRange + */ +export declare function pointToHexbin( + props: any, + aggregationParams: any +): { + hexagons: any; + radiusCommon: number; +}; +/** + * Get the bounding box of all data points + */ +export declare function getPointsCenter(data: any, aggregationParams: any): number[]; +/** + * Get radius in mercator world space coordinates from meter + * @param {Number} radius - in meter + * @param {Object} viewport - current viewport object + * @param {Array} center - data center + + * @return {Number} radius in mercator world spcae coordinates + */ +export declare function getRadiusInCommon(radius: any, viewport: any, center: any): number; +// # sourceMappingURL=hexagon-aggregator.d.ts.map diff --git a/modules/aggregation-layers/typed/hexagon-layer/hexagon-aggregator.d.ts.map b/modules/aggregation-layers/typed/hexagon-layer/hexagon-aggregator.d.ts.map new file mode 100644 index 00000000000..53c640b6ea3 --- /dev/null +++ b/modules/aggregation-layers/typed/hexagon-layer/hexagon-aggregator.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"hexagon-aggregator.d.ts","sourceRoot":"","sources":["../../src/hexagon-layer/hexagon-aggregator.ts"],"names":[],"mappings":"AAuBA;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAAC,KAAK,KAAA,EAAE,iBAAiB,KAAA;;;EA2CrD;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,IAAI,KAAA,EAAE,iBAAiB,KAAA,YA4BtD;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,KAAA,EAAE,QAAQ,KAAA,EAAE,MAAM,KAAA,UAIzD"} \ No newline at end of file diff --git a/modules/aggregation-layers/typed/hexagon-layer/hexagon-layer.d.ts b/modules/aggregation-layers/typed/hexagon-layer/hexagon-layer.d.ts new file mode 100644 index 00000000000..72706a15d45 --- /dev/null +++ b/modules/aggregation-layers/typed/hexagon-layer/hexagon-layer.d.ts @@ -0,0 +1,175 @@ +import { + Accessor, + AccessorFunction, + Color, + Position, + Material, + UpdateParameters, + DefaultProps +} from '@deck.gl/core'; +import {ColumnLayer} from '@deck.gl/layers'; +import CPUAggregator from '../utils/cpu-aggregator'; +import AggregationLayer, {AggregationLayerProps} from '../aggregation-layer'; +import {AggregateAccessor} from '../types'; +/** All properties supported by by HexagonLayer. */ +export declare type HexagonLayerProps = _HexagonLayerProps & + AggregationLayerProps; +/** Properties added by HexagonLayer. */ +declare type _HexagonLayerProps = { + /** + * Radius of hexagon bin in meters. The hexagons are pointy-topped (rather than flat-topped). + * @default 1000 + */ + radius?: number; + /** + * Function to aggregate data into hexagonal bins. + * @default d3-hexbin + */ + hexagonAggregator?: (props: any, params: any) => any; + /** + * Color scale input domain. + * @default [min(colorWeight), max(colorWeight)] + */ + colorDomain?: [number, number] | null; + /** + * Specified as an array of colors [color1, color2, ...]. + * @default `6-class YlOrRd` - [colorbrewer](http://colorbrewer2.org/#type=sequential&scheme=YlOrRd&n=6) + */ + colorRange?: Color[]; + /** + * Hexagon radius multiplier, clamped between 0 - 1. + * @default 1 + */ + coverage?: number; + /** + * Elevation scale input domain. The elevation scale is a linear scale that maps number of counts to elevation. + * @default [0, max(elevationWeight)] + */ + elevationDomain?: [number, number] | null; + /** + * Elevation scale output range. + * @default [0, 1000] + */ + elevationRange?: [number, number]; + /** + * Hexagon elevation multiplier. + * @default 1 + */ + elevationScale?: number; + /** + * Whether to enable cell elevation. If set to false, all cell will be flat. + * @default false + */ + extruded?: boolean; + /** + * Filter bins and re-calculate color by `upperPercentile`. + * Hexagons with color value larger than the `upperPercentile` will be hidden. + * @default 100 + */ + upperPercentile?: number; + /** + * Filter bins and re-calculate color by `lowerPercentile`. + * Hexagons with color value smaller than the `lowerPercentile` will be hidden. + * @default 0 + */ + lowerPercentile?: number; + /** + * Filter bins and re-calculate elevation by `elevationUpperPercentile`. + * Hexagons with elevation value larger than the `elevationUpperPercentile` will be hidden. + * @default 100 + */ + elevationUpperPercentile?: number; + /** + * Filter bins and re-calculate elevation by `elevationLowerPercentile`. + * Hexagons with elevation value larger than the `elevationLowerPercentile` will be hidden. + * @default 0 + */ + elevationLowerPercentile?: number; + /** + * Scaling function used to determine the color of the grid cell, default value is 'quantize'. + * Supported Values are 'quantize', 'quantile' and 'ordinal'. + * @default 'quantize' + */ + colorScaleType?: 'quantize' | 'quantile' | 'ordinal'; + /** + * Scaling function used to determine the elevation of the grid cell, only supports 'linear'. + */ + elevationScaleType?: 'linear'; + /** + * Material settings for lighting effect. Applies if `extruded: true`. + * + * @default true + * @see https://deck.gl/docs/developer-guide/using-lighting + */ + material?: Material; + /** + * Defines the operation used to aggregate all data object weights to calculate a cell's color value. + * @default 'SUM' + */ + colorAggregation?: 'SUM' | 'MEAN' | 'MIN' | 'MAX'; + /** + * Defines the operation used to aggregate all data object weights to calculate a cell's elevation value. + * @default 'SUM' + */ + elevationAggregation?: 'SUM' | 'MEAN' | 'MIN' | 'MAX'; + /** + * Method called to retrieve the position of each object. + * @default object => object.position + */ + getPosition?: AccessorFunction; + /** + * The weight of a data object used to calculate the color value for a bin. + * @default 1 + */ + getColorWeight?: Accessor; + /** + * After data objects are aggregated into bins, this accessor is called on each cell to get the value that its color is based on. + * @default null + */ + getColorValue?: AggregateAccessor | null; + /** + * The weight of a data object used to calculate the elevation value for a bin. + * @default 1 + */ + getElevationWeight?: Accessor; + /** + * After data objects are aggregated into bins, this accessor is called on each cell to get the value that its elevation is based on. + * @default null + */ + getElevationValue?: AggregateAccessor | null; + /** + * This callback will be called when cell color domain has been calculated. + * @default () => {} + */ + onSetColorDomain?: (minMax: [number, number]) => void; + /** + * This callback will be called when cell elevation domain has been calculated. + * @default () => {} + */ + onSetElevationDomain?: (minMax: [number, number]) => void; + /** + * (Experimental) Filter data objects + */ + _filterData: null | ((d: DataT) => boolean); +}; +/** Aggregates data into a hexagon-based heatmap. The color and height of a hexagon are determined based on the objects it contains. */ +export default class HexagonLayer extends AggregationLayer< + ExtraPropsT & Required<_HexagonLayerProps> +> { + static layerName: string; + static defaultProps: DefaultProps>; + state: AggregationLayer['state'] & { + cpuAggregator: CPUAggregator; + aggregatorState: any; + }; + initializeState(): void; + updateState(opts: UpdateParameters): void; + convertLatLngToMeterOffset(hexagonVertices: any): number[][]; + getPickingInfo({info}: {info: any}): any; + _onGetSublayerColor(cell: any): any; + _onGetSublayerElevation(cell: any): any; + _getSublayerUpdateTriggers(): {}; + renderLayers(): ColumnLayer; +} +export {}; +// # sourceMappingURL=hexagon-layer.d.ts.map diff --git a/modules/aggregation-layers/typed/hexagon-layer/hexagon-layer.d.ts.map b/modules/aggregation-layers/typed/hexagon-layer/hexagon-layer.d.ts.map new file mode 100644 index 00000000000..2187f9bae6d --- /dev/null +++ b/modules/aggregation-layers/typed/hexagon-layer/hexagon-layer.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"hexagon-layer.d.ts","sourceRoot":"","sources":["../../src/hexagon-layer/hexagon-layer.ts"],"names":[],"mappings":"AAoBA,OAAO,EACL,QAAQ,EACR,gBAAgB,EAChB,KAAK,EAEL,QAAQ,EACR,QAAQ,EACR,gBAAgB,EAChB,YAAY,EACb,MAAM,eAAe,CAAC;AACvB,OAAO,EAAC,WAAW,EAAC,MAAM,iBAAiB,CAAC;AAM5C,OAAO,aAAa,MAAM,yBAAyB,CAAC;AACpD,OAAO,gBAAgB,EAAE,EAAC,qBAAqB,EAAC,MAAM,sBAAsB,CAAC;AAE7E,OAAO,EAAC,iBAAiB,EAAC,MAAM,UAAU,CAAC;AAyC3C,mDAAmD;AACnD,oBAAY,iBAAiB,CAAC,KAAK,GAAG,GAAG,IAAI,kBAAkB,CAAC,KAAK,CAAC,GACpE,qBAAqB,CAAC,KAAK,CAAC,CAAC;AAE/B,wCAAwC;AACxC,aAAK,kBAAkB,CAAC,KAAK,GAAG,GAAG,IAAI;IACrC;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,KAAK,GAAG,CAAC;IAErD;;;OAGG;IACH,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAAC;IAEtC;;;OAGG;IACH,UAAU,CAAC,EAAE,KAAK,EAAE,CAAC;IAErB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;;OAGG;IACH,eAAe,CAAC,EAAE,CAAC,MAAM,EAAE,MA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AAC,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,IAAI,CAAC;IAEtD;;;OAGG;IACH,oBAAoB,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,IAAI,CAAC;IAE1D;;OAEG;IACH,WAAW,EAAE,IAAI,GAAG,CAAC,CAAC,CAAC,EAAE,KAAK,KAAK,OAAO,CAAC,CAAC;CAC7C,CAAC;AAEF,uIAAuI;AACvI,MAAM,CAAC,OAAO,OAAO,YAAY,CAAC,WAAW,GAAG,EAAE,CAAE,SAAQ,gBAAgB,CAC1E,WAAW,GAAG,QAAQ,CAAC,kBAAkB,CAAC,CAC3C;IACC,MAAM,CAAC,SAAS,SAAkB;IAClC,MAAM,CAAC,YAAY,uCAAgB;IAEnC,KAAK,EAAG,gBAAgB,CAAC,OAAO,CAAC,GAAG;QAClC,aAAa,EAAE,aAAa,CAAC;QAC7B,eAAe,EAAE,GAAG,CAAC;KACtB,CAAC;IACF,eAAe;IAoBf,WAAW,CAAC,IAAI,EAAE,gBAAgB,CAAC,IAAI,CAAC;IAyBxC,0BAA0B,CAAC,eAAe,KAAA;IA6B1C,cAAc,CAAC,EAAC,IAAI,EAAC;;KAAA;IAKrB,mBAAmB,CAAC,IAAI,KAAA;IAKxB,uBAAuB,CAAC,IAAI,KAAA;IAI5B,0BAA0B;IAI1B,YAAY;CAwCb"} \ No newline at end of file diff --git a/modules/aggregation-layers/typed/index.d.ts b/modules/aggregation-layers/typed/index.d.ts new file mode 100644 index 00000000000..2f57ad8e939 --- /dev/null +++ b/modules/aggregation-layers/typed/index.d.ts @@ -0,0 +1,20 @@ +export {default as ScreenGridLayer} from './screen-grid-layer/screen-grid-layer'; +export {default as CPUGridLayer} from './cpu-grid-layer/cpu-grid-layer'; +export {default as HexagonLayer} from './hexagon-layer/hexagon-layer'; +export {default as ContourLayer} from './contour-layer/contour-layer'; +export {default as GridLayer} from './grid-layer/grid-layer'; +export {default as GPUGridLayer} from './gpu-grid-layer/gpu-grid-layer'; +export {AGGREGATION_OPERATION} from './utils/aggregation-operation-utils'; +export {default as HeatmapLayer} from './heatmap-layer/heatmap-layer'; +export {default as _GPUGridAggregator} from './utils/gpu-grid-aggregation/gpu-grid-aggregator'; +export {default as _CPUAggregator} from './utils/cpu-aggregator'; +export {default as _AggregationLayer} from './aggregation-layer'; +export {default as _BinSorter} from './utils/bin-sorter'; +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 {GPUGridLayerProps} from './gpu-grid-layer/gpu-grid-layer'; +export type {ScreenGridLayerProps} from './screen-grid-layer/screen-grid-layer'; +// # sourceMappingURL=index.d.ts.map diff --git a/modules/aggregation-layers/typed/index.d.ts.map b/modules/aggregation-layers/typed/index.d.ts.map new file mode 100644 index 00000000000..94c6a4f812b --- /dev/null +++ b/modules/aggregation-layers/typed/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAC,OAAO,IAAI,eAAe,EAAC,MAAM,uCAAuC,CAAC;AACjF,OAAO,EAAC,OAAO,IAAI,YAAY,EAAC,MAAM,iCAAiC,CAAC;AACxE,OAAO,EAAC,OAAO,IAAI,YAAY,EAAC,MAAM,+BAA+B,CAAC;AACtE,OAAO,EAAC,OAAO,IAAI,YAAY,EAAC,MAAM,+BAA+B,CAAC;AACtE,OAAO,EAAC,OAAO,IAAI,SAAS,EAAC,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAC,OAAO,IAAI,YAAY,EAAC,MAAM,iCAAiC,CAAC;AACxE,OAAO,EAAC,qBAAqB,EAAC,MAAM,qCAAqC,CAAC;AAG1E,OAAO,EAAC,OAAO,IAAI,YAAY,EAAC,MAAM,+BAA+B,CAAC;AACtE,OAAO,EAAC,OAAO,IAAI,kBAAkB,EAAC,MAAM,kDAAkD,CAAC;AAC/F,OAAO,EAAC,OAAO,IAAI,cAAc,EAAC,MAAM,wBAAwB,CAAC;AACjE,OAAO,EAAC,OAAO,IAAI,iBAAiB,EAAC,MAAM,qBAAqB,CAAC;AACjE,OAAO,EAAC,OAAO,IAAI,UAAU,EAAC,MAAM,oBAAoB,CAAC;AAGzD,YAAY,EAAC,iBAAiB,EAAC,MAAM,+BAA+B,CAAC;AACrE,YAAY,EAAC,iBAAiB,EAAC,MAAM,+BAA+B,CAAC;AACrE,YAAY,EAAC,iBAAiB,EAAC,MAAM,+BAA+B,CAAC;AACrE,YAAY,EAAC,iBAAiB,EAAC,MAAM,iCAAiC,CAAC;AACvE,YAAY,EAAC,cAAc,EAAC,MAAM,yBAAyB,CAAC;AAC5D,YAAY,EAAC,iBAAiB,EAAC,MAAM,iCAAiC,CAAC;AACvE,YAAY,EAAC,oBAAoB,EAAC,MAAM,uCAAuC,CAAC"} \ No newline at end of file diff --git a/modules/aggregation-layers/typed/screen-grid-layer/screen-grid-cell-layer.d.ts b/modules/aggregation-layers/typed/screen-grid-layer/screen-grid-cell-layer.d.ts new file mode 100644 index 00000000000..5ed56b19456 --- /dev/null +++ b/modules/aggregation-layers/typed/screen-grid-layer/screen-grid-cell-layer.d.ts @@ -0,0 +1,47 @@ +import {Device} from '@luma.gl/api'; +import {Model, Texture2D} from '@luma.gl/webgl-legacy'; +import {Layer, LayerProps, UpdateParameters, DefaultProps} from '@deck.gl/core'; +import type {_ScreenGridLayerProps} from './screen-grid-layer'; +/** All properties supported by ScreenGridCellLayer. */ +export declare type ScreenGridCellLayerProps = _ScreenGridCellLayerProps & + LayerProps; +/** Proprties added by ScreenGridCellLayer. */ +export declare type _ScreenGridCellLayerProps = _ScreenGridLayerProps & { + maxTexture: Texture2D; +}; +export default class ScreenGridCellLayer extends Layer< + ExtraPropsT & Required<_ScreenGridCellLayerProps> +> { + static layerName: string; + static defaultProps: DefaultProps>; + static isSupported(device: Device): boolean; + state: Layer['state'] & { + model: Model; + }; + getShaders(): { + vs: string; + fs: string; + modules: import('@deck.gl/core')._ShaderModule<{ + pickingSelectedColor?: [number, number, number]; + pickingHighlightColor?: [number, number, number, number]; + pickingActive?: boolean; + pickingAttribute?: boolean; + }>[]; + }; + initializeState(): void; + shouldUpdateState({changeFlags}: {changeFlags: any}): any; + updateState(params: UpdateParameters): void; + draw({uniforms}: {uniforms: any}): void; + calculateInstancePositions( + attribute: any, + { + numInstances + }: { + numInstances: any; + } + ): void; + _getModel(): Model; + _shouldUseMinMax(): boolean; + _updateUniforms(oldProps: any, props: any, changeFlags: any): void; +} +// # sourceMappingURL=screen-grid-cell-layer.d.ts.map diff --git a/modules/aggregation-layers/typed/screen-grid-layer/screen-grid-cell-layer.d.ts.map b/modules/aggregation-layers/typed/screen-grid-layer/screen-grid-cell-layer.d.ts.map new file mode 100644 index 00000000000..22bbbbd7004 --- /dev/null +++ b/modules/aggregation-layers/typed/screen-grid-layer/screen-grid-cell-layer.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"screen-grid-cell-layer.d.ts","sourceRoot":"","sources":["../../src/screen-grid-layer/screen-grid-cell-layer.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAC,MAAM,EAAC,MAAM,cAAc,CAAC;AAEpC,OAAO,EAAK,KAAK,EAAyB,SAAS,EAAC,MAAM,uBAAuB,CAAC;AAClF,OAAO,EAAC,KAAK,EAAE,UAAU,EAAgB,gBAAgB,EAAE,YAAY,EAAC,MAAM,eAAe,CAAC;AAI9F,OAAO,KAAK,EAAC,qBAAqB,EAAC,MAAM,qBAAqB,CAAC;AAgB/D,uDAAuD;AACvD,oBAAY,wBAAwB,CAAC,KAAK,GAAG,GAAG,IAAI,yBAAyB,CAAC,KAAK,CAAC,GAClF,UAAU,CAAC,KAAK,CAAC,CAAC;AAEpB,8CAA8C;AAC9C,oBAAY,yBAAyB,CAAC,KAAK,IAAI,qBAAqB,CAAC,KAAK,CAAC,GAAG;IAC5E,UAAU,EAAE,SAAS,CAAC;CACvB,CAAC;AAEF,MAAM,CAAC,OAAO,OAAO,mBAAmB,CAAC,KAAK,GAAG,GAAG,EAAE,WAAW,GAAG,EAAE,CAAE,SAAQ,KAAK,CACnF,WAAW,GAAG,QAAQ,CAAC,yBAAyB,CAAC,KAAK,CAAC,CAAC,CACzD;IACC,MAAM,CAAC,SAAS,SAAyB;IACzC,MAAM,CAAC,YAAY,8CAAgB;IAEnC,MAAM,CAAC,WAAW,CAAC,MAAM,EAAE,MAAM;IAIjC,KAAK,EAAG,KAAK,CAAC,OAAO,CAAC,GAAG;QACvB,KAAK,EAAE,KAAK,CAAC;KACd,CAAC;IACF,UAAU;;;;;;;;;;IAIV,eAAe;IAYf,iBAAiB,CAAC,EAAC,WAAW,EAAC;;KAAA;IAK/B,WAAW,CAAC,MAAM,EAAE,gBAAgB,CAAC,IAAI,CAAC;IAe1C,IAAI,CAAC,EAAC,QAAQ,EAAC;;KAAA;IA0Bf,0BAA0B,CAAC,SAAS,KAAA,EAAE,EAAC,YAAY,EAAC;;KAAA;IAkBpD,SAAS,IAAI,KAAK;IAclB,gBAAgB,IAAI,OAAO;IAe3B,eAAe,CAAC,QAAQ,KAAA,EAAE,KAAK,KAAA,EAAE,WAAW,KAAA,GAAG,IAAI;CA2BpD"} \ No newline at end of file diff --git a/modules/aggregation-layers/typed/screen-grid-layer/screen-grid-layer-fragment.glsl.d.ts b/modules/aggregation-layers/typed/screen-grid-layer/screen-grid-layer-fragment.glsl.d.ts new file mode 100644 index 00000000000..f724dbf516c --- /dev/null +++ b/modules/aggregation-layers/typed/screen-grid-layer/screen-grid-layer-fragment.glsl.d.ts @@ -0,0 +1,3 @@ +declare const _default: '#define SHADER_NAME screen-grid-layer-fragment-shader\n\nprecision highp float;\n\nvarying vec4 vColor;\nvarying float vSampleCount;\n\nvoid main(void) {\n if (vSampleCount <= 0.0) {\n discard;\n }\n gl_FragColor = vColor;\n\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n'; +export default _default; +// # sourceMappingURL=screen-grid-layer-fragment.glsl.d.ts.map diff --git a/modules/aggregation-layers/typed/screen-grid-layer/screen-grid-layer-fragment.glsl.d.ts.map b/modules/aggregation-layers/typed/screen-grid-layer/screen-grid-layer-fragment.glsl.d.ts.map new file mode 100644 index 00000000000..1ee357cc4c8 --- /dev/null +++ b/modules/aggregation-layers/typed/screen-grid-layer/screen-grid-layer-fragment.glsl.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"screen-grid-layer-fragment.glsl.d.ts","sourceRoot":"","sources":["../../src/screen-grid-layer/screen-grid-layer-fragment.glsl.ts"],"names":[],"mappings":";AAqBA,wBAgBE"} \ No newline at end of file diff --git a/modules/aggregation-layers/typed/screen-grid-layer/screen-grid-layer-vertex.glsl.d.ts b/modules/aggregation-layers/typed/screen-grid-layer/screen-grid-layer-vertex.glsl.d.ts new file mode 100644 index 00000000000..87037a4428a --- /dev/null +++ b/modules/aggregation-layers/typed/screen-grid-layer/screen-grid-layer-vertex.glsl.d.ts @@ -0,0 +1,3 @@ +declare const _default: '#define SHADER_NAME screen-grid-layer-vertex-shader\n#define RANGE_COUNT 6\n\nattribute vec3 positions;\nattribute vec3 instancePositions;\nattribute vec4 instanceCounts;\nattribute vec3 instancePickingColors;\n\nuniform float opacity;\nuniform vec3 cellScale;\nuniform vec4 minColor;\nuniform vec4 maxColor;\nuniform vec4 colorRange[RANGE_COUNT];\nuniform vec2 colorDomain;\nuniform bool shouldUseMinMax;\nuniform sampler2D maxTexture;\n\nvarying vec4 vColor;\nvarying float vSampleCount;\n\nvec4 quantizeScale(vec2 domain, vec4 range[RANGE_COUNT], float value) {\n vec4 outColor = vec4(0., 0., 0., 0.);\n if (value >= domain.x && value <= domain.y) {\n float domainRange = domain.y - domain.x;\n if (domainRange <= 0.) {\n outColor = colorRange[0];\n } else {\n float rangeCount = float(RANGE_COUNT);\n float rangeStep = domainRange / rangeCount;\n float idx = floor((value - domain.x) / rangeStep);\n idx = clamp(idx, 0., rangeCount - 1.);\n int intIdx = int(idx);\n outColor = colorRange[intIdx];\n }\n }\n outColor = outColor / 255.;\n return outColor;\n}\n\nvoid main(void) {\n vSampleCount = instanceCounts.a;\n\n float weight = instanceCounts.r;\n float maxWeight = texture2D(maxTexture, vec2(0.5)).r;\n\n float step = weight / maxWeight;\n vec4 minMaxColor = mix(minColor, maxColor, step) / 255.;\n\n vec2 domain = colorDomain;\n float domainMaxValid = float(colorDomain.y != 0.);\n domain.y = mix(maxWeight, colorDomain.y, domainMaxValid);\n vec4 rangeColor = quantizeScale(domain, colorRange, weight);\n\n float rangeMinMax = float(shouldUseMinMax);\n vec4 color = mix(rangeColor, minMaxColor, rangeMinMax);\n vColor = vec4(color.rgb, color.a * opacity);\n\n // Set color to be rendered to picking fbo (also used to check for selection highlight).\n picking_setPickingColor(instancePickingColors);\n\n gl_Position = vec4(instancePositions + positions * cellScale, 1.);\n}\n'; +export default _default; +// # sourceMappingURL=screen-grid-layer-vertex.glsl.d.ts.map diff --git a/modules/aggregation-layers/typed/screen-grid-layer/screen-grid-layer-vertex.glsl.d.ts.map b/modules/aggregation-layers/typed/screen-grid-layer/screen-grid-layer-vertex.glsl.d.ts.map new file mode 100644 index 00000000000..49899073398 --- /dev/null +++ b/modules/aggregation-layers/typed/screen-grid-layer/screen-grid-layer-vertex.glsl.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"screen-grid-layer-vertex.glsl.d.ts","sourceRoot":"","sources":["../../src/screen-grid-layer/screen-grid-layer-vertex.glsl.ts"],"names":[],"mappings":";AAoBA,wBA+DE"} \ No newline at end of file diff --git a/modules/aggregation-layers/typed/screen-grid-layer/screen-grid-layer.d.ts b/modules/aggregation-layers/typed/screen-grid-layer/screen-grid-layer.d.ts new file mode 100644 index 00000000000..9a5ec521b25 --- /dev/null +++ b/modules/aggregation-layers/typed/screen-grid-layer/screen-grid-layer.d.ts @@ -0,0 +1,107 @@ +import { + Accessor, + Color, + GetPickingInfoParams, + Layer, + LayerContext, + LayersList, + PickingInfo, + Position, + UpdateParameters, + DefaultProps +} from '@deck.gl/core'; +import type {Texture2D} from '@luma.gl/webgl-legacy'; +import GridAggregationLayer, {GridAggregationLayerProps} from '../grid-aggregation-layer'; +/** All properties supported by ScreenGridLayer. */ +export declare type ScreenGridLayerProps = _ScreenGridLayerProps & + GridAggregationLayerProps; +/** Properties added by ScreenGridLayer. */ +export declare type _ScreenGridLayerProps = { + /** + * Unit width/height of the bins. + * @default 100 + */ + cellSizePixels?: number; + /** + * Cell margin size in pixels. + * @default 2 + */ + cellMarginPixels?: number; + /** + * Expressed as an rgba array, minimal color that could be rendered by a tile. + * @default [0, 0, 0, 255] + * @deprecated Deprecated in version 5.2.0, use `colorRange` and `colorDomain` instead. + */ + minColor?: Color | null; + /** + * Expressed as an rgba array, maximal color that could be rendered by a tile. + * @default [0, 255, 0, 255] + * @deprecated Deprecated in version 5.2.0, use `colorRange` and `colorDomain` instead. + */ + maxColor?: Color | null; + /** + * Color scale input domain. The color scale maps continues numeric domain into discrete color range. + * @default [1, max(weight)] + */ + colorDomain?: [number, number] | null; + /** + * Specified as an array of colors [color1, color2, ...]. + * + * @default `6-class YlOrRd` - [colorbrewer](http://colorbrewer2.org/#type=sequential&scheme=YlOrRd&n=6) + */ + colorRange?: Color[]; + /** + * Method called to retrieve the position of each object. + * + * @default d => d.position + */ + getPosition?: Accessor; + /** + * The weight of each object. + * + * @default 1 + */ + getWeight?: Accessor; + /** + * Perform aggregation is performed on GPU. + * + * NOTE: GPU Aggregation requires WebGL2 support by the browser. + * When `gpuAggregation` is set to true and browser doesn't support WebGL2, aggregation falls back to CPU. + * + * @default true + */ + gpuAggregation?: boolean; + /** + * Defines the type of aggregation operation + * + * V valid values are 'SUM', 'MEAN', 'MIN' and 'MAX'. + * + * @default 'SUM' + */ + aggregation?: 'SUM' | 'MEAN' | 'MIN' | 'MAX'; +}; +/** Aggregates data into histogram bins and renders them as a grid. */ +export default class ScreenGridLayer extends GridAggregationLayer< + ExtraProps & Required<_ScreenGridLayerProps> +> { + static layerName: string; + static defaultProps: DefaultProps>; + state: GridAggregationLayer['state'] & { + supported: boolean; + gpuGridAggregator?: any; + gpuAggregation?: any; + weights?: any; + maxTexture?: Texture2D; + }; + initializeState(): void; + shouldUpdateState({changeFlags}: UpdateParameters): boolean; + updateState(opts: UpdateParameters): void; + renderLayers(): LayersList | Layer; + finalizeState(context: LayerContext): void; + getPickingInfo({info}: GetPickingInfoParams): PickingInfo; + updateResults({aggregationData, maxData}: {aggregationData: any; maxData: any}): void; + updateAggregationState(opts: any): void; + _updateAccessors(opts: any): void; + _resetResults(): void; +} +// # sourceMappingURL=screen-grid-layer.d.ts.map diff --git a/modules/aggregation-layers/typed/screen-grid-layer/screen-grid-layer.d.ts.map b/modules/aggregation-layers/typed/screen-grid-layer/screen-grid-layer.d.ts.map new file mode 100644 index 00000000000..28cead7c651 --- /dev/null +++ b/modules/aggregation-layers/typed/screen-grid-layer/screen-grid-layer.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"screen-grid-layer.d.ts","sourceRoot":"","sources":["../../src/screen-grid-layer/screen-grid-layer.ts"],"names":[],"mappings":"AAoBA,OAAO,EACL,QAAQ,EACR,KAAK,EACL,oBAAoB,EACpB,KAAK,EACL,YAAY,EACZ,UAAU,EAEV,WAAW,EACX,QAAQ,EACR,gBAAgB,EAChB,YAAY,EACb,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,uBAAuB,CAAC;AAKrD,OAAO,oBAAoB,EAAE,EAAC,yBAAyB,EAAC,MAAM,2BAA2B,CAAC;AAuB1F,mDAAmD;AACnD,oBAAY,oBAAoB,CAAC,KAAK,GAAG,GAAG,IAAI,qBAAqB,CAAC,KAAK,CAAC,GAC1E,yBAAyB,CAAC,KAAK,CAAC,CAAC;AAEnC,2CAA2C;AAC3C,o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e;IA2Cf,iBAAiB,CAAC,EAAC,WAAW,EAAC,EAAE,gBAAgB,CAAC,IAAI,CAAC;IAIvD,WAAW,CAAC,IAAI,EAAE,gBAAgB,CAAC,IAAI,CAAC;IAIxC,YAAY,IAAI,UAAU,GAAG,KAAK;IAuBlC,aAAa,CAAC,OAAO,EAAE,YAAY,GAAG,IAAI;IAU1C,cAAc,CAAC,EAAC,IAAI,EAAC,EAAE,oBAAoB,GAAG,WAAW;IAsBzD,aAAa,CAAC,EAAC,eAAe,EAAE,OAAO,EAAC;;;KAAA;IASxC,sBAAsB,CAAC,IAAI,KAAA;IAiE3B,gBAAgB,CAAC,IAAI,KAAA;IAUrB,aAAa;CAMd"} \ No newline at end of file diff --git a/modules/aggregation-layers/typed/types.d.ts b/modules/aggregation-layers/typed/types.d.ts new file mode 100644 index 00000000000..ec79223076e --- /dev/null +++ b/modules/aggregation-layers/typed/types.d.ts @@ -0,0 +1,11 @@ +export declare type AggregateAccessor = { + /** a list of objects whose positions fall inside this cell. */ + objects: DataT[]; + objectInfo: { + /** the indices of `objects` in the original data. */ + indices: number[]; + /** the value of the `data` prop */ + data: any; + }; +}; +// # sourceMappingURL=types.d.ts.map diff --git a/modules/aggregation-layers/typed/types.d.ts.map b/modules/aggregation-layers/typed/types.d.ts.map new file mode 100644 index 00000000000..adb4b150fc5 --- /dev/null +++ b/modules/aggregation-layers/typed/types.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,oBAAY,iBAAiB,CAAC,KAAK,GAAG,GAAG,IAAI;IAC3C,+DAA+D;IAC/D,OAAO,EAAE,KAAK,EAAE,CAAC;IACjB,UAAU,EAAE;QACV,qDAAqD;QACrD,OAAO,EAAE,MAAM,EAAE,CAAC;QAClB,mCAAmC;QACnC,IAAI,EAAE,GAAG,CAAC;KACX,CAAC;CACH,CAAC"} \ No newline at end of file diff --git a/modules/aggregation-layers/typed/utils/aggregation-operation-utils.d.ts b/modules/aggregation-layers/typed/utils/aggregation-operation-utils.d.ts new file mode 100644 index 00000000000..d32abceeb18 --- /dev/null +++ b/modules/aggregation-layers/typed/utils/aggregation-operation-utils.d.ts @@ -0,0 +1,26 @@ +export declare const AGGREGATION_OPERATION: { + SUM: number; + MEAN: number; + MIN: number; + MAX: number; +}; +export declare function getMean(pts: any, accessor: any): any; +export declare function getSum(pts: any, accessor: any): any; +export declare function getMax(pts: any, accessor: any): any; +export declare function getMin(pts: any, accessor: any): any; +export declare function getValueFunc( + aggregation: any, + accessor: any, + context: any +): (pts: any) => any; +declare type AccessorContext = { + data?: any; + index?: number; + indices?: number[]; +}; +export declare function wrapGetValueFunc( + getValue: any, + context?: AccessorContext +): (pts: any) => any; +export {}; +// # sourceMappingURL=aggregation-operation-utils.d.ts.map diff --git a/modules/aggregation-layers/typed/utils/aggregation-operation-utils.d.ts.map b/modules/aggregation-layers/typed/utils/aggregation-operation-utils.d.ts.map new file mode 100644 index 00000000000..baf0953d096 --- /dev/null +++ b/modules/aggregation-layers/typed/utils/aggregation-operation-utils.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"aggregation-operation-utils.d.ts","sourceRoot":"","sources":["../../src/utils/aggregation-operation-utils.ts"],"names":[],"mappings":"AAoBA,eAAO,MAAM,qBAAqB;;;;;CAKjC,CAAC;AAcF,wBAAgB,OAAO,CAAC,GAAG,KAAA,EAAE,QAAQ,KAAA,OAOpC;AAED,wBAAgB,MAAM,CAAC,GAAG,KAAA,EAAE,QAAQ,KAAA,OAOnC;AAED,wBAAgB,MAAM,CAAC,GAAG,KAAA,EAAE,QAAQ,KAAA,OAOnC;AAED,wBAAgB,MAAM,CAAC,GAAG,KAAA,EAAE,QAAQ,KAAA,OAOnC;AAGD,wBAAgB,YAAY,CAAC,WAAW,KAAA,EAAE,QAAQ,KAAA,EAAE,OAAO,KAAA,qBAe1D;AAED,aAAK,eAAe,GAAG;IACrB,IAAI,CAAC,MAAC;IACN,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB,CAAC;AAYF,wBAAgB,gBAAgB,CAAC,QAAQ,KAAA,EAAE,OAAO,GAAE,eAAoB,qBAQvE"} \ No newline at end of file diff --git a/modules/aggregation-layers/typed/utils/bin-sorter.d.ts b/modules/aggregation-layers/typed/utils/bin-sorter.d.ts new file mode 100644 index 00000000000..eadf8e06fb9 --- /dev/null +++ b/modules/aggregation-layers/typed/utils/bin-sorter.d.ts @@ -0,0 +1,55 @@ +declare const defaultProps: { + getValue: (points: any) => any; + getPoints: (bin: any) => any; + getIndex: (bin: any) => any; + filterData: any; +}; +export declare type AggregatedBin = { + i: number; + value: any; + counts: number; +}; +export default class BinSorter { + maxCount: number; + maxValue: number; + minValue: number; + totalCount: number; + aggregatedBins: AggregatedBin[]; + sortedBins: AggregatedBin[]; + binMap: Record; + constructor(bins?: any[], props?: Partial); + /** + * Get an array of object with aggregated values and index of bins + * Array object will be sorted by value optionally. + * @param {Array} bins + * @param {Function} getValue + * @return {Array} array of values and index lookup + */ + getAggregatedBins(bins: any, props: any): AggregatedBin[]; + _percentileToIndex(percentileRange: any): [number, number]; + /** + * Get a mapping from cell/hexagon index to sorted bin + * This is used to retrieve bin value for color calculation + * @return {Object} bin index to aggregatedBins + */ + getBinMap(): Record; + /** + * Get ths max count of all bins + */ + _updateMinMaxValues(): void; + /** + * Get range of values of all bins + * @param {Number[]} range + * @param {Number} range[0] - lower bound + * @param {Number} range[1] - upper bound + * @return {Array} array of new value range + */ + getValueRange(percentileRange: [number, number]): [number, number]; + getValueDomainByScale( + scale: string, + [lower, upper]?: [number?, number?] + ): any[] | [number, number]; + _getScaleDomain(scaleType: string, [lowerIdx, upperIdx]: [number, number]): [number, number]; +} +export {}; +// # sourceMappingURL=bin-sorter.d.ts.map diff --git a/modules/aggregation-layers/typed/utils/bin-sorter.d.ts.map b/modules/aggregation-layers/typed/utils/bin-sorter.d.ts.map new file mode 100644 index 00000000000..fd5ad8b613f --- /dev/null +++ b/modules/aggregation-layers/typed/utils/bin-sorter.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"bin-sorter.d.ts","sourceRoot":"","sources":["../../src/utils/bin-sorter.ts"],"names":[],"mappings":"AAsCA,QAAA,MAAM,YAAY;;;;;CAKjB,CAAC;AAEF,oBAAY,aAAa,GAAG;IAC1B,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,GAAG,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,CAAC,OAAO,OAAO,SAAS;IAC5B,QAAQ,EAAG,MAAM,CAAC;IAClB,QAAQ,EAAG,MAAM,CAAC;IAClB,QAAQ,EAAG,MAAM,CAAC;IAClB,UAAU,EAAG,MAAM,CAAC;IAEpB,cAAc,EAAE,aAAa,EAAE,CAAC;IAChC,UAAU,EAAG,aAAa,EAAE,CAAC;IAC7B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;gBAE1B,IAAI,QAAK,EAAE,KAAK,GAAE,OAAO,CAAC,OAAO,YAAY,CAAgB;IAMzE;;;;;;OAMG;IACH,iBAAiB,CAAC,IAAI,KAAA,EAAE,KAAK,KAAA,GAAG,aAAa,EAAE;IAqC/C,kBAAkB,CAAC,eAAe,KAAA,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC;IAcrD;;;;OAIG;IACH,SAAS,IAAI,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC;IAU1C;;OAEG;IACH,mBAAmB,IAAI,IAAI;IAiB3B;;;;;;OAMG;IACH,aAAa,CAAC,eAAe,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC;IAoBlE,qBAAqB,CAAC,KAAK,EAAE,MAAM,EAAE,CAAC,KAAS,EAAE,KAAW,CAAC,qBAAK;IAYlE,eAAe,CAAC,SAAS,EAAE,MAAM,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC;CAkB7F"} \ No newline at end of file diff --git a/modules/aggregation-layers/typed/utils/color-utils.d.ts b/modules/aggregation-layers/typed/utils/color-utils.d.ts new file mode 100644 index 00000000000..f9f0092bbf1 --- /dev/null +++ b/modules/aggregation-layers/typed/utils/color-utils.d.ts @@ -0,0 +1,7 @@ +export declare const defaultColorRange: [number, number, number][]; +export declare function colorRangeToFlatArray( + colorRange: any, + normalize?: boolean, + ArrayType?: Float32ArrayConstructor +): any; +// # sourceMappingURL=color-utils.d.ts.map diff --git a/modules/aggregation-layers/typed/utils/color-utils.d.ts.map b/modules/aggregation-layers/typed/utils/color-utils.d.ts.map new file mode 100644 index 00000000000..b32c4268619 --- /dev/null +++ b/modules/aggregation-layers/typed/utils/color-utils.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"color-utils.d.ts","sourceRoot":"","sources":["../../src/utils/color-utils.ts"],"names":[],"mappings":"AAoBA,eAAO,MAAM,iBAAiB,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAOvD,CAAC;AAGF,wBAAgB,qBAAqB,CAAC,UAAU,KAAA,EAAE,SAAS,UAAQ,EAAE,SAAS,0BAAe,OA0B5F"} \ No newline at end of file diff --git a/modules/aggregation-layers/typed/utils/cpu-aggregator.d.ts b/modules/aggregation-layers/typed/utils/cpu-aggregator.d.ts new file mode 100644 index 00000000000..941c45d7286 --- /dev/null +++ b/modules/aggregation-layers/typed/utils/cpu-aggregator.d.ts @@ -0,0 +1,180 @@ +export default class CPUAggregator { + state: { + layerData: { + data: any; + }; + dimensions: {}; + }; + changeFlags: {}; + dimensionUpdaters: {}; + _getCellSize: any; + _getAggregator: any; + constructor(opts: any); + static defaultDimensions(): ( + | { + key: string; + accessor: string; + pickingInfo: string; + getBins: { + triggers: { + value: { + prop: string; + updateTrigger: string; + }; + weight: { + prop: string; + updateTrigger: string; + }; + aggregation: { + prop: string; + }; + filterData: { + prop: string; + updateTrigger: string; + }; + }; + }; + getDomain: { + triggers: { + lowerPercentile: { + prop: string; + }; + upperPercentile: { + prop: string; + }; + scaleType: { + prop: string; + }; + }; + }; + getScaleFunc: { + triggers: { + domain: { + prop: string; + }; + range: { + prop: string; + }; + }; + onSet: { + props: string; + }; + }; + nullValue: number[]; + } + | { + key: string; + accessor: string; + pickingInfo: string; + getBins: { + triggers: { + value: { + prop: string; + updateTrigger: string; + }; + weight: { + prop: string; + updateTrigger: string; + }; + aggregation: { + prop: string; + }; + filterData: { + prop: string; + updateTrigger: string; + }; + }; + }; + getDomain: { + triggers: { + lowerPercentile: { + prop: string; + }; + upperPercentile: { + prop: string; + }; + scaleType: { + prop: string; + }; + }; + }; + getScaleFunc: { + triggers: { + domain: { + prop: string; + }; + range: { + prop: string; + }; + }; + onSet: { + props: string; + }; + }; + nullValue: number; + } + )[]; + updateState( + opts: any, + aggregationParams: any + ): { + layerData: { + data: any; + }; + dimensions: {}; + }; + setState(updateObject: any): void; + setDimensionState(key: any, updateObject: any): void; + normalizeResult(result?: {hexagons?: any; layerData?: any}): + | { + hexagons?: any; + layerData?: any; + } + | { + hexagons?: any; + layerData?: any; + data: any; + }; + getAggregatedData(props: any, aggregationParams: any): void; + updateGetValueFuncs(oldProps: any, props: any, changeFlags: any): void; + needsReProjectPoints(oldProps: any, props: any, changeFlags: any): any; + addDimension(dimensions: any): void; + _addDimension(dimensions?: any[]): void; + getDimensionUpdaters({ + key, + accessor, + pickingInfo, + getBins, + getDomain, + getScaleFunc, + nullValue + }: { + key: any; + accessor: any; + pickingInfo: any; + getBins: any; + getDomain: any; + getScaleFunc: any; + nullValue: any; + }): { + key: any; + accessor: any; + pickingInfo: any; + getBins: any; + getDomain: any; + getScaleFunc: any; + attributeAccessor: (cell: any) => any; + }; + needUpdateDimensionStep(dimensionStep: any, oldProps: any, props: any, changeFlags: any): boolean; + getDimensionChanges(oldProps: any, props: any, changeFlags: any): any[]; + getUpdateTriggers(props: any): {}; + getSortedBins(props: any): void; + getDimensionSortedBins(props: any, dimensionUpdater: any): void; + getDimensionValueDomain(props: any, dimensionUpdater: any): void; + getDimensionScale(props: any, dimensionUpdater: any): void; + getSubLayerDimensionAttribute(key: any, nullValue: any): (cell: any) => any; + getSubLayerAccessors(props: any): {}; + getPickingInfo({info}: {info: any}): any; + getAccessor(dimensionKey: any): any; +} +// # sourceMappingURL=cpu-aggregator.d.ts.map diff --git a/modules/aggregation-layers/typed/utils/cpu-aggregator.d.ts.map b/modules/aggregation-layers/typed/utils/cpu-aggregator.d.ts.map new file mode 100644 index 00000000000..f605c736ce8 --- /dev/null +++ b/modules/aggregation-layers/typed/utils/cpu-aggregator.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"cpu-aggregator.d.ts","sourceRoot":"","sources":["../../src/utils/cpu-aggregator.ts"],"names":[],"mappings":"AA4HA,MAAM,CAAC,OAAO,OAAO,aAAa;IAChC,KAAK;;;;;MAkBH;IACF,WAAW,KAAM;IACjB,iBAAiB,KAAM;IAEvB,YAAY,MAAC;IACb,cAAc,MAAC;gBAEH,IAAI,KAAA;IAMhB,MAAM,CAAC,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAIxB,WAAW,CAAC,IAAI,KAAA,EAAE,iBAAiB,KAAA;;;;;;IAqBnC,QAAQ,CAAC,YAAY,KAAA;IAKrB,iBAAiB,CAAC,GAAG,KAAA,EAAE,YAAY,KAAA;IASnC,eAAe,CAAC,MAAM,GAAE;QAAC,QAAQ,CAAC,MAAC;QAAC,SAAS,CAAC,MAAA;KAAM;;;;;;;;IAWpD,iBAAiB,CAAC,KAAK,KAAA,EAAE,iBAAiB,KAAA;IAa1C,mBAAmB,CAAC,QAAQ,KAAA,EAAE,KAAK,KAAA,EAAE,WAAW,KAAA;IA0BhD,oBAAoB,CAAC,QAAQ,KAAA,EAAE,KAAK,KAAA,EAAE,WAAW,KAAA;IAUjD,YAAY,CAAC,UAAU,KAAA;IAIvB,aAAa,CAAC,UAAU,QAAK;IAa7B,oBAAoB,CAAC,EAAC,GAAG,EAAE,QAAQ,EAAE,WAAW,EAAE,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,SAAS,EAAC;;;;;;;;KAAA;;;;;;;;;IAY9F,uBAAuB,CAAC,aAAa,KAAA,EAAE,QAAQ,KAAA,EAAE,KAAK,KAAA,EAAE,WAAW,KAAA;IAkCnE,mBAAmB,CAAC,QAAQ,KAAA,EAAE,KAAK,KAAA,EAAE,WAAW,KAAA;IA8BhD,iBAAiB,CAAC,KAAK,KAAA;IAmCvB,aAAa,CAAC,KAAK,KAAA;IAMnB,sBAAsB,CAAC,KAAK,KAAA,EAAE,gBAAgB,KAAA;IAY9C,uBAAuB,CAAC,KAAK,KAAA,EAAE,gBAAgB,KAAA;IAc/C,iBAAiB,CAAC,KAAK,KAAA,EAAE,gBAAgB,KAAA;IAiBzC,6BAA6B,CAAC,GAAG,KAAA,EAAE,SAAS,KAAA;IAmB5C,oBAAoB,CAAC,KAAK,KAAA;IAU1B,cAAc,CAAC,EAAC,IAAI,EAAC;;KAAA;IA6BrB,WAAW,CAAC,YAAY,KAAA;CAMzB"} \ No newline at end of file diff --git a/modules/aggregation-layers/typed/utils/gpu-grid-aggregation/aggregate-all-fs.glsl.d.ts b/modules/aggregation-layers/typed/utils/gpu-grid-aggregation/aggregate-all-fs.glsl.d.ts new file mode 100644 index 00000000000..e297381e8e9 --- /dev/null +++ b/modules/aggregation-layers/typed/utils/gpu-grid-aggregation/aggregate-all-fs.glsl.d.ts @@ -0,0 +1,3 @@ +declare const _default: '#version 300 es\n#define SHADER_NAME gpu-aggregation-all-fs\n\nprecision highp float;\n\nin vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform bool combineMaxMin;\nout vec4 fragColor;\nvoid main(void) {\n vec4 textureColor = texture(uSampler, vec2(vTextureCoord.s, vTextureCoord.t));\n if (textureColor.a == 0.) {\n discard;\n }\n fragColor.rgb = textureColor.rgb;\n // if combineMinMax is true, use Alpha channel for first weights min value.\n fragColor.a = combineMaxMin ? textureColor.r : textureColor.a;\n}\n'; +export default _default; +// # sourceMappingURL=aggregate-all-fs.glsl.d.ts.map diff --git a/modules/aggregation-layers/typed/utils/gpu-grid-aggregation/aggregate-all-fs.glsl.d.ts.map b/modules/aggregation-layers/typed/utils/gpu-grid-aggregation/aggregate-all-fs.glsl.d.ts.map new file mode 100644 index 00000000000..2c2022f9890 --- /dev/null +++ b/modules/aggregation-layers/typed/utils/gpu-grid-aggregation/aggregate-all-fs.glsl.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"aggregate-all-fs.glsl.d.ts","sourceRoot":"","sources":["../../../src/utils/gpu-grid-aggregation/aggregate-all-fs.glsl.ts"],"names":[],"mappings":";AAoBA,wBAmBE"} \ No newline at end of file diff --git a/modules/aggregation-layers/typed/utils/gpu-grid-aggregation/aggregate-all-vs.glsl.d.ts b/modules/aggregation-layers/typed/utils/gpu-grid-aggregation/aggregate-all-vs.glsl.d.ts new file mode 100644 index 00000000000..5028590884d --- /dev/null +++ b/modules/aggregation-layers/typed/utils/gpu-grid-aggregation/aggregate-all-vs.glsl.d.ts @@ -0,0 +1,3 @@ +declare const _default: '#version 300 es\n#define SHADER_NAME gpu-aggregation-all-vs-64\n\nin vec2 position;\nuniform ivec2 gridSize;\nout vec2 vTextureCoord;\n\nvoid main(void) {\n // Map each position to single pixel\n vec2 pos = vec2(-1.0, -1.0);\n\n // Move to pixel center, pixel-size in screen sapce (2/gridSize) * 0.5 => 1/gridSize\n vec2 offset = 1.0 / vec2(gridSize);\n pos = pos + offset;\n\n gl_Position = vec4(pos, 0.0, 1.0);\n\n int yIndex = gl_InstanceID / gridSize[0];\n int xIndex = gl_InstanceID - (yIndex * gridSize[0]);\n\n vec2 yIndexFP64 = vec2(float(yIndex), 0.);\n vec2 xIndexFP64 = vec2(float(xIndex), 0.);\n vec2 gridSizeYFP64 = vec2(gridSize[1], 0.);\n vec2 gridSizeXFP64 = vec2(gridSize[0], 0.);\n\n vec2 texCoordXFP64 = div_fp64(yIndexFP64, gridSizeYFP64);\n vec2 texCoordYFP64 = div_fp64(xIndexFP64, gridSizeXFP64);\n\n vTextureCoord = vec2(texCoordYFP64.x, texCoordXFP64.x);\n // Enforce default value for ANGLE issue (https://bugs.chromium.org/p/angleproject/issues/detail?id=3941)\n gl_PointSize = 1.0;\n}\n'; +export default _default; +// # sourceMappingURL=aggregate-all-vs.glsl.d.ts.map diff --git a/modules/aggregation-layers/typed/utils/gpu-grid-aggregation/aggregate-all-vs.glsl.d.ts.map b/modules/aggregation-layers/typed/utils/gpu-grid-aggregation/aggregate-all-vs.glsl.d.ts.map new file mode 100644 index 00000000000..31c0e5b7853 --- /dev/null +++ b/modules/aggregation-layers/typed/utils/gpu-grid-aggregation/aggregate-all-vs.glsl.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"aggregate-all-vs.glsl.d.ts","sourceRoot":"","sources":["../../../src/utils/gpu-grid-aggregation/aggregate-all-vs.glsl.ts"],"names":[],"mappings":";AAoBA,wBAiCE"} \ No newline at end of file diff --git a/modules/aggregation-layers/typed/utils/gpu-grid-aggregation/aggregate-to-grid-fs.glsl.d.ts b/modules/aggregation-layers/typed/utils/gpu-grid-aggregation/aggregate-to-grid-fs.glsl.d.ts new file mode 100644 index 00000000000..9c5ac0439e0 --- /dev/null +++ b/modules/aggregation-layers/typed/utils/gpu-grid-aggregation/aggregate-to-grid-fs.glsl.d.ts @@ -0,0 +1,3 @@ +declare const _default: '#define SHADER_NAME gpu-aggregation-to-grid-fs\n\nprecision highp float;\n\nvarying vec3 vWeights;\n\nvoid main(void) {\n gl_FragColor = vec4(vWeights, 1.0);\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n'; +export default _default; +// # sourceMappingURL=aggregate-to-grid-fs.glsl.d.ts.map diff --git a/modules/aggregation-layers/typed/utils/gpu-grid-aggregation/aggregate-to-grid-fs.glsl.d.ts.map b/modules/aggregation-layers/typed/utils/gpu-grid-aggregation/aggregate-to-grid-fs.glsl.d.ts.map new file mode 100644 index 00000000000..9117114d86e --- /dev/null +++ b/modules/aggregation-layers/typed/utils/gpu-grid-aggregation/aggregate-to-grid-fs.glsl.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"aggregate-to-grid-fs.glsl.d.ts","sourceRoot":"","sources":["../../../src/utils/gpu-grid-aggregation/aggregate-to-grid-fs.glsl.ts"],"names":[],"mappings":";AAoBA,wBAWE"} \ No newline at end of file diff --git a/modules/aggregation-layers/typed/utils/gpu-grid-aggregation/aggregate-to-grid-vs.glsl.d.ts b/modules/aggregation-layers/typed/utils/gpu-grid-aggregation/aggregate-to-grid-vs.glsl.d.ts new file mode 100644 index 00000000000..5b8d4eaafdf --- /dev/null +++ b/modules/aggregation-layers/typed/utils/gpu-grid-aggregation/aggregate-to-grid-vs.glsl.d.ts @@ -0,0 +1,3 @@ +declare const _default: '#define SHADER_NAME gpu-aggregation-to-grid-vs\n\nattribute vec3 positions;\nattribute vec3 positions64Low;\nattribute vec3 weights;\nuniform vec2 cellSize;\nuniform vec2 gridSize;\nuniform bool projectPoints;\nuniform vec2 translation;\nuniform vec3 scaling;\n\nvarying vec3 vWeights;\n\nvec2 project_to_pixel(vec4 pos) {\n vec4 result;\n pos.xy = pos.xy/pos.w;\n result = pos + vec4(translation, 0., 0.);\n result.xy = scaling.z > 0. ? result.xy * scaling.xy : result.xy;\n return result.xy;\n}\n\nvoid main(void) {\n\n vWeights = weights;\n\n vec4 windowPos = vec4(positions, 1.);\n if (projectPoints) {\n windowPos = project_position_to_clipspace(positions, positions64Low, vec3(0));\n }\n\n vec2 pos = project_to_pixel(windowPos);\n\n vec2 pixelXY64[2];\n pixelXY64[0] = vec2(pos.x, 0.);\n pixelXY64[1] = vec2(pos.y, 0.);\n\n // Transform (0,0):windowSize -> (0, 0): gridSize\n vec2 gridXY64[2];\n gridXY64[0] = div_fp64(pixelXY64[0], vec2(cellSize.x, 0));\n gridXY64[1] = div_fp64(pixelXY64[1], vec2(cellSize.y, 0));\n float x = floor(gridXY64[0].x);\n float y = floor(gridXY64[1].x);\n pos = vec2(x, y);\n\n // Transform (0,0):gridSize -> (-1, -1):(1,1)\n pos = (pos * (2., 2.) / (gridSize)) - (1., 1.);\n\n // Move to pixel center, pixel-size in screen sapce (2/gridSize) * 0.5 => 1/gridSize\n vec2 offset = 1.0 / gridSize;\n pos = pos + offset;\n\n gl_Position = vec4(pos, 0.0, 1.0);\n\n // Enforce default value for ANGLE issue (https://bugs.chromium.org/p/angleproject/issues/detail?id=3941)\n gl_PointSize = 1.0;\n}\n'; +export default _default; +// # sourceMappingURL=aggregate-to-grid-vs.glsl.d.ts.map diff --git a/modules/aggregation-layers/typed/utils/gpu-grid-aggregation/aggregate-to-grid-vs.glsl.d.ts.map b/modules/aggregation-layers/typed/utils/gpu-grid-aggregation/aggregate-to-grid-vs.glsl.d.ts.map new file mode 100644 index 00000000000..b2adce012f5 --- /dev/null +++ b/modules/aggregation-layers/typed/utils/gpu-grid-aggregation/aggregate-to-grid-vs.glsl.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"aggregate-to-grid-vs.glsl.d.ts","sourceRoot":"","sources":["../../../src/utils/gpu-grid-aggregation/aggregate-to-grid-vs.glsl.ts"],"names":[],"mappings":";AAoBA,wBAyDE"} \ No newline at end of file diff --git a/modules/aggregation-layers/typed/utils/gpu-grid-aggregation/gpu-grid-aggregator-constants.d.ts b/modules/aggregation-layers/typed/utils/gpu-grid-aggregation/gpu-grid-aggregator-constants.d.ts new file mode 100644 index 00000000000..e5cbda91ab3 --- /dev/null +++ b/modules/aggregation-layers/typed/utils/gpu-grid-aggregation/gpu-grid-aggregator-constants.d.ts @@ -0,0 +1,38 @@ +import {GL} from '@luma.gl/webgl-legacy'; +export declare const DEFAULT_RUN_PARAMS: { + projectPoints: boolean; + viewport: any; + createBufferObjects: boolean; + moduleSettings: {}; +}; +export declare const MAX_32_BIT_FLOAT = 3.402823466e38; +export declare const MIN_BLEND_EQUATION: GL[]; +export declare const MAX_BLEND_EQUATION: GL[]; +export declare const MAX_MIN_BLEND_EQUATION: GL[]; +export declare const EQUATION_MAP: { + [x: number]: GL | GL[]; +}; +export declare const ELEMENTCOUNT = 4; +export declare const DEFAULT_WEIGHT_PARAMS: { + size: number; + operation: number; + needMin: boolean; + needMax: boolean; + combineMaxMin: boolean; +}; +export declare const PIXEL_SIZE = 4; +export declare const WEIGHT_SIZE = 3; +export declare const MAX_MIN_TEXTURE_OPTS: { + format: GL; + type: GL; + border: number; + mipmaps: boolean; + parameters: { + 10240: GL; + 10241: GL; + }; + dataFormat: GL; + width: number; + height: number; +}; +// # sourceMappingURL=gpu-grid-aggregator-constants.d.ts.map diff --git a/modules/aggregation-layers/typed/utils/gpu-grid-aggregation/gpu-grid-aggregator-constants.d.ts.map b/modules/aggregation-layers/typed/utils/gpu-grid-aggregation/gpu-grid-aggregator-constants.d.ts.map new file mode 100644 index 00000000000..d57b8dbb8bc --- /dev/null +++ b/modules/aggregation-layers/typed/utils/gpu-grid-aggregation/gpu-grid-aggregator-constants.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"gpu-grid-aggregator-constants.d.ts","sourceRoot":"","sources":["../../../src/utils/gpu-grid-aggregation/gpu-grid-aggregator-constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,EAAE,EAAC,MAAM,uBAAuB,CAAC;AAGzC,eAAO,MAAM,kBAAkB;;;;;CAK9B,CAAC;AAEF,eAAO,MAAM,gBAAgB,kBAAiB,CAAC;AAC/C,eAAO,MAAM,kBAAkB,MAAwB,CAAC;AACxD,eAAO,MAAM,kBAAkB,MAAwB,CAAC;AACxD,eAAO,MAAM,sBAAsB,MAAmB,CAAC;AACvD,eAAO,MAAM,YAAY;;CAKxB,CAAC;AAEF,eAAO,MAAM,YAAY,IAAI,CAAC;AAC9B,eAAO,MAAM,qBAAqB;;;;;;CAMjC,CAAC;AAEF,eAAO,MAAM,UAAU,IAAI,CAAC;AAC5B,eAAO,MAAM,WAAW,IAAI,CAAC;AAE7B,eAAO,MAAM,oBAAoB;;;;;;;;;;;;CAYhC,CAAC"} \ No newline at end of file diff --git a/modules/aggregation-layers/typed/utils/gpu-grid-aggregation/gpu-grid-aggregator-utils.d.ts b/modules/aggregation-layers/typed/utils/gpu-grid-aggregation/gpu-grid-aggregator-utils.d.ts new file mode 100644 index 00000000000..95cc3e57bca --- /dev/null +++ b/modules/aggregation-layers/typed/utils/gpu-grid-aggregation/gpu-grid-aggregator-utils.d.ts @@ -0,0 +1 @@ +// # sourceMappingURL=gpu-grid-aggregator-utils.d.ts.map diff --git a/modules/aggregation-layers/typed/utils/gpu-grid-aggregation/gpu-grid-aggregator-utils.d.ts.map b/modules/aggregation-layers/typed/utils/gpu-grid-aggregation/gpu-grid-aggregator-utils.d.ts.map new file mode 100644 index 00000000000..8c727e1cdc6 --- /dev/null +++ b/modules/aggregation-layers/typed/utils/gpu-grid-aggregation/gpu-grid-aggregator-utils.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"gpu-grid-aggregator-utils.d.ts","sourceRoot":"","sources":["../../../src/utils/gpu-grid-aggregation/gpu-grid-aggregator-utils.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/modules/aggregation-layers/typed/utils/gpu-grid-aggregation/gpu-grid-aggregator.d.ts b/modules/aggregation-layers/typed/utils/gpu-grid-aggregation/gpu-grid-aggregator.d.ts new file mode 100644 index 00000000000..246a166f974 --- /dev/null +++ b/modules/aggregation-layers/typed/utils/gpu-grid-aggregation/gpu-grid-aggregator.d.ts @@ -0,0 +1,72 @@ +import type {Device} from '@luma.gl/api'; +export declare type GPUGridAggregatorProps = { + id?: string; +}; +export default class GPUGridAggregator { + static getAggregationData({ + aggregationData, + maxData, + minData, + maxMinData, + pixelIndex + }: { + aggregationData: any; + maxData: any; + minData: any; + maxMinData: any; + pixelIndex: any; + }): { + cellCount?: any; + cellWeight?: any; + maxCellWieght?: any; + minCellWeight?: any; + totalCount?: any; + }; + static getCellData({countsData, size}: {countsData: any; size?: number}): { + cellCounts: Uint32Array; + cellWeights: Float32Array; + }; + static isSupported(device: Device): boolean; + state: { + weightAttributes: {}; + textures: {}; + meanTextures: {}; + buffers: {}; + framebuffers: {}; + maxMinFramebuffers: {}; + minFramebuffers: {}; + maxFramebuffers: {}; + equations: {}; + shaderOptions: {}; + modelDirty: boolean; + resources: {}; + results: {}; + }; + id: string; + device: Device; + _hasGPUSupport: boolean; + gridAggregationModel: any; + allAggregationModel: any; + meanTransform: any; + constructor(device: Device, props?: GPUGridAggregatorProps); + delete(): void; + run(opts?: {}): {}; + getData(weightId: any): { + aggregationData?: any; + }; + updateShaders(shaderOptions?: {}): void; + _normalizeAggregationParams(opts: any): any; + setState(updateObject: any): void; + _getAggregateData(opts: any): {}; + _renderAggregateData(opts: any): void; + _renderToMaxMinTexture(opts: any): void; + _renderToWeightsTexture(opts: any): void; + _runAggregation(opts: any): {}; + _setupFramebuffers(opts: any): void; + _getMinMaxTexture(name: any): any; + _setupModels({numCol, numRow}?: {numCol?: number; numRow?: number}): void; + _setupWeightAttributes(opts: any): void; + _trackGPUResultBuffers(results: any, weights: any): void; + _updateModels(opts: any): void; +} +// # sourceMappingURL=gpu-grid-aggregator.d.ts.map diff --git a/modules/aggregation-layers/typed/utils/gpu-grid-aggregation/gpu-grid-aggregator.d.ts.map b/modules/aggregation-layers/typed/utils/gpu-grid-aggregation/gpu-grid-aggregator.d.ts.map new file mode 100644 index 00000000000..5f999780738 --- /dev/null +++ b/modules/aggregation-layers/typed/utils/gpu-grid-aggregation/gpu-grid-aggregator.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"gpu-grid-aggregator.d.ts","sourceRoot":"","sources":["../../../src/utils/gpu-grid-aggregation/gpu-grid-aggregator.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAC,MA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AC,IAAI,KAAA;CAiBnB"} \ No newline at end of file diff --git a/modules/aggregation-layers/typed/utils/gpu-grid-aggregation/transform-mean-vs.glsl.d.ts b/modules/aggregation-layers/typed/utils/gpu-grid-aggregation/transform-mean-vs.glsl.d.ts new file mode 100644 index 00000000000..e348e5c0666 --- /dev/null +++ b/modules/aggregation-layers/typed/utils/gpu-grid-aggregation/transform-mean-vs.glsl.d.ts @@ -0,0 +1,3 @@ +declare const _default: '#define SHADER_NAME gpu-aggregation-transform-mean-vs\nattribute vec4 aggregationValues;\nvarying vec4 meanValues;\n\nvoid main()\n{\n // TODO: Use 64-bit division ?? not needed given this is aggregation ??\n bool isCellValid = bool(aggregationValues.w > 0.);\n // aggregationValues: XYZ contain aggregated values, W contains count\n meanValues.xyz = isCellValid ? aggregationValues.xyz/aggregationValues.w : vec3(0, 0, 0);\n meanValues.w = aggregationValues.w;\n\n // Enforce default value for ANGLE issue (https://bugs.chromium.org/p/angleproject/issues/detail?id=3941)\n gl_PointSize = 1.0;\n}\n'; +export default _default; +// # sourceMappingURL=transform-mean-vs.glsl.d.ts.map diff --git a/modules/aggregation-layers/typed/utils/gpu-grid-aggregation/transform-mean-vs.glsl.d.ts.map b/modules/aggregation-layers/typed/utils/gpu-grid-aggregation/transform-mean-vs.glsl.d.ts.map new file mode 100644 index 00000000000..0d479b2f936 --- /dev/null +++ b/modules/aggregation-layers/typed/utils/gpu-grid-aggregation/transform-mean-vs.glsl.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"transform-mean-vs.glsl.d.ts","sourceRoot":"","sources":["../../../src/utils/gpu-grid-aggregation/transform-mean-vs.glsl.ts"],"names":[],"mappings":";AAoBA,wBAgBE"} \ No newline at end of file diff --git a/modules/aggregation-layers/typed/utils/grid-aggregation-utils.d.ts b/modules/aggregation-layers/typed/utils/grid-aggregation-utils.d.ts new file mode 100644 index 00000000000..188c2f93b39 --- /dev/null +++ b/modules/aggregation-layers/typed/utils/grid-aggregation-utils.d.ts @@ -0,0 +1,42 @@ +export declare function getBoundingBox( + attributes: any, + vertexCount: any +): { + xMin: any; + xMax: any; + yMin: any; + yMax: any; +}; +export declare function alignToCell(inValue: any, cellSize: any): number; +/** + * Based on geometric center of sample points, calculate cellSize in lng/lat (degree) space + * @param {object} boundingBox - {xMin, yMin, xMax, yMax} contains bounding box of data + * @param {number} cellSize - grid cell size in meters + * @param {boolean, optional} converToDegrees - when true offsets are converted from meters to lng/lat (degree) space + * @returns {xOffset, yOffset} - cellSize size + */ +export declare function getGridOffset( + boundingBox: any, + cellSize: any, + convertToMeters?: boolean +): { + xOffset: any; + yOffset: any; +}; +export declare function getGridParams( + boundingBox: any, + cellSize: any, + viewport: any, + coordinateSystem: any +): { + gridOffset: { + xOffset: any; + yOffset: any; + }; + translation: number[]; + width: any; + height: any; + numCol: number; + numRow: number; +}; +// # sourceMappingURL=grid-aggregation-utils.d.ts.map diff --git a/modules/aggregation-layers/typed/utils/grid-aggregation-utils.d.ts.map b/modules/aggregation-layers/typed/utils/grid-aggregation-utils.d.ts.map new file mode 100644 index 00000000000..3d7eb6677cb --- /dev/null +++ b/modules/aggregation-layers/typed/utils/grid-aggregation-utils.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"grid-aggregation-utils.d.ts","sourceRoot":"","sources":["../../src/utils/grid-aggregation-utils.ts"],"names":[],"mappings":"AASA,wBAAgB,cAAc,CAAC,UAAU,KAAA,EAAE,WAAW,KAAA;;;;;EA4BrD;AA4BD,wBAAgB,WAAW,CAAC,OAAO,KAAA,EAAE,QAAQ,KAAA,UAQ5C;AAED;;;;;;GAMG;AAEH,wBAAgB,aAAa,CAAC,WAAW,KAAA,EAAE,QAAQ,KAAA,EAAE,eAAe,UAAO;;;EAS1E;AAED,wBAAgB,aAAa,CAAC,WAAW,KAAA,EAAE,QAAQ,KAAA,EAAE,QAAQ,KAAA,EAAE,gBAAgB,KAAA;;;;;;;;;;EAiB9E"} \ No newline at end of file diff --git a/modules/aggregation-layers/typed/utils/prop-utils.d.ts b/modules/aggregation-layers/typed/utils/prop-utils.d.ts new file mode 100644 index 00000000000..194dcc2fe8d --- /dev/null +++ b/modules/aggregation-layers/typed/utils/prop-utils.d.ts @@ -0,0 +1,2 @@ +export declare function filterProps(props: any, filterKeys: any): {}; +// # sourceMappingURL=prop-utils.d.ts.map diff --git a/modules/aggregation-layers/typed/utils/prop-utils.d.ts.map b/modules/aggregation-layers/typed/utils/prop-utils.d.ts.map new file mode 100644 index 00000000000..14c0ffaa182 --- /dev/null +++ b/modules/aggregation-layers/typed/utils/prop-utils.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"prop-utils.d.ts","sourceRoot":"","sources":["../../src/utils/prop-utils.ts"],"names":[],"mappings":"AAoBA,wBAAgB,WAAW,CAAC,KAAK,KAAA,EAAE,UAAU,KAAA,MAQ5C"} \ No newline at end of file diff --git a/modules/aggregation-layers/typed/utils/resource-utils.d.ts b/modules/aggregation-layers/typed/utils/resource-utils.d.ts new file mode 100644 index 00000000000..01b822c10ae --- /dev/null +++ b/modules/aggregation-layers/typed/utils/resource-utils.d.ts @@ -0,0 +1,15 @@ +import {Device} from '@luma.gl/api'; +import {GL, Framebuffer, Texture2D} from '@luma.gl/webgl-legacy'; +declare type FloatTextureOptions = { + id: string; + width?: number; + height?: number; + data?: any; + unpackFlipY?: boolean; + parameters?: Record; +}; +export declare function getFloatTexture(device: Device, opts: FloatTextureOptions): Texture2D; +export declare function getFramebuffer(device: Device, opts: any): Framebuffer; +export declare function getFloatArray(array: any, size: any, fillValue?: number): any; +export {}; +// # sourceMappingURL=resource-utils.d.ts.map diff --git a/modules/aggregation-layers/typed/utils/resource-utils.d.ts.map b/modules/aggregation-layers/typed/utils/resource-utils.d.ts.map new file mode 100644 index 00000000000..609a74eb784 --- /dev/null +++ b/modules/aggregation-layers/typed/utils/resource-utils.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"resource-utils.d.ts","sourceRoot":"","sources":["../../src/utils/resource-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,MAAM,EAAC,MAAM,cAAc,CAAC;AACpC,OAAO,EAAC,EAAE,EAAE,WAAW,EAAE,SAAS,EAAC,MAAM,uBAAuB,CAAC;AAOjE,aAAK,mBAAmB,GAAG;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,GAAG,CAAC;IACX,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;CAC7B,CAAC;AAEF,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,mBAAmB,aAsBxE;AAED,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,KAAA,eAYlD;AAED,wBAAgB,aAAa,CAAC,KAAK,KAAA,EAAE,IAAI,KAAA,EAAE,SAAS,SAAI,OAKvD"} \ No newline at end of file diff --git a/modules/aggregation-layers/typed/utils/scale-utils.d.ts b/modules/aggregation-layers/typed/utils/scale-utils.d.ts new file mode 100644 index 00000000000..0b0a31a740f --- /dev/null +++ b/modules/aggregation-layers/typed/utils/scale-utils.d.ts @@ -0,0 +1,15 @@ +export function getScale(domain: any, range: any, scaleFunction: any): any; +export function getQuantizeScale(domain: any, range: any): any; +export function getLinearScale(domain: any, range: any): any; +export function getQuantileScale(domain: any, range: any): any; +export function getOrdinalScale(domain: any, range: any): any; +export function quantizeScale(domain: any, range: any, value: any): any; +export function linearScale(domain: any, range: any, value: any): any; +export function unique(values: any): any[]; +export function getLinearDomain(data: any, valueAccessor: any): any[]; +export function getQuantileDomain(data: any, valueAccessor: any): any; +export function getOrdinalDomain(data: any, valueAccessor: any): any[]; +export function getScaleDomain(scaleType: any, data: any, valueAccessor: any): any; +export function clamp(value: any, min: any, max: any): number; +export function getScaleFunctionByScaleType(scaleType: any): typeof getQuantizeScale; +// # sourceMappingURL=scale-utils.d.ts.map diff --git a/modules/aggregation-layers/typed/utils/scale-utils.d.ts.map b/modules/aggregation-layers/typed/utils/scale-utils.d.ts.map new file mode 100644 index 00000000000..9b3cdf1e8fd --- /dev/null +++ b/modules/aggregation-layers/typed/utils/scale-utils.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"scale-utils.d.ts","sourceRoot":"","sources":["../../src/utils/scale-utils.js"],"names":[],"mappings":"AAuBA,2EAMC;AAKD,+DAIC;AAGD,6DAIC;AAED,+DAcC;AAqDD,8DAaC;AAID,wEAWC;AAGD,sEAEC;AAOD,2CASC;AAOD,sEAGC;AAED,sEAEC;AAED,uEAEC;AAED,mFAeC;AAED,8DAEC;AAED,qFAcC"} \ No newline at end of file diff --git a/modules/carto/typed/api/carto-api-error.d.ts b/modules/carto/typed/api/carto-api-error.d.ts new file mode 100644 index 00000000000..441959771ff --- /dev/null +++ b/modules/carto/typed/api/carto-api-error.d.ts @@ -0,0 +1,24 @@ +import {MapType, RequestType} from './maps-api-common'; +export declare type APIErrorContext = { + requestType: RequestType; + mapId?: string; + connection?: string; + source?: string; + type?: MapType; +}; +/** + * + * Custom error for reported errors in CARTO Maps API. + * Provides useful debugging information in console and context for applications. + * + */ +export declare class CartoAPIError extends Error { + /** Source error from server */ + error: Error; + /** Context (API call & parameters) in which error occured */ + errorContext: APIErrorContext; + /** Response from server */ + response?: Response; + constructor(error: Error, errorContext: APIErrorContext, response?: Response); +} +// # sourceMappingURL=carto-api-error.d.ts.map diff --git a/modules/carto/typed/api/carto-api-error.d.ts.map b/modules/carto/typed/api/carto-api-error.d.ts.map new file mode 100644 index 00000000000..f81edee398a --- /dev/null +++ b/modules/carto/typed/api/carto-api-error.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"carto-api-error.d.ts","sourceRoot":"","sources":["../../src/api/carto-api-error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAE,WAAW,EAAC,MAAM,mBAAmB,CAAC;AAEvD,oBAAY,eAAe,GAAG;IAC5B,WAAW,EAAE,WAAW,CAAC;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB,CAAC;AAEF;;;;;GAKG;AACH,qBAAa,aAAc,SAAQ,KAAK;IACtC,+BAA+B;IAC/B,KAAK,EAAE,KAAK,CAAC;IAEb,6DAA6D;IAC7D,YAAY,EAAE,eAAe,CAAC;IAE9B,2BAA2B;IAC3B,QAAQ,CAAC,EAAE,QAAQ,CAAC;gBAER,KAAK,EAAE,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,QAAQ,CAAC,EAAE,QAAQ;CAiC7E"} \ No newline at end of file diff --git a/modules/carto/typed/api/index.d.ts b/modules/carto/typed/api/index.d.ts new file mode 100644 index 00000000000..351c08abe4f --- /dev/null +++ b/modules/carto/typed/api/index.d.ts @@ -0,0 +1,7 @@ +export {CartoAPIError} from './carto-api-error'; +export type {APIErrorContext} from './carto-api-error'; +export {FORMATS, TILE_FORMATS, MAP_TYPES, API_VERSIONS} from './maps-api-common'; +export type {QueryParameters} from './maps-api-common'; +export {getDataV2, CONNECTIONS} from './maps-client'; +export {fetchLayerData, fetchMap, mapInstantiation} from './maps-v3-client'; +// # sourceMappingURL=index.d.ts.map diff --git a/modules/carto/typed/api/index.d.ts.map b/modules/carto/typed/api/index.d.ts.map new file mode 100644 index 00000000000..19dbce9337a --- /dev/null +++ b/modules/carto/typed/api/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAC,MAAM,mBAAmB,CAAC;AAChD,YAAY,EAAC,eAAe,EAAC,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAC,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,YAAY,EAAC,MAAM,mBAAmB,CAAC;AACjF,YAAY,EAAC,eAAe,EAAC,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAC,SAAS,EAAE,WAAW,EAAC,MAAM,eAAe,CAAC;AACrD,OAAO,EAAC,cAAc,EAAE,QAAQ,EAAE,gBAAgB,EAAC,MAAM,kBAAkB,CAAC"} \ No newline at end of file diff --git a/modules/carto/typed/api/layer-map.d.ts b/modules/carto/typed/api/layer-map.d.ts new file mode 100644 index 00000000000..9a716f02636 --- /dev/null +++ b/modules/carto/typed/api/layer-map.d.ts @@ -0,0 +1,127 @@ +import { + scaleLinear, + scaleOrdinal, + scaleLog, + scalePoint, + scaleQuantile, + scaleQuantize, + scaleSqrt, + scaleThreshold +} from 'd3-scale'; +import {Accessor, Layer, _ConstructorOf as ConstructorOf} from '@deck.gl/core'; +import {MVTLayer} from '@deck.gl/geo-layers'; +import CartoTileLayer from '../layers/carto-tile-layer'; +import H3TileLayer from '../layers/h3-tile-layer'; +import QuadbinTileLayer from '../layers/quadbin-tile-layer'; +import { + CustomMarkersRange, + MapDataset, + MapTextSubLayerConfig, + TextLabel, + VisConfig, + VisualChannelField, + VisualChannels +} from './types'; +declare const SCALE_FUNCS: { + linear: typeof scaleLinear; + ordinal: typeof scaleOrdinal; + log: typeof scaleLog; + point: typeof scalePoint; + quantile: typeof scaleQuantile; + quantize: typeof scaleQuantize; + sqrt: typeof scaleSqrt; + custom: typeof scaleThreshold; +}; +export declare type SCALE_TYPE = keyof typeof SCALE_FUNCS; +export declare const AGGREGATION: { + average: string; + maximum: string; + minimum: string; + sum: string; +}; +export declare const OPACITY_MAP: { + getFillColor: string; + getLineColor: string; + getTextColor: string; +}; +export declare function getLayer( + type: string, + config: MapTextSubLayerConfig, + dataset: MapDataset +): { + Layer: ConstructorOf; + propMap: any; + defaultProps: any; +}; +export declare function layerFromTileDataset( + formatTiles: string | null, + scheme: string +): typeof CartoTileLayer | typeof H3TileLayer | typeof MVTLayer | typeof QuadbinTileLayer; +declare function domainFromValues(values: any, scaleType: SCALE_TYPE): any; +export declare function opacityToAlpha(opacity?: number): number; +export declare function getColorValueAccessor( + { + name + }: { + name: any; + }, + colorAggregation: any, + data: any +): any; +export declare function getColorAccessor( + { + name + }: { + name: any; + }, + scaleType: SCALE_TYPE, + { + aggregation, + range: {colors, colorMap} + }: { + aggregation: any; + range: { + colors: any; + colorMap: any; + }; + }, + opacity: number | undefined, + data: any +): any; +export declare function getIconUrlAccessor( + field: VisualChannelField | null | undefined, + range: CustomMarkersRange | null | undefined, + { + fallbackUrl, + maxIconSize, + useMaskedIcons + }: { + fallbackUrl: any; + maxIconSize: any; + useMaskedIcons: any; + }, + data: any +): any; +export declare function getMaxMarkerSize( + visConfig: VisConfig, + visualChannels: VisualChannels +): number; +export declare function negateAccessor(accessor: Accessor): Accessor; +export declare function getSizeAccessor( + { + name + }: { + name: any; + }, + scaleType: SCALE_TYPE | undefined, + aggregation: any, + range: Iterable | undefined, + data: any +): any; +export declare function getTextAccessor({name, type}: VisualChannelField, data: any): any; +export declare function getTextPixelOffsetAccessor( + {alignment, anchor, size}: TextLabel, + radius: any +): Accessor; +export {domainFromValues as _domainFromValues}; +// # sourceMappingURL=layer-map.d.ts.map diff --git a/modules/carto/typed/api/layer-map.d.ts.map b/modules/carto/typed/api/layer-map.d.ts.map new file mode 100644 index 00000000000..7a7df480962 --- /dev/null +++ b/modules/carto/typed/api/layer-map.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"layer-map.d.ts","sourceRoot":"","sources":["../../src/api/layer-map.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,WAAW,EACX,YAAY,EACZ,QAAQ,EACR,UAAU,EACV,aAAa,EACb,aAAa,EACb,SAAS,EACT,cAAc,EACf,MAAM,UAAU,CAAC;AAIlB,OAAO,EAAC,QAAQ,EAAE,KAAK,EAAE,cAAc,IAAI,aAAa,EAAC,MAAM,eAAe,CAAC;AAG/E,OAAO,EAAiB,QAAQ,EAAC,MAAM,qBAAq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,EAAE,MAAM,GAAG,SAAS,EAC3B,IAAI,EAAE,GAAG,OAmCV;AAKD,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,kBAAkB,GAAG,IAAI,GAAG,SAAS,EAC5C,KAAK,EAAE,kBAAkB,GAAG,IAAI,GAAG,SAAS,EAC5C,EAAC,WAAW,EAAE,WAAW,EAAE,cAAc,EAAC;;;;CAAA,EAC1C,IAAI,EAAE,GAAG,OAgCV;AAED,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,SAAS,EAAE,cAAc,EAAE,cAAc,GAAG,MAAM,CAK7F;AAED,wBAAgB,cAAc,CAAC,CAAC,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC,GAAG,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC,CAEpF;AAED,wBAAgB,eAAe,CAC7B,EAAC,IAAI,EAAC;;CAAA,EACN,SAAS,EAAE,UAAU,GAAG,SAAS,EACjC,WAAW,KAAA,EACX,KAAK,EAAE,QAAQ,CAAC,KAAK,CAAC,GAAG,SAAS,EAClC,IAAI,EAAE,GAAG,OAiBV;AAUD,wBAAgB,eAAe,CAAC,EAAC,IAAI,EAAE,IAAI,EAAC,EAAE,kBAAkB,EAAE,IAAI,KAAA,OAMrE;AAED,wBAAgB,0BAA0B,CACxC,EAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAC,EAAE,SAAS,EACpC,MAAM,KAAA,GACL,QAAQ,CAAC,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAgBrC;AAED,OAAO,EAAC,gBAAgB,IAAI,iBAAiB,EAAC,CAAC"} \ No newline at end of file diff --git a/modules/carto/typed/api/maps-api-common.d.ts b/modules/carto/typed/api/maps-api-common.d.ts new file mode 100644 index 00000000000..5f77db13a25 --- /dev/null +++ b/modules/carto/typed/api/maps-api-common.d.ts @@ -0,0 +1,84 @@ +export declare const DEFAULT_USER_COMPONENT_IN_URL = '{user}'; +export declare const DEFAULT_REGION_COMPONENT_IN_URL = '{region}'; +export declare type ValuesOf = T[keyof T]; +export declare const API_VERSIONS: { + readonly V1: 'v1'; + readonly V2: 'v2'; + readonly V3: 'v3'; +}; +export declare type ApiVersion = ValuesOf; +export declare const DEFAULT_MAPS_URL_FORMAT: { + readonly v1: 'https://{user}.carto.com/api/v1/map'; + readonly v2: 'https://maps-api-v2.{region}.carto.com/user/{user}'; +}; +export declare const MAP_TYPES: { + readonly QUERY: 'query'; + readonly TABLE: 'table'; + readonly TILESET: 'tileset'; +}; +export declare type MapType = ValuesOf; +export declare const COLUMNS_SUPPORT: MapType[]; +export declare const GEO_COLUMN_SUPPORT: MapType[]; +export declare const FORMATS: { + readonly GEOJSON: 'geojson'; + readonly NDJSON: 'ndjson'; + readonly TILEJSON: 'tilejson'; + readonly JSON: 'json'; +}; +export declare type Format = ValuesOf; +export declare const TILE_FORMATS: { + readonly MVT: 'mvt'; + readonly JSON: 'json'; + readonly GEOJSON: 'geojson'; + readonly BINARY: 'binary'; +}; +export declare type TileFormat = ValuesOf; +export declare enum SchemaFieldType { + Number = 'number', + Bigint = 'bigint', + String = 'string', + Geometry = 'geometry', + Timestamp = 'timestamp', + Object = 'object', + Boolean = 'boolean', + Variant = 'variant', + Unknown = 'unknown' +} +export interface SchemaField { + name: string; + type: SchemaFieldType; +} +export interface MapInstantiation extends MapInstantiationFormats { + nrows: number; + size?: number; + schema: SchemaField[]; +} +declare type MapInstantiationFormats = Record< + Format, + { + url: string[]; + error?: any; + } +>; +export declare const REQUEST_TYPES: { + readonly DATA: 'Map data'; + readonly INSTANTIATION: 'Map instantiation'; + readonly PUBLIC_MAP: 'Public map'; + readonly TILE_STATS: 'Tile stats'; +}; +export declare type RequestType = ValuesOf; +/** + * Simple encode parameter + */ +export declare function encodeParameter(name: string, value: string | boolean | number): string; +export declare type QueryParameterValue = + | string + | number + | boolean + | Array + | object; +export declare type NamedQueryParameter = Record; +export declare type PositionalQueryParameter = QueryParameterValue[]; +export declare type QueryParameters = NamedQueryParameter | PositionalQueryParameter; +export {}; +// # sourceMappingURL=maps-api-common.d.ts.map diff --git a/modules/carto/typed/api/maps-api-common.d.ts.map b/modules/carto/typed/api/maps-api-common.d.ts.map new file mode 100644 index 00000000000..7e50031405c --- /dev/null +++ b/modules/carto/typed/api/maps-api-common.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"maps-api-common.d.ts","sourceRoot":"","sources":["../../src/api/maps-api-common.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,6BAA6B,WAAW,CAAC;AACtD,eAAO,MAAM,+BAA+B,aAAa,CAAC;AAE1D,oBAAY,QAAQ,CAAC,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;AAChD,eAAO,MAAM,YAAY;;;;CAIf,CAAC;AACX,oBAAY,UAAU,GAAG,QAAQ,CAAC,OAAO,YAAY,CAAC,CAAC;AAEvD,eAAO,MAAM,uBAAuB;;;CAG1B,CAAC;AAEX,eAAO,MAAM,SAAS;;;;CAIZ,CAAC;AACX,oBAAY,OAAO,GAAG,QAAQ,CAAC,OAAO,SAAS,CAAC,CAAC;AACjD,eAAO,MAAM,eAAe,EAAE,OAAO,EAAsB,CAAC;AAC5D,eAAO,MAAM,kBAAkB,EAAE,OAAO,EAAuC,CAAC;AAGhF,eAAO,MAAM,OAAO;;;;;CAKV,CAAC;AACX,oBAAY,MAAM,GAAG,QAAQ,CAAC,OAAO,OAAO,CAAC,CAAC;AAG9C,eAAO,MAAM,YAAY;;;;;CAKf,CAAC;AACX,oBAAY,UAAU,GAAG,QAAQ,CAAC,OAAO,YAAY,CAAC,CAAC;AAEvD,oBAAY,eAAe;IACzB,MAAM,WAAW;IACjB,MAAM,WAAW;IACjB,MAAM,WAAW;IACjB,QAAQ,aAAa;IACrB,SAAS,cAAc;IACvB,MAAM,WAAW;IACjB,OAAO,YAAY;IACnB,OAAO,YAAY;IACnB,OAAO,YAAY;CACpB;AACD,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,eAAe,CAAC;CACvB;AAED,MAAM,WAAW,gBAAiB,SAAQ,uBAAuB;IAC/D,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,WAAW,EAAE,CAAC;CACvB;AAED,aAAK,uBAAuB,GAAG,MAAM,CACnC,MAAM,EACN;IACE,GAAG,EAAE,MAAM,EAAE,CAAC;IACd,KAAK,CAAC,EAAE,GAAG,CAAC;CACb,CACF,CAAC;AAEF,eAAO,MAAM,aAAa;;;;;CAKhB,CAAC;AACX,oBAAY,WAAW,GAAG,QAAQ,CAAC,OAAO,aAAa,CAAC,CAAC;AAEzD;;GAEG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,CAEtF;AAED,oBAAY,mBAAmB,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,KAAK,CAAC,mBAAmB,CAAC,GAAG,MAAM,CAAC;AAElG,oBAAY,mBAAmB,GAAG,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAC;AAEtE,oBAAY,wBAAwB,GAAG,mBAAmB,EAAE,CAAC;AAE7D,oBAAY,eAAe,GAAG,mBAAmB,GAAG,wBAAwB,CAAC"} \ No newline at end of file diff --git a/modules/carto/typed/api/maps-client.d.ts b/modules/carto/typed/api/maps-client.d.ts new file mode 100644 index 00000000000..e0600efc1c7 --- /dev/null +++ b/modules/carto/typed/api/maps-client.d.ts @@ -0,0 +1,22 @@ +/** + * Maps API Client for Maps API v1 and Maps API v2 + */ +import {ClassicCredentials} from '../config'; +import {MapType} from './maps-api-common'; +export declare const CONNECTIONS: { + BIGQUERY: string; + CARTO: string; +}; +/** + * Obtain a TileJson from Maps API v1 and v2 + */ +export declare function getDataV2({ + type, + source, + credentials +}: { + type: MapType; + source: string; + credentials?: Partial; +}): Promise; +// # sourceMappingURL=maps-client.d.ts.map diff --git a/modules/carto/typed/api/maps-client.d.ts.map b/modules/carto/typed/api/maps-client.d.ts.map new file mode 100644 index 00000000000..1ea865e2540 --- /dev/null +++ b/modules/carto/typed/api/maps-client.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"maps-client.d.ts","sourceRoot":"","sources":["../../src/api/maps-client.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EACL,kBAAkB,EAInB,MAAM,WAAW,CAAC;AACnB,OAAO,EAML,OAAO,EAER,MAAM,mBAAmB,CAAC;AAE3B,eAAO,MAAM,WAAW;;;CAGvB,CAAC;AAKF;;GAEG;AACH,wBAAsB,SAAS,CAAC,EAC9B,IAAI,EACJ,MAAM,EACN,WAAW,EACZ,EAAE;IACD,IAAI,EAAE,OAAO,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,OAAO,CAAC,kBAAkB,CAAC,CAAC;CAC3C,gBAkCA"} \ No newline at end of file diff --git a/modules/carto/typed/api/maps-v3-client.d.ts b/modules/carto/typed/api/maps-v3-client.d.ts new file mode 100644 index 00000000000..f9555ea6232 --- /dev/null +++ b/modules/carto/typed/api/maps-v3-client.d.ts @@ -0,0 +1,89 @@ +/** + * Maps API Client for Carto 3 + */ +import {CloudNativeCredentials} from '../config'; +import { + Format, + MapInstantiation, + MapType, + QueryParameters, + SchemaField, + TileFormat +} from './maps-api-common'; +export declare type Headers = Record; +declare type FetchLayerDataParams = { + type: MapType; + source: string; + connection: string; + credentials: CloudNativeCredentials; + geoColumn?: string; + columns?: string[]; + clientId?: string; + format?: Format; + formatTiles?: TileFormat; + headers?: Headers; + aggregationExp?: string; + aggregationResLevel?: number; + queryParameters?: QueryParameters; +}; +export declare function mapInstantiation({ + type, + source, + connection, + credentials, + geoColumn, + columns, + clientId, + headers, + aggregationExp, + aggregationResLevel, + queryParameters +}: FetchLayerDataParams): Promise; +export interface FetchLayerDataResult { + data: any; + format?: Format; + schema: SchemaField[]; +} +export declare function fetchLayerData({ + type, + source, + connection, + credentials, + geoColumn, + columns, + format, + formatTiles, + clientId, + headers, + aggregationExp, + aggregationResLevel, + queryParameters +}: FetchLayerDataParams): Promise; +export declare function fetchMap({ + cartoMapId, + clientId, + credentials, + headers, + autoRefresh, + onNewData +}: { + cartoMapId: string; + clientId: string; + credentials?: CloudNativeCredentials; + headers?: Headers; + autoRefresh?: number; + onNewData?: (map: any) => void; +}): Promise<{ + stopAutoRefresh: () => void; + id: any; + title: any; + description: any; + createdAt: any; + updatedAt: any; + initialViewState: any; + mapStyle: any; + token: any; + layers: import('@deck.gl/core').Layer<{}>[]; +}>; +export {}; +// # sourceMappingURL=maps-v3-client.d.ts.map diff --git a/modules/carto/typed/api/maps-v3-client.d.ts.map b/modules/carto/typed/api/maps-v3-client.d.ts.map new file mode 100644 index 00000000000..f9b86033fc4 --- /dev/null +++ b/modules/carto/typed/api/maps-v3-client.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"maps-v3-client.d.ts","sourceRoot":"","sources":["../../src/api/maps-v3-client.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAIL,sBAAsB,EACvB,MAAM,WAAW,CAAC;AACnB,OAAO,EAIL,MAAM,EAGN,gBAAgB,EAChB,OAAO,EAEP,eAAe,EAEf,WAAW,EACX,UAAU,EAEX,MAAM,mBAAmB,CAAC;AAY3B,oBAAY,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAiF7C,aAAK,oBAAoB,GAAG;IAC1B,IAAI,EAAE,OAAO,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,sBAAsB,CAAC;IACpC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,UAAU,CAAC;IACzB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,eAAe,CAAC,EAAE,eAAe,CAAC;CACnC,CAAC;AAiDF,wBAAsB,gBAAgB,CAAC,EACrC,IAAI,EACJ,MAAM,EACN,UAAU,EACV,WAAW,EACX,SAAS,EACT,OAAO,EACP,QAAQ,EACR,OAAO,EACP,cAAc,EACd,mBAAmB,EACnB,eAAe,EAChB,EAAE,oBAAoB,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAoClD;AA+CD,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,GAAG,CAAC;IACV,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,WAAW,EAAE,CAAC;CACvB;AACD,wBAAsB,cAAc,CAAC,EACnC,IAAI,EACJ,MAAM,EACN,UAAU,EACV,WAAW,EACX,SAAS,EACT,OAAO,EACP,MAAM,EACN,WAAW,EACX,QAAQ,EACR,OAAO,EACP,cAAc,EACd,mBAAmB,EACnB,eAAe,EAChB,EAAE,oBAAoB,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAuBtD;AA+MD,wBAAsB,QAAQ,CAAC,EAC7B,UAAU,EACV,QAAQ,EACR,WAAW,EACX,OAAO,EACP,WAAW,EACX,SAAS,EACV,EAAE;IACD,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,sBAAsB,CAAC;IACrC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,IAAI,CAAC;CAChC;2BA+B6B,IAAI;;;;;;;;;;GAmCjC"} \ No newline at end of file diff --git a/modules/carto/typed/api/parseMap.d.ts b/modules/carto/typed/api/parseMap.d.ts new file mode 100644 index 00000000000..59a9fa0e96a --- /dev/null +++ b/modules/carto/typed/api/parseMap.d.ts @@ -0,0 +1,12 @@ +export declare function parseMap(json: any): { + id: any; + title: any; + description: any; + createdAt: any; + updatedAt: any; + initialViewState: any; + mapStyle: any; + token: any; + layers: import('@deck.gl/core').Layer<{}>[]; +}; +// # sourceMappingURL=parseMap.d.ts.map diff --git a/modules/carto/typed/api/parseMap.d.ts.map b/modules/carto/typed/api/parseMap.d.ts.map new file mode 100644 index 00000000000..b9905f10853 --- /dev/null +++ b/modules/carto/typed/api/parseMap.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"parseMap.d.ts","sourceRoot":"","sources":["../../src/api/parseMap.ts"],"names":[],"mappings":"AAmBA,wBAAgB,QAAQ,CAAC,IAAI,KAAA;;;;;;;;;;EAwC5B"} \ No newline at end of file diff --git a/modules/carto/typed/api/types.d.ts b/modules/carto/typed/api/types.d.ts new file mode 100644 index 00000000000..71441633679 --- /dev/null +++ b/modules/carto/typed/api/types.d.ts @@ -0,0 +1,87 @@ +import {SCALE_TYPE} from './layer-map'; +export declare type VisualChannelField = { + name: string; + type: string; +}; +export declare type VisualChannels = { + colorField?: VisualChannelField; + colorScale?: SCALE_TYPE; + customMarkersField?: VisualChannelField; + customMarkersScale?: SCALE_TYPE; + radiusField?: VisualChannelField; + radiusScale?: SCALE_TYPE; + rotationScale?: SCALE_TYPE; + rotationField?: VisualChannelField; + sizeField?: VisualChannelField; + sizeScale?: SCALE_TYPE; + strokeColorField?: VisualChannelField; + strokeColorScale?: SCALE_TYPE; + heightField?: VisualChannelField; + heightScale?: SCALE_TYPE; +}; +export declare type ColorRange = { + category: string; + colors: string[]; + colorMap: string[][] | undefined; + name: string; + type: string; +}; +export declare type CustomMarkersRange = { + markerMap: { + value: string; + markerUrl?: string; + }[]; + othersMarker?: string; +}; +export declare type VisConfig = { + filled?: boolean; + opacity?: number; + enable3d?: boolean; + colorAggregation?: any; + colorRange: ColorRange; + customMarkers?: boolean; + customMarkersRange?: CustomMarkersRange | null; + customMarkersUrl?: string | null; + radius: number; + radiusRange?: number[]; + sizeAggregation?: any; + sizeRange?: any; + strokeColorAggregation?: any; + strokeOpacity?: number; + strokeColorRange?: ColorRange; + heightRange?: any; + heightAggregation?: any; +}; +export declare type TextLabel = { + field: VisualChannelField | null | undefined; + alignment?: 'center' | 'bottom' | 'top'; + anchor?: 'middle' | 'start' | 'end'; + size: number; + color?: number[]; + offset?: [number, number]; +}; +export declare type MapLayerConfig = { + columns?: Record; + color?: number[]; + label?: string; + dataId: string; + textLabel: TextLabel[]; + visConfig: VisConfig; +}; +export declare type MapTextSubLayerConfig = Omit & { + textLabel?: TextLabel; +}; +export declare type MapConfigLayer = { + type: string; + id: string; + config: MapLayerConfig; + visualChannels: VisualChannels; +}; +export declare type MapDataset = { + id: string; + data: any; + aggregationExp: string | null; + aggregationResLevel: number | null; + geoColumn: string; +}; +// # sourceMappingURL=types.d.ts.map diff --git a/modules/carto/typed/api/types.d.ts.map b/modules/carto/typed/api/types.d.ts.map new file mode 100644 index 00000000000..a2289c1d309 --- /dev/null +++ b/modules/carto/typed/api/types.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/api/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,aAAa,CAAC;AAEvC,oBAAY,kBAAkB,GAAG;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,oBAAY,cAAc,GAAG;IAC3B,UAAU,CAAC,EAAE,kBAAkB,CAAC;IAChC,UAAU,CAAC,EAAE,UAAU,CAAC;IAExB,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;IACxC,kBAAkB,CAAC,EAAE,UAAU,CAAC;IAEhC,WAAW,CAAC,EAAE,kBAAkB,CAAC;IACjC,WAAW,CAAC,EAAE,UAAU,CAAC;IAEzB,aAAa,CAAC,EAAE,UA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C,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC"} \ No newline at end of file diff --git a/modules/carto/typed/basemap.d.ts b/modules/carto/typed/basemap.d.ts new file mode 100644 index 00000000000..c54ec5460d4 --- /dev/null +++ b/modules/carto/typed/basemap.d.ts @@ -0,0 +1,10 @@ +declare const _default: { + readonly VOYAGER: string; + readonly POSITRON: string; + readonly DARK_MATTER: string; + readonly VOYAGER_NOLABELS: string; + readonly POSITRON_NOLABELS: string; + readonly DARK_MATTER_NOLABELS: string; +}; +export default _default; +// # sourceMappingURL=basemap.d.ts.map diff --git a/modules/carto/typed/basemap.d.ts.map b/modules/carto/typed/basemap.d.ts.map new file mode 100644 index 00000000000..d903d4aeb6a --- /dev/null +++ b/modules/carto/typed/basemap.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"basemap.d.ts","sourceRoot":"","sources":["../src/basemap.ts"],"names":[],"mappings":";;;;;;;;AAEA,wBAOW"} \ No newline at end of file diff --git a/modules/carto/typed/config.d.ts b/modules/carto/typed/config.d.ts new file mode 100644 index 00000000000..1ef8f90ff30 --- /dev/null +++ b/modules/carto/typed/config.d.ts @@ -0,0 +1,28 @@ +export declare const defaultClassicCredentials: { + readonly apiKey: 'default_public'; + readonly region: 'us'; + readonly username: 'public'; +}; +export declare const defaultCloudNativeCredentials: { + readonly apiBaseUrl: 'https://gcp-us-east1.api.carto.com'; +}; +export interface ClassicCredentials { + apiVersion: 'v1' | 'v2'; + apiKey: string; + region: string; + username: string; + mapsUrl?: string; +} +export interface CloudNativeCredentials { + apiVersion: 'v3'; + apiBaseUrl: string; + accessToken?: string; + mapsUrl?: string; +} +export declare type Credentials = ClassicCredentials | CloudNativeCredentials; +export declare function setDefaultCredentials({apiVersion, ...rest}: Partial): void; +export declare function getDefaultCredentials(): Credentials; +export declare type V3Endpoint = 'maps' | 'stats'; +export declare function buildMapsUrlFromBase(apiBaseUrl: string): string; +export declare function buildStatsUrlFromBase(apiBaseUrl: string): string; +// # sourceMappingURL=config.d.ts.map diff --git a/modules/carto/typed/config.d.ts.map b/modules/carto/typed/config.d.ts.map new file mode 100644 index 00000000000..9dfc884b223 --- /dev/null +++ b/modules/carto/typed/config.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,yBAAyB;;;;CAI5B,CAAC;AAEX,eAAO,MAAM,6BAA6B;;CAEhC,CAAC;AAEX,MAAM,WAAW,kBAAkB;IACjC,UAAU,EAAE,IAAI,GAAG,IAAI,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,sBAAsB;IACrC,UAAU,EAAE,IAAI,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,oBAAY,WAAW,GAAG,kBAAkB,GAAG,sBAAsB,CAAC;AAKtE,wBAAgB,qBAAqB,CAAC,EAAC,UAAU,EAAE,GAAG,IAAI,EAAC,EAAE,OAAO,CAAC,WAAW,CAAC,QAchF;AAED,wBAAgB,qBAAqB,IAAI,WAAW,CAEnD;AAED,oBAAY,UAAU,GAAG,MAAM,GAAG,OAAO,CAAC;AAW1C,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAE/D;AAED,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAEhE"} \ No newline at end of file diff --git a/modules/carto/typed/index.d.ts b/modules/carto/typed/index.d.ts new file mode 100644 index 00000000000..723572d6be5 --- /dev/null +++ b/modules/carto/typed/index.d.ts @@ -0,0 +1,23 @@ +export {getDefaultCredentials, setDefaultCredentials} from './config'; +export {default as CartoLayer} from './layers/carto-layer'; +export {default as _CartoTileLayer} from './layers/carto-tile-layer'; +export {default as _H3TileLayer} from './layers/h3-tile-layer'; +export {default as _QuadbinTileLayer} from './layers/quadbin-tile-layer'; +export {default as BASEMAP} from './basemap'; +export {default as colorBins} from './style/color-bins-style'; +export {default as colorCategories} from './style/color-categories-style'; +export {default as colorContinuous} from './style/color-continuous-style'; +export { + FORMATS, + TILE_FORMATS, + MAP_TYPES, + API_VERSIONS, + CartoAPIError, + fetchLayerData, + fetchMap, + getDataV2 as _getDataV2, + mapInstantiation as _mapInstantiation +} from './api'; +export type {APIErrorContext, QueryParameters} from './api'; +export type {CartoLayerProps} from './layers/carto-layer'; +// # sourceMappingURL=index.d.ts.map diff --git a/modules/carto/typed/index.d.ts.map b/modules/carto/typed/index.d.ts.map new file mode 100644 index 00000000000..1c7c6dcac27 --- /dev/null +++ b/modules/carto/typed/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,qBAAqB,EAAE,qBAAqB,EAAC,MAAM,UAAU,CAAC;AACtE,OAAO,EAAC,OAAO,IAAI,UAAU,EAAC,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAC,OAAO,IAAI,eAAe,EAAC,MAAM,2BAA2B,CAAC;AACrE,OAAO,EAAC,OAAO,IAAI,YAAY,EAAC,MAAM,wBAAwB,CAAC;AAC/D,OAAO,EAAC,OAAO,IAAI,iBAAiB,EAAC,MAAM,6BAA6B,CAAC;AACzE,OAAO,EAAC,OAAO,IAAI,OAAO,EAAC,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAC,OAAO,IAAI,SAAS,EAAC,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAC,OAAO,IAAI,eAAe,EAAC,MAAM,gCAAgC,CAAC;AAC1E,OAAO,EAAC,OAAO,IAAI,eAAe,EAAC,MAAM,gCAAgC,CAAC;AAC1E,OAAO,EACL,OAAO,EACP,YAAY,EACZ,SAAS,EACT,YAAY,EACZ,aAAa,EACb,cAAc,EACd,QAAQ,EACR,SAAS,IAAI,UAAU,EACvB,gBAAgB,IAAI,iBAAiB,EACtC,MAAM,OAAO,CAAC;AACf,YAAY,EAAC,eAAe,EAAE,eAAe,EAAC,MAAM,OAAO,CAAC;AAC5D,YAAY,EAAC,eAAe,EAAC,MAAM,sBAAsB,CAAC"} \ No newline at end of file diff --git a/modules/carto/typed/layers/carto-layer.d.ts b/modules/carto/typed/layers/carto-layer.d.ts new file mode 100644 index 00000000000..b9c9c1702a9 --- /dev/null +++ b/modules/carto/typed/layers/carto-layer.d.ts @@ -0,0 +1,101 @@ +import { + CompositeLayer, + CompositeLayerProps, + Layer, + LayerProps, + UpdateParameters +} from '@deck.gl/core'; +import {CartoAPIError} from '../api/carto-api-error'; +import {MapType, TileFormat, QueryParameters} from '../api/maps-api-common'; +import {Credentials} from '../config'; +import {Headers} from '../api/maps-v3-client'; +/** All properties supported by CartoLayer. */ +export declare type CartoLayerProps = _CartoLayerProps & CompositeLayerProps; +/** Properties added by CartoLayer. */ +declare type _CartoLayerProps = { + /** + * Either a SQL query or a name of dataset/tileset. + */ + data: string; + /** + * Data type. + * + * Possible values are: + * * `MAP_TYPES.QUERY`, if data is a SQL query. + * * `MAP_TYPES.TILESET`, if data is a tileset name. + * * `MAP_TYPES.TABLE`, if data is a dataset name. Only supported with API v3. + */ + type: MapType; + /** + * Name of the connection registered in the CARTO workspace. + * + * Required when apiVersion is `API_VERSIONS.V3`. + */ + connection?: string; + /** + * Use to override the default tile data format. + * + * Only supported when apiVersion is `API_VERSIONS.V3`. + * + * Possible values are: `TILE_FORMATS.BINARY`, `TILE_FORMATS.GEOJSON` and `TILE_FORMATS.MVT`. + */ + formatTiles?: TileFormat; + /** + * Name of the geo_column in the CARTO platform. + * + * Use this override the default column (`'geom'`), from which the geometry information should be fetched. + * + * Only supported when apiVersion is `API_VERSIONS.V3` and type is `MAP_TYPES.TABLE`. + */ + geoColumn?: string; + /** + * Names of columns to fetch. + * + * By default, all columns are fetched + * + * Only supported when apiVersion is `API_VERSIONS.V3` and type is `MAP_TYPES.TABLE`. + */ + columns?: string[]; + /** + * A string pointing to a unique attribute at the result of the query. + * + * A unique attribute is needed for highlighting with vector tiles when a feature is split across two or more tiles. + */ + uniqueIdProperty?: string; + /** + * Optional. Overrides the configuration to connect with CARTO. + * + * @see Credentials + */ + credentials?: Credentials; + /** + * Called when the request to the CARTO Maps API failed. + * + * By default the CartoAPIError is thrown. + */ + onDataError?: (err: CartoAPIError) => void; + clientId?: string; + /** Custom headers to include in the map instantiation request **/ + headers?: Headers; + /** Aggregation SQL expression. Only used for spatial index datasets **/ + aggregationExp?: string; + /** Aggregation resolution level. Only used for spatial index datasets, defaults to 6 for quadbins, 4 for h3. **/ + aggregationResLevel?: number; + /** Query parameters to be sent to the server. **/ + queryParameters?: QueryParameters; +}; +export default class CartoLayer extends CompositeLayer< + Required<_CartoLayerProps> & ExtraProps +> { + static layerName: string; + static defaultProps: any; + initializeState(): void; + get isLoaded(): boolean; + _checkProps(props: CartoLayerProps): void; + updateState({props, oldProps, changeFlags}: UpdateParameters): void; + _updateData(): Promise; + _getSubLayerAndProps(): [any, LayerProps]; + renderLayers(): Layer | null; +} +export {}; +// # sourceMappingURL=carto-layer.d.ts.map diff --git a/modules/carto/typed/layers/carto-layer.d.ts.map b/modules/carto/typed/layers/carto-layer.d.ts.map new file mode 100644 index 00000000000..5e42c6186f5 --- /dev/null +++ b/modules/carto/typed/layers/carto-layer.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"carto-layer.d.ts","sourceRoot":"","sources":["../../src/layers/carto-layer.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,mBAAmB,EACnB,KAAK,EACL,UAAU,EAEV,gBAAgB,EACjB,MAAM,eAAe,CAAC;AAIvB,OAAO,EAAC,aAAa,EAAC,MAAM,wBAAwB,CAAC;AAErD,OAAO,EAIL,OAAO,EAEP,UAAU,EACV,eAAe,EAChB,MAAM,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AAI,IAAI;IAOvB,IAAI,QAAQ,IAAI,OAAO,CAEtB;IAED,WAAW,CAAC,KAAK,EAAE,eAAe,GAAG,IAAI;IAuCzC,WAAW,CAAC,EAAC,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAC,EAAE,gBAAgB,CAAC,IAAI,CAAC;IAqB5D,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC;IAsClC,oBAAoB,IAAI,CAAC,GAAG,EAAE,UAAU,CAAC;IAwBzC,YAAY,IAAI,KAAK,GAAG,IAAI;CA4B7B"} \ No newline at end of file diff --git a/modules/carto/typed/layers/carto-tile-layer.d.ts b/modules/carto/typed/layers/carto-tile-layer.d.ts new file mode 100644 index 00000000000..4794ba10e15 --- /dev/null +++ b/modules/carto/typed/layers/carto-tile-layer.d.ts @@ -0,0 +1,55 @@ +import {DefaultProps} from '@deck.gl/core'; +import { + MVTLayer, + MVTLayerProps, + TileLayer, + _Tile2DHeader, + _TileLoadProps as TileLoadProps +} from '@deck.gl/geo-layers'; +import {GeoJsonLayer} from '@deck.gl/layers'; +import {TileFormat} from '../api/maps-api-common'; +import type {Feature} from 'geojson'; +/** All properties supported by CartoTileLayer. */ +export declare type CartoTileLayerProps = _CartoTileLayerProps & + MVTLayerProps; +/** Properties added by CartoTileLayer. */ +declare type _CartoTileLayerProps = { + /** Use to override the default tile data format. + * + * Possible values are: `TILE_FORMATS.BINARY`, `TILE_FORMATS.GEOJSON` and `TILE_FORMATS.MVT`. + * + * Only supported when `apiVersion` is `API_VERSIONS.V3` and `format` is `FORMATS.TILEJSON`. + */ + formatTiles?: TileFormat; +}; +export default class CartoTileLayer< + DataT extends Feature = Feature, + ExtraProps = {} +> extends MVTLayer & ExtraProps> { + static layerName: string; + static defaultProps: DefaultProps< + CartoTileLayerProps< + Feature< + import('geojson').Geometry, + { + [name: string]: any; + } + > + > + >; + initializeState(): void; + getTileData(tile: TileLoadProps): any; + renderSubLayers( + props: TileLayer['props'] & { + id: string; + data: any; + _offset: number; + tile: _Tile2DHeader; + } + ): GeoJsonLayer | null; + getPickingInfo( + params: any + ): import('modules/geo-layers/src/tile-layer/tile-layer').TiledPickingInfo; +} +export {}; +// # sourceMappingURL=carto-tile-layer.d.ts.map diff --git a/modules/carto/typed/layers/carto-tile-layer.d.ts.map b/modules/carto/typed/layers/carto-tile-layer.d.ts.map new file mode 100644 index 00000000000..171442c89d0 --- /dev/null +++ b/modules/carto/typed/layers/carto-tile-layer.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"carto-tile-layer.d.ts","sourceRoot":"","sources":["../../src/layers/carto-tile-layer.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,YAAY,EAAC,MAAM,eAAe,CAAC;AAE3C,OAAO,EACL,QAAQ,EACR,aAAa,EACb,SAAS,EAET,aAAa,EACb,cAAc,IAAI,aAAa,EAChC,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAC,YAAY,EAAC,MAAM,iBAAiB,CAAC;AAG7C,OAAO,EAAC,UAAU,EAAe,MAAM,wBAAwB,CAAC;AAChE,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,SAAS,CAAC;AASrC,kDAAkD;AAClD,oBAAY,mBAAmB,CAAC,KAAK,SAAS,OAAO,GAAG,OAAO,IAAI,oBAAoB,GACrF,aAAa,CAAC,KAAK,CAAC,CAAC;AAEvB,0CAA0C;AAC1C,aAAK,oBAAoB,GAAG;IAC1B;;;;;OAKG;IACH,WAAW,CAAC,EAAE,UAAU,CAAC;CAC1B,CAAC;AAEF,MAAM,CAAC,OAAO,OAAO,cAAc,CACjC,KAAK,SAAS,OAAO,GAAG,OAAO,EAC/B,UAAU,GAAG,EAAE,CACf,SAAQ,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,oBAAoB,CAAC,GAAG,UAAU,CAAC;IACpE,MAAM,CAAC,SAAS,SAAoB;IACpC,MAAM,CAAC,YAAY;;SAAgB;IAEnC,eAAe,IAAI,IAAI;IAMvB,WAAW,CAAC,IAAI,EAAE,aAAa;IAsB/B,eAAe,CACb,KAAK,EAAE,SAAS,CAAC,OAAO,CAAC,GAAG;QAC1B,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,GAAG,CAAC;QACV,OAAO,EAAE,MAAM,CAAC;QAChB,IAAI,EAAE,aAAa,CAAC;KACrB,GACA,YAAY,GAAG,IAAI;IAmBtB,cAAc,CAAC,MAAM,KAAA;CAUtB"} \ No newline at end of file diff --git a/modules/carto/typed/layers/h3-tile-layer.d.ts b/modules/carto/typed/layers/h3-tile-layer.d.ts new file mode 100644 index 00000000000..1da80c59f77 --- /dev/null +++ b/modules/carto/typed/layers/h3-tile-layer.d.ts @@ -0,0 +1,31 @@ +import { + CompositeLayer, + CompositeLayerProps, + Layer, + LayersList, + UpdateParameters, + DefaultProps +} from '@deck.gl/core'; +/** All properties supported by H3TileLayer. */ +export declare type H3TileLayerProps = _H3TileLayerProps & + CompositeLayerProps; +declare type H3HexagonLayerProps = Record; +/** Properties added by H3TileLayer. */ +declare type _H3TileLayerProps = H3HexagonLayerProps & { + aggregationResLevel?: number; +}; +export default class H3TileLayer extends CompositeLayer< + ExtraPropsT & Required<_H3TileLayerProps> +> { + static layerName: string; + static defaultProps: DefaultProps>; + state: { + tileJSON: any; + data: any; + }; + initializeState(): void; + updateState({changeFlags}: UpdateParameters): void; + renderLayers(): Layer | null | LayersList; +} +export {}; +// # sourceMappingURL=h3-tile-layer.d.ts.map diff --git a/modules/carto/typed/layers/h3-tile-layer.d.ts.map b/modules/carto/typed/layers/h3-tile-layer.d.ts.map new file mode 100644 index 00000000000..1cd71b5ba66 --- /dev/null +++ b/modules/carto/typed/layers/h3-tile-layer.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"h3-tile-layer.d.ts","sourceRoot":"","sources":["../../src/layers/h3-tile-layer.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,mBAAmB,EACnB,KAAK,EACL,UAAU,EACV,gBAAgB,EAChB,YAAY,EACb,MAAM,eAAe,CAAC;AAqBvB,+CAA+C;AAC/C,oBAAY,gBAAgB,CAAC,KAAK,GAAG,GAAG,IAAI,iBAAiB,CAAC,KAAK,CAAC,GAAG,mBAAmB,CAAC,KAAK,CAAC,CAAC;AAIlG,aAAK,mBAAmB,CAAC,KAAK,GAAG,GAAG,IAAI,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AAE5D,uCAAuC;AACvC,aAAK,iBAAiB,CAAC,KAAK,IAAI,mBAAmB,CAAC,KAAK,CAAC,GAAG;IAC3D,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B,CAAC;AAEF,MAAM,CAAC,OAAO,OAAO,WAAW,CAAC,KAAK,GAAG,GAAG,EAAE,WAAW,GAAG,EAAE,CAAE,SAAQ,cAAc,CACpF,WAAW,GAAG,QAAQ,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC,CACjD;IACC,MAAM,CAAC,SAAS,SAAiB;IACjC,MAAM,CAAC,YAAY,yCAAgB;IAEnC,KAAK,EAAG;QACN,QAAQ,EAAE,GAAG,CAAC;QACd,IAAI,EAAE,GAAG,CAAC;KACX,CAAC;IAEF,eAAe,IAAI,IAAI;IAKvB,WAAW,CAAC,EAAC,WAAW,EAAC,EAAE,gBAAgB,CAAC,IAAI,CAAC,GAAG,IAAI;IASxD,YAAY,IAAI,KAAK,GAAG,IAAI,GAAG,UAAU;CAyC1C"} \ No newline at end of file diff --git a/modules/carto/typed/layers/h3-tileset-2d.d.ts b/modules/carto/typed/layers/h3-tileset-2d.d.ts new file mode 100644 index 00000000000..464e9448a67 --- /dev/null +++ b/modules/carto/typed/layers/h3-tileset-2d.d.ts @@ -0,0 +1,28 @@ +import {_Tileset2D as Tileset2D, GeoBoundingBox} from '@deck.gl/geo-layers'; +export declare type H3TileIndex = { + i: string; +}; +export declare function getHexagonResolution(viewport: any): number; +export default class H3Tileset2D extends Tileset2D { + /** + * Returns all tile indices in the current viewport. If the current zoom level is smaller + * than minZoom, return an empty array. If the current zoom level is greater than maxZoom, + * return tiles that are on maxZoom. + */ + getTileIndices({ + viewport, + minZoom, + maxZoom + }: { + viewport: any; + minZoom: any; + maxZoom: any; + }): H3TileIndex[]; + getTileId({i}: H3TileIndex): string; + getTileMetadata({i}: H3TileIndex): { + bbox: GeoBoundingBox; + }; + getTileZoom({i}: H3TileIndex): number; + getParentIndex(index: H3TileIndex): H3TileIndex; +} +// # sourceMappingURL=h3-tileset-2d.d.ts.map diff --git a/modules/carto/typed/layers/h3-tileset-2d.d.ts.map b/modules/carto/typed/layers/h3-tileset-2d.d.ts.map new file mode 100644 index 00000000000..303d50de2e8 --- /dev/null +++ b/modules/carto/typed/layers/h3-tileset-2d.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"h3-tileset-2d.d.ts","sourceRoot":"","sources":["../../src/layers/h3-tileset-2d.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,IAAI,SAAS,EAAE,cAAc,EAAC,MAAM,qBAAqB,CAAC;AAG5E,oBAAY,WAAW,GAAG;IAAC,CAAC,EAAE,MAAM,CAAA;CAAC,CAAC;AA0DtC,wBAAgB,oBAAoB,CAAC,QAAQ,KAAA,GAAG,MAAM,CAMrD;AAED,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,SAAS;IAChD;;;;OAIG;IAEH,cAAc,CAAC,EAAC,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAC;;;;KAAA,GAAG,WAAW,EAAE;IAwB3D,SAAS,CAAC,EAAC,CAAC,EAAC,EAAE,WAAW,GAAG,MAAM;IAKnC,eAAe,CAAC,EAAC,CAAC,EAAC,EAAE,WAAW;;;IAKhC,WAAW,CAAC,EAAC,CAAC,EAAC,EAAE,WAAW,GAAG,MAAM;IAKrC,cAAc,CAAC,KAAK,EAAE,WAAW,GAAG,WAAW;CAKhD"} \ No newline at end of file diff --git a/modules/carto/typed/layers/quadbin-layer.d.ts b/modules/carto/typed/layers/quadbin-layer.d.ts new file mode 100644 index 00000000000..fae83d9d3d7 --- /dev/null +++ b/modules/carto/typed/layers/quadbin-layer.d.ts @@ -0,0 +1,27 @@ +import {AccessorFunction, DefaultProps} from '@deck.gl/core'; +import { + _GeoCellLayer as GeoCellLayer, + _GeoCellLayerProps as GeoCellLayerProps +} from '@deck.gl/geo-layers'; +/** All properties supported by QuadbinLayer. */ +export declare type QuadbinLayerProps = _QuadbinLayerProps & + GeoCellLayerProps; +/** Properties added by QuadbinLayer. */ +declare type _QuadbinLayerProps = { + /** + * Called for each data object to retrieve the quadbin string identifier. + * + * By default, it reads `quadbin` property of data object. + */ + getQuadbin?: AccessorFunction; +}; +export default class QuadbinLayer extends GeoCellLayer< + DataT, + Required<_QuadbinLayerProps> & ExtraProps +> { + static layerName: string; + static defaultProps: DefaultProps>; + indexToBounds(): Partial | null; +} +export {}; +// # sourceMappingURL=quadbin-layer.d.ts.map diff --git a/modules/carto/typed/layers/quadbin-layer.d.ts.map b/modules/carto/typed/layers/quadbin-layer.d.ts.map new file mode 100644 index 00000000000..ab143c43976 --- /dev/null +++ b/modules/carto/typed/layers/quadbin-layer.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"quadbin-layer.d.ts","sourceRoot":"","sources":["../../src/layers/quadbin-layer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,gBAAgB,EAAE,YAAY,EAAC,MAAM,eAAe,CAAC;AAC7D,OAAO,EACL,aAAa,IAAI,YAAY,EAC7B,kBAAkB,IAAI,iBAAiB,EACxC,MAAM,qBAAqB,CAAC;AAO7B,gDAAgD;AAChD,oBAAY,iBAAiB,CAAC,KAAK,GAAG,GAAG,IAAI,kBAAkB,CAAC,KAAK,CAAC,GAAG,iBAAiB,CAAC,KAAK,CAAC,CAAC;AAElG,wCAAwC;AACxC,aAAK,kBAAkB,CAAC,KAAK,IAAI;IAC/B;;;;OAIG;IACH,UAAU,CAAC,EAAE,gBAAgB,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;CAC9C,CAAC;AAEF,MAAM,CAAC,OAAO,OAAO,YAAY,CAAC,KAAK,GAAG,GAAG,EAAE,UAAU,GAAG,EAAE,CAAE,SAAQ,YAAY,CAClF,KAAK,EACL,QAAQ,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC,GAAG,UAAU,CACjD;IACC,MAAM,CAAC,SAAS,SAAkB;IAClC,MAAM,CAAC,YAAY,uCAAgB;IAEnC,aAAa,IAAI,OAAO,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,GAAG,IAAI;CAWvD"} \ No newline at end of file diff --git a/modules/carto/typed/layers/quadbin-tile-layer.d.ts b/modules/carto/typed/layers/quadbin-tile-layer.d.ts new file mode 100644 index 00000000000..07d4f4e0ce5 --- /dev/null +++ b/modules/carto/typed/layers/quadbin-tile-layer.d.ts @@ -0,0 +1,37 @@ +import { + CompositeLayer, + CompositeLayerProps, + Layer, + LayersList, + UpdateParameters, + DefaultProps +} from '@deck.gl/core'; +import QuadbinLayer, {QuadbinLayerProps} from './quadbin-layer'; +export declare const renderSubLayers: (props: any) => QuadbinLayer< + any, + { + getQuadbin: (d: any) => any; + } +>; +/** All properties supported by QuadbinTileLayer. */ +export declare type QuadbinTileLayerProps = _QuadbinTileLayerProps & + CompositeLayerProps; +/** Properties added by QuadbinTileLayer. */ +declare type _QuadbinTileLayerProps = QuadbinLayerProps & { + aggregationResLevel?: number; +}; +export default class QuadbinTileLayer extends CompositeLayer< + ExtraProps & Required<_QuadbinTileLayerProps> +> { + static layerName: string; + static defaultProps: DefaultProps>; + state: { + tileJSON: any; + data: any; + }; + initializeState(): void; + updateState({changeFlags}: UpdateParameters): void; + renderLayers(): Layer | null | LayersList; +} +export {}; +// # sourceMappingURL=quadbin-tile-layer.d.ts.map diff --git a/modules/carto/typed/layers/quadbin-tile-layer.d.ts.map b/modules/carto/typed/layers/quadbin-tile-layer.d.ts.map new file mode 100644 index 00000000000..c63290b9f60 --- /dev/null +++ b/modules/carto/typed/layers/quadbin-tile-layer.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"quadbin-tile-layer.d.ts","sourceRoot":"","sources":["../../src/layers/quadbin-tile-layer.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,mBAAmB,EACnB,KAAK,EACL,UAAU,EACV,gBAAgB,EAChB,YAAY,EACb,MAAM,eAAe,CAAC;AACvB,OAAO,YAAY,EAAE,EAAC,iBAAiB,EAAC,MAAM,iBAAiB,CAAC;AAKhE,eAAO,MAAM,eAAe;;EAO3B,CAAC;AAMF,oDAAoD;AACpD,oBAAY,qBAAqB,CAAC,KAAK,GAAG,GAAG,IAAI,sBAAsB,CAAC,KAAK,CAAC,GAC5E,mBAAmB,CAAC,KAAK,CAAC,CAAC;AAE7B,4CAA4C;AAC5C,aAAK,sBAAsB,CAAC,KAAK,IAAI,iBAAiB,CAAC,KAAK,CAAC,GAAG;IAC9D,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B,CAAC;AAEF,MAAM,CAAC,OAAO,OAAO,gBAAgB,CAAC,KAAK,GAAG,GAAG,EAAE,UAAU,GAAG,EAAE,CAAE,SAAQ,cAAc,CACxF,UAAU,GAAG,QAAQ,CAAC,sBAAsB,CAAC,KAAK,CAAC,CAAC,CACrD;IACC,MAAM,CAAC,SAAS,SAAsB;IACtC,MAAM,CAAC,YAAY,2CAAgB;IAEnC,KAAK,EAAG;QACN,QAAQ,EAAE,GAAG,CAAC;QACd,IAAI,EAAE,GAAG,CAAC;KACX,CAAC;IACF,eAAe,IAAI,IAAI;IAIvB,WAAW,CAAC,EAAC,WAAW,EAAC,EAAE,gBAAgB,CAAC,IAAI,CAAC,GAAG,IAAI;IASxD,YAAY,IAAI,KAAK,GAAG,IAAI,GAAG,UAAU;CAoB1C"} \ No newline at end of file diff --git a/modules/carto/typed/layers/quadbin-tileset-2d.d.ts b/modules/carto/typed/layers/quadbin-tileset-2d.d.ts new file mode 100644 index 00000000000..f93e061dc87 --- /dev/null +++ b/modules/carto/typed/layers/quadbin-tileset-2d.d.ts @@ -0,0 +1,14 @@ +import {_Tileset2D as Tileset2D} from '@deck.gl/geo-layers'; +declare type QuadbinTileIndex = { + q: bigint; + i?: string; +}; +export default class QuadbinTileset2D extends Tileset2D { + getTileIndices(opts: any): QuadbinTileIndex[]; + getTileId({q, i}: QuadbinTileIndex): string; + getTileMetadata({q}: QuadbinTileIndex): Record; + getTileZoom({q}: QuadbinTileIndex): number; + getParentIndex({q}: QuadbinTileIndex): QuadbinTileIndex; +} +export {}; +// # sourceMappingURL=quadbin-tileset-2d.d.ts.map diff --git a/modules/carto/typed/layers/quadbin-tileset-2d.d.ts.map b/modules/carto/typed/layers/quadbin-tileset-2d.d.ts.map new file mode 100644 index 00000000000..7c6d6a54cb7 --- /dev/null +++ b/modules/carto/typed/layers/quadbin-tileset-2d.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"quadbin-tileset-2d.d.ts","sourceRoot":"","sources":["../../src/layers/quadbin-tileset-2d.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,IAAI,SAAS,EAAC,MAAM,qBAAqB,CAAC;AAK5D,aAAK,gBAAgB,GAAG;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,CAAC,EAAE,MAAM,CAAA;CAAC,CAAC;AAEhD,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,SAAS;IAErD,cAAc,CAAC,IAAI,KAAA,GAAG,gBAAgB,EAAE;IAQxC,SAAS,CAAC,EAAC,CAAC,EAAE,CAAC,EAAC,EAAE,gBAAgB,GAAG,MAAM;IAK3C,eAAe,CAAC,EAAC,CAAC,EAAC,EAAE,gBAAgB;IAKrC,WAAW,CAAC,EAAC,CAAC,EAAC,EAAE,gBAAgB,GAAG,MAAM;IAK1C,cAAc,CAAC,EAAC,CAAC,EAAC,EAAE,gBAAgB,GAAG,gBAAgB;CAGxD"} \ No newline at end of file diff --git a/modules/carto/typed/layers/quadbin-utils.d.ts b/modules/carto/typed/layers/quadbin-utils.d.ts new file mode 100644 index 00000000000..ff6924d3291 --- /dev/null +++ b/modules/carto/typed/layers/quadbin-utils.d.ts @@ -0,0 +1,3 @@ +export declare function quadbinToWorldBounds(quadbin: bigint): [number[], number[]]; +export declare function getQuadbinPolygon(quadbin: bigint): number[]; +// # sourceMappingURL=quadbin-utils.d.ts.map diff --git a/modules/carto/typed/layers/quadbin-utils.d.ts.map b/modules/carto/typed/layers/quadbin-utils.d.ts.map new file mode 100644 index 00000000000..25e4bb004c9 --- /dev/null +++ b/modules/carto/typed/layers/quadbin-utils.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"quadbin-utils.d.ts","sourceRoot":"","sources":["../../src/layers/quadbin-utils.ts"],"names":[],"mappings":"AAKA,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,CAAC,CAQ1E;AAED,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAK3D"} \ No newline at end of file diff --git a/modules/carto/typed/layers/schema/carto-spatial-tile-loader.d.ts b/modules/carto/typed/layers/schema/carto-spatial-tile-loader.d.ts new file mode 100644 index 00000000000..69b5b806fb6 --- /dev/null +++ b/modules/carto/typed/layers/schema/carto-spatial-tile-loader.d.ts @@ -0,0 +1,4 @@ +import {LoaderWithParser} from '@loaders.gl/loader-utils'; +declare const CartoSpatialTileLoader: LoaderWithParser; +export default CartoSpatialTileLoader; +// # sourceMappingURL=carto-spatial-tile-loader.d.ts.map diff --git a/modules/carto/typed/layers/schema/carto-spatial-tile-loader.d.ts.map b/modules/carto/typed/layers/schema/carto-spatial-tile-loader.d.ts.map new file mode 100644 index 00000000000..6c57f51c973 --- /dev/null +++ b/modules/carto/typed/layers/schema/carto-spatial-tile-loader.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"carto-spatial-tile-loader.d.ts","sourceRoot":"","sources":["../../../src/layers/schema/carto-spatial-tile-loader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,gBAAgB,EAAC,MAAM,0BAA0B,CAAC;AAMzE,QAAA,MAAM,sBAAsB,EAAE,gBAgB7B,CAAC;AAmBF,eAAe,sBAAsB,CAAC"} \ No newline at end of file diff --git a/modules/carto/typed/layers/schema/carto-spatial-tile.d.ts b/modules/carto/typed/layers/schema/carto-spatial-tile.d.ts new file mode 100644 index 00000000000..59c14f0035a --- /dev/null +++ b/modules/carto/typed/layers/schema/carto-spatial-tile.d.ts @@ -0,0 +1,21 @@ +import {Indices, IndexScheme} from './spatialjson-utils'; +import {KeyValueProperties, NumericProp} from './carto-tile'; +export declare class IndicesReader { + static read(pbf: any, end?: number): Indices; + static _readField(this: void, tag: number, obj: any, pbf: any): void; +} +interface Cells { + indices: Indices; + properties: KeyValueProperties[]; + numericProps: Record; +} +export interface Tile { + scheme: IndexScheme; + cells: Cells; +} +export declare class TileReader { + static read(pbf: any, end?: number): Tile; + static _readField(this: void, tag: number, obj: Tile, pbf: any): void; +} +export {}; +// # sourceMappingURL=carto-spatial-tile.d.ts.map diff --git a/modules/carto/typed/layers/schema/carto-spatial-tile.d.ts.map b/modules/carto/typed/layers/schema/carto-spatial-tile.d.ts.map new file mode 100644 index 00000000000..54296ddaa08 --- /dev/null +++ b/modules/carto/typed/layers/schema/carto-spatial-tile.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"carto-spatial-tile.d.ts","sourceRoot":"","sources":["../../../src/layers/schema/carto-spatial-tile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAE,WAAW,EAAC,MAAM,qBAAqB,CAAC;AACzD,OAAO,EACL,kBAAkB,EAClB,WAAW,EAGZ,MAAM,cAAc,CAAC;AAItB,qBAAa,aAAa;IACxB,MAAM,CAAC,IAAI,CAAC,GAAG,KAAA,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,OAAO;IAIvC,MAAM,CAAC,UAAU,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,KAAA,EAAE,GAAG,KAAA;CAGpD;AAID,UAAU,KAAK;IACb,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,kBAAkB,EAAE,CAAC;IACjC,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;CAC3C;AAuBD,MAAM,WAAW,IAAI;IACnB,MAAM,EAAE,WAAW,CAAC;IACpB,KAAK,EAAE,KAAK,CAAC;CACd;AAED,qBAAa,UAAU;IACrB,MAAM,CAAC,IAAI,CAAC,GAAG,KAAA,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI;IAGpC,MAAM,CAAC,UAAU,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,KAAA;CAI1D"} \ No newline at end of file diff --git a/modules/carto/typed/layers/schema/carto-tile.d.ts b/modules/carto/typed/layers/schema/carto-tile.d.ts new file mode 100644 index 00000000000..e225a40209e --- /dev/null +++ b/modules/carto/typed/layers/schema/carto-tile.d.ts @@ -0,0 +1,60 @@ +interface KeyValueObject { + key: string; + value: string; +} +export interface KeyValueProperties { + data: KeyValueObject[]; +} +export declare class PropertiesReader { + static read(pbf: any, end?: number): any; + static _readField(this: void, tag: number, obj: KeyValueProperties, pbf: any): void; +} +interface Doubles { + value: Float32Array; + size: number; +} +interface Ints { + value: Uint32Array; + size: number; +} +interface Fields { + id: number; +} +export interface NumericProp { + value: number[]; +} +interface NumbericPropKeyValue { + key: string; + value: NumericProp; +} +export declare class NumericPropKeyValueReader { + static read(pbf: any, end?: number): NumbericPropKeyValue; + static _readField(this: void, tag: number, obj: NumbericPropKeyValue, pbf: any): void; +} +interface Points { + positions: Doubles; + globalFeatureIds: Ints; + featureIds: Ints; + properties: KeyValueProperties[]; + numericProps: Record; + fields: Fields[]; +} +interface Lines extends Points { + pathIndices: Ints; +} +interface Polygons extends Points { + polygonIndices: Ints; + primitivePolygonIndices: Ints; + triangles: Ints; +} +export interface Tile { + points: Points; + lines: Lines; + polygons: Polygons; +} +export declare class TileReader { + static read(pbf: any, end?: number): Tile; + static _readField(this: void, tag: number, obj: Tile, pbf: any): void; +} +export {}; +// # sourceMappingURL=carto-tile.d.ts.map diff --git a/modules/carto/typed/layers/schema/carto-tile.d.ts.map b/modules/carto/typed/layers/schema/carto-tile.d.ts.map new file mode 100644 index 00000000000..4d57556add7 --- /dev/null +++ b/modules/carto/typed/layers/schema/carto-tile.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"carto-tile.d.ts","sourceRoot":"","sources":["../../../src/layers/schema/carto-tile.ts"],"names":[],"mappings":"AACA,UAAU,cAAc;IACtB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;CACf;AAcD,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,cAAc,EAAE,CAAC;CACxB;AAED,qBAAa,gBAAgB;IAC3B,MAAM,CAAC,IAAI,CAAC,GAAG,KAAA,EAAE,GAAG,CAAC,EAAE,MAAM;IAG7B,MAAM,CAAC,UAAU,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,kBAAkB,EAAE,GAAG,KAAA;CAGxE;AAID,UAAU,OAAO;IACf,KAAK,EAAE,YAAY,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;CACd;AAiBD,UAAU,IAAI;IACZ,KAAK,EAAE,WAAW,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;CACd;AAeD,UAAU,MAAM;IACd,EAAE,EAAE,MAAM,CAAC;CACZ;AAaD,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB;AAYD,UAAU,oBAAoB;IAC5B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,WAAW,CAAC;CACpB;AAED,qBAAa,yBAAyB;IACpC,MAAM,CAAC,IAAI,CAAC,GAAG,KAAA,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,oBAAoB;IAGpD,MAAM,CAAC,UAAU,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,oBAAoB,EAAE,GAAG,KAAA;CAI1E;AAID,UAAU,MAAM;IACd,SAAS,EAAE,OAAO,CAAC;IACnB,gBAAgB,EAAE,IAAI,CAAC;IACvB,UAAU,EAAE,IAAI,CAAC;IACjB,UAAU,EAAE,kBAAkB,EAAE,CAAC;IACjC,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;IAC1C,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AA6BD,UAAU,KAAM,SAAQ,MAAM;IAC5B,WAAW,EAAE,IAAI,CAAC;CACnB;AAiCD,UAAU,QAAS,SAAQ,MAAM;IAC/B,cAAc,EAAE,IAAI,CAAC;IACrB,uBAAuB,EAAE,IAAI,CAAC;IAC9B,SAAS,EAAE,IAAI,CAAC;CACjB;AAsCD,MAAM,WAAW,IAAI;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,KAAK,CAAC;IACb,QAAQ,EAAE,QAAQ,CAAC;CACpB;AAED,qBAAa,UAAU;IACrB,MAAM,CAAC,IAAI,CAAC,GAAG,KAAA,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI;IAGpC,MAAM,CAAC,UAAU,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,KAAA;CAK1D"} \ No newline at end of file diff --git a/modules/carto/typed/layers/schema/carto-vector-tile-loader.d.ts b/modules/carto/typed/layers/schema/carto-vector-tile-loader.d.ts new file mode 100644 index 00000000000..ca1ff48f765 --- /dev/null +++ b/modules/carto/typed/layers/schema/carto-vector-tile-loader.d.ts @@ -0,0 +1,4 @@ +import {LoaderWithParser} from '@loaders.gl/loader-utils'; +declare const CartoVectorTileLoader: LoaderWithParser; +export default CartoVectorTileLoader; +// # sourceMappingURL=carto-vector-tile-loader.d.ts.map diff --git a/modules/carto/typed/layers/schema/carto-vector-tile-loader.d.ts.map b/modules/carto/typed/layers/schema/carto-vector-tile-loader.d.ts.map new file mode 100644 index 00000000000..ac0c50c3f92 --- /dev/null +++ b/modules/carto/typed/layers/schema/carto-vector-tile-loader.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"carto-vector-tile-loader.d.ts","sourceRoot":"","sources":["../../../src/layers/schema/carto-vector-tile-loader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,gBAAgB,EAAC,MAAM,0BAA0B,CAAC;AAMzE,QAAA,MAAM,qBAAqB,EAAE,gBAY5B,CAAC;AAoBF,eAAe,qBAAqB,CAAC"} \ No newline at end of file diff --git a/modules/carto/typed/layers/schema/spatialjson-utils.d.ts b/modules/carto/typed/layers/schema/spatialjson-utils.d.ts new file mode 100644 index 00000000000..a6b015cefbf --- /dev/null +++ b/modules/carto/typed/layers/schema/spatialjson-utils.d.ts @@ -0,0 +1,28 @@ +export declare type IndexScheme = 'h3' | 'quadbin'; +declare type TypedArray = Float32Array | Float64Array; +export declare type Indices = { + value: BigUint64Array; +}; +export declare type NumericProps = Record< + string, + { + value: number[] | TypedArray; + } +>; +export declare type Properties = Record; +export declare type Cells = { + indices: Indices; + numericProps: NumericProps; + properties: Properties[]; +}; +export declare type SpatialBinary = { + scheme?: IndexScheme; + cells: Cells; +}; +export declare type SpatialJson = { + id: string | bigint; + properties: Properties; +}[]; +export declare function binaryToSpatialjson(binary: SpatialBinary): SpatialJson; +export {}; +// # sourceMappingURL=spatialjson-utils.d.ts.map diff --git a/modules/carto/typed/layers/schema/spatialjson-utils.d.ts.map b/modules/carto/typed/layers/schema/spatialjson-utils.d.ts.map new file mode 100644 index 00000000000..2449533e510 --- /dev/null +++ b/modules/carto/typed/layers/schema/spatialjson-utils.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"spatialjson-utils.d.ts","sourceRoot":"","sources":["../../../src/layers/schema/spatialjson-utils.ts"],"names":[],"mappings":"AAEA,oBAAY,WAAW,GAAG,IAAI,GAAG,SAAS,CAAC;AAC3C,aAAK,UAAU,GAAG,YAAY,GAAG,YAAY,CAAC;AAE9C,oBAAY,OAAO,GAAG;IAAC,KAAK,EAAE,cAAc,CAAA;CAAC,CAAC;AAC9C,oBAAY,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE;IAAC,KAAK,EAAE,MAAM,EAAE,GAAG,UAAU,CAAA;CAAC,CAAC,CAAC;AAC1E,oBAAY,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC,CAAC;AAC1E,oBAAY,KAAK,GAAG;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,YAAY,EAAE,YAAY,CAAC;IAC3B,UAAU,EAAE,UAAU,EAAE,CAAC;CAC1B,CAAC;AACF,oBAAY,aAAa,GAAG;IAAC,MAAM,CAAC,EAAE,WAAW,CAAC;IAAC,KAAK,EAAE,KAAK,CAAA;CAAC,CAAC;AACjE,oBAAY,WAAW,GAAG;IACxB,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;IACpB,UAAU,EAAE,UAAU,CAAC;CACxB,EAAE,CAAC;AAEJ,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,aAAa,GAAG,WAAW,CAetE"} \ No newline at end of file diff --git a/modules/carto/typed/layers/schema/tile-loader-utils.d.ts b/modules/carto/typed/layers/schema/tile-loader-utils.d.ts new file mode 100644 index 00000000000..63782cb44b1 --- /dev/null +++ b/modules/carto/typed/layers/schema/tile-loader-utils.d.ts @@ -0,0 +1,5 @@ +import {KeyValueProperties} from './carto-tile'; +import {Properties} from './spatialjson-utils'; +export declare function parsePbf(buffer: ArrayBuffer, TileReader: any): any; +export declare function unpackProperties(properties: KeyValueProperties[]): Properties[]; +// # sourceMappingURL=tile-loader-utils.d.ts.map diff --git a/modules/carto/typed/layers/schema/tile-loader-utils.d.ts.map b/modules/carto/typed/layers/schema/tile-loader-utils.d.ts.map new file mode 100644 index 00000000000..4cdeb106a29 --- /dev/null +++ b/modules/carto/typed/layers/schema/tile-loader-utils.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"tile-loader-utils.d.ts","sourceRoot":"","sources":["../../../src/layers/schema/tile-loader-utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,kBAAkB,EAAC,MAAM,cAAc,CAAC;AAChD,OAAO,EAAC,UAAU,EAAC,MAAM,qBAAqB,CAAC;AAE/C,wBAAgB,QAAQ,CAAC,MAAM,EAAE,WAAW,EAAE,UAAU,KAAA,OAIvD;AAED,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,kBAAkB,EAAE,GAAG,UAAU,EAAE,CAW/E"} \ No newline at end of file diff --git a/modules/carto/typed/layers/spatial-index-tile-layer.d.ts b/modules/carto/typed/layers/spatial-index-tile-layer.d.ts new file mode 100644 index 00000000000..4c1aa352860 --- /dev/null +++ b/modules/carto/typed/layers/spatial-index-tile-layer.d.ts @@ -0,0 +1,31 @@ +import {DefaultProps, UpdateParameters} from '@deck.gl/core'; +import {PickingInfo} from '@deck.gl/core'; +import { + TileLayer, + _Tile2DHeader as Tile2DHeader, + _TileLoadProps as TileLoadProps +} from '@deck.gl/geo-layers'; +/** All properties supported by SpatialIndexTileLayer. */ +export declare type SpatialIndexTileLayerProps = _SpatialIndexTileLayerProps & + TileLayer; +/** Properties added by SpatialIndexTileLayer. */ +declare type _SpatialIndexTileLayerProps = { + aggregationResLevel?: number; +}; +export default class SpatialIndexTileLayer extends TileLayer< + DataT, + ExtraProps & Required<_SpatialIndexTileLayerProps> +> { + static layerName: string; + static defaultProps: DefaultProps>; + getTileData(tile: TileLoadProps): any; + updateState(params: UpdateParameters): void; + protected _updateAutoHighlight(info: PickingInfo): void; + getSubLayerPropsByTile(tile: Tile2DHeader): { + highlightedObjectIndex: number; + highlightColor: any; + }; + getHighlightedObjectIndex(tile: Tile2DHeader): number; +} +export {}; +// # sourceMappingURL=spatial-index-tile-layer.d.ts.map diff --git a/modules/carto/typed/layers/spatial-index-tile-layer.d.ts.map b/modules/carto/typed/layers/spatial-index-tile-layer.d.ts.map new file mode 100644 index 00000000000..e85146b13a4 --- /dev/null +++ b/modules/carto/typed/layers/spatial-index-tile-layer.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"spatial-index-tile-layer.d.ts","sourceRoot":"","sources":["../../src/layers/spatial-index-tile-layer.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,YAAY,EAAE,gBAAgB,EAAC,MAAM,eAAe,CAAC;AAI7D,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAC;AAC1C,OAAO,EACL,SAAS,EAET,aAAa,IAAI,YAAY,EAC7B,cAAc,IAAI,aAAa,EAChC,MAAM,qBAAqB,CAAC;AAW7B,yDAAyD;AACzD,oBAAY,0BAA0B,CAAC,KAAK,GAAG,GAAG,IAAI,2BAA2B,CAAC,KAAK,CAAC,GACtF,SAAS,CAAC,KAAK,CAAC,CAAC;AAEnB,iDAAiD;AACjD,aAAK,2BAA2B,CAAC,KAAK,GAAG,GAAG,IAAI;IAC9C,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B,CAAC;AAEF,MAAM,CAAC,OAAO,OAAO,qBAAqB,CAAC,KAAK,GAAG,GAAG,EAAE,UAAU,GAAG,EAAE,CAAE,SAAQ,SAAS,CACxF,KAAK,EACL,UAAU,GAAG,QAAQ,CAAC,2BAA2B,CAAC,KAAK,CAAC,CAAC,CAC1D;IACC,MAAM,CAAC,SAAS,SAA2B;IAC3C,MAAM,CAAC,YAAY,gDAAgB;IAEnC,WAAW,CAAC,IAAI,EAAE,aAAa;IA8B/B,WAAW,CAAC,MAAM,EAAE,gBAAgB,CAAC,IAAI,CAAC;IAS1C,SAAS,CAAC,oBAAoB,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI;IAsBvD,sBAAsB,CAAC,IAAI,EAAE,YAAY;;;;IAOzC,yBAAyB,CAAC,IAAI,EAAE,YAAY;CAW7C"} \ No newline at end of file diff --git a/modules/carto/typed/style/color-bins-style.d.ts b/modules/carto/typed/style/color-bins-style.d.ts new file mode 100644 index 00000000000..d648d79ee66 --- /dev/null +++ b/modules/carto/typed/style/color-bins-style.d.ts @@ -0,0 +1,33 @@ +import {AccessorFunction} from '@deck.gl/core'; +import {Feature} from 'geojson'; +import {Color} from './palette'; +import {AttributeSelector} from './utils'; +/** + * Helper function for quickly creating a color bins style based on `d3` `scaleThreshold`. + * + * Data values of each attribute are rounded down to the nearest value in the domain and are then + * styled with the corresponding color. + * + * @return accessor that maps objects to `Color` values + */ +export default function colorBins({ + attr, + domain, + colors, + nullColor +}: { + /** Attribute or column to symbolize by. */ + attr: AttributeSelector; + /** Category list. Must be a valid list of categories. */ + domain: number[]; + /** + * Color assigned to each domain value. + * + * Either Array of colors in RGBA or valid named CARTOColors palette. + * @default `PurpOr` + */ + colors?: string | Color[]; + /** Color for null values. @default: [204, 204, 204] */ + nullColor?: Color; +}): AccessorFunction; +// # sourceMappingURL=color-bins-style.d.ts.map diff --git a/modules/carto/typed/style/color-bins-style.d.ts.map b/modules/carto/typed/style/color-bins-style.d.ts.map new file mode 100644 index 00000000000..e1d7e14534f --- /dev/null +++ b/modules/carto/typed/style/color-bins-style.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"color-bins-style.d.ts","sourceRoot":"","sources":["../../src/style/color-bins-style.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,gBAAgB,EAAC,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAC,OAAO,EAAC,MAAM,SAAS,CAAC;AAChC,OAAmB,EAAC,KAAK,EAA8B,MAAM,WAAW,CAAC;AACzE,OAAO,EAAS,iBAAiB,EAAe,MAAM,SAAS,CAAC;AAEhE;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,KAAK,GAAG,OAAO,EAAE,EACjD,IAAI,EACJ,MAAM,EACN,MAAwB,EACxB,SAAsB,EACvB,EAAE;IACD,2CAA2C;IAC3C,IAAI,EAAE,iBAAiB,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IAEvC,yDAAyD;IACzD,MAAM,EAAE,MAAM,EAAE,CAAC;IAEjB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,KAAK,EAAE,CAAC;IAE1B,uDAAuD;IACvD,SAAS,CAAC,EAAE,KAAK,CAAC;CACnB,GAAG,gBAAgB,CAAC,KAAK,EAAE,KAAK,CAAC,CAWjC"} \ No newline at end of file diff --git a/modules/carto/typed/style/color-categories-style.d.ts b/modules/carto/typed/style/color-categories-style.d.ts new file mode 100644 index 00000000000..a9f16f965ba --- /dev/null +++ b/modules/carto/typed/style/color-categories-style.d.ts @@ -0,0 +1,36 @@ +import {AccessorFunction} from '@deck.gl/core'; +import {Feature} from 'geojson'; +import {Color} from './palette'; +import {AttributeSelector} from './utils'; +/** + * Helper function for quickly creating a color category style. + * + * Data values of each attribute listed in the domain are mapped one to one + * with corresponding colors in the range. + * + * @return accessor that maps objects to `Color` values + */ +export default function colorCategories({ + attr, + domain, + colors, + nullColor, + othersColor +}: { + /** Attribute or column to symbolize by */ + attr: string | AttributeSelector; + /** Category list. Must be a valid list of categories. */ + domain: number[] | string[]; + /** + * Color assigned to each domain value. + * + * Either Array of colors in RGBA or valid named CARTOColors palette. + * @default `PurpOr` + */ + colors: string | Color[]; + /** Color for null values. @default: [204, 204, 204] */ + nullColor?: Color; + /** Fallback color for a category not correctly assigned. @default: [119, 119, 119] */ + othersColor?: Color; +}): AccessorFunction; +// # sourceMappingURL=color-categories-style.d.ts.map diff --git a/modules/carto/typed/style/color-categories-style.d.ts.map b/modules/carto/typed/style/color-categories-style.d.ts.map new file mode 100644 index 00000000000..75a80ecd835 --- /dev/null +++ b/modules/carto/typed/style/color-categories-style.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"color-categories-style.d.ts","sourceRoot":"","sources":["../../src/style/color-categories-style.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,gBAAgB,EAAC,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAC,OAAO,EAAC,MAAM,SAAS,CAAC;AAChC,OAAmB,EAAC,KAAK,EAA4C,MAAM,WAAW,CAAC;AACvF,OAAO,EAAS,iBAAiB,EAAe,MAAM,SAAS,CAAC;AAEhE;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,KAAK,GAAG,OAAO,EAAE,EACvD,IAAI,EACJ,MAAM,EACN,MAAwB,EACxB,SAAsB,EACtB,WAA0B,EAC3B,EAAE;IACD,0CAA0C;IAC1C,IAAI,EAAE,MAAM,GAAG,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC;IAEzD,yDAAyD;IACzD,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC;IAE5B;;;;;OAKG;IACH,MAAM,EAAE,MAAM,GAAG,KAAK,EAAE,CAAC;IAEzB,uDAAuD;IACvD,SAAS,CAAC,EAAE,KAAK,CAAC;IAElB,sFAAsF;IACtF,WAAW,CAAC,EAAE,KAAK,CAAC;CACrB,GAAG,gBAAgB,CAAC,KAAK,EAAE,KAAK,CAAC,CAgBjC"} \ No newline at end of file diff --git a/modules/carto/typed/style/color-continuous-style.d.ts b/modules/carto/typed/style/color-continuous-style.d.ts new file mode 100644 index 00000000000..4583f4071f9 --- /dev/null +++ b/modules/carto/typed/style/color-continuous-style.d.ts @@ -0,0 +1,33 @@ +import {AccessorFunction} from '@deck.gl/core'; +import {Feature} from 'geojson'; +import {Color} from './palette'; +import {AttributeSelector} from './utils'; +/** + * Helper function for quickly creating a color continuous style. + * + * Data values of each field are interpolated linearly across values in the domain and + * are then styled with a blend of the corresponding color in the range. + * + * @return accessor that maps objects to `Color` values + */ +export default function colorContinuous({ + attr, + domain, + colors, + nullColor +}: { + /** Attribute or column to symbolize by. */ + attr: AttributeSelector; + /** Attribute domain to define the data range. */ + domain: number[]; + /** + * Color assigned to each domain value. + * + * Either Array of colors in RGBA or valid named CARTOColors palette. + * @default `PurpOr` + */ + colors?: string | Color[]; + /** Color for null values. @default: [204, 204, 204]*/ + nullColor?: Color; +}): AccessorFunction; +// # sourceMappingURL=color-continuous-style.d.ts.map diff --git a/modules/carto/typed/style/color-continuous-style.d.ts.map b/modules/carto/typed/style/color-continuous-style.d.ts.map new file mode 100644 index 00000000000..7872193fd4b --- /dev/null +++ b/modules/carto/typed/style/color-continuous-style.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"color-continuous-style.d.ts","sourceRoot":"","sources":["../../src/style/color-continuous-style.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,gBAAgB,EAAC,MAAM,eAAe,CAAC;AAE/C,OAAO,EAAC,OAAO,EAAC,MAAM,SAAS,CAAC;AAChC,OAAmB,EAAC,KAAK,EAA8B,MAAM,WAAW,CAAC;AACzE,OAAO,EAAS,iBAAiB,EAAe,MAAM,SAAS,CAAC;AAEhE;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,KAAK,GAAG,OAAO,EAAE,EACvD,IAAI,EACJ,MAAM,EACN,MAAwB,EACxB,SAAsB,EACvB,EAAE;IACD,2CAA2C;IAC3C,IAAI,EAAE,iBAAiB,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IAEvC,iDAAiD;IACjD,MAAM,EAAE,MAAM,EAAE,CAAC;IAEjB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,KAAK,EAAE,CAAC;IAE1B,sDAAsD;IACtD,SAAS,CAAC,EAAE,KAAK,CAAC;CACnB,GAAG,gBAAgB,CAAC,KAAK,EAAE,KAAK,CAAC,CAUjC"} \ No newline at end of file diff --git a/modules/carto/typed/style/palette.d.ts b/modules/carto/typed/style/palette.d.ts new file mode 100644 index 00000000000..c96f7c24a67 --- /dev/null +++ b/modules/carto/typed/style/palette.d.ts @@ -0,0 +1,7 @@ +export declare type Color = [r: number, b: number, g: number, a?: number]; +export declare const DEFAULT_PALETTE = 'PurpOr'; +export declare const NULL_COLOR: Color; +export declare const OTHERS_COLOR: Color; +export default function getPalette(name: string, numCategories: number): Color[]; +export declare function hexToRgb(hex: string): Color; +// # sourceMappingURL=palette.d.ts.map diff --git a/modules/carto/typed/style/palette.d.ts.map b/modules/carto/typed/style/palette.d.ts.map new file mode 100644 index 00000000000..b42a4ec17b7 --- /dev/null +++ b/modules/carto/typed/style/palette.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"palette.d.ts","sourceRoot":"","sources":["../../src/style/palette.ts"],"names":[],"mappings":"AAGA,oBAAY,KAAK,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;AAElE,eAAO,MAAM,eAAe,WAAW,CAAC;AACxC,eAAO,MAAM,UAAU,EAAE,KAAuB,CAAC;AACjD,eAAO,MAAM,YAAY,EAAE,KAAuB,CAAC;AAOnD,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,GAAG,KAAK,EAAE,CA0B/E;AAED,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,KAAK,CA2C3C"} \ No newline at end of file diff --git a/modules/carto/typed/style/utils.d.ts b/modules/carto/typed/style/utils.d.ts new file mode 100644 index 00000000000..aa392c88ccd --- /dev/null +++ b/modules/carto/typed/style/utils.d.ts @@ -0,0 +1,8 @@ +import {Feature} from 'geojson'; +export declare type AttributeSelector = string | ((d: DataT) => OutT); +export declare function getAttrValue( + attr: string | AttributeSelector, + d: DataT +): OutT; +export declare function assert(condition: any, message?: string): asserts condition; +// # sourceMappingURL=utils.d.ts.map diff --git a/modules/carto/typed/style/utils.d.ts.map b/modules/carto/typed/style/utils.d.ts.map new file mode 100644 index 00000000000..27b99cf1a99 --- /dev/null +++ b/modules/carto/typed/style/utils.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/style/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAC,MAAM,SAAS,CAAC;AAIhC,oBAAY,iBAAiB,CAAC,KAAK,GAAG,OAAO,EAAE,IAAI,GAAG,GAAG,IAAI,MAAM,GAAG,CAAC,CAAC,CAAC,EAAE,KAAK,KAAK,IAAI,CAAC,CAAC;AAE3F,wBAAgB,YAAY,CAAC,KAAK,GAAG,OAAO,EAAE,IAAI,GAAG,GAAG,EACtD,IAAI,EAAE,MAAM,GAAG,iBAAiB,CAAC,KAAK,EAAE,IAAI,CAAC,EAC7C,CAAC,EAAE,KAAK,GACP,IAAI,CASN;AAED,wBAAgB,MAAM,CAAC,SAAS,KAAA,EAAE,OAAO,SAAK,GAAG,OAAO,CAAC,SAAS,CAIjE"} \ No newline at end of file diff --git a/modules/carto/typed/utils.d.ts b/modules/carto/typed/utils.d.ts new file mode 100644 index 00000000000..77829ef5f74 --- /dev/null +++ b/modules/carto/typed/utils.d.ts @@ -0,0 +1,2 @@ +export declare function assert(condition: unknown, message?: string): asserts condition; +// # sourceMappingURL=utils.d.ts.map diff --git a/modules/carto/typed/utils.d.ts.map b/modules/carto/typed/utils.d.ts.map new file mode 100644 index 00000000000..dcd0375bc1b --- /dev/null +++ b/modules/carto/typed/utils.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAEA,wBAAgB,MAAM,CAAC,SAAS,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAE9E"} \ No newline at end of file diff --git a/modules/core/src/lib/deck.ts b/modules/core/src/lib/deck.ts index 43d78fd90b1..9cf3c8e2511 100644 --- a/modules/core/src/lib/deck.ts +++ b/modules/core/src/lib/deck.ts @@ -42,7 +42,7 @@ import type {PickByPointOptions, PickByRectOptions} from './deck-picker'; import type {LayersList} from './layer-manager'; import type {TooltipContent} from './tooltip'; import type {ViewStateMap, AnyViewStateOf, ViewOrViews, ViewStateObject} from './view-manager'; -import {CreateDeviceProps} from '@luma.gl/core/dist/lib/luma'; +import {CreateDeviceProps} from '@luma.gl/core'; /* global document */ @@ -107,18 +107,20 @@ export type DeckProps = { * @default `document.body` */ parent?: HTMLDivElement | null; + /** The canvas to render into. * Can be either a HTMLCanvasElement or the element id. * Will be auto-created if not supplied. */ canvas?: HTMLCanvasElement | string | null; - /** luma.gl GPU device. A device will be auto-created if not supplied. */ + /** Use an existing luma.gl GPU device. @note If not supplied, a new device will be created using props.deviceProps */ device?: Device | null; - /** A device will be auto-created if not supplied using these props. */ + + /** A new device will be created using these props, assuming that an existing device is not supplied using props.device) */ deviceProps?: CreateDeviceProps; - /** WebGL context @deprecated Use props.device */ + /** WebGL context @deprecated Use props.deviceProps.webgl. Also note that preserveDrawingBuffers is true by default */ gl?: WebGL2RenderingContext | null; /** diff --git a/modules/core/typed/controllers/controller.d.ts b/modules/core/typed/controllers/controller.d.ts new file mode 100644 index 00000000000..5c6ad184ce6 --- /dev/null +++ b/modules/core/typed/controllers/controller.d.ts @@ -0,0 +1,175 @@ +import TransitionManager, {TransitionProps} from './transition-manager'; +import {IViewState} from './view-state'; +import {ConstructorOf} from '../types/types'; +import type Viewport from '../viewports/viewport'; +import type { + EventManager, + MjolnirEvent, + MjolnirGestureEvent, + MjolnirWheelEvent, + MjolnirKeyEvent +} from 'mjolnir.js'; +import type {Timeline} from '@luma.gl/engine'; +/** Configuration of how user input is handled */ +export declare type ControllerOptions = { + /** Enable zooming with mouse wheel. Default `true`. */ + scrollZoom?: + | boolean + | { + /** Scaler that translates wheel delta to the change of viewport scale. Default `0.01`. */ + speed?: number; + /** Smoothly transition to the new zoom. If enabled, will provide a slightly lagged but smoother experience. Default `false`. */ + smooth?: boolean; + }; + /** Enable panning with pointer drag. Default `true` */ + dragPan?: boolean; + /** Enable rotating with pointer drag. Default `true` */ + dragRotate?: boolean; + /** Enable zooming with double click. Default `true` */ + doubleClickZoom?: boolean; + /** Enable zooming with multi-touch. Default `true` */ + touchZoom?: boolean; + /** Enable rotating with multi-touch. Use two-finger rotating gesture for horizontal and three-finger swiping gesture for vertical rotation. Default `false` */ + touchRotate?: boolean; + /** Enable interaction with keyboard. Default `true`. */ + keyboard?: + | boolean + | { + /** Speed of zoom using +/- keys. Default `2` */ + zoomSpeed?: number; + /** Speed of movement using arrow keys, in pixels. */ + moveSpeed?: number; + /** Speed of rotation using shift + left/right arrow keys, in degrees. Default 15. */ + rotateSpeedX?: number; + /** Speed of rotation using shift + up/down arrow keys, in degrees. Default 10. */ + rotateSpeedY?: number; + }; + /** Drag behavior without pressing function keys, one of `pan` and `rotate`. */ + dragMode?: 'pan' | 'rotate'; + /** Enable inertia after panning/pinching. If a number is provided, indicates the duration of time over which the velocity reduces to zero, in milliseconds. Default `false`. */ + inertia?: boolean | number; +}; +export declare type ControllerProps = { + /** Identifier of the controller */ + id: string; + /** Viewport x position */ + x: number; + /** Viewport y position */ + y: number; + /** Viewport width */ + width: number; + /** Viewport height */ + height: number; +} & ControllerOptions & + TransitionProps; +/** The state of a controller */ +export declare type InteractionState = { + /** If the view state is in transition */ + inTransition?: boolean; + /** If the user is dragging */ + isDragging?: boolean; + /** If the view is being panned, either from user input or transition */ + isPanning?: boolean; + /** If the view is being rotated, either from user input or transition */ + isRotating?: boolean; + /** If the view is being zoomed, either from user input or transition */ + isZooming?: boolean; +}; +/** Parameters passed to the onViewStateChange callback */ +export declare type ViewStateChangeParameters = { + /** The next view state, either from user input or transition */ + viewState: Record; + /** Object describing the nature of the view state change */ + interactionState: InteractionState; + /** The current view state */ + oldViewState?: Record; +}; +export default abstract class Controller> { + abstract get ControllerState(): ConstructorOf; + abstract get transition(): TransitionProps; + protected props: ControllerProps; + protected state: Record; + protected transitionManager: TransitionManager; + protected eventManager: EventManager; + protected onViewStateChange: (params: ViewStateChangeParameters) => void; + protected onStateChange: (state: InteractionState) => void; + protected makeViewport: (opts: Record) => Viewport; + private _controllerState?; + private _events; + private _interactionState; + private _customEvents; + private _eventStartBlocked; + private _panMove; + protected invertPan: boolean; + protected dragMode: 'pan' | 'rotate'; + protected inertia: number; + protected scrollZoom: + | boolean + | { + speed?: number; + smooth?: boolean; + }; + protected dragPan: boolean; + protected dragRotate: boolean; + protected doubleClickZoom: boolean; + protected touchZoom: boolean; + protected touchRotate: boolean; + protected keyboard: + | boolean + | { + zoomSpeed?: number; + moveSpeed?: number; + rotateSpeedX?: number; + rotateSpeedY?: number; + }; + constructor(opts: { + timeline: Timeline; + eventManager: EventManager; + makeViewport: (opts: Record) => Viewport; + onViewStateChange: (params: ViewStateChangeParameters) => void; + onStateChange: (state: InteractionState) => void; + }); + set events(customEvents: any); + finalize(): void; + /** + * Callback for events + */ + handleEvent(event: MjolnirEvent): boolean; + get controllerState(): ControllerState; + getCenter(event: MjolnirGestureEvent | MjolnirWheelEvent): [number, number]; + isPointInBounds(pos: [number, number], event: MjolnirEvent): boolean; + isFunctionKeyPressed(event: MjolnirEvent): boolean; + isDragging(): boolean; + blockEvents(timeout: number): void; + /** + * Extract interactivity options + */ + setProps(props: ControllerProps): void; + updateTransition(): void; + toggleEvents(eventNames: any, enabled: any): void; + protected updateViewport( + newControllerState: ControllerState, + extraProps?: Record | null, + interactionState?: InteractionState + ): void; + private _onTransition; + private _setInteractionState; + protected _onPanStart(event: MjolnirGestureEvent): boolean; + protected _onPan(event: MjolnirGestureEvent): boolean; + protected _onPanEnd(event: MjolnirGestureEvent): boolean; + protected _onPanMove(event: MjolnirGestureEvent): boolean; + protected _onPanMoveEnd(event: MjolnirGestureEvent): boolean; + protected _onPanRotate(event: MjolnirGestureEvent): boolean; + protected _onPanRotateEnd(event: any): boolean; + protected _onWheel(event: MjolnirWheelEvent): boolean; + protected _onTriplePanStart(event: MjolnirGestureEvent): boolean; + protected _onTriplePan(event: MjolnirGestureEvent): boolean; + protected _onTriplePanEnd(event: MjolnirGestureEvent): boolean; + protected _onPinchStart(event: MjolnirGestureEvent): boolean; + protected _onPinch(event: MjolnirGestureEvent): boolean; + protected _onPinchEnd(event: MjolnirGestureEvent): boolean; + protected _onDoubleTap(event: MjolnirGestureEvent): boolean; + protected _onKeyDown(event: MjolnirKeyEvent): boolean; + protected _getTransitionProps(opts?: any): TransitionProps; +} +// # sourceMappingURL=controller.d.ts.map diff --git a/modules/core/typed/controllers/controller.d.ts.map b/modules/core/typed/controllers/controller.d.ts.map new file mode 100644 index 00000000000..d2d39b18214 --- /dev/null +++ b/modules/core/typed/controllers/controller.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"controller.d.ts","sourceRoot":"","sources":["../../src/controllers/controller.ts"],"names":[],"mappings":"AAqBA,OAAO,iBAAiB,EAAE,EAAC,eAAe,EAAC,MAAM,sBAAsB,CAAC;AAExE,OAAO,EAAC,UAAU,EAAC,MAAM,cAAc,CAAC;AACxC,OAAO,EAAC,aAAa,EAAC,MAAM,gBAAgB,CAAC;AAE7C,OAAO,KAAK,QAAQ,MAAM,uBAAuB,CAAC;AAElD,OAAO,KAAK,EAAC,YAAY,EAAE,YAAY,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,eAAe,EAAC,MAAM,YAAY,CAAC;AACpH,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,iBAAiB,CAAC;AAkB9C,iDAAiD;AACjD,oBAAY,iBAAiB,GAAG;IAC9B,uDAAuD;IACvD,UAAU,CAAC,EAAE,OAAO,GAAG;QACrB,0FAA0F;QAC1F,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,gIAAgI;QAChI,MAAM,CAAC,EAAE,OAAO,CAAA;KACjB,CAAC;IACF,uDAAuD;IACvD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,wDAAwD;IACxD,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,uDAAuD;IACvD,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,sDAAsD;IACtD,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,+JAA+J;IAC/J,WAAW,CAAC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AAE,eAAe,GAAG,OAAO;IAmErD,SAAS,CAAC,mBAAmB,CAAC,IAAI,CAAC,EAAE,GAAG,GAAG,eAAe;CAmB3D"} \ No newline at end of file diff --git a/modules/core/typed/controllers/first-person-controller.d.ts b/modules/core/typed/controllers/first-person-controller.d.ts new file mode 100644 index 00000000000..ec9a61df476 --- /dev/null +++ b/modules/core/typed/controllers/first-person-controller.d.ts @@ -0,0 +1,119 @@ +import Controller from './controller'; +import ViewState from './view-state'; +import LinearInterpolator from '../transitions/linear-interpolator'; +import {Vector3} from '@math.gl/core'; +declare type FirstPersonStateProps = { + width: number; + height: number; + position?: number[]; + bearing?: number; + pitch?: number; + longitude?: number | null; + latitude?: number | null; + maxPitch?: number; + minPitch?: number; +}; +declare type FirstPersonStateInternal = { + startRotatePos?: [number, number]; + startBearing?: number; + startPitch?: number; + startZoomPosition?: number[]; +}; +declare class FirstPersonState extends ViewState< + FirstPersonState, + FirstPersonStateProps, + FirstPersonStateInternal +> { + constructor(options: FirstPersonStateProps & FirstPersonStateInternal); + /** + * Start panning + * @param {[Number, Number]} pos - position on screen where the pointer grabs + */ + panStart(): FirstPersonState; + /** + * Pan + * @param {[Number, Number]} pos - position on screen where the pointer is + */ + pan(): FirstPersonState; + /** + * End panning + * Must call if `panStart()` was called + */ + panEnd(): FirstPersonState; + /** + * Start rotating + * @param {[Number, Number]} pos - position on screen where the pointer grabs + */ + rotateStart({pos}: {pos: [number, number]}): FirstPersonState; + /** + * Rotate + * @param {[Number, Number]} pos - position on screen where the pointer is + */ + rotate({ + pos, + deltaAngleX, + deltaAngleY + }: { + pos?: [number, number]; + deltaAngleX?: number; + deltaAngleY: number; + }): FirstPersonState; + /** + * End rotating + * Must call if `rotateStart()` was called + */ + rotateEnd(): FirstPersonState; + /** + * Start zooming + * @param {[Number, Number]} pos - position on screen where the pointer grabs + */ + zoomStart(): FirstPersonState; + /** + * Zoom + * @param {[Number, Number]} pos - position on screen where the current center is + * @param {[Number, Number]} startPos - the center position at + * the start of the operation. Must be supplied of `zoomStart()` was not called + * @param {Number} scale - a number between [0, 1] specifying the accumulated + * relative scale. + */ + zoom({scale}: {scale: number}): FirstPersonState; + /** + * End zooming + * Must call if `zoomStart()` was called + */ + zoomEnd(): FirstPersonState; + moveLeft(speed?: number): FirstPersonState; + moveRight(speed?: number): FirstPersonState; + moveUp(speed?: number): FirstPersonState; + moveDown(speed?: number): FirstPersonState; + rotateLeft(speed?: number): FirstPersonState; + rotateRight(speed?: number): FirstPersonState; + rotateUp(speed?: number): FirstPersonState; + rotateDown(speed?: number): FirstPersonState; + zoomIn(speed?: number): FirstPersonState; + zoomOut(speed?: number): FirstPersonState; + shortestPathFrom(viewState: FirstPersonState): { + width: number; + height: number; + position: number[]; + bearing: number; + pitch: number; + longitude: number; + latitude: number; + maxPitch: number; + minPitch: number; + }; + _move(direction: Vector3, speed: number, fromPosition?: number[]): FirstPersonState; + getDirection(use2D?: boolean): Vector3; + _getUpdatedState(newProps: Record): FirstPersonState; + applyConstraints(props: Required): Required; +} +export default class FirstPersonController extends Controller { + ControllerState: typeof FirstPersonState; + transition: { + transitionDuration: number; + transitionInterpolator: LinearInterpolator; + }; +} +export {}; +// # sourceMappingURL=first-person-controller.d.ts.map diff --git a/modules/core/typed/controllers/first-person-controller.d.ts.map b/modules/core/typed/controllers/first-person-controller.d.ts.map new file mode 100644 index 00000000000..d69d0f296e9 --- /dev/null +++ b/modules/core/typed/controllers/first-person-controller.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"first-person-controller.d.ts","sourceRoot":"","sources":["../../src/controllers/first-person-controller.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,cAAc,CAAC;AACtC,OAAO,SAAS,MAAM,cAAc,CAAC;AAErC,OAAO,kBAAkB,MAAM,oCAAoC,CAAC;AAEpE,OAAO,EAAC,OAAO,EAAuD,MAAM,eAAe,CAAC;AAI5F,aAAK,qBAAqB,GAAG;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EA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llers/globe-controller.d.ts new file mode 100644 index 00000000000..70df09861ad --- /dev/null +++ b/modules/core/typed/controllers/globe-controller.d.ts @@ -0,0 +1,17 @@ +import Controller, {ControllerProps} from './controller'; +import {MapState, MapStateProps} from './map-controller'; +import LinearInterpolator from '../transitions/linear-interpolator'; +declare class GlobeState extends MapState { + applyConstraints(props: Required): Required; +} +export default class GlobeController extends Controller { + ControllerState: typeof GlobeState; + transition: { + transitionDuration: number; + transitionInterpolator: LinearInterpolator; + }; + dragMode: 'pan' | 'rotate'; + setProps(props: ControllerProps): void; +} +export {}; +// # sourceMappingURL=globe-controller.d.ts.map diff --git a/modules/core/typed/controllers/globe-controller.d.ts.map b/modules/core/typed/controllers/globe-controller.d.ts.map new file mode 100644 index 00000000000..f49ebefe41f --- /dev/null +++ b/modules/core/typed/controllers/globe-controller.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"globe-controller.d.ts","sourceRoot":"","sources":["../../src/controllers/globe-controller.ts"],"names":[],"mappings":"AACA,OAAO,UAAU,EAAE,EAAC,eAAe,EAAC,MAAM,cAAc,CAAC;AAEzD,OAAO,EAAC,QAAQ,EAAE,aAAa,EAAC,MAAM,kBAAkB,CAAC;AAEzD,OAAO,kBAAkB,MAAM,oCAAoC,CAAC;AAEpE,cAAM,UAAW,SAAQ,QAAQ;IAE/B,gBAAgB,CAAC,KAAK,EAAE,QAAQ,CAAC,aAAa,CAAC,GAAG,QAAQ,CAAC,aAAa,CAAC;CAa1E;AAED,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,UAAU,CAAC,QAAQ,CAAC;IAC/D,eAAe,oBAAc;IAE7B,UAAU;;;MAGR;IAEF,QAAQ,EAAE,KAAK,GAAG,QAAQ,CAAS;IAEnC,QAAQ,CAAC,KAAK,EAAE,eAAe;CAOhC"} \ No newline at end of file diff --git a/modules/core/typed/controllers/map-controller.d.ts b/modules/core/typed/controllers/map-controller.d.ts new file mode 100644 index 00000000000..bc26091939f --- /dev/null +++ b/modules/core/typed/controllers/map-controller.d.ts @@ -0,0 +1,160 @@ +import Controller, {ControllerProps} from './controller'; +import ViewState from './view-state'; +import LinearInterpolator from '../transitions/linear-interpolator'; +import type Viewport from '../viewports/viewport'; +export declare type MapStateProps = { + /** Mapbox viewport properties */ + /** The width of the viewport */ + width: number; + /** The height of the viewport */ + height: number; + /** The latitude at the center of the viewport */ + latitude: number; + /** The longitude at the center of the viewport */ + longitude: number; + /** The tile zoom level of the map. */ + zoom: number; + /** The bearing of the viewport in degrees */ + bearing?: number; + /** The pitch of the viewport in degrees */ + pitch?: number; + /** + * Specify the altitude of the viewport camera + * Unit: map heights, default 1.5 + * Non-public API, see https://github.com/mapbox/mapbox-gl-js/issues/1137 + */ + altitude?: number; + /** Viewport position */ + position?: [number, number, number]; + /** Viewport constraints */ + maxZoom?: number; + minZoom?: number; + maxPitch?: number; + minPitch?: number; + /** Normalize viewport props to fit map height into viewport. Default `true` */ + normalize?: boolean; +}; +declare type MapStateInternal = { + /** Interaction states, required to calculate change during transform */ + startPanLngLat?: [number, number]; + startZoomLngLat?: [number, number]; + startRotatePos?: [number, number]; + /** Bearing when current perspective rotate operation started */ + startBearing?: number; + /** Pitch when current perspective rotate operation started */ + startPitch?: number; + /** Zoom when current zoom operation started */ + startZoom?: number; +}; +export declare class MapState extends ViewState { + makeViewport: (props: Record) => Viewport; + constructor( + options: MapStateProps & + MapStateInternal & { + makeViewport: (props: Record) => Viewport; + } + ); + /** + * Start panning + * @param {[Number, Number]} pos - position on screen where the pointer grabs + */ + panStart({pos}: {pos: [number, number]}): MapState; + /** + * Pan + * @param {[Number, Number]} pos - position on screen where the pointer is + * @param {[Number, Number], optional} startPos - where the pointer grabbed at + * the start of the operation. Must be supplied of `panStart()` was not called + */ + pan({pos, startPos}: {pos: [number, number]; startPos?: [number, number]}): MapState; + /** + * End panning + * Must call if `panStart()` was called + */ + panEnd(): MapState; + /** + * Start rotating + * @param {[Number, Number]} pos - position on screen where the center is + */ + rotateStart({pos}: {pos: [number, number]}): MapState; + /** + * Rotate + * @param {[Number, Number]} pos - position on screen where the center is + */ + rotate({ + pos, + deltaAngleX, + deltaAngleY + }: { + pos?: [number, number]; + deltaAngleX?: number; + deltaAngleY?: number; + }): MapState; + /** + * End rotating + * Must call if `rotateStart()` was called + */ + rotateEnd(): MapState; + /** + * Start zooming + * @param {[Number, Number]} pos - position on screen where the center is + */ + zoomStart({pos}: {pos: [number, number]}): MapState; + /** + * Zoom + * @param {[Number, Number]} pos - position on screen where the current center is + * @param {[Number, Number]} startPos - the center position at + * the start of the operation. Must be supplied of `zoomStart()` was not called + * @param {Number} scale - a number between [0, 1] specifying the accumulated + * relative scale. + */ + zoom({ + pos, + startPos, + scale + }: { + pos: [number, number]; + startPos?: [number, number]; + scale: number; + }): MapState; + /** + * End zooming + * Must call if `zoomStart()` was called + */ + zoomEnd(): MapState; + zoomIn(speed?: number): MapState; + zoomOut(speed?: number): MapState; + moveLeft(speed?: number): MapState; + moveRight(speed?: number): MapState; + moveUp(speed?: number): MapState; + moveDown(speed?: number): MapState; + rotateLeft(speed?: number): MapState; + rotateRight(speed?: number): MapState; + rotateUp(speed?: number): MapState; + rotateDown(speed?: number): MapState; + shortestPathFrom(viewState: MapState): MapStateProps; + applyConstraints(props: Required): Required; + _zoomFromCenter(scale: any): MapState; + _panFromCenter(offset: any): MapState; + _getUpdatedState(newProps: any): MapState; + _unproject(pos?: [number, number]): [number, number] | undefined; + _getNewRotation( + pos: [number, number], + startPos: [number, number], + startPitch: number, + startBearing: number + ): { + pitch: number; + bearing: number; + }; +} +export default class MapController extends Controller { + ControllerState: typeof MapState; + transition: { + transitionDuration: number; + transitionInterpolator: LinearInterpolator; + }; + dragMode: 'pan' | 'rotate'; + setProps(props: ControllerProps & MapStateProps): void; +} +export {}; +// # sourceMappingURL=map-controller.d.ts.map diff --git a/modules/core/typed/controllers/map-controller.d.ts.map b/modules/core/typed/controllers/map-controller.d.ts.map new file mode 100644 index 00000000000..b552cbebdc0 --- /dev/null +++ b/modules/core/typed/controllers/map-controller.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"map-controller.d.ts","sourceRoot":"","sources":["../../src/controllers/map-controller.ts"],"names":[],"mappings":"AACA,OAAO,UAAU,EAAE,EAAC,eAAe,EAAC,MAAM,cAAc,CAAC;AACzD,OAAO,SAAS,MAAM,cAAc,CAAC;AAIrC,OAAO,kBAAkB,MAAM,oCAAoC,CAAC;AACpE,OAAO,KAAK,QAAQ,MAAM,uBAAuB,CAAC;AAKlD,oBAAY,aAAa,GAAG;IAC1B,iCAAiC;IACjC,gCAAgC;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,iCAAiC;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,iDAAiD;IACjD,QAAQ,EAAE,MAAM,CAAC;IACjB,kDAAkD;IAClD,SAAS,EAAE,MAAM,CAAC;IAClB,sCAAsC;IACtC,IAAI,EAAE,MAAM,CAAC;IACb,6CAA6C;IAC7C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,2CAA2C;IAC3C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,wBAAwB;IACxB,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IAEpC,2BAA2B;IAC3B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,+EAA+E;IAC/E,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF,aAAK,gBAAgB,GAAG;IACtB,wEAAwE;IAExE,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAElC,eAAe,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAEnC,cAAc,CAAC,EAAE,C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AAQ;IAUpC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS;IAMhE,eAAe,CACb,GAAG,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EACrB,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAC1B,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,GACnB;QACD,KAAK,EAAE,MAAM,CAAC;QACd,OAAO,EAAE,MAAM,CAAC;KACjB;CA0CF;AAED,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,UAAU,CAAC,QAAQ,CAAC;IAC7D,eAAe,kBAAY;IAE3B,UAAU;;;MAQR;IAEF,QAAQ,EAAE,KAAK,GAAG,QAAQ,CAAS;IAEnC,QAAQ,CAAC,KAAK,EAAE,eAAe,GAAG,aAAa;CAkBhD"} \ No newline at end of file diff --git a/modules/core/typed/controllers/orbit-controller.d.ts b/modules/core/typed/controllers/orbit-controller.d.ts new file mode 100644 index 00000000000..49c5fb6a569 --- /dev/null +++ b/modules/core/typed/controllers/orbit-controller.d.ts @@ -0,0 +1,130 @@ +import Controller from './controller'; +import ViewState from './view-state'; +import type Viewport from '../viewports/viewport'; +import LinearInterpolator from '../transitions/linear-interpolator'; +export declare type OrbitStateProps = { + width: number; + height: number; + target?: number[]; + zoom?: number | number[]; + rotationX?: number; + rotationOrbit?: number; + /** Viewport constraints */ + maxZoom?: number; + minZoom?: number; + minRotationX?: number; + maxRotationX?: number; +}; +declare type OrbitStateInternal = { + startPanPosition?: number[]; + startRotatePos?: number[]; + startRotationX?: number; + startRotationOrbit?: number; + startZoomPosition?: number[]; + startZoom?: number | number[]; +}; +export declare class OrbitState extends ViewState { + makeViewport: (props: Record) => Viewport; + constructor( + options: OrbitStateProps & + OrbitStateInternal & { + makeViewport: (props: Record) => Viewport; + } + ); + /** + * Start panning + * @param {[Number, Number]} pos - position on screen where the pointer grabs + */ + panStart({pos}: {pos: [number, number]}): OrbitState; + /** + * Pan + * @param {[Number, Number]} pos - position on screen where the pointer is + */ + pan({pos, startPosition}: {pos: [number, number]; startPosition?: number[]}): OrbitState; + /** + * End panning + * Must call if `panStart()` was called + */ + panEnd(): OrbitState; + /** + * Start rotating + * @param {[Number, Number]} pos - position on screen where the pointer grabs + */ + rotateStart({pos}: {pos: [number, number]}): OrbitState; + /** + * Rotate + * @param {[Number, Number]} pos - position on screen where the pointer is + */ + rotate({ + pos, + deltaAngleX, + deltaAngleY + }: { + pos?: [number, number]; + deltaAngleX?: number; + deltaAngleY?: number; + }): OrbitState; + /** + * End rotating + * Must call if `rotateStart()` was called + */ + rotateEnd(): OrbitState; + shortestPathFrom(viewState: OrbitState): OrbitStateProps; + /** + * Start zooming + * @param {[Number, Number]} pos - position on screen where the pointer grabs + */ + zoomStart({pos}: {pos: [number, number]}): OrbitState; + /** + * Zoom + * @param {[Number, Number]} pos - position on screen where the current target is + * @param {[Number, Number]} startPos - the target position at + * the start of the operation. Must be supplied of `zoomStart()` was not called + * @param {Number} scale - a number between [0, 1] specifying the accumulated + * relative scale. + */ + zoom({ + pos, + startPos, + scale + }: { + pos: [number, number]; + startPos?: [number, number]; + scale: number; + }): OrbitState; + /** + * End zooming + * Must call if `zoomStart()` was called + */ + zoomEnd(): OrbitState; + zoomIn(speed?: number): OrbitState; + zoomOut(speed?: number): OrbitState; + moveLeft(speed?: number): OrbitState; + moveRight(speed?: number): OrbitState; + moveUp(speed?: number): OrbitState; + moveDown(speed?: number): OrbitState; + rotateLeft(speed?: number): OrbitState; + rotateRight(speed?: number): OrbitState; + rotateUp(speed?: number): OrbitState; + rotateDown(speed?: number): OrbitState; + _unproject(pos?: number[]): number[] | undefined; + _calculateNewZoom({ + scale, + startZoom + }: { + scale: number; + startZoom?: number | number[]; + }): number | number[]; + _panFromCenter(offset: any): OrbitState; + _getUpdatedState(newProps: any): OrbitState; + applyConstraints(props: Required): Required; +} +export default class OrbitController extends Controller { + ControllerState: typeof OrbitState; + transition: { + transitionDuration: number; + transitionInterpolator: LinearInterpolator; + }; +} +export {}; +// # sourceMappingURL=orbit-controller.d.ts.map diff --git a/modules/core/typed/controllers/orbit-controller.d.ts.map b/modules/core/typed/controllers/orbit-controller.d.ts.map new file mode 100644 index 00000000000..f49fd9edefe --- /dev/null +++ b/modules/core/typed/controllers/orbit-controller.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"orbit-controller.d.ts","sourceRoot":"","sources":["../../src/controllers/orbit-controller.ts"],"names":[],"mappings":"AACA,OAAO,UAAU,MAAM,cAAc,CAAC;AACtC,OAAO,SAAS,MAAM,cAAc,CAAC;AAGrC,OAAO,KAAK,QAAQ,MAAM,uBAAuB,CAAC;AAClD,OAAO,kBAAkB,MAAM,oCAAoC,CAAC;AAEpE,oBAAY,eAAe,GAAG;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB,2BAA2B;IAC3B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,aAAK,kBAAkB,GAAG;IACxB,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC5B,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;CAC/B,CAAC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OAAO,OAAO,eAAgB,SAAQ,UAAU,CAAC,UAAU,CAAC;IACjE,eAAe,oBAAc;IAE7B,UAAU;;;MAQR;CACH"} \ No newline at end of file diff --git a/modules/core/typed/controllers/orthographic-controller.d.ts b/modules/core/typed/controllers/orthographic-controller.d.ts new file mode 100644 index 00000000000..247453e3bf1 --- /dev/null +++ b/modules/core/typed/controllers/orthographic-controller.d.ts @@ -0,0 +1,19 @@ +import Controller from './controller'; +import {OrbitState} from './orbit-controller'; +import LinearInterpolator from '../transitions/linear-interpolator'; +declare class OrthographicState extends OrbitState { + zoomAxis: 'X' | 'Y' | 'all'; + constructor(props: any); + _calculateNewZoom({scale, startZoom}: {scale: any; startZoom: any}): number | any[]; +} +export default class OrthographicController extends Controller { + ControllerState: typeof OrthographicState; + transition: { + transitionDuration: number; + transitionInterpolator: LinearInterpolator; + }; + dragMode: 'pan' | 'rotate'; + _onPanRotate(): boolean; +} +export {}; +// # sourceMappingURL=orthographic-controller.d.ts.map diff --git a/modules/core/typed/controllers/orthographic-controller.d.ts.map b/modules/core/typed/controllers/orthographic-controller.d.ts.map new file mode 100644 index 00000000000..c2e36df63fa --- /dev/null +++ b/modules/core/typed/controllers/orthographic-controller.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"orthographic-controller.d.ts","sourceRoot":"","sources":["../../src/controllers/orthographic-controller.ts"],"names":[],"mappings":"AACA,OAAO,UAAU,MAAM,cAAc,CAAC;AACtC,OAAO,EAAC,UAAU,EAAC,MAAM,oBAAoB,CAAC;AAC9C,OAAO,kBAAkB,MAAM,oCAAoC,CAAC;AAEpE,cAAM,iBAAkB,SAAQ,UAAU;IACxC,QAAQ,EAAE,GAAG,GAAG,GAAG,GAAG,KAAK,CAAC;gBAEhB,KAAK,KAAA;IAMjB,iBAAiB,CAAC,EAAC,KAAK,EAAE,SAAS,EAAC;;;KAAA;CAqCrC;AAED,MAAM,CAAC,OAAO,OAAO,sBAAuB,SAAQ,UAAU,CAAC,UAAU,CAAC;IACxE,eAAe,2BAAqB;IACpC,UAAU;;;MAGR;IACF,QAAQ,EAAE,KAAK,GAAG,QAAQ,CAAS;IAEnC,YAAY;CAIb"} \ No newline at end of file diff --git a/modules/core/typed/controllers/transition-manager.d.ts b/modules/core/typed/controllers/transition-manager.d.ts new file mode 100644 index 00000000000..ed94c96f7a7 --- /dev/null +++ b/modules/core/typed/controllers/transition-manager.d.ts @@ -0,0 +1,59 @@ +import Transition from '../transitions/transition'; +import TransitionInterpolator from '../transitions/transition-interpolator'; +import type {IViewState} from './view-state'; +import type {Timeline} from '@luma.gl/engine'; +import type {InteractionState} from './controller'; +export declare const TRANSITION_EVENTS: { + readonly BREAK: 1; + readonly SNAP_TO_END: 2; + readonly IGNORE: 3; +}; +declare type TransitionEvent = 1 | 2 | 3; +export declare type TransitionProps = { + /** Transition duration in milliseconds, default value 0, implies no transition. When using `FlyToInterpolator`, it can also be set to `'auto'`. */ + transitionDuration?: number | 'auto'; + /** An interpolator object that defines the transition behavior between two viewports. */ + transitionInterpolator?: TransitionInterpolator; + /** Easing function that can be used to achieve effects like "Ease-In-Cubic", "Ease-Out-Cubic", etc. Default value performs Linear easing. */ + transitionEasing?: (t: number) => number; + /** Controls how to process a new view state change that occurs during an existing transition. */ + transitionInterruption?: TransitionEvent; + /** Callback fired when requested transition starts. */ + onTransitionStart?: (transition: Transition) => void; + /** Callback fired when requested transition is interrupted. */ + onTransitionInterrupt?: (transition: Transition) => void; + /** Callback fired when requested transition ends. */ + onTransitionEnd?: (transition: Transition) => void; +}; +export default class TransitionManager> { + getControllerState: (props: any) => ControllerState; + props?: TransitionProps; + propsInTransition: Record | null; + transition: Transition; + onViewStateChange: (params: { + viewState: Record; + oldViewState: Record; + }) => void; + onStateChange: (state: InteractionState) => void; + constructor(opts: { + timeline: Timeline; + getControllerState: (props: any) => ControllerState; + onViewStateChange?: (params: { + viewState: Record; + oldViewState: Record; + }) => void; + onStateChange?: (state: InteractionState) => void; + }); + finalize(): void; + getViewportInTransition(): Record | null; + processViewStateChange(nextProps: TransitionProps): boolean; + updateTransition(): void; + _isTransitionEnabled(props: TransitionProps): boolean; + _isUpdateDueToCurrentTransition(props: TransitionProps): boolean; + _shouldIgnoreViewportChange(currentProps: TransitionProps, nextProps: TransitionProps): boolean; + _triggerTransition(startProps: TransitionProps, endProps: TransitionProps): void; + _onTransitionEnd(callback?: (transition: Transition) => void): (transition: any) => void; + _onTransitionUpdate: (transition: any) => void; +} +export {}; +// # sourceMappingURL=transition-manager.d.ts.map diff --git a/modules/core/typed/controllers/transition-manager.d.ts.map b/modules/core/typed/controllers/transition-manager.d.ts.map new file mode 100644 index 00000000000..78515514ae6 --- /dev/null +++ b/modules/core/typed/controllers/transition-manager.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"transition-manager.d.ts","sourceRoot":"","sources":["../../src/controllers/transition-manager.ts"],"names":[],"mappings":"AAAA,OAAO,UAA0D,MAAM,2BAA2B,CAAC;AACnG,OAAO,sBAAsB,MAAM,wCAAwC,CAAC;AAC5E,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,cAAc,CAAC;AAE7C,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,iBAAiB,CAAC;AAC9C,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,cAAc,CAAC;AAKnD,eAAO,MAAM,iBAAiB;;;;CAIpB,CAAC;AAEX,aAAK,eAAe,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAEjC,oBAAY,eAAe,GAAG;IAC5B,mJAAmJ;IACnJ,kBAAkB,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACrC,yFAAyF;IACzF,sBAAsB,CAAC,EAAE,sBAAsB,CAAC;IAChD,6IAA6I;IAC7I,gBAAgB,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;IACzC,iGAAiG;IACjG,sBAAsB,CAAC,EAAE,eAAe,CAAC;IACzC,uDAAuD;IACvD,iBAAiB,CAAC,EAAE,CAAC,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,CAAC,SAAS,EAAE,eAAe;IAkCjD,gBAAgB;IAMhB,oBAAoB,CAAC,KAAK,EAAE,eAAe,GAAG,OAAO;IAQrD,+BAA+B,CAAC,KAAK,EAAE,eAAe,GAAG,OAAO;IAWhE,2BAA2B,CAAC,YAAY,EAAE,eAAe,EAAE,SAAS,EAAE,eAAe,GAAG,OAAO;IAkB/F,kBAAkB,CAAC,UAAU,EAAE,eAAe,EAAE,QAAQ,EAAE,eAAe,GAAG,IAAI;IAsChF,gBAAgB,CAAC,QAAQ,CAAC,EAAE,CAAC,UAAU,EAAE,UAAU,KAAK,IAAI;IAe5D,mBAAmB,4BAoBjB;CACH"} \ No newline at end of file diff --git a/modules/core/typed/controllers/view-state.d.ts b/modules/core/typed/controllers/view-state.d.ts new file mode 100644 index 00000000000..fa24d52b125 --- /dev/null +++ b/modules/core/typed/controllers/view-state.d.ts @@ -0,0 +1,71 @@ +import type Viewport from '../viewports/viewport'; +export default abstract class ViewState implements IViewState { + private _viewportProps; + private _state; + constructor(props: Required, state: State); + getViewportProps(): Required; + getState(): State; + abstract applyConstraints(props: Required): Required; + abstract shortestPathFrom(viewState: T): Props; + abstract panStart(params: {pos: [number, number]}): T; + abstract pan({pos, startPos}: {pos: [number, number]; startPos?: [number, number]}): T; + abstract panEnd(): T; + abstract rotateStart(params: {pos: [number, number]}): T; + abstract rotate(params: {pos?: [number, number]; deltaAngleX?: number; deltaAngleY: number}): T; + abstract rotateEnd(): T; + abstract zoomStart({pos}: {pos: [number, number]}): T; + abstract zoom({ + pos, + startPos, + scale + }: { + pos: [number, number]; + startPos?: [number, number]; + scale: number; + }): T; + abstract zoomEnd(): T; + abstract zoomIn(speed?: number): T; + abstract zoomOut(speed?: number): T; + abstract moveLeft(speed?: number): T; + abstract moveRight(speed?: number): T; + abstract moveUp(speed?: number): T; + abstract moveDown(speed?: number): T; + abstract rotateLeft(speed?: number): T; + abstract rotateRight(speed?: number): T; + abstract rotateUp(speed?: number): T; + abstract rotateDown(speed?: number): T; +} +export interface IViewState { + makeViewport?: (props: Record) => Viewport; + getViewportProps(): Record; + getState(): Record; + shortestPathFrom(viewState: T): Record; + panStart(params: {pos: [number, number]}): T; + pan({pos, startPos}: {pos: [number, number]; startPos?: [number, number]}): T; + panEnd(): T; + rotateStart(params: {pos: [number, number]}): T; + rotate(params: {pos?: [number, number]; deltaAngleX?: number; deltaAngleY?: number}): T; + rotateEnd(): T; + zoomStart({pos}: {pos: [number, number]}): T; + zoom({ + pos, + startPos, + scale + }: { + pos: [number, number]; + startPos?: [number, number]; + scale: number; + }): T; + zoomEnd(): T; + zoomIn(speed?: number): T; + zoomOut(speed?: number): T; + moveLeft(speed?: number): T; + moveRight(speed?: number): T; + moveUp(speed?: number): T; + moveDown(speed?: number): T; + rotateLeft(speed?: number): T; + rotateRight(speed?: number): T; + rotateUp(speed?: number): T; + rotateDown(speed?: number): T; +} +// # sourceMappingURL=view-state.d.ts.map diff --git a/modules/core/typed/controllers/view-state.d.ts.map b/modules/core/typed/controllers/view-state.d.ts.map new file mode 100644 index 00000000000..67967949ac6 --- /dev/null +++ b/modules/core/typed/controllers/view-state.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"view-state.d.ts","sourceRoot":"","sources":["../../src/controllers/view-state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,uBAAuB,CAAC;AAElD,MAAM,CAAC,OAAO,CAAC,QAAQ,OAAO,SAAS,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,CAAE,YAAW,UAAU,CAAC,CAAC,CAAC;IAC/E,OAAO,CAAC,cAAc,CAAkB;IACxC,OAAO,CAAC,MAAM,CAAQ;gBAEV,KAAK,EAAE,QAAQ,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,KAAK;IAKhD,gBAAgB,IAAI,QAAQ,CAAC,KAAK,CAAC;IAInC,QAAQ,IAAI,KAAK;IAIjB,QAAQ,CAAC,gBAAgB,CAAC,KAAK,EAAE,QAAQ,CAAC,KAAK,CA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G,CAAC,CAAC;IAC9B,WAAW,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC;IAC/B,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC;IAC5B,UAAU,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC;CAC/B"} \ No newline at end of file diff --git a/modules/core/typed/debug/index.d.ts b/modules/core/typed/debug/index.d.ts new file mode 100644 index 00000000000..f6e949fcbd7 --- /dev/null +++ b/modules/core/typed/debug/index.d.ts @@ -0,0 +1,3 @@ +export declare function register(handlers: Record): void; +export default function debug(eventType: string, arg1?: any, arg2?: any, arg3?: any): void; +// # sourceMappingURL=index.d.ts.map diff --git a/modules/core/typed/debug/index.d.ts.map b/modules/core/typed/debug/index.d.ts.map new file mode 100644 index 00000000000..2ec445258b2 --- /dev/null +++ b/modules/core/typed/debug/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/debug/index.ts"],"names":[],"mappings":"AAaA,wBAAgB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,GAAG,IAAI,CAEjE;AAED,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,GAAG,EAAE,IAAI,CAAC,EAAE,GAAG,EAAE,IAAI,CAAC,EAAE,GAAG,GAAG,IAAI,CAKzF"} \ No newline at end of file diff --git a/modules/core/typed/debug/loggers.d.ts b/modules/core/typed/debug/loggers.d.ts new file mode 100644 index 00000000000..e7763de5513 --- /dev/null +++ b/modules/core/typed/debug/loggers.d.ts @@ -0,0 +1,3 @@ +import type {Log} from '@probe.gl/log'; +export declare const getLoggers: (log: Log) => Record; +// # sourceMappingURL=loggers.d.ts.map diff --git a/modules/core/typed/debug/loggers.d.ts.map b/modules/core/typed/debug/loggers.d.ts.map new file mode 100644 index 00000000000..1385e364275 --- /dev/null +++ b/modules/core/typed/debug/loggers.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"loggers.d.ts","sourceRoot":"","sources":["../../src/debug/loggers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,GAAG,EAAC,MAAM,eAAe,CAAC;AAkBvC,eAAO,MAAM,UAAU,QAAS,GAAG,KAAG,OAAO,MAAM,EAAE,QAAQ,CAyH3D,CAAC"} \ No newline at end of file diff --git a/modules/core/typed/effects/lighting/ambient-light.d.ts b/modules/core/typed/effects/lighting/ambient-light.d.ts new file mode 100644 index 00000000000..3c4eaea03b6 --- /dev/null +++ b/modules/core/typed/effects/lighting/ambient-light.d.ts @@ -0,0 +1,19 @@ +export declare type AmbientLightOptions = { + id?: string; + /** Light color, [r, g, b] in the 0-255 range + * @default [255, 255, 255] + */ + color?: number[]; + /** Light intensity, higher number is brighter + * @default 1.0 + */ + intensity?: number; +}; +export declare class AmbientLight { + id: string; + color: number[]; + intensity: number; + type: string; + constructor(props?: AmbientLightOptions); +} +// # sourceMappingURL=ambient-light.d.ts.map diff --git a/modules/core/typed/effects/lighting/ambient-light.d.ts.map b/modules/core/typed/effects/lighting/ambient-light.d.ts.map new file mode 100644 index 00000000000..b293bfe488b --- /dev/null +++ b/modules/core/typed/effects/lighting/ambient-light.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ambient-light.d.ts","sourceRoot":"","sources":["../../../src/effects/lighting/ambient-light.ts"],"names":[],"mappings":"AAKA,oBAAY,mBAAmB,GAAG;IAChC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,qBAAa,YAAY;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,SAAa;gBAEL,KAAK,GAAE,mBAAwB;CAQ5C"} \ No newline at end of file diff --git a/modules/core/typed/effects/lighting/camera-light.d.ts b/modules/core/typed/effects/lighting/camera-light.d.ts new file mode 100644 index 00000000000..50a10eaf082 --- /dev/null +++ b/modules/core/typed/effects/lighting/camera-light.d.ts @@ -0,0 +1,6 @@ +import {PointLight} from './point-light'; +import type Layer from '../../lib/layer'; +export default class CameraLight extends PointLight { + getProjectedLight({layer}: {layer: Layer}): PointLight; +} +// # sourceMappingURL=camera-light.d.ts.map diff --git a/modules/core/typed/effects/lighting/camera-light.d.ts.map b/modules/core/typed/effects/lighting/camera-light.d.ts.map new file mode 100644 index 00000000000..192b57d4472 --- /dev/null +++ b/modules/core/typed/effects/lighting/camera-light.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"camera-light.d.ts","sourceRoot":"","sources":["../../../src/effects/lighting/camera-light.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,UAAU,EAAC,MAAM,eAAe,CAAC;AAEzC,OAAO,KAAK,KAAK,MAAM,iBAAiB,CAAC;AAEzC,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,UAAU;IACjD,iBAAiB,CAAC,EAAC,KAAK,EAAC,EAAE;QAAC,KAAK,EAAE,KAAK,CAAA;KAAC,GAAG,UAAU;CAevD"} \ No newline at end of file diff --git a/modules/core/typed/effects/lighting/directional-light.d.ts b/modules/core/typed/effects/lighting/directional-light.d.ts new file mode 100644 index 00000000000..c6e04f0c6bc --- /dev/null +++ b/modules/core/typed/effects/lighting/directional-light.d.ts @@ -0,0 +1,31 @@ +import type Layer from '../../lib/layer'; +export declare type DirectionalLightOptions = { + id?: string; + /** Light color, [r, g, b] in the 0-255 range + * @default [255, 255, 255] + */ + color?: number[]; + /** Light intensity, higher number is brighter + * @default 1.0 + */ + intensity?: number; + /** Light direction in the common space + * @default [0.0, 0.0, -1.0] + */ + direction?: number[]; + /** (Experimental) render shadows cast by this light + * @default false + */ + _shadow?: boolean; +}; +export declare class DirectionalLight { + id: string; + color: number[]; + intensity: number; + type: string; + direction: number[]; + shadow: boolean; + constructor(props?: DirectionalLightOptions); + getProjectedLight(opts: {layer: Layer}): DirectionalLight; +} +// # sourceMappingURL=directional-light.d.ts.map diff --git a/modules/core/typed/effects/lighting/directional-light.d.ts.map b/modules/core/typed/effects/lighting/directional-light.d.ts.map new file mode 100644 index 00000000000..8ca0c5d6a3a --- /dev/null +++ b/modules/core/typed/effects/lighting/directional-light.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"directional-light.d.ts","sourceRoot":"","sources":["../../../src/effects/lighting/directional-light.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,iBAAiB,CAAC;AAQzC,oBAAY,uBAAuB,GAAG;IACpC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,qBAAa,gBAAgB;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,SAAiB;IACrB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,MAAM,EAAE,OAAO,CAAC;gBAEJ,KAAK,GAAE,uBAA4B;IAc/C,iBAAiB,CAAC,IAAI,EAAE;QAAC,KAAK,EAAE,KAAK,CAAA;KAAC,GAAG,gBAAgB;CAG1D"} \ No newline at end of file diff --git a/modules/core/typed/effects/lighting/lighting-effect.d.ts b/modules/core/typed/effects/lighting/lighting-effect.d.ts new file mode 100644 index 00000000000..ed30682c5fb --- /dev/null +++ b/modules/core/typed/effects/lighting/lighting-effect.d.ts @@ -0,0 +1,43 @@ +import type {Device} from '@luma.gl/api'; +import {Texture2D} from '@luma.gl/webgl-legacy'; +import {AmbientLight} from './ambient-light'; +import {DirectionalLight} from './directional-light'; +import {PointLight} from './point-light'; +import {Matrix4} from '@math.gl/core'; +import type Layer from '../../lib/layer'; +import type {Effect, PreRenderOptions} from '../../lib/effect'; +export default class LightingEffect implements Effect { + id: string; + props: any; + shadowColor: number[]; + private shadow; + private ambientLight?; + private directionalLights; + private pointLights; + private shadowPasses; + private shadowMaps; + private dummyShadowMap; + private pipelineFactory?; + private shadowMatrices?; + constructor(props?: Record); + preRender( + device: Device, + {layers, layerFilter, viewports, onViewportActive, views}: PreRenderOptions + ): void; + getModuleParameters(layer: Layer): { + lightSources?: { + ambientLight?: AmbientLight | null; + directionalLights: DirectionalLight[]; + pointLights: PointLight[]; + }; + shadowMaps?: Texture2D[]; + dummyShadowMap?: Texture2D; + shadowColor?: number[]; + shadowMatrices?: Matrix4[]; + }; + cleanup(): void; + private _calculateMatrices; + private _createShadowPasses; + private _applyDefaultLights; +} +// # sourceMappingURL=lighting-effect.d.ts.map diff --git a/modules/core/typed/effects/lighting/lighting-effect.d.ts.map b/modules/core/typed/effects/lighting/lighting-effect.d.ts.map new file mode 100644 index 00000000000..272c4f28dd0 --- /dev/null +++ b/modules/core/typed/effects/lighting/lighting-effect.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"lighting-effect.d.ts","sourceRoot":"","sources":["../../../src/effects/lighting/lighting-effect.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,cAAc,CAAC;AAEzC,OAAO,EAAC,SAAS,EAAC,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAC,YAAY,EAAC,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAC,gBAAgB,EAAC,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAC,UAAU,EAAC,MAAM,eAAe,CAAC;AACzC,OAAO,EAAC,OAAO,EAAU,MAAM,eAAe,CAAC;AAI/C,OAAO,KAAK,KAAK,MAAM,iBAAiB,CAAC;AACzC,OAAO,KAAK,EAAC,MAAM,EAAE,gBAAgB,EAAC,MAAM,kBAAkB,CAAC;AAkB/D,MAAM,CAAC,OAAO,OAAO,cAAe,YAAW,MAAM;IACnD,EAAE,SAAqB;IACvB,KAAK,MAAQ;IACb,WAAW,EAAE,MAAM,EAAE,CAAwB;IAE7C,OAAO,CAAC,MAAM,CAAU;IACxB,OAAO,CAAC,YAAY,CAAC,CAA6B;IAClD,OAAO,CAAC,iBAAiB,CAA0B;IACnD,OAAO,CAAC,WAAW,CAAoB;IACvC,OAAO,CAAC,YAAY,CAAoB;IACxC,OAAO,CAAC,UAAU,CAAmB;IACrC,OAAO,CAAC,cAAc,CAA0B;IAChD,OAAO,CAAC,eAAe,CAAC,CAAiB;IACzC,OAAO,CAAC,cAAc,CAAC,CAAY;gBAEvB,KAAK,GAAE,MAAM,CAAC,MAAM,EAAE,UAAU,GAAG,gBAAgB,GAAG,YAAY,CAAM;IAwBpF,SAAS,CACP,MAAM,EAAE,MAAM,EACd,EAAC,MAAM,EAAE,WAAW,EAAE,SAAS,EAAE,gBAAgB,EAAE,KAAK,EAAC,EAAE,gBAAgB;IAyC7E,mBAAmB,CAAC,KAAK,EAAE,KAAK;uBAEb;YACb,YAAY,CAAC,EAAE,YAAY,GAAG,IAAI,CAAC;YACnC,iBAAiB,EAAE,gBAAgB,EAAE,CAAC;YACtC,WAAW,EAAE,UAAU,EAAE,CAAC;SAC3B;qBACY,SAAS,EAAE;yBACP,SAAS;sBACZ,MAAM,EAAE;yBACL,OAAO,EAAE;;IAuB9B,OAAO,IAAI,IAAI;IAkBf,OAAO,CAAC,kBAAkB;IAY1B,OAAO,CAAC,mBAAmB;IAQ3B,OAAO,CAAC,mBAAmB;CAU5B"} \ No newline at end of file diff --git a/modules/core/typed/effects/lighting/point-light.d.ts b/modules/core/typed/effects/lighting/point-light.d.ts new file mode 100644 index 00000000000..537c21f2e76 --- /dev/null +++ b/modules/core/typed/effects/lighting/point-light.d.ts @@ -0,0 +1,32 @@ +import type Layer from '../../lib/layer'; +export declare type PointLightOptions = { + id?: string; + /** Light color, [r, g, b] in the 0-255 range + * @default [255, 255, 255] + */ + color?: number[]; + /** Light intensity, higher number is brighter + * @default 1.0 + */ + intensity?: number; + /** Light position [x, y, z] in the common space + * @default [0.0, 0.0, 1.0] + */ + position?: number[]; + /** Light attenuation + * @default [0.0, 0.0, 1.0] + */ + attenuation?: number[]; +}; +export declare class PointLight { + id: string; + color: number[]; + intensity: number; + type: string; + position: number[]; + attenuation: number[]; + protected projectedLight: PointLight; + constructor(props?: PointLightOptions); + getProjectedLight({layer}: {layer: Layer}): PointLight; +} +// # sourceMappingURL=point-light.d.ts.map diff --git a/modules/core/typed/effects/lighting/point-light.d.ts.map b/modules/core/typed/effects/lighting/point-light.d.ts.map new file mode 100644 index 00000000000..2cba6eb2b8c --- /dev/null +++ b/modules/core/typed/effects/lighting/point-light.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"point-light.d.ts","sourceRoot":"","sources":["../../../src/effects/lighting/point-light.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,iBAAiB,CAAC;AASzC,oBAAY,iBAAiB,GAAG;IAC9B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;CACxB,CAAC;AAEF,qBAAa,UAAU;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,SAAW;IACf,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,WAAW,EAAE,MAAM,EAAE,CAAC;IAEtB,SAAS,CAAC,cAAc,EAAE,UAAU,CAAC;gBAEzB,KAAK,GAAE,iBAAsB;IAczC,iBAAiB,CAAC,EAAC,KAAK,EAAC,EAAE;QAAC,KAAK,EAAE,KAAK,CAAA;KAAC,GAAG,UAAU;CAkBvD"} \ No newline at end of file diff --git a/modules/core/typed/effects/lighting/sun-light.d.ts b/modules/core/typed/effects/lighting/sun-light.d.ts new file mode 100644 index 00000000000..46629e7b241 --- /dev/null +++ b/modules/core/typed/effects/lighting/sun-light.d.ts @@ -0,0 +1,27 @@ +import {DirectionalLight} from './directional-light'; +import type Layer from '../../lib/layer'; +export declare type SunLightOptions = { + id?: string; + /** Light color, [r, g, b] in the 0-255 range + * @default [255, 255, 255] + */ + color?: number[]; + /** Light intensity, higher number is brighter + * @default 1.0 + */ + intensity?: number; + /** + * The time at which to position the sun. Either a Date object or a timestamp (milliseconds elapsed since unix time 0) + */ + timestamp: number | Date; + /** (Experimental) render shadows casted by this light + * @default false + */ + _shadow?: boolean; +}; +export default class SunLight extends DirectionalLight { + timestamp: number | Date; + constructor(opts: SunLightOptions); + getProjectedLight({layer}: {layer: Layer}): DirectionalLight; +} +// # sourceMappingURL=sun-light.d.ts.map diff --git a/modules/core/typed/effects/lighting/sun-light.d.ts.map b/modules/core/typed/effects/lighting/sun-light.d.ts.map new file mode 100644 index 00000000000..1a6d6620d03 --- /dev/null +++ b/modules/core/typed/effects/lighting/sun-light.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"sun-light.d.ts","sourceRoot":"","sources":["../../../src/effects/lighting/sun-light.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,gBAAgB,EAAC,MAAM,qBAAqB,CAAC;AAGrD,OAAO,KAAK,KAAK,MAAM,iBAAiB,CAAC;AAEzC,oBAAY,eAAe,GAAG;IAC5B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,gBAAgB;IACpD,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;gBAEb,IAAI,EAAE,eAAe;IAMjC,iBAAiB,CAAC,EAAC,KAAK,EAAC,EAAE;QAAC,KAAK,EAAE,KAAK,CAAA;KAAC,GAAG,gBAAgB;CAgB7D"} \ No newline at end of file diff --git a/modules/core/typed/effects/lighting/suncalc.d.ts b/modules/core/typed/effects/lighting/suncalc.d.ts new file mode 100644 index 00000000000..4ee3d93ce85 --- /dev/null +++ b/modules/core/typed/effects/lighting/suncalc.d.ts @@ -0,0 +1,14 @@ +export declare function getSolarPosition( + timestamp: any, + latitude: any, + longitude: any +): { + azimuth: number; + altitude: number; +}; +export declare function getSunlightDirection( + timestamp: any, + latitude: any, + longitude: any +): number[]; +// # sourceMappingURL=suncalc.d.ts.map diff --git a/modules/core/typed/effects/lighting/suncalc.d.ts.map b/modules/core/typed/effects/lighting/suncalc.d.ts.map new file mode 100644 index 00000000000..7ee77287f53 --- /dev/null +++ b/modules/core/typed/effects/lighting/suncalc.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"suncalc.d.ts","sourceRoot":"","sources":["../../../src/effects/lighting/suncalc.ts"],"names":[],"mappings":"AAmBA,wBAAgB,gBAAgB,CAAC,SAAS,KAAA,EAAE,QAAQ,KAAA,EAAE,SAAS,KAAA;;;EAiB9D;AAED,wBAAgB,oBAAoB,CAAC,SAAS,KAAA,EAAE,QAAQ,KAAA,EAAE,SAAS,KAAA,YASlE"} \ No newline at end of file diff --git a/modules/core/typed/effects/mask/mask-effect.d.ts b/modules/core/typed/effects/mask/mask-effect.d.ts new file mode 100644 index 00000000000..f78e57c463a --- /dev/null +++ b/modules/core/typed/effects/mask/mask-effect.d.ts @@ -0,0 +1,43 @@ +import type {Device} from '@luma.gl/api'; +import {Texture2D} from '@luma.gl/webgl-legacy'; +import type {Effect, PreRenderOptions} from '../../lib/effect'; +import type {MaskBounds} from './utils'; +import type {CoordinateSystem} from '../../lib/constants'; +declare type Mask = { + /** The channel index */ + index: number; + bounds: MaskBounds; + coordinateOrigin: [number, number, number]; + coordinateSystem: CoordinateSystem; +}; +export default class MaskEffect implements Effect { + id: string; + props: any; + useInPicking: boolean; + private dummyMaskMap?; + private channels; + private masks; + private maskPass?; + private maskMap?; + private lastViewport?; + preRender( + device: Device, + {layers, layerFilter, viewports, onViewportActive, views}: PreRenderOptions + ): void; + private _renderChannel; + /** + * Find a channel to render each mask into + * If a maskId already exists, diff and update the existing channel + * Otherwise replace a removed mask + * Otherwise create a new channel + * Returns a map from mask layer id to channel info + */ + private _sortMaskChannels; + getModuleParameters(): { + maskMap: Texture2D; + maskChannels: Record | null; + }; + cleanup(): void; +} +export {}; +// # sourceMappingURL=mask-effect.d.ts.map diff --git a/modules/core/typed/effects/mask/mask-effect.d.ts.map b/modules/core/typed/effects/mask/mask-effect.d.ts.map new file mode 100644 index 00000000000..bae60107161 --- /dev/null +++ b/modules/core/typed/effects/mask/mask-effect.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"mask-effect.d.ts","sourceRoot":"","sources":["../../../src/effects/mask/mask-effect.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,cAAc,CAAC;AACzC,OAAO,EAAC,SAAS,EAAC,MAAM,uBAAuB,CAAC;AAQhD,OAAO,KAAK,EAAC,MAAM,EAAE,gBAAgB,EAAC,MAAM,kBAAkB,CAAC;AAG/D,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,SAAS,CAAC;AACxC,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,qBAAqB,CAAC;AAE1D,aAAK,IAAI,GAAG;IACV,wBAAwB;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,UAAU,CAAC;IACnB,gBAAgB,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IAC3C,gBAAgB,EAAE,gBAAgB,CAAC;CACpC,CAAC;AAcF,MAAM,CAAC,OAAO,OAAO,UAAW,YAAW,MAAM;IAC/C,EAAE,SAAiB;IACnB,KAAK,MAAQ;IACb,YAAY,UAAQ;IAEpB,OAAO,CAAC,YAAY,CAAC,CAAY;IACjC,OAAO,CAAC,QAAQ,CAA0B;IAC1C,OAAO,CAAC,KAAK,CAAqC;IAClD,OAAO,CAAC,QAAQ,CAAC,CAAW;IAC5B,OAAO,CAAC,OAAO,CAAC,CAAY;IAC5B,OAAO,CAAC,YAAY,CAAC,CAAW;IAEhC,SAAS,CACP,MAAM,EAAE,MAAM,EACd,EAAC,MAAM,EAAE,WAAW,EAAE,SAAS,EAAE,gBAAgB,EAAE,KAAK,EAAC,EAAE,gBAAgB,GAC1E,IAAI;IAgEP,OAAO,CAAC,cAAc;IA6EtB;;;;;;OAMG;IACH,OAAO,CAAC,iBAAiB;IA4CzB,mBAAmB,IAAI;QACrB,OAAO,EAAE,SAAS,CAAC;QACnB,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,GAAG,IAAI,CAAC;KAC3C;IAOD,OAAO,IAAI,IAAI;CAgBhB"} \ No newline at end of file diff --git a/modules/core/typed/effects/mask/utils.d.ts b/modules/core/typed/effects/mask/utils.d.ts new file mode 100644 index 00000000000..c5ac143aebf --- /dev/null +++ b/modules/core/typed/effects/mask/utils.d.ts @@ -0,0 +1,22 @@ +import type Layer from '../../lib/layer'; +import type Viewport from '../../viewports/viewport'; +export declare type MaskBounds = [number, number, number, number]; +export declare function getMaskBounds({ + layers, + viewport +}: { + layers: Layer[]; + viewport: Viewport; +}): MaskBounds; +export declare function getMaskViewport({ + bounds, + viewport, + width, + height +}: { + bounds: MaskBounds; + viewport: Viewport; + width: number; + height: number; +}): Viewport | null; +// # sourceMappingURL=utils.d.ts.map diff --git a/modules/core/typed/effects/mask/utils.d.ts.map b/modules/core/typed/effects/mask/utils.d.ts.map new file mode 100644 index 00000000000..96e17b9d573 --- /dev/null +++ b/modules/core/typed/effects/mask/utils.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/effects/mask/utils.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,KAAK,MAAM,iBAAiB,CAAC;AACzC,OAAO,KAAK,QAAQ,MAAM,0BAA0B,CAAC;AAErD,oBAAY,UAAU,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AAO1D,wBAAgB,aAAa,CAAC,EAC5B,MAAM,EACN,QAAQ,EACT,EAAE;IACD,MAAM,EAAE,KAAK,EAAE,CAAC;IAChB,QAAQ,EAAE,QAAQ,CAAC;CACpB,GAAG,UAAU,CAkDb;AAKD,wBAAgB,eAAe,CAAC,EAC9B,MAAM,EACN,QAAQ,EACR,KAAK,EACL,MAAM,EACP,EAAE;IACD,MAAM,EAAE,UAAU,CAAC;IACnB,QAAQ,EAAE,QAAQ,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB,GAAG,QAAQ,GAAG,IAAI,CAsDlB"} \ No newline at end of file diff --git a/modules/core/typed/effects/post-process-effect.d.ts b/modules/core/typed/effects/post-process-effect.d.ts new file mode 100644 index 00000000000..bd282a357f4 --- /dev/null +++ b/modules/core/typed/effects/post-process-effect.d.ts @@ -0,0 +1,16 @@ +import type {Device} from '@luma.gl/api'; +import type {Framebuffer} from '@luma.gl/webgl-legacy'; +import ScreenPass from '../passes/screen-pass'; +import type {Effect, PostRenderOptions} from '../lib/effect'; +import type {ShaderModule} from '../types/types'; +export default class PostProcessEffect implements Effect { + id: string; + props: any; + module: ShaderModule; + passes?: ScreenPass[]; + constructor(module: ShaderModule, props?: any); + preRender(): void; + postRender(device: Device, params: PostRenderOptions): Framebuffer; + cleanup(): void; +} +// # sourceMappingURL=post-process-effect.d.ts.map diff --git a/modules/core/typed/effects/post-process-effect.d.ts.map b/modules/core/typed/effects/post-process-effect.d.ts.map new file mode 100644 index 00000000000..5080177bd0f --- /dev/null +++ b/modules/core/typed/effects/post-process-effect.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"post-process-effect.d.ts","sourceRoot":"","sources":["../../src/effects/post-process-effect.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,cAAc,CAAC;AAEzC,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,uBAAuB,CAAC;AAEvD,OAAO,UAAU,MAAM,uBAAuB,CAAC;AAE/C,OAAO,KAAK,EAAC,MAAM,EAAE,iBAAiB,EAAC,MAAM,eAAe,CAAC;AAC7D,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,gBAAgB,CAAC;AAEjD,MAAM,CAAC,OAAO,OAAO,iBAAkB,YAAW,MAAM;IACtD,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,GAAG,CAAC;IACX,MAAM,EAAE,YAAY,CAAC;IACrB,MAAM,CAAC,EAAE,UAAU,EAAE,CAAC;gBAEV,MAAM,EAAE,YAAY,EAAE,KAAK,GAAE,GAAQ;IAQjD,SAAS,IAAI,IAAI;IAEjB,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,iBAAiB,GAAG,WAAW;IAoBlE,OAAO,IAAI,IAAI;CAQhB"} \ No newline at end of file diff --git a/modules/core/typed/index.d.ts b/modules/core/typed/index.d.ts new file mode 100644 index 00000000000..cd4727dd5db --- /dev/null +++ b/modules/core/typed/index.d.ts @@ -0,0 +1,82 @@ +import './lib/init'; +import './shaderlib'; +export {COORDINATE_SYSTEM, OPERATION, UNIT} from './lib/constants'; +export {default as LightingEffect} from './effects/lighting/lighting-effect'; +export {AmbientLight} from './effects/lighting/ambient-light'; +export {DirectionalLight} from './effects/lighting/directional-light'; +export {PointLight} from './effects/lighting/point-light'; +export {default as _CameraLight} from './effects/lighting/camera-light'; +export {default as _SunLight} from './effects/lighting/sun-light'; +export {default as PostProcessEffect} from './effects/post-process-effect'; +export {default as _LayersPass} from './passes/layers-pass'; +export {default as Deck} from './lib/deck'; +export {default as LayerManager} from './lib/layer-manager'; +export {default as AttributeManager} from './lib/attribute/attribute-manager'; +export {default as Layer} from './lib/layer'; +export {default as CompositeLayer} from './lib/composite-layer'; +export {default as DeckRenderer} from './lib/deck-renderer'; +export {default as Viewport} from './viewports/viewport'; +export {default as WebMercatorViewport} from './viewports/web-mercator-viewport'; +export {default as _GlobeViewport} from './viewports/globe-viewport'; +export {default as OrbitViewport} from './viewports/orbit-viewport'; +export {default as OrthographicViewport} from './viewports/orthographic-viewport'; +export {default as FirstPersonViewport} from './viewports/first-person-viewport'; +export {picking, project, project32, gouraudLighting, phongLighting, shadow} from './shaderlib'; +export {default as View} from './views/view'; +export {default as MapView} from './views/map-view'; +export {default as FirstPersonView} from './views/first-person-view'; +export {default as OrbitView} from './views/orbit-view'; +export {default as OrthographicView} from './views/orthographic-view'; +export {default as _GlobeView} from './views/globe-view'; +export {default as Controller} from './controllers/controller'; +export {default as MapController} from './controllers/map-controller'; +export {default as _GlobeController} from './controllers/globe-controller'; +export {default as FirstPersonController} from './controllers/first-person-controller'; +export {default as OrbitController} from './controllers/orbit-controller'; +export {default as OrthographicController} from './controllers/orthographic-controller'; +export {default as LayerExtension} from './lib/layer-extension'; +export {TRANSITION_EVENTS} from './controllers/transition-manager'; +export {default as TransitionInterpolator} from './transitions/transition-interpolator'; +export {default as LinearInterpolator} from './transitions/linear-interpolator'; +export {default as FlyToInterpolator} from './transitions/fly-to-interpolator'; +export {default as log} from './utils/log'; +export {default as assert} from './utils/assert'; +export {createIterable} from './utils/iterable-utils'; +export {fp64LowPart} from './utils/math-utils'; +export {default as Tesselator} from './utils/tesselator'; +export {fillArray as _fillArray, flatten as _flatten} from './utils/flatten'; +export {count as _count} from './utils/count'; +export {default as _memoize} from './utils/memoize'; +export {mergeShaders as _mergeShaders} from './utils/shader'; +export {compareProps as _compareProps} from './lifecycle/props'; +export type {CoordinateSystem} from './lib/constants'; +export type {MapViewState} from './views/map-view'; +export type {FirstPersonViewState} from './views/first-person-view'; +export type {OrbitViewState} from './views/orbit-view'; +export type {OrthographicViewState} from './views/orthographic-view'; +export type {GlobeViewState} from './views/globe-view'; +export type {ChangeFlags} from './lib/layer-state'; +export type {LayersList} from './lib/layer-manager'; +export type {LayerContext} from './lib/layer-manager'; +export type {UpdateParameters} from './lib/layer'; +export type {DeckProps} from './lib/deck'; +export type { + LayerProps, + CompositeLayerProps, + Accessor, + AccessorFunction, + LayerData, + Unit, + Position, + Color, + Texture, + Material +} from './types/layer-props'; +export type {FilterContext} from './passes/layers-pass'; +export type {PickingInfo, GetPickingInfoParams} from './lib/picking/pick-info'; +export type {ConstructorOf as _ConstructorOf, ShaderModule as _ShaderModule} from './types/types'; +export type {BinaryAttribute} from './lib/attribute/attribute'; +export type {Effect} from './lib/effect'; +export type {PickingUniforms, ProjectUniforms} from './shaderlib'; +export type {DefaultProps} from './lifecycle/prop-types'; +// # sourceMappingURL=index.d.ts.map diff --git a/modules/core/typed/index.d.ts.map b/modules/core/typed/index.d.ts.map new file mode 100644 index 00000000000..d0d9421299f --- /dev/null +++ b/modules/core/typed/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAsBA,OAAO,YAAY,CAAC;AAGpB,OAAO,aAAa,CAAC;AAGrB,OAAO,EAAC,iBAAiB,EAAE,SAAS,EAAE,IAAI,EAAC,MAAM,iBAAiB,CAAC;AAGnE,OAAO,EAAC,OAAO,IAAI,cAAc,EAAC,MAAM,oCAAoC,CAAC;AAC7E,OAAO,EAAC,YAAY,EAAC,MAAM,kCAAkC,CAAC;AAC9D,OAAO,EAAC,gBAAgB,EAAC,MAAM,sCAAsC,CAAC;AACtE,OAAO,EAAC,UAAU,EAAC,M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AC/E,YAAY,EAAC,aAAa,IAAI,cAAc,EAAE,YAAY,IAAI,aAAa,EAAC,MAAM,eAAe,CAAC;AAClG,YAAY,EAAC,eAAe,EAAC,MAAM,2BAA2B,CAAC;AAC/D,YAAY,EAAC,MAAM,EAAC,MAAM,cAAc,CAAC;AACzC,YAAY,EAAC,eAAe,EAAE,eAAe,EAAC,MAAM,aAAa,CAAC;AAClE,YAAY,EAAC,YAAY,EAAC,MAAM,wBAAwB,CAAC"} \ No newline at end of file diff --git a/modules/core/typed/lib/attribute/attribute-manager.d.ts b/modules/core/typed/lib/attribute/attribute-manager.d.ts new file mode 100644 index 00000000000..ae7e1d602ec --- /dev/null +++ b/modules/core/typed/lib/attribute/attribute-manager.d.ts @@ -0,0 +1,126 @@ +import Attribute, {AttributeOptions} from './attribute'; +import {IShaderAttribute} from './shader-attribute'; +import {NumericArray} from '../../types/types'; +import type {Device} from '@luma.gl/api'; +import type {Stats} from 'probe.gl'; +import type {Timeline} from '@luma.gl/engine'; +export default class AttributeManager { + /** + * @classdesc + * Automated attribute generation and management. Suitable when a set of + * vertex shader attributes are generated by iteration over a data array, + * and updates to these attributes are needed either when the data itself + * changes, or when other data relevant to the calculations change. + * + * - First the application registers descriptions of its dynamic vertex + * attributes using AttributeManager.add(). + * - Then, when any change that affects attributes is detected by the + * application, the app will call AttributeManager.invalidate(). + * - Finally before it renders, it calls AttributeManager.update() to + * ensure that attributes are automatically rebuilt if anything has been + * invalidated. + * + * The application provided update functions describe how attributes + * should be updated from a data array and are expected to traverse + * that data array (or iterable) and fill in the attribute's typed array. + * + * Note that the attribute manager intentionally does not do advanced + * change detection, but instead makes it easy to build such detection + * by offering the ability to "invalidate" each attribute separately. + */ + id: string; + device: Device; + attributes: Record; + updateTriggers: { + [name: string]: string[]; + }; + needsRedraw: string | boolean; + userData: any; + private stats?; + private attributeTransitionManager; + constructor( + device: Device, + { + id, + stats, + timeline + }?: { + id?: string; + stats?: Stats; + timeline?: Timeline; + } + ); + finalize(): void; + getNeedsRedraw(opts?: {clearRedrawFlags?: boolean}): string | false; + setNeedsRedraw(): void; + add(attributes: {[id: string]: AttributeOptions}): void; + addInstanced(attributes: {[id: string]: AttributeOptions}): void; + /** + * Removes attributes + * Takes an array of attribute names and delete them from + * the attribute map if they exists + * + * @example + * attributeManager.remove(['position']); + * + * @param {Object} attributeNameArray - attribute name array (see above) + */ + remove(attributeNameArray: string[]): void; + invalidate( + triggerName: string, + dataRange?: { + startRow?: number; + endRow?: number; + } + ): void; + invalidateAll(dataRange?: {startRow?: number; endRow?: number}): void; + /** Ensure all attribute buffers are updated from props or data. */ + update({ + data, + numInstances, + startIndices, + transitions, + props, + buffers, + context + }: { + data: any; + numInstances: number; + startIndices?: NumericArray | null; + transitions: any; + props: any; + buffers: any; + context: any; + }): void; + updateTransition(): boolean; + /** + * Returns all attribute descriptors + * Note: Format matches luma.gl Model/Program.setAttributes() + * @return {Object} attributes - descriptors + */ + getAttributes(): { + [id: string]: Attribute; + }; + /** + * Returns changed attribute descriptors + * This indicates which WebGLBuffers need to be updated + * @return {Object} attributes - descriptors + */ + getChangedAttributes(opts?: {clearChangedFlags?: boolean}): { + [id: string]: Attribute; + }; + getShaderAttributes( + attributes?: { + [id: string]: Attribute; + }, + excludeAttributes?: Record + ): { + [id: string]: IShaderAttribute; + }; + private _add; + private _createAttribute; + private _mapUpdateTriggersToAttributes; + private _invalidateTrigger; + private _updateAttribute; +} +// # sourceMappingURL=attribute-manager.d.ts.map diff --git a/modules/core/typed/lib/attribute/attribute-manager.d.ts.map b/modules/core/typed/lib/attribute/attribute-manager.d.ts.map new file mode 100644 index 00000000000..6cc0e851fa0 --- /dev/null +++ b/modules/core/typed/lib/attribute/attribute-manager.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"attribute-manager.d.ts","sourceRoot":"","sources":["../../../src/lib/attribute/attribute-manager.ts"],"names":[],"mappings":"AAqBA,OAAO,SAAS,EAAE,EAAC,gBAAgB,EAAC,MAAM,aAAa,CAAC;A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O,CAAC,gBAAgB;CA4BzB"} \ No newline at end of file diff --git a/modules/core/typed/lib/attribute/attribute-transition-manager.d.ts b/modules/core/typed/lib/attribute/attribute-transition-manager.d.ts new file mode 100644 index 00000000000..6c2a156b8d2 --- /dev/null +++ b/modules/core/typed/lib/attribute/attribute-transition-manager.d.ts @@ -0,0 +1,42 @@ +import type {Device} from '@luma.gl/api'; +import type Attribute from './attribute'; +import type {Timeline} from '@luma.gl/engine'; +export default class AttributeTransitionManager { + id: string; + isSupported: boolean; + private device; + private timeline?; + private transitions; + private needsRedraw; + private numInstances; + constructor( + device: Device, + { + id, + timeline + }: { + id: string; + timeline?: Timeline; + } + ); + finalize(): void; + update({ + attributes, + transitions, + numInstances + }: { + attributes: { + [id: string]: Attribute; + }; + transitions: any; + numInstances: number; + }): void; + hasAttribute(attributeName: string): boolean; + getAttributes(): { + [id: string]: Attribute; + }; + run(): boolean; + private _removeTransition; + private _updateAttribute; +} +// # sourceMappingURL=attribute-transition-manager.d.ts.map diff --git a/modules/core/typed/lib/attribute/attribute-transition-manager.d.ts.map b/modules/core/typed/lib/attribute/attribute-transition-manager.d.ts.map new file mode 100644 index 00000000000..77b4e8103cc --- /dev/null +++ b/modules/core/typed/lib/attribute/attribute-transition-manager.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"attribute-transition-manager.d.ts","sourceRoot":"","sources":["../../../src/lib/attribute/attribute-transition-manager.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,cAAc,CAAC;AAOzC,OAAO,KAAK,SAAS,MAAM,aAAa,CAAC;AACzC,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,iBAAiB,CAAC;AAS9C,MAAM,CAAC,OAAO,OAAO,0BAA0B;IAC7C,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,OAAO,CAAC;IAErB,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,QAAQ,CAAC,CAAW;IAE5B,OAAO,CAAC,WAAW,CAAgC;IACnD,OAAO,CAAC,WAAW,CAAU;IAC7B,OAAO,CAAC,YAAY,CAAS;gBAG3B,MAAM,EAAE,MAAM,EACd,EACE,EAAE,EACF,QAAQ,EACT,EAAE;QACD,EAAE,EAAE,MAAM,CAAC;QACX,QAAQ,CAAC,EAAE,QAAQ,CAAC;KACrB;IAYH,QAAQ,IAAI,IAAI;IAUhB,MAAM,CAAC,EACL,UAAU,EACV,WAAW,EACX,YAAY,EACb,EAAE;QACD,UAAU,EAAE;YAAC,CAAC,EAAE,EAAE,MAAM,GAAG,SAAS,CAAA;SAAC,CAAC;QACtC,WAAW,EAAE,GAAG,CAAC;QACjB,YAAY,EAAE,MAAM,CAAC;KACtB,GAAG,IAAI;IAuBR,YAAY,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO;IAM5C,aAAa,IAAI;QAAC,CAAC,EAAE,EAAE,MAAM,GAAG,SAAS,CAAA;KAAC;IAgB1C,GAAG,IAAI,OAAO;IAmBd,OAAO,CAAC,iBAAiB;IAOzB,OAAO,CAAC,gBAAgB;CA0CzB"} \ No newline at end of file diff --git a/modules/core/typed/lib/attribute/attribute-transition-utils.d.ts b/modules/core/typed/lib/attribute/attribute-transition-utils.d.ts new file mode 100644 index 00000000000..77f527e75d4 --- /dev/null +++ b/modules/core/typed/lib/attribute/attribute-transition-utils.d.ts @@ -0,0 +1,60 @@ +import type {Device} from '@luma.gl/api'; +import {NumericArray} from '../../types/types'; +import Attribute from './attribute'; +import type {BufferAccessor} from './data-column'; +import type {Buffer} from '@luma.gl/webgl-legacy'; +export interface TransitionSettings { + type: string; + /** Callback to get the value that the entering vertices are transitioning from. */ + enter?: (toValue: NumericArray, chunk?: NumericArray) => NumericArray; + /** Callback when the transition is started */ + onStart?: () => void; + /** Callback when the transition is done */ + onEnd?: () => void; + /** Callback when the transition is interrupted */ + onInterrupt?: () => void; +} +export declare type InterpolationTransitionSettings = TransitionSettings & { + type?: 'interpolation'; + /** Duration of the transition animation, in milliseconds */ + duration: number; + /** Easing function that maps a value from [0, 1] to [0, 1], see [http://easings.net/](http://easings.net/) */ + easing?: (t: number) => number; +}; +export declare type SpringTransitionSettings = TransitionSettings & { + type: 'spring'; + /** "Tension" factor for the spring */ + stiffness: number; + /** "Friction" factor that counteracts the spring's acceleration */ + damping: number; +}; +export declare function normalizeTransitionSettings( + userSettings: number | InterpolationTransitionSettings | SpringTransitionSettings, + layerSettings?: boolean | Partial +): TransitionSettings | null; +export declare function getSourceBufferAttribute( + device: Device, + attribute: Attribute +): [Buffer, BufferAccessor] | NumericArray; +export declare function getAttributeTypeFromSize(size: number): string; +export declare function cycleBuffers(buffers: Buffer[]): void; +export declare function getAttributeBufferLength( + attribute: Attribute, + numInstances: number +): number; +export declare function padBuffer({ + buffer, + numInstances, + attribute, + fromLength, + fromStartIndices, + getData +}: { + buffer: Buffer; + numInstances: number; + attribute: Attribute; + fromLength: number; + fromStartIndices?: NumericArray | null; + getData?: (toValue: NumericArray, chunk?: NumericArray) => NumericArray; +}): void; +// # sourceMappingURL=attribute-transition-utils.d.ts.map diff --git a/modules/core/typed/lib/attribute/attribute-transition-utils.d.ts.map b/modules/core/typed/lib/attribute/attribute-transition-utils.d.ts.map new file mode 100644 index 00000000000..b315e44a96c --- /dev/null +++ b/modules/core/typed/lib/attribute/attribute-transition-utils.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"attribute-transition-utils.d.ts","sourceRoot":"","sources":["../../../src/lib/attribute/attribute-transition-utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,cAAc,CAAC;AAEzC,OAAO,EAAC,YAAY,EAAC,MAAM,mBAAmB,CAAC;AAC/C,OAAO,SAAS,MAAM,aAAa,CAAC;AACpC,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,eAAe,CAAC;AAClD,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,uBAAuB,CAAC;AAElD,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,M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CAAC,EACxB,MAAM,EACN,YAAY,EACZ,SAAS,EACT,UAAU,EACV,gBAAgB,EAChB,OAAgB,EACjB,EAAE;IACD,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,SAAS,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,gBAAgB,CAAC,EAAE,YAAY,GAAG,IAAI,CAAC;IACvC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,YAAY,EAAE,KAAK,CAAC,EAAE,YAAY,KAAK,YAAY,CAAC;CACzE,GAAG,IAAI,CA6CP"} \ No newline at end of file diff --git a/modules/core/typed/lib/attribute/attribute.d.ts b/modules/core/typed/lib/attribute/attribute.d.ts new file mode 100644 index 00000000000..d975c7b6125 --- /dev/null +++ b/modules/core/typed/lib/attribute/attribute.d.ts @@ -0,0 +1,99 @@ +import DataColumn, {DataColumnOptions, ShaderAttributeOptions, BufferAccessor} from './data-column'; +import {IShaderAttribute} from './shader-attribute'; +import {TransitionSettings} from './attribute-transition-utils'; +import type {Device} from '@luma.gl/api'; +import type {Buffer} from '@luma.gl/webgl-legacy'; +import type {NumericArray, TypedArray} from '../../types/types'; +export declare type Accessor = ( + object: DataType, + context: { + data: any; + index: number; + target: number[]; + } +) => ReturnType; +export declare type Updater = ( + attribute: Attribute, + { + data, + startRow, + endRow, + props, + numInstances + }: { + data: any; + startRow: number; + endRow: number; + props: any; + numInstances: number; + } +) => void; +export declare type AttributeOptions = DataColumnOptions<{ + transition?: boolean | Partial; + noAlloc?: boolean; + update?: Updater; + accessor?: Accessor | string | string[]; + transform?: (value: any) => any; + shaderAttributes?: Record>; +}>; +export declare type BinaryAttribute = Partial & { + value?: TypedArray; + buffer?: Buffer; +}; +declare type AttributeInternalState = { + startIndices: NumericArray | null; + /** Legacy: external binary supplied via attribute name */ + lastExternalBuffer: TypedArray | Buffer | BinaryAttribute | null; + /** External binary supplied via accessor name */ + binaryValue: TypedArray | Buffer | BinaryAttribute | null; + binaryAccessor: Accessor | null; + needsUpdate: string | boolean; + needsRedraw: string | boolean; + updateRanges: number[][]; +}; +export default class Attribute extends DataColumn { + /** Legacy approach to set attribute value - read `isConstant` instead for attribute state */ + constant: boolean; + constructor(device: Device, opts: AttributeOptions); + get startIndices(): NumericArray | null; + set startIndices(layout: NumericArray | null); + needsUpdate(): string | boolean; + needsRedraw({clearChangedFlags}?: {clearChangedFlags?: boolean}): string | boolean; + getUpdateTriggers(): string[]; + supportsTransition(): boolean; + getTransitionSetting(opts: Record): TransitionSettings | null; + setNeedsUpdate( + reason?: string, + dataRange?: { + startRow?: number; + endRow?: number; + } + ): void; + clearNeedsUpdate(): void; + setNeedsRedraw(reason?: string): void; + allocate(numInstances: number): boolean; + updateBuffer({ + numInstances, + data, + props, + context + }: { + numInstances: number; + data: any; + props: any; + context: any; + }): boolean; + setConstantValue(value?: NumericArray): boolean; + setExternalBuffer(buffer?: TypedArray | Buffer | BinaryAttribute): boolean; + setBinaryValue( + buffer?: TypedArray | Buffer | BinaryAttribute, + startIndices?: NumericArray | null + ): boolean; + getVertexOffset(row: number): number; + getShaderAttributes(): Record; + private _autoUpdater; + private _validateAttributeUpdaters; + private _checkAttributeArray; +} +export {}; +// # sourceMappingURL=attribute.d.ts.map diff --git a/modules/core/typed/lib/attribute/attribute.d.ts.map b/modules/core/typed/lib/attribute/attribute.d.ts.map new file mode 100644 index 00000000000..a9fd369686f --- /dev/null +++ b/modules/core/typed/lib/attribute/attribute.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"attribute.d.ts","sourceRoot":"","sources":["../../../src/lib/attribute/attribute.ts"],"names":[],"mappings":"AACA,OAAO,UAAU,EAAE,EAAC,iBAAiB,EAAE,sBAAsB,EAAE,cAAc,EAAC,MAAM,eAAe,CAAC;AACpG,OAAO,EAAC,gBAAgB,EAAC,MAAM,oBAAoB,CAAC;AAKpD,OAAO,EAA8B,kBAAkB,EAAC,MAAM,8BAA8B,CAAC;AAC7F,OAAO,KA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,GAAG,IAAI;IAWhG,gBAAgB,IAAI,IAAI;IAKxB,cAAc,CAAC,MAAM,GAAE,MAAgB,GAAG,IAAI;IAI9C,QAAQ,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO;IAgBvC,YAAY,CAAC,EACX,YAAY,EACZ,IAAI,EACJ,KAAK,EACL,OAAO,EACR,EAAE;QACD,YAAY,EAAE,MAAM,CAAC;QACrB,IAAI,EAAE,GAAG,CAAC;QACV,KAAK,EAAE,GAAG,CAAC;QACX,OAAO,EAAE,GAAG,CAAC;KACd,GAAG,OAAO;IAsDX,gBAAgB,CAAC,KAAK,CAAC,EAAE,YAAY,GAAG,OAAO;IAiB/C,iBAAiB,CAAC,MAAM,CAAC,EAAE,UAAU,GAAG,MAAM,GAAG,eAAe,GAAG,OAAO;IAsB1E,cAAc,CACZ,MAAM,CAAC,EAAE,UAAU,GAAG,MAAM,GAAG,eAAe,EAC9C,YAAY,GAAE,YAAY,GAAG,IAAW,GACvC,OAAO;IA+CV,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM;IAMpC,mBAAmB,IAAI,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC;IAevD,OAAO,CAAC,YAAY;IAyEpB,OAAO,CAAC,0BAA0B;IAYlC,OAAO,CAAC,oBAAoB;CAyB7B"} \ No newline at end of file diff --git a/modules/core/typed/lib/attribute/data-column.d.ts b/modules/core/typed/lib/attribute/data-column.d.ts new file mode 100644 index 00000000000..892b7c53dd5 --- /dev/null +++ b/modules/core/typed/lib/attribute/data-column.d.ts @@ -0,0 +1,93 @@ +import type {Device} from '@luma.gl/api'; +import type {Buffer as LumaBuffer} from '@luma.gl/webgl-legacy'; +import {IShaderAttribute} from './shader-attribute'; +import type {TypedArray, NumericArray, TypedArrayConstructor} from '../../types/types'; +export declare type BufferAccessor = { + /** A WebGL data type, see [vertexAttribPointer](https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/vertexAttribPointer#parameters). */ + type?: number; + /** The number of elements per vertex attribute. */ + size?: number; + /** 1 if instanced. */ + divisor?: number; + /** Offset of the first vertex attribute into the buffer, in bytes. */ + offset?: number; + /** The offset between the beginning of consecutive vertex attributes, in bytes. */ + stride?: number; + /** Whether data values should be normalized. Note that all color attributes in deck.gl layers are normalized by default. */ + normalized?: boolean; + integer?: boolean; +}; +export declare type ShaderAttributeOptions = Partial & { + offset: number; + stride: number; + vertexOffset?: number; + elementOffset?: number; +}; +export declare type DataColumnOptions = Options & + BufferAccessor & { + id?: string; + vertexOffset?: number; + fp64?: boolean; + logicalType?: number; + isIndexed?: boolean; + defaultValue?: number | number[]; + }; +declare type DataColumnSettings = DataColumnOptions & { + type: number; + size: number; + logicalType?: number; + bytesPerElement: number; + defaultValue: number[]; + defaultType: TypedArrayConstructor; +}; +declare type DataColumnInternalState = State & { + externalBuffer: LumaBuffer | null; + bufferAccessor: DataColumnSettings; + allocatedValue: TypedArray | null; + numInstances: number; + bounds: [number[], number[]] | null; + constant: boolean; +}; +export default class DataColumn implements IShaderAttribute { + device: Device; + id: string; + size: number; + settings: DataColumnSettings; + value: NumericArray | null; + doublePrecision: boolean; + protected _buffer: LumaBuffer | null; + protected state: DataColumnInternalState; + constructor(device: Device, opts: DataColumnOptions, state: State); + get isConstant(): boolean; + get buffer(): LumaBuffer; + get byteOffset(): number; + get numInstances(): number; + set numInstances(n: number); + delete(): void; + getShaderAttributes( + id: string, + options: Partial | null + ): Record; + getBuffer(): LumaBuffer | null; + getValue(): [LumaBuffer, BufferAccessor] | NumericArray | null; + getAccessor(): DataColumnSettings; + getBounds(): [number[], number[]] | null; + setData( + data: + | TypedArray + | LumaBuffer + | ({ + constant?: boolean; + value?: NumericArray; + buffer?: LumaBuffer; + } & Partial) + ): boolean; + updateSubBuffer(opts?: {startOffset?: number; endOffset?: number}): void; + allocate(numInstances: number, copy?: boolean): boolean; + protected _checkExternalBuffer(opts: {value?: NumericArray; normalized?: boolean}): void; + normalizeConstant(value: NumericArray): NumericArray; + protected _normalizeValue(value: any, out: NumericArray, start: number): NumericArray; + protected _areValuesEqual(value1: any, value2: any): boolean; +} +export {}; +// # sourceMappingURL=data-column.d.ts.map diff --git a/modules/core/typed/lib/attribute/data-column.d.ts.map b/modules/core/typed/lib/attribute/data-column.d.ts.map new file mode 100644 index 00000000000..d8ec1bd4cb9 --- /dev/null +++ b/modules/core/typed/lib/attribute/data-column.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"data-column.d.ts","sourceRoot":"","sources":["../../../src/lib/attribute/data-column.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,cAAc,CAAC;AACzC,OAAO,KAAK,EAAC,MAAM,IAAI,UAAU,EAAC,MAAM,uBAAuB,CAAC;AAGhE,OAAwB,EAAC,gBAAgB,EAAC,MAAM,oBAAoB,CAAC;AAMrE,OAAO,KAAK,EAAC,UAAU,EAAE,YAAY,EAAE,qBAAqB,EAAC,MAAM,mBAAmB,CAAC;AAEvF,oBAAY,cAAc,GAAG;IAC3B,2JAA2J;IAC3J,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,mDAAmD;IACnD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,sBAAsB;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,sEAAsE;IACtE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,mFAAmF;IACnF,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,4HAA4H;IAC5H,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,oBAAY,sBAAsB,GAAG,OAAO,CAAC,cAAc,CAAC,GAAG;IAC7D,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC;AAyDF,oBAAY,iBAAiB,CAAC,OAAO,IAAI,OAAO,GAC9C,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CAAC,EAAE,YAAY,CAAC;QAAC,UAAU,CAAC,EAAE,OAAO,CAAA;KAAC,GAAG,IAAI;IAqBxF,iBAAiB,CAAC,KAAK,EAAE,YAAY,GAAG,YAAY;IAyBpD,SAAS,CAAC,eAAe,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,GAAG,YAAY;IAqCrF,SAAS,CAAC,eAAe,CAAC,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,GAAG,OAAO;CAY7D"} \ No newline at end of file diff --git a/modules/core/typed/lib/attribute/gl-utils.d.ts b/modules/core/typed/lib/attribute/gl-utils.d.ts new file mode 100644 index 00000000000..50092c5eb35 --- /dev/null +++ b/modules/core/typed/lib/attribute/gl-utils.d.ts @@ -0,0 +1,3 @@ +import type {TypedArrayConstructor} from '../../types/types'; +export declare function glArrayFromType(glType: number): TypedArrayConstructor; +// # sourceMappingURL=gl-utils.d.ts.map diff --git a/modules/core/typed/lib/attribute/gl-utils.d.ts.map b/modules/core/typed/lib/attribute/gl-utils.d.ts.map new file mode 100644 index 00000000000..6f7f40cdc6a --- /dev/null +++ b/modules/core/typed/lib/attribute/gl-utils.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"gl-utils.d.ts","sourceRoot":"","sources":["../../../src/lib/attribute/gl-utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,qBAAqB,EAAC,MAAM,mBAAmB,CAAC;AAG7D,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,qBAAqB,CAyBrE"} \ No newline at end of file diff --git a/modules/core/typed/lib/attribute/shader-attribute.d.ts b/modules/core/typed/lib/attribute/shader-attribute.d.ts new file mode 100644 index 00000000000..01bf457d0c2 --- /dev/null +++ b/modules/core/typed/lib/attribute/shader-attribute.d.ts @@ -0,0 +1,17 @@ +import type DataColumn from './data-column'; +import type {BufferAccessor, ShaderAttributeOptions} from './data-column'; +import type {Buffer} from '@luma.gl/webgl-legacy'; +import type {NumericArray} from '../../types/types'; +export interface IShaderAttribute { + value: NumericArray | null; + getValue(): [Buffer, BufferAccessor] | NumericArray | null; +} +export default class ShaderAttribute implements IShaderAttribute { + opts: ShaderAttributeOptions; + source: DataColumn; + constructor(dataColumn: DataColumn, opts: ShaderAttributeOptions); + get value(): NumericArray | null; + getValue(): [Buffer, BufferAccessor] | NumericArray | null; + getAccessor(): any; +} +// # sourceMappingURL=shader-attribute.d.ts.map diff --git a/modules/core/typed/lib/attribute/shader-attribute.d.ts.map b/modules/core/typed/lib/attribute/shader-attribute.d.ts.map new file mode 100644 index 00000000000..308b5405d6c --- /dev/null +++ b/modules/core/typed/lib/attribute/shader-attribute.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"shader-attribute.d.ts","sourceRoot":"","sources":["../../../src/lib/attribute/shader-attribute.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,UAAU,MAAM,eAAe,CAAC;AAC5C,OAAO,KAAK,EAAC,cAAc,EAAE,sBAAsB,EAAC,MAAM,eAAe,CAAC;AAC1E,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,uBAAuB,CAAC;AAClD,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,mBAAmB,CAAC;AAEpD,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,YAAY,GAAG,IAAI,CAAC;IAC3B,QAAQ,IAAI,CAAC,MAAM,EAAE,cAAc,CAAC,GAAG,YAAY,GAAG,IAAI,CAAC;CAC5D;AAGD,MAAM,CAAC,OAAO,OAAO,eAAgB,YAAW,gBAAgB;IAC9D,IAAI,EAAE,sBAAsB,CAAC;IAC7B,MAAM,EAAE,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;gBAEjB,UAAU,EAAE,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,IAAI,EAAE,sBAAsB;IAM1E,IAAI,KAAK,IAAI,YAAY,GAAG,IAAI,CAE/B;IAED,QAAQ,IAAI,CAAC,MAAM,EAAE,cAAc,CAAC,GAAG,YAAY,GAAG,IAAI;IAuB1D,WAAW;CAQZ"} \ No newline at end of file diff --git a/modules/core/typed/lib/composite-layer.d.ts b/modules/core/typed/lib/composite-layer.d.ts new file mode 100644 index 00000000000..ce2d0f2cd8a --- /dev/null +++ b/modules/core/typed/lib/composite-layer.d.ts @@ -0,0 +1,57 @@ +import Layer, {UpdateParameters} from './layer'; +import type AttributeManager from './attribute/attribute-manager'; +import type {PickingInfo, GetPickingInfoParams} from './picking/pick-info'; +import type {FilterContext} from '../passes/layers-pass'; +import type {LayersList, LayerContext} from './layer-manager'; +import type {CompositeLayerProps, Accessor} from '../types/layer-props'; +import {ConstructorOf} from '../types/types'; +export default abstract class CompositeLayer extends Layer< + PropsT & Required +> { + static layerName: string; + /** `true` if this layer renders other layers */ + get isComposite(): boolean; + /** Returns true if all async resources are loaded */ + get isLoaded(): boolean; + /** Return last rendered sub layers */ + getSubLayers(): Layer[]; + initializeState(context: LayerContext): void; + /** Updates selected state members and marks the composite layer to need rerender */ + setState(updateObject: any): void; + /** called to augment the info object that is bubbled up from a sublayer + override Layer.getPickingInfo() because decoding / setting uniform do + not apply to a composite layer. */ + getPickingInfo({info}: GetPickingInfoParams): PickingInfo; + abstract renderLayers(): Layer | null | LayersList; + /** + * Filters sub layers at draw time. Return true if the sub layer should be drawn. + */ + filterSubLayer(context: FilterContext): boolean; + /** Returns true if sub layer needs to be rendered */ + protected shouldRenderSubLayer(subLayerId: string, data: any): boolean; + /** Returns sub layer class for a specific sublayer */ + protected getSubLayerClass( + subLayerId: string, + DefaultLayerClass: ConstructorOf + ): ConstructorOf; + /** When casting user data into another format to pass to sublayers, + add reference to the original object and object index */ + protected getSubLayerRow(row: T, sourceObject: any, sourceObjectIndex: number): T; + /** Some composite layers cast user data into another format before passing to sublayers + We need to unwrap them before calling the accessor so that they see the original data + objects */ + protected getSubLayerAccessor(accessor: Accessor): Accessor; + /** Returns sub layer props for a specific sublayer */ + protected getSubLayerProps(sublayerProps?: { + id?: string; + updateTriggers?: Record; + [propName: string]: any; + }): any; + /** Update sub layers to highlight the hovered object */ + protected _updateAutoHighlight(info: PickingInfo): void; + /** Override base Layer method */ + protected _getAttributeManager(): AttributeManager | null; + /** (Internal) Called after an update to rerender sub layers */ + protected _postUpdate(updateParams: UpdateParameters, forceUpdate: boolean): void; +} +// # sourceMappingURL=composite-layer.d.ts.map diff --git a/modules/core/typed/lib/composite-layer.d.ts.map b/modules/core/typed/lib/composite-layer.d.ts.map new file mode 100644 index 00000000000..0290b33afc2 --- /dev/null +++ b/modules/core/typed/lib/composite-layer.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"composite-layer.d.ts","sourceRoot":"","sources":["../../src/lib/composite-layer.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,EAAC,gBAAgB,EAAC,MAAM,SAAS,CAAC;AAIhD,OAAO,KAAK,gBAAgB,MAAM,+BAA+B,CAAC;AAClE,OAAO,KAAK,EAAC,WAAW,EAAE,oBAAoB,EAAC,MAAM,qBAAqB,CAAC;AAC3E,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,uBAAuB,CAAC;AACzD,OAAO,KAAK,EAAC,UAAU,EAAE,YAAY,EAAC,MAAM,iBAAiB,CAAC;AAC9D,OAAO,KAAK,EAAC,mBAAmB,EAAE,QAAQ,EAAkB,MAAM,sBAAsB,CAAC;AACzF,OAAO,EAAC,aAAa,EAAC,MAAM,gBAAgB,CAAC;AAI7C,MAAM,CAAC,OAAO,CAAC,QAAQ,OAAO,cAAc,CAAC,MAAM,GAAG,EAAE,CAAE,SAAQ,KAAK,CACrE,MAAM,GAAG,QAAQ,CAAC,mBAAmB,CAAC,CACvC;IACC,MAAM,CAAC,SAAS,EAAE,MAAM,CAAoB;IAE5C,gDAAgD;IAChD,IAAI,WAAW,IAAI,OAAO,CAEzB;IAED,qDAAqD;IACrD,IAAI,QAAQ,IAAI,OAAO,CAEtB;IAED,sCAAsC;IACtC,YAAY,IA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C,SAAS,CAAC,oBAAoB,IAAI,gBAAgB,GAAG,IAAI;IAIzD,+DAA+D;IAC/D,SAAS,CAAC,WAAW,CAAC,YAAY,EAAE,gBAAgB,CAAC,IAAI,CAAC,EAAE,WAAW,EAAE,OAAO;CAqBjF"} \ No newline at end of file diff --git a/modules/core/typed/lib/constants.d.ts b/modules/core/typed/lib/constants.d.ts new file mode 100644 index 00000000000..5b8733e91a4 --- /dev/null +++ b/modules/core/typed/lib/constants.d.ts @@ -0,0 +1,79 @@ +/** + * The coordinate system that positions/dimensions are defined in. + */ +export declare const COORDINATE_SYSTEM: { + /** + * `LNGLAT` if rendering into a geospatial viewport, `CARTESIAN` otherwise + */ + readonly DEFAULT: -1; + /** + * Positions are interpreted as [longitude, latitude, elevation] + * longitude/latitude are in degrees, elevation is in meters. + * Dimensions are in meters. + */ + readonly LNGLAT: 1; + /** + * Positions are interpreted as [x, y, z] in meter offsets from the coordinate origin. + * Dimensions are in meters. + */ + readonly METER_OFFSETS: 2; + /** + * Positions are interpreted as [deltaLng, deltaLat, elevation] from the coordinate origin. + * deltaLng/deltaLat are in degrees, elevation is in meters. + * Dimensions are in meters. + */ + readonly LNGLAT_OFFSETS: 3; + /** + * Positions and dimensions are in the common units of the viewport. + */ + readonly CARTESIAN: 0; +}; +export declare type CoordinateSystem = -1 | 0 | 1 | 2 | 3; +/** + * How coordinates are transformed from the world space into the common space. + */ +export declare const PROJECTION_MODE: { + /** + * Render geospatial data in Web Mercator projection + */ + readonly WEB_MERCATOR: 1; + /** + * Render geospatial data as a 3D globe + */ + readonly GLOBE: 2; + /** + * (Internal use only) Web Mercator projection at high zoom + */ + readonly WEB_MERCATOR_AUTO_OFFSET: 4; + /** + * No transformation + */ + readonly IDENTITY: 0; +}; +export declare const UNIT: { + readonly common: 0; + readonly meters: 1; + readonly pixels: 2; +}; +export declare const EVENTS: { + readonly click: { + readonly handler: 'onClick'; + }; + readonly panstart: { + readonly handler: 'onDragStart'; + }; + readonly panmove: { + readonly handler: 'onDrag'; + }; + readonly panend: { + readonly handler: 'onDragEnd'; + }; +}; +/** + * The rendering operation to perform with a layer, used in the `operation` prop + */ +export declare const OPERATION: { + readonly DRAW: 'draw'; + readonly MASK: 'mask'; +}; +// # sourceMappingURL=constants.d.ts.map diff --git a/modules/core/typed/lib/constants.d.ts.map b/modules/core/typed/lib/constants.d.ts.map new file mode 100644 index 00000000000..7eb0b862101 --- /dev/null +++ b/modules/core/typed/lib/constants.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/lib/constants.ts"],"names":[],"mappings":"AAyBA;;GAEG;AACH,eAAO,MAAM,iBAAiB;IAC5B;;OAEG;;IAEH;;;;OAIG;;IAGH;;;OAGG;;IAGH;;;;OAIG;;IAGH;;OAEG;;CAEK,CAAC;AAGX,oBAAY,gBAAgB,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAYlD;;GAEG;AACH,eAAO,MAAM,eAAe;IAC1B;;OAEG;;IAEH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;CAEK,CAAC;AAEX,eAAO,MAAM,IAAI;;;;CAIP,CAAC;AAEX,eAAO,MAAM,MAAM;;;;;;;;;;;;;CAKT,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,SAAS;;;CAGZ,CAAC"} \ No newline at end of file diff --git a/modules/core/typed/lib/deck-picker.d.ts b/modules/core/typed/lib/deck-picker.d.ts new file mode 100644 index 00000000000..5a4bfc55ab4 --- /dev/null +++ b/modules/core/typed/lib/deck-picker.d.ts @@ -0,0 +1,166 @@ +import type {Device} from '@luma.gl/api'; +import PickLayersPass, {PickingColorDecoder} from '../passes/pick-layers-pass'; +import {PickingInfo} from './picking/pick-info'; +import type {Framebuffer as LumaFramebuffer} from '@luma.gl/webgl-legacy'; +import type {FilterContext, Rect} from '../passes/layers-pass'; +import type Layer from './layer'; +import type {Effect} from './effect'; +import type View from '../views/view'; +import type Viewport from '../viewports/viewport'; +export declare type PickByPointOptions = { + x: number; + y: number; + radius?: number; + depth?: number; + mode?: string; + unproject3D?: boolean; +}; +export declare type PickByRectOptions = { + x: number; + y: number; + width?: number; + height?: number; + mode?: string; + maxObjects?: number | null; +}; +declare type PickOperationContext = { + layers: Layer[]; + views: Record; + viewports: Viewport[]; + onViewportActive: (viewport: Viewport) => void; + effects: Effect[]; +}; +/** Manages picking in a Deck context */ +export default class DeckPicker { + device: Device; + pickingFBO?: LumaFramebuffer; + depthFBO?: LumaFramebuffer; + pickLayersPass: PickLayersPass; + layerFilter?: (context: FilterContext) => boolean; + /** Identifiers of the previously picked object, for callback tracking and auto highlight */ + lastPickedInfo: { + index: number; + layerId: string | null; + info: PickingInfo | null; + }; + _pickable: boolean; + constructor(device: Device); + setProps(props: any): void; + finalize(): void; + /** Pick the closest info at given coordinate */ + pickObject(opts: PickByPointOptions & PickOperationContext): { + result: PickingInfo[]; + emptyInfo: PickingInfo; + }; + /** Get all unique infos within a bounding box */ + pickObjects(opts: PickByRectOptions & PickOperationContext): PickingInfo[]; + getLastPickedObject( + { + x, + y, + layers, + viewports + }: { + x: any; + y: any; + layers: any; + viewports: any; + }, + lastPickedInfo?: PickingInfo + ): { + x: any; + y: any; + viewport: any; + coordinate: any; + layer: any; + color: Uint8Array; + sourceLayer?: Layer<{}>; + index: number; + picked: boolean; + object?: any; + pixel?: [number, number]; + devicePixel?: [number, number]; + pixelRatio: number; + }; + /** Ensures that picking framebuffer exists and matches the canvas size */ + _resizeBuffer(): void; + /** Preliminary filtering of the layers list. Skid picking pass if no layer is pickable. */ + _getPickable(layers: Layer[]): Layer[] | null; + /** Pick the closest object at the given coordinate */ + _pickClosestObject({ + layers, + views, + viewports, + x, + y, + radius, + depth, + mode, + unproject3D, + onViewportActive, + effects + }: PickByPointOptions & PickOperationContext): { + result: PickingInfo[]; + emptyInfo: PickingInfo; + }; + /** Pick all objects within the given bounding box */ + _pickVisibleObjects({ + layers, + views, + viewports, + x, + y, + width, + height, + mode, + maxObjects, + onViewportActive, + effects + }: PickByRectOptions & PickOperationContext): PickingInfo[]; + /** Renders layers into the picking buffer with picking colors and read the pixels. */ + _drawAndSample(params: { + deviceRect: Rect; + pass: string; + layers: Layer[]; + views: Record; + viewports: Viewport[]; + onViewportActive: (viewport: Viewport) => void; + cullRect?: Rect; + effects: Effect[]; + }): { + pickedColors: Uint8Array; + decodePickingColor: PickingColorDecoder; + }; + /** Renders layers into the picking buffer with encoded z values and read the pixels. */ + _drawAndSample( + params: { + deviceRect: Rect; + pass: string; + layers: Layer[]; + views: Record; + viewports: Viewport[]; + onViewportActive: (viewport: Viewport) => void; + cullRect?: Rect; + effects: Effect[]; + }, + pickZ: true + ): { + pickedColors: Float32Array; + decodePickingColor: null; + }; + _getPickingRect({ + deviceX, + deviceY, + deviceRadius, + deviceWidth, + deviceHeight + }: { + deviceX: number; + deviceY: number; + deviceRadius: number; + deviceWidth: number; + deviceHeight: number; + }): Rect | null; +} +export {}; +// # sourceMappingURL=deck-picker.d.ts.map diff --git a/modules/core/typed/lib/deck-picker.d.ts.map b/modules/core/typed/lib/deck-picker.d.ts.map new file mode 100644 index 00000000000..b2a62a601e5 --- /dev/null +++ b/modules/core/typed/lib/deck-picker.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"deck-picker.d.ts","sourceRoot":"","sources":["../../src/lib/deck-picker.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,cAAc,CAAC;AAEzC,OAAO,cAAc,EAAE,EAAC,mBAAmB,EAAC,MAAM,4BAA4B,CAAC;AAE/E,OAAO,EAIL,WAAW,EACZ,MAAM,qBAAqB,CAAC;AAE7B,OAAO,KAAK,EAAC,WAAW,IAAI,eAAe,EAAC,MAAM,uBAAuB,CAAC;AAC1E,OAAO,KAAK,EAAC,aAAa,EAAE,IAAI,EAAC,MAAM,uBAAuB,CAAC;AAC/D,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;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B,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QAC5B,SAAS,EAAE,QAAQ,EAAE,CAAC;QACtB,gBAAgB,EAAE,CAAC,QAAQ,EAAE,QAAQ,KAAK,IAAI,CAAC;QAC/C,QAAQ,CAAC,EAAE,IAAI,CAAC;QAChB,OAAO,EAAE,MAAM,EAAE,CAAC;KACnB,GAAG;QACF,YAAY,EAAE,UAAU,CAAC;QACzB,kBAAkB,EAAE,mBAAmB,CAAC;KACzC;IAED,wFAAwF;IACxF,cAAc,CACZ,MAAM,EAAE;QACN,UAAU,EAAE,IAAI,CAAC;QACjB,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,KAAK,EAAE,CAAC;QAChB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QAC5B,SAAS,EAAE,QAAQ,EAAE,CAAC;QACtB,gBAAgB,EAAE,CAAC,QAAQ,EAAE,QAAQ,KAAK,IAAI,CAAC;QAC/C,QAAQ,CAAC,EAAE,IAAI,CAAC;QAChB,OAAO,EAAE,MAAM,EAAE,CAAC;KACnB,EACD,KAAK,EAAE,IAAI,GACV;QACD,YAAY,EAAE,YAAY,CAAC;QAC3B,kBAAkB,EAAE,IAAI,CAAC;KAC1B;IA4DD,eAAe,CAAC,EACd,OAAO,EACP,OAAO,EACP,YAAY,EACZ,WAAW,EACX,YAAY,EACb,EAAE;QACD,OAAO,EAAE,MAAM,CAAC;QAChB,OAAO,EAAE,MAAM,CAAC;QAChB,YAAY,EAAE,MAAM,CAAC;QACrB,WAAW,EAAE,MAAM,CAAC;QACpB,YAAY,EAAE,MAAM,CAAC;KACtB,GAAG,IAAI,GAAG,IAAI;CAchB"} \ No newline at end of file diff --git a/modules/core/typed/lib/deck-renderer.d.ts b/modules/core/typed/lib/deck-renderer.d.ts new file mode 100644 index 00000000000..1a0d4d2b717 --- /dev/null +++ b/modules/core/typed/lib/deck-renderer.d.ts @@ -0,0 +1,23 @@ +import type {Device} from '@luma.gl/api'; +import DrawLayersPass from '../passes/draw-layers-pass'; +import PickLayersPass from '../passes/pick-layers-pass'; +export default class DeckRenderer { + device: Device; + layerFilter: Function | null; + drawPickingColors: boolean; + drawLayersPass: DrawLayersPass; + pickLayersPass: PickLayersPass; + renderCount: number; + _needsRedraw: string | false; + renderBuffers: any[]; + lastPostProcessEffect: any; + constructor(device: Device); + setProps(props: any): void; + renderLayers(opts: any): void; + needsRedraw(opts?: {clearRedrawFlags: boolean}): string | false; + finalize(): void; + _preRender(effects: any, opts: any): void; + _resizeRenderBuffers(): void; + _postRender(effects: any, opts: any): void; +} +// # sourceMappingURL=deck-renderer.d.ts.map diff --git a/modules/core/typed/lib/deck-renderer.d.ts.map b/modules/core/typed/lib/deck-renderer.d.ts.map new file mode 100644 index 00000000000..a620a9ebb52 --- /dev/null +++ b/modules/core/typed/lib/deck-renderer.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"deck-renderer.d.ts","sourceRoot":"","sources":["../../src/lib/deck-renderer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,cAAc,CAAC;AAGzC,OAAO,cAAc,MAAM,4BAA4B,CAAC;AACxD,OAAO,cAAc,MAAM,4BAA4B,CAAC;AAIxD,MAAM,CAAC,OAAO,OAAO,YAAY;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,QAAQ,GAAG,IAAI,CAAQ;IACpC,iBAAiB,UAAS;IAC1B,cAAc,EAAE,cAAc,CAAC;IAC/B,cAAc,EAAE,cAAc,CAAC;IAC/B,WAAW,SAAK;IAChB,YAAY,EAAE,MAAM,GAAG,KAAK,CAAoB;IAChD,aAAa,EAAE,GAAG,EAAE,CAAM;IAC1B,qBAAqB,MAAQ;gBAEjB,MAAM,EAAE,MAAM;IAM1B,QAAQ,CAAC,KAAK,KAAA;IAwBd,YAAY,CAAC,IAAI,KAAA;IAmBjB,WAAW,CAAC,IAAI;;KAA4B;IAQ5C,QAAQ;IASR,UAAU,CAAC,OAAO,KAAA,EAAE,IAAI,KAAA;IAgBxB,oBAAoB;IAUpB,WAAW,CAAC,OAAO,KAAA,EAAE,IAAI,KAAA;CAoB1B"} \ No newline at end of file diff --git a/modules/core/typed/lib/deck.d.ts b/modules/core/typed/lib/deck.d.ts new file mode 100644 index 00000000000..1dee18efe7c --- /dev/null +++ b/modules/core/typed/lib/deck.d.ts @@ -0,0 +1,382 @@ +import LayerManager from './layer-manager'; +import ViewManager from './view-manager'; +import EffectManager from './effect-manager'; +import DeckRenderer from './deck-renderer'; +import DeckPicker from './deck-picker'; +import Tooltip from './tooltip'; +import {Device, DeviceProps} from '@luma.gl/api'; +import {AnimationLoop} from '@luma.gl/webgl-legacy'; +import {Stats} from '@probe.gl/stats'; +import {EventManager} from 'mjolnir.js'; +import type {Effect} from './effect'; +import type {FilterContext} from '../passes/layers-pass'; +import type Layer from './layer'; +import type View from '../views/view'; +import type Viewport from '../viewports/viewport'; +import type {RecognizerOptions, MjolnirGestureEvent, MjolnirPointerEvent} from 'mjolnir.js'; +import type {Framebuffer} from '@luma.gl/webgl-legacy'; +import type {TypedArrayManagerOptions} from '../utils/typed-array-manager'; +import type {ViewStateChangeParameters, InteractionState} from '../controllers/controller'; +import type {PickingInfo} from './picking/pick-info'; +import type {LayersList} from './layer-manager'; +import type {TooltipContent} from './tooltip'; +declare function noop(): void; +export declare type DeckMetrics = { + fps: number; + setPropsTime: number; + updateAttributesTime: number; + framesRedrawn: number; + pickTime: number; + pickCount: number; + gpuTime: number; + gpuTimePerFrame: number; + cpuTime: number; + cpuTimePerFrame: number; + bufferMemory: number; + textureMemory: number; + renderbufferMemory: number; + gpuMemory: number; +}; +declare type CursorState = { + /** Whether the cursor is over a pickable object */ + isHovering: boolean; + /** Whether the cursor is down */ + isDragging: boolean; +}; +export declare type DeckProps = { + /** Id of this Deck instance */ + id?: string; + /** Width of the canvas, a number in pixels or a valid CSS string. + * @default `'100%'` + */ + width?: string | number | null; + /** Height of the canvas, a number in pixels or a valid CSS string. + * @default `'100%'` + */ + height?: string | number | null; + /** Additional CSS styles for the canvas. */ + style?: Partial | null; + /** Controls the resolution of drawing buffer used for rendering. + * @default `true` (use browser devicePixelRatio) + */ + useDevicePixels?: boolean | number; + /** Extra pixels around the pointer to include while picking. + * @default `0` + */ + pickingRadius?: number; + /** WebGL parameters to be set before each frame is rendered. + * @see https://github.com/visgl/luma.gl/blob/8.5-release/modules/gltools/docs/api-reference/parameter-setting.md#parameters + */ + parameters?: any; + /** If supplied, will be called before a layer is drawn to determine whether it should be rendered. */ + layerFilter?: ((context: FilterContext) => boolean) | null; + /** The container to append the auto-created canvas to. + * @default `document.body` + */ + parent?: HTMLDivElement | null; + /** The canvas to render into. + * Can be either a HTMLCanvasElement or the element id. + * Will be auto-created if not supplied. + */ + canvas?: HTMLCanvasElement | string | null; + /** luma.gl GPU device. A device will be auto-created if not supplied. */ + device?: Device | null; + /** A device will be auto-created if not supplied using these props. */ + deviceProps?: DeviceProps; + /** WebGL context @deprecated Use props.device */ + gl?: WebGLRenderingContext | null; + /** Options used when creating a WebGL context. @deprecated Use props.deviceProps */ + glOptions?: WebGLContextAttributes; + /** + * The array of Layer instances to be rendered. + * Nested arrays are accepted, as well as falsy values (`null`, `false`, `undefined`) + */ + layers?: LayersList; + /** The array of effects to be rendered. A lighting effect will be added if an empty array is supplied. */ + effects?: Effect[]; + /** A single View instance, or an array of `View` instances. + * @default `new MapView()` + */ + views?: View | View[] | null; + /** Options for viewport interactivity, e.g. pan, rotate and zoom with mouse, touch and keyboard. + * This is a shorthand for defining interaction with the `views` prop if you are using the default view (i.e. a single `MapView`) + */ + controller?: View['props']['controller']; + /** + * An object that describes the view state for each view in the `views` prop. + * Use if the camera state should be managed external to the `Deck` instance. + */ + viewState?: any; + /** + * If provided, the `Deck` instance will track camera state changes automatically, + * with `initialViewState` as its initial settings. + */ + initialViewState?: any; + /** Allow browser default touch actions. + * @default `'none'` + */ + touchAction?: string; + /** Set Hammer.js recognizer options for gesture recognition. See documentation for details. */ + eventRecognizerOptions?: { + [type: string]: RecognizerOptions; + }; + /** (Experimental) Render to a custom frame buffer other than to screen. */ + _framebuffer?: Framebuffer | null; + /** (Experimental) Forces deck.gl to redraw layers every animation frame. */ + _animate?: boolean; + /** (Experimental) If set to `false`, force disables all picking features, disregarding the `pickable` prop set in any layer. */ + _pickable?: boolean; + /** (Experimental) Fine-tune attribute memory usage. See documentation for details. */ + _typedArrayManagerProps?: TypedArrayManagerOptions; + /** Called once the GPU Device has been initiated. */ + onDeviceInitialized?: (device: Device) => void; + /** @deprecated Called once the WebGL context has been initiated. */ + onWebGLInitialized?: (gl: WebGLRenderingContext) => void; + /** Called when the canvas resizes. */ + onResize?: (dimensions: {width: number; height: number}) => void; + /** Called when the user has interacted with the deck.gl canvas, e.g. using mouse, touch or keyboard. */ + onViewStateChange?: ( + params: ViewStateChangeParameters & { + viewId: string; + } + ) => any; + /** Called when the user has interacted with the deck.gl canvas, e.g. using mouse, touch or keyboard. */ + onInteractionStateChange?: (state: InteractionState) => void; + /** Called just before the canvas rerenders. */ + onBeforeRender?: (context: {device: Device; gl: WebGLRenderingContext}) => void; + /** Called right after the canvas rerenders. */ + onAfterRender?: (context: {device: Device; gl: WebGLRenderingContext}) => void; + /** Called once after gl context and all Deck components are created. */ + onLoad?: () => void; + /** Called if deck.gl encounters an error. + * If this callback is set to `null`, errors are silently ignored. + * @default `console.error` + */ + onError?: ((error: Error, layer?: Layer) => void) | null; + /** Called when the pointer moves over the canvas. */ + onHover?: ((info: PickingInfo, event: MjolnirPointerEvent) => void) | null; + /** Called when clicking on the canvas. */ + onClick?: ((info: PickingInfo, event: MjolnirGestureEvent) => void) | null; + /** Called when the user starts dragging on the canvas. */ + onDragStart?: ((info: PickingInfo, event: MjolnirGestureEvent) => void) | null; + /** Called when dragging the canvas. */ + onDrag?: ((info: PickingInfo, event: MjolnirGestureEvent) => void) | null; + /** Called when the user releases from dragging the canvas. */ + onDragEnd?: ((info: PickingInfo, event: MjolnirGestureEvent) => void) | null; + /** (Experimental) Replace the default redraw procedure */ + _customRender?: ((reason: string) => void) | null; + /** (Experimental) Called once every second with performance metrics. */ + _onMetrics?: ((metrics: DeckMetrics) => void) | null; + /** A custom callback to retrieve the cursor type. */ + getCursor?: (state: CursorState) => string; + /** Callback that takes a hovered-over point and renders a tooltip. */ + getTooltip?: ((info: PickingInfo) => TooltipContent) | null; + /** (Debug) Flag to enable WebGL debug mode. Requires importing `@luma.gl/debug`. */ + debug?: boolean; + /** (Debug) Render the picking buffer to screen. */ + drawPickingColors?: boolean; +}; +export default class Deck { + static defaultProps: { + id: string; + width: string; + height: string; + style: any; + viewState: any; + initialViewState: any; + pickingRadius: number; + layerFilter: any; + parameters: {}; + parent: any; + device: any; + deviceProps: {}; + gl: any; + glOptions: {}; + canvas: any; + layers: any[]; + effects: any[]; + views: any; + controller: any; + useDevicePixels: boolean; + touchAction: string; + eventRecognizerOptions: {}; + _framebuffer: any; + _animate: boolean; + _pickable: boolean; + _typedArrayManagerProps: {}; + _customRender: any; + onDeviceInitialized: typeof noop; + onWebGLInitialized: typeof noop; + onResize: typeof noop; + onViewStateChange: typeof noop; + onInteractionStateChange: typeof noop; + onBeforeRender: typeof noop; + onAfterRender: typeof noop; + onLoad: typeof noop; + onError: (error: Error) => void; + onHover: any; + onClick: any; + onDragStart: any; + onDrag: any; + onDragEnd: any; + _onMetrics: any; + getCursor: ({isDragging}: {isDragging: any}) => 'grabbing' | 'grab'; + getTooltip: any; + debug: boolean; + drawPickingColors: boolean; + }; + static VERSION: any; + readonly props: Required; + readonly width: number; + readonly height: number; + readonly userData: Record; + protected device: Device | null; + protected canvas: HTMLCanvasElement | null; + protected viewManager: ViewManager | null; + protected layerManager: LayerManager | null; + protected effectManager: EffectManager | null; + protected deckRenderer: DeckRenderer | null; + protected deckPicker: DeckPicker | null; + protected eventManager: EventManager | null; + protected tooltip: Tooltip | null; + protected animationLoop: AnimationLoop; + /** Internal view state if no callback is supplied */ + protected viewState: any; + protected cursorState: CursorState; + protected stats: Stats; + protected metrics: DeckMetrics; + private _metricsCounter; + private _needsRedraw; + private _pickRequest; + /** + * Pick and store the object under the pointer on `pointerdown`. + * This object is reused for subsequent `onClick` and `onDrag*` callbacks. + */ + private _lastPointerDownInfo; + constructor(props: DeckProps); + /** Stop rendering and dispose all resources */ + finalize(): void; + /** Partially update props */ + setProps(props: DeckProps): void; + /** + * Check if a redraw is needed + * @returns `false` or a string summarizing the redraw reason + */ + needsRedraw(opts?: { + /** Reset the redraw flag afterwards. Default `true` */ + clearRedrawFlags: boolean; + }): false | string; + /** + * Redraw the GL context + * @param reason If not provided, only redraw if deemed necessary. Otherwise redraw regardless of internal states. + * @returns + */ + redraw(reason?: string): void; + /** Flag indicating that the Deck instance has initialized its resources and it's safe to call public methods. */ + get isInitialized(): boolean; + /** Get a list of views that are currently rendered */ + getViews(): View[]; + /** Get a list of viewports that are currently rendered. + * @param rect If provided, only returns viewports within the given bounding box. + */ + getViewports(rect?: {x: number; y: number; width?: number; height?: number}): Viewport[]; + /** Query the object rendered on top at a given point */ + pickObject(opts: { + /** x position in pixels */ + x: number; + /** y position in pixels */ + y: number; + /** Radius of tolerance in pixels. Default `0`. */ + radius?: number; + /** A list of layer ids to query from. If not specified, then all pickable and visible layers are queried. */ + layerIds?: string[]; + /** If `true`, `info.coordinate` will be a 3D point by unprojecting the `x, y` screen coordinates onto the picked geometry. Default `false`. */ + unproject3D?: boolean; + }): PickingInfo | null; + pickMultipleObjects(opts: { + /** x position in pixels */ + x: number; + /** y position in pixels */ + y: number; + /** Radius of tolerance in pixels. Default `0`. */ + radius?: number; + /** Specifies the max number of objects to return. Default `10`. */ + depth?: number; + /** A list of layer ids to query from. If not specified, then all pickable and visible layers are queried. */ + layerIds?: string[]; + /** If `true`, `info.coordinate` will be a 3D point by unprojecting the `x, y` screen coordinates onto the picked geometry. Default `false`. */ + unproject3D?: boolean; + }): PickingInfo[]; + pickObjects(opts: { + /** Left of the bounding box in pixels */ + x: number; + /** Top of the bounding box in pixels */ + y: number; + /** Width of the bounding box in pixels. Default `1` */ + width?: number; + /** Height of the bounding box in pixels. Default `1` */ + height?: number; + /** A list of layer ids to query from. If not specified, then all pickable and visible layers are queried. */ + layerIds?: string[]; + /** If specified, limits the number of objects that can be returned. */ + maxObjects?: number | null; + }): PickingInfo[]; + /** Experimental + * Add a global resource for sharing among layers + */ + _addResources( + resources: { + [id: string]: any; + }, + forceUpdate?: boolean + ): void; + /** Experimental + * Remove a global resource + */ + _removeResources(resourceIds: string[]): void; + private _pick; + /** Resolve props.canvas to element */ + private _createCanvas; + /** Updates canvas width and/or height, if provided as props */ + private _setCanvasSize; + /** If canvas size has changed, reads out the new size and update */ + private _updateCanvasSize; + private _createAnimationLoop; + private _getViewState; + private _getViews; + private _onContextLost; + /** Internal use only: event handler for pointerdown */ + _onPointerMove: (event: MjolnirPointerEvent) => void; + /** Actually run picking */ + private _pickAndCallback; + private _updateCursor; + private _setDevice; + /** Internal only: default render function (redraw all layers and views) */ + _drawLayers( + redrawReason: string, + renderOptions?: { + target?: Framebuffer; + layerFilter?: (context: FilterContext) => boolean; + layers?: Layer[]; + viewports?: Viewport[]; + views?: { + [viewId: string]: View; + }; + pass?: string; + effects?: Effect[]; + clearStack?: boolean; + clearCanvas?: boolean; + } + ): void; + private _onRenderFrame; + private _onViewStateChange; + private _onInteractionStateChange; + /** Internal use only: event handler for click & drag */ + _onEvent: (event: MjolnirGestureEvent) => void; + /** Internal use only: evnet handler for pointerdown */ + _onPointerDown: (event: MjolnirPointerEvent) => void; + private _getFrameStats; + private _getMetrics; +} +export {}; +// # sourceMappingURL=deck.d.ts.map diff --git a/modules/core/typed/lib/deck.d.ts.map b/modules/core/typed/lib/deck.d.ts.map new file mode 100644 index 00000000000..20e50acee78 --- /dev/null +++ b/modules/core/typed/lib/deck.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"deck.d.ts","sourceRoot":"","sources":["../../src/lib/deck.ts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a/modules/core/typed/lib/effect-manager.d.ts b/modules/core/typed/lib/effect-manager.d.ts new file mode 100644 index 00000000000..336d862c251 --- /dev/null +++ b/modules/core/typed/lib/effect-manager.d.ts @@ -0,0 +1,14 @@ +import type {Effect} from './effect'; +export default class EffectManager { + effects: Effect[]; + _internalEffects: Effect[]; + _needsRedraw: false | string; + constructor(); + setProps(props: any): void; + needsRedraw(opts?: {clearRedrawFlags: boolean}): false | string; + getEffects(): Effect[]; + finalize(): void; + setEffects(effects?: Effect[]): void; + cleanup(): void; +} +// # sourceMappingURL=effect-manager.d.ts.map diff --git a/modules/core/typed/lib/effect-manager.d.ts.map b/modules/core/typed/lib/effect-manager.d.ts.map new file mode 100644 index 00000000000..cbdc50ee778 --- /dev/null +++ b/modules/core/typed/lib/effect-manager.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"effect-manager.d.ts","sourceRoot":"","sources":["../../src/lib/effect-manager.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,UAAU,CAAC;AAIrC,MAAM,CAAC,OAAO,OAAO,aAAa;IAChC,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,YAAY,EAAE,KAAK,GAAG,MAAM,CAAC;;IAS7B,QAAQ,CAAC,KAAK,KAAA;IASd,WAAW,CAAC,IAAI;;KAA4B,GAAG,KAAK,GAAG,MAAM;IAQ7D,UAAU;IAIV,QAAQ;IAKR,UAAU,CAAC,OAAO,GAAE,MAAM,EAAO;IAYjC,OAAO;CAWR"} \ No newline at end of file diff --git a/modules/core/typed/lib/effect.d.ts b/modules/core/typed/lib/effect.d.ts new file mode 100644 index 00000000000..c17255439b0 --- /dev/null +++ b/modules/core/typed/lib/effect.d.ts @@ -0,0 +1,19 @@ +import type Layer from './layer'; +import type {LayersPassRenderOptions} from '../passes/layers-pass'; +import type {Device} from '@luma.gl/api'; +import type {Framebuffer} from '@luma.gl/webgl-legacy'; +export declare type PreRenderOptions = LayersPassRenderOptions; +export declare type PostRenderOptions = LayersPassRenderOptions & { + inputBuffer: Framebuffer; + swapBuffer: Framebuffer; +}; +export interface Effect { + id: string; + props: any; + useInPicking?: boolean; + preRender: (device: Device, opts: PreRenderOptions) => void; + postRender?: (device: Device, opts: PostRenderOptions) => Framebuffer; + getModuleParameters?: (layer: Layer) => any; + cleanup(): void; +} +// # sourceMappingURL=effect.d.ts.map diff --git a/modules/core/typed/lib/effect.d.ts.map b/modules/core/typed/lib/effect.d.ts.map new file mode 100644 index 00000000000..549a1a4165f --- /dev/null +++ b/modules/core/typed/lib/effect.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"effect.d.ts","sourceRoot":"","sources":["../../src/lib/effect.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AACjC,OAAO,KAAK,EAAC,uBAAuB,EAAC,MAAM,uBAAuB,CAAC;AACnE,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,cAAc,CAAC;AACzC,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,uBAAuB,CAAC;AAEvD,oBAAY,gBAAgB,GAAG,uBAAuB,CAAC;AACvD,oBAAY,iBAAiB,GAAG,uBAAuB,GAAG;IACxD,WAAW,EAAE,WAAW,CAAC;IACzB,UAAU,EAAE,WAAW,CAAC;CACzB,CAAC;AAEF,MAAM,WAAW,MAAM;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,GAAG,CAAC;IACX,YAAY,CAAC,EAAE,OAAO,CAAC;IAEvB,SAAS,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,gBAAgB,KAAK,IAAI,CAAC;IAC5D,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,iBAAiB,KAAK,WAAW,CAAC;IACtE,mBAAmB,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,GAAG,CAAC;IAE5C,OAAO,IAAI,IAAI,CAAC;CACjB"} \ No newline at end of file diff --git a/modules/core/typed/lib/init.d.ts b/modules/core/typed/lib/init.d.ts new file mode 100644 index 00000000000..4e58a7f2fb9 --- /dev/null +++ b/modules/core/typed/lib/init.d.ts @@ -0,0 +1,3 @@ +declare const _default: any; +export default _default; +// # sourceMappingURL=init.d.ts.map diff --git a/modules/core/typed/lib/init.d.ts.map b/modules/core/typed/lib/init.d.ts.map new file mode 100644 index 00000000000..4696a24c177 --- /dev/null +++ b/modules/core/typed/lib/init.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/lib/init.ts"],"names":[],"mappings":";AA8DA,wBAA+B"} \ No newline at end of file diff --git a/modules/core/typed/lib/layer-extension.d.ts b/modules/core/typed/lib/layer-extension.d.ts new file mode 100644 index 00000000000..a895148624d --- /dev/null +++ b/modules/core/typed/lib/layer-extension.d.ts @@ -0,0 +1,27 @@ +import type Layer from './layer'; +import type CompositeLayer from './composite-layer'; +import type {UpdateParameters} from './layer'; +import type {LayerContext} from './layer-manager'; +export default abstract class LayerExtension { + /** + * Note that defaultProps of a LayerExtension does not behave like defaultProps of a Layer: + - The default values are not automatically merged with user-supplied props when the layer is constructed + - The types are not used during props diff + * Currently they are only used in getSubLayerProps + * TODO: find a more consistent solution + */ + static defaultProps: any; + opts: OptionsT; + constructor(opts?: OptionsT); + /** Returns true if two extensions are equivalent */ + equals(extension: LayerExtension): boolean; + /** Only called if attached to a primitive layer */ + getShaders(this: Layer, extension: this): any; + /** Only called if attached to a CompositeLayer */ + getSubLayerProps(this: CompositeLayer, extension: this): any; + initializeState(this: Layer, context: LayerContext, extension: this): void; + updateState(this: Layer, params: UpdateParameters, extension: this): void; + draw(this: Layer, params: any, extension: this): void; + finalizeState(this: Layer, context: LayerContext, extension: this): void; +} +// # sourceMappingURL=layer-extension.d.ts.map diff --git a/modules/core/typed/lib/layer-extension.d.ts.map b/modules/core/typed/lib/layer-extension.d.ts.map new file mode 100644 index 00000000000..cbbd1c96ba9 --- /dev/null +++ b/modules/core/typed/lib/layer-extension.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"layer-extension.d.ts","sourceRoot":"","sources":["../../src/lib/layer-extension.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AACjC,OAAO,KAAK,cAAc,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,SAAS,CAAC;AAC9C,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,iBAAiB,CAAC;AAElD,MAAM,CAAC,OAAO,CAAC,QAAQ,OAAO,cAAc,CAAC,QAAQ,GAAG,SAAS;IAC/D;;;;;;OAMG;IACH,MAAM,CAAC,YAAY,EAAE,GAAG,CAAM;IAC9B,IAAI,EAAG,QAAQ,CAAC;gBAEJ,IAAI,CAAC,EAAE,QAAQ;IAM3B,oDAAoD;IACpD,MAAM,CAAC,SAAS,EAAE,cAAc,CAAC,QAAQ,CAAC,GAAG,OAAO;IAQpD,mDAAmD;IACnD,UAAU,CAAC,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,GAAG,GAAG;IAI7C,kDAAkD;IAClD,gBAAgB,CAAC,IAAI,EAAE,cAAc,EAAE,SAAS,EAAE,IAAI,GAAG,GAAG;IAyB5D,eAAe,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,IAAI,GAAG,IAAI;IAE1E,WAAW,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,gBAAgB,CAAC,KAAK,CAAC,EAAE,SAAS,EAAE,IAAI,GAAG,IAAI;IAEhF,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,IAAI,GAAG,IAAI;IAErD,aAAa,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,IAAI,GAAG,IAAI;CACzE"} \ No newline at end of file diff --git a/modules/core/typed/lib/layer-manager.d.ts b/modules/core/typed/lib/layer-manager.d.ts new file mode 100644 index 00000000000..4cbc2f1e4fb --- /dev/null +++ b/modules/core/typed/lib/layer-manager.d.ts @@ -0,0 +1,87 @@ +import {Device} from '@luma.gl/api'; +import {Timeline} from '@luma.gl/engine'; +import type {ProgramManager} from '@luma.gl/webgl-legacy'; +import {Stats} from '@probe.gl/stats'; +import ResourceManager from './resource/resource-manager'; +import Viewport from '../viewports/viewport'; +import type Layer from './layer'; +import type Deck from './deck'; +export declare type LayerContext = { + layerManager: LayerManager; + resourceManager: ResourceManager; + deck?: Deck; + device: Device; + pipelineFactory: ProgramManager; + stats: Stats; + viewport: Viewport; + timeline: Timeline; + mousePosition: { + x: number; + y: number; + } | null; + userData: any; + onError?: (error: Error, source: Layer) => void; + /** @deprecated Use context.device */ + gl: WebGLRenderingContext; +}; +export declare type LayersList = (Layer | undefined | false | null | LayersList)[]; +export declare type LayerManagerProps = { + deck?: Deck; + stats?: Stats; + viewport?: Viewport; + timeline?: Timeline; +}; +export default class LayerManager { + layers: Layer[]; + context: LayerContext; + resourceManager: ResourceManager; + private _lastRenderedLayers; + private _needsRedraw; + private _needsUpdate; + private _nextLayers; + private _debug; + /** + * @param device + * @param param1 + */ + constructor(device: Device, props: LayerManagerProps); + /** Method to call when the layer manager is not needed anymore. */ + finalize(): void; + /** Check if a redraw is needed */ + needsRedraw(opts?: { + /** Reset redraw flags to false after the call */ + clearRedrawFlags: boolean; + }): string | false; + /** Check if a deep update of all layers is needed */ + needsUpdate(): string | false; + /** Layers will be redrawn (in next animation frame) */ + setNeedsRedraw(reason: string): void; + /** Layers will be updated deeply (in next animation frame) + Potentially regenerating attributes and sub layers */ + setNeedsUpdate(reason: string): void; + /** Gets a list of currently rendered layers. Optionally filter by id. */ + getLayers({layerIds}?: {layerIds?: string[]}): Layer[]; + /** Set props needed for layer rendering and picking. */ + setProps(props: any): void; + /** Supply a new layer list, initiating sublayer generation and layer matching */ + setLayers(newLayers: LayersList, reason?: string): void; + /** Update layers from last cycle if `setNeedsUpdate()` has been called */ + updateLayers(): void; + /** Make a viewport "current" in layer context, updating viewportChanged flags */ + activateViewport: (viewport: Viewport) => void; + private _handleError; + /** Match all layers, checking for caught errors + to avoid having an exception in one layer disrupt other layers */ + private _updateLayers; + private _updateSublayersRecursively; + private _finalizeOldLayers; + /** Safely initializes a single layer, calling layer methods */ + private _initializeLayer; + /** Transfer state from one layer to a newer version */ + private _transferLayerState; + /** Safely updates a single layer, cleaning all flags */ + private _updateLayer; + /** Safely finalizes a single layer, removing all resources */ + private _finalizeLayer; +} +// # sourceMappingURL=layer-manager.d.ts.map diff --git a/modules/core/typed/lib/layer-manager.d.ts.map b/modules/core/typed/lib/layer-manager.d.ts.map new file mode 100644 index 00000000000..59355f3649a --- /dev/null +++ b/modules/core/typed/lib/layer-manager.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"layer-manager.d.ts","sourceRoot":"","sources":["../../src/lib/layer-manager.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAC,MAAM,EAAC,MAAM,cAAc,CAAC;AACpC,OAAO,EAAC,QAAQ,EAAC,MAAM,iBAAiB,CAAC;AACzC,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,uBAAuB,CAAC;AAK1D,OAAO,EAAC,KAAK,EAAC,MAAM,iBAAiB,CAAC;AACtC,OAAO,eAAe,MAAM,6BAA6B,CAAC;AAE1D,OAAO,QAAQ,MAAM,uBAAuB,CAAC;AAG7C,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AAEjC,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAK/B,oBAAY,YAAY,GAAG;IACzB,YAAY,EAAE,YAAY,CAAC;IAC3B,eAAe,EAAE,eAAe,CAAC;IACjC,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,eAAe,EAAE,cAAc,CAAC;IAChC,KAAK,EAAE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,MAAM,GAAG,KAAK;IAQ7B,uDAAuD;IACvD,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAIpC;2DACuD;IACvD,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAIpC,yEAAyE;IACzE,SAAS,CAAC,EAAC,QAAQ,EAAC,GAAE;QAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;KAAM,GAAG,KAAK,EAAE;IAQ1D,wDAAwD;IACxD,QAAQ,CAAC,KAAK,EAAE,GAAG,GAAG,IAAI;IAoB1B,iFAAiF;IACjF,SAAS,CAAC,SAAS,EAAE,UAAU,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI;IAcvD,0EAA0E;IAC1E,YAAY,IAAI,IAAI;IAkBpB,iFAAiF;IACjF,gBAAgB,aAAc,QAAQ,UAKpC;IAEF,OAAO,CAAC,YAAY;IAKpB;uEACmE;IACnE,OAAO,CAAC,aAAa;IAkCrB,OAAO,CAAC,2BAA2B;IAgDnC,OAAO,CAAC,kBAAkB;IAW1B,+DAA+D;IAC/D,OAAO,CAAC,gBAAgB;IAUxB,uDAAuD;IACvD,OAAO,CAAC,mBAAmB;IAS3B,wDAAwD;IACxD,OAAO,CAAC,YAAY;IAQpB,8DAA8D;IAC9D,OAAO,CAAC,cAAc;CAYvB"} \ No newline at end of file diff --git a/modules/core/typed/lib/layer-state.d.ts b/modules/core/typed/lib/layer-state.d.ts new file mode 100644 index 00000000000..b449e0c8da5 --- /dev/null +++ b/modules/core/typed/lib/layer-state.d.ts @@ -0,0 +1,56 @@ +import ComponentState from '../lifecycle/component-state'; +import type Layer from './layer'; +import type AttributeManager from './attribute/attribute-manager'; +import type Viewport from '../viewports/viewport'; +import type UniformTransitionManager from './uniform-transition-manager'; +export declare type ChangeFlags = { + dataChanged: + | string + | false + | { + startRow: number; + endRow?: number; + }[]; + propsChanged: string | false; + updateTriggersChanged: Record | false; + extensionsChanged: boolean; + viewportChanged: boolean; + stateChanged: boolean; + propsOrDataChanged: boolean; + somethingChanged: boolean; +}; +export default class LayerState extends ComponentState { + attributeManager: AttributeManager | null; + needsRedraw: boolean; + needsUpdate: boolean; + /** + * Sublayers rendered in a previous cycle + */ + subLayers: Layer[] | null; + /** + * If the layer is using the shared instancedPickingColors buffer + */ + usesPickingColorCache: boolean; + /** + * Dirty flags of the layer's props and state + */ + changeFlags: ChangeFlags; + /** The last viewport rendered by this layer */ + viewport?: Viewport; + uniformTransitions: UniformTransitionManager; + /** Populated during uniform transition to replace user-supplied values */ + propsInTransition?: LayerT['props']; + constructor({ + attributeManager, + layer + }: { + attributeManager: AttributeManager | null; + layer: LayerT; + }); + get layer(): LayerT; + set layer(layer: LayerT); + protected _fetch(propName: any, url: string): any; + protected _onResolve(propName: string, value: any): void; + protected _onError(propName: string, error: Error): void; +} +// # sourceMappingURL=layer-state.d.ts.map diff --git a/modules/core/typed/lib/layer-state.d.ts.map b/modules/core/typed/lib/layer-state.d.ts.map new file mode 100644 index 00000000000..e192cfd5bc2 --- /dev/null +++ b/modules/core/typed/lib/layer-state.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"layer-state.d.ts","sourceRoot":"","sources":["../../src/lib/layer-state.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,MAAM,8BAA8B,CAAC;AAE1D,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AACjC,OAAO,KAAK,gBAAgB,MAAM,+BAA+B,CAAC;AAClE,OAAO,KAAK,QAAQ,MAAM,uBAAuB,CAAC;AAClD,OAAO,KAAK,wBAAwB,MAAM,8BAA8B,CAAC;AAEzE,oBAAY,WAAW,GAAG;IAExB,WAAW,EAAE,MAAM,GAAG,KAAK,GAAG;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAC,EAAE,CAAC;IACpE,YAAY,EAAE,MAAM,GAAG,KAAK,CAAC;IAC7B,qBAAqB,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,CA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841e906fd --- /dev/null +++ b/modules/core/typed/lib/layer.d.ts @@ -0,0 +1,189 @@ +import AttributeManager from './attribute/attribute-manager'; +import {Lifecycle} from '../lifecycle/constants'; +import Component from '../lifecycle/component'; +import LayerState, {ChangeFlags} from './layer-state'; +import type {CoordinateSystem} from './constants'; +import type Attribute from './attribute/attribute'; +import type {Model} from '@luma.gl/webgl-legacy'; +import type {PickingInfo, GetPickingInfoParams} from './picking/pick-info'; +import type Viewport from '../viewports/viewport'; +import type {NumericArray} from '../types/types'; +import type {DefaultProps} from '../lifecycle/prop-types'; +import type {LayerProps} from '../types/layer-props'; +import type {LayerContext} from './layer-manager'; +export declare type UpdateParameters = { + props: LayerT['props']; + oldProps: LayerT['props']; + context: LayerContext; + changeFlags: ChangeFlags; +}; +export default abstract class Layer extends Component> { + static defaultProps: DefaultProps>; + static layerName: string; + internalState: LayerState | null; + lifecycle: Lifecycle; + context: LayerContext; + state: Record; + parent: Layer | null; + get root(): Layer; + toString(): string; + /** Projects a point with current view state from the current layer's coordinate system to screen */ + project(xyz: number[]): number[]; + /** Unprojects a screen pixel to the current view's default coordinate system + Note: this does not reverse `project`. */ + unproject(xy: number[]): number[]; + /** Projects a point with current view state from the current layer's coordinate system to the world space */ + projectPosition( + xyz: number[], + params?: { + /** The viewport to use */ + viewport?: Viewport; + /** The coordinate system that the supplied position is in. Default to the same as `coordinateSystem`. */ + fromCoordinateSystem?: CoordinateSystem; + /** The coordinate origin that the supplied position is in. Default to the same as `coordinateOrigin`. */ + fromCoordinateOrigin?: [number, number, number]; + } + ): [number, number, number]; + /** `true` if this layer renders other layers */ + get isComposite(): boolean; + /** Updates selected state members and marks the layer for redraw */ + setState(partialState: any): void; + /** Sets the redraw flag for this layer, will trigger a redraw next animation frame */ + setNeedsRedraw(): void; + /** Mark this layer as needs a deep update */ + setNeedsUpdate(): void; + /** Returns true if all async resources are loaded */ + get isLoaded(): boolean; + /** Returns true if using shader-based WGS84 longitude wrapping */ + get wrapLongitude(): boolean; + /** Returns true if the layer is visible in the picking pass */ + isPickable(): boolean; + /** Returns an array of models used by this layer, can be overriden by layer subclass */ + getModels(): Model[]; + /** Update shader module parameters */ + setModuleParameters(moduleParameters: any): void; + /** Returns the attribute manager of this layer */ + getAttributeManager(): AttributeManager | null; + /** Returns the most recent layer that matched to this state + (When reacting to an async event, this layer may no longer be the latest) */ + getCurrentLayer(): Layer | null; + /** Returns the default parse options for async props */ + getLoadOptions(): any; + use64bitPositions(): boolean; + onHover(info: PickingInfo, pickingEvent: any): boolean; + onClick(info: PickingInfo, pickingEvent: any): boolean; + nullPickingColor(): number[]; + encodePickingColor(i: any, target?: number[]): number[]; + decodePickingColor(color: any): number; + /** Deduces number of instances. Intention is to support: + - Explicit setting of numInstances + - Auto-deduction for ES6 containers that define a size member + - Auto-deduction for Classic Arrays via the built-in length attribute + - Auto-deduction via arrays */ + getNumInstances(): number; + /** Buffer layout describes how many attribute values are packed for each data object + The default (null) is one value each object. + Some data formats (e.g. paths, polygons) have various length. Their buffer layout + is in the form of [L0, L1, L2, ...] */ + getStartIndices(): NumericArray | null; + getBounds(): [number[], number[]] | null; + /** Called once to set up the initial state. Layers can create WebGL resources here. */ + abstract initializeState(context: LayerContext): void; + getShaders(shaders: any): any; + /** Controls if updateState should be called. By default returns true if any prop has changed */ + shouldUpdateState(params: UpdateParameters>): boolean; + /** Default implementation, all attributes will be invalidated and updated when data changes */ + updateState(params: UpdateParameters>): void; + /** Called once when layer is no longer matched and state will be discarded. Layers can destroy WebGL resources here. */ + finalizeState(context: LayerContext): void; + draw(opts: any): void; + getPickingInfo({info, mode, sourceLayer}: GetPickingInfoParams): PickingInfo; + /** (Internal) Propagate an error event through the system */ + raiseError(error: Error, message: string): void; + /** (Internal) Checks if this layer needs redraw */ + getNeedsRedraw(opts?: { + /** Reset redraw flags to false after the check */ + clearRedrawFlags: boolean; + }): string | false; + /** (Internal) Checks if this layer needs a deep update */ + needsUpdate(): boolean; + /** Checks if this layer has ongoing uniform transition */ + hasUniformTransition(): boolean; + /** Called when this layer is rendered into the given viewport */ + activateViewport(viewport: Viewport): void; + /** Default implementation of attribute invalidation, can be redefined */ + protected invalidateAttribute(name?: string): void; + /** Send updated attributes to the WebGL model */ + protected updateAttributes(changedAttributes: {[id: string]: Attribute}): void; + /** Recalculate any attributes if needed */ + protected _updateAttributes(): void; + /** Update attribute transitions. This is called in drawLayer, no model updates required. */ + private _updateAttributeTransition; + /** Update uniform (prop) transitions. This is called in updateState, may result in model updates. */ + private _updateUniformTransition; + /** Updater for the automatically populated instancePickingColors attribute */ + protected calculateInstancePickingColors( + attribute: Attribute, + { + numInstances + }: { + numInstances: number; + } + ): void; + /** Apply changed attributes to */ + protected _setModelAttributes( + model: Model, + changedAttributes: { + [id: string]: Attribute; + } + ): void; + /** (Internal) Sets the picking color at the specified index to null picking color. Used for multi-depth picking. + This method may be overriden by layer implementations */ + disablePickingIndex(objectIndex: number): void; + protected _disablePickingIndex(objectIndex: number): void; + /** (Internal) Re-enable all picking indices after multi-depth picking */ + restorePickingColors(): void; + _initialize(): void; + /** (Internal) Called by layer manager to transfer state from an old layer */ + _transferState(oldLayer: Layer): void; + /** (Internal) Called by layer manager when a new layer is added or an existing layer is matched with a new instance */ + _update(): void; + /** (Internal) Called by manager when layer is about to be disposed + Note: not guaranteed to be called on application shutdown */ + _finalize(): void; + _drawLayer({ + moduleParameters, + uniforms, + parameters + }: { + moduleParameters: any; + uniforms: any; + parameters: any; + }): void; + /** Returns the current change flags */ + getChangeFlags(): ChangeFlags | undefined; + /** Dirty some change flags, will be handled by updateLayer */ + setChangeFlags(flags: Partial): void; + /** Clear all changeFlags, typically after an update */ + private _clearChangeFlags; + /** Compares the layers props with old props from a matched older layer + and extracts change flags that describe what has change so that state + can be update correctly with minimal effort */ + private _diffProps; + /** (Internal) called by layer manager to perform extra props validation (in development only) */ + validateProps(): void; + /** (Internal) Called by deck picker when the hovered object changes to update the auto highlight */ + updateAutoHighlight(info: PickingInfo): void; + /** Update picking module parameters to highlight the hovered object */ + protected _updateAutoHighlight(info: PickingInfo): void; + /** Create new attribute manager */ + protected _getAttributeManager(): AttributeManager | null; + /** Called after updateState to perform common tasks */ + protected _postUpdate(updateParams: UpdateParameters>, forceUpdate: boolean): void; + private _getUpdateParams; + /** Checks state of attributes and model */ + private _getNeedsRedraw; + /** Callback when asyn prop is loaded */ + private _onAsyncPropUpdated; +} +// # sourceMappingURL=layer.d.ts.map diff --git a/modules/core/typed/lib/layer.d.ts.map b/modules/core/typed/lib/layer.d.ts.map new file mode 100644 index 00000000000..ae6dcf1ec37 --- /dev/null +++ b/modules/core/typed/lib/layer.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"layer.d.ts","sourceRoot":"","sources":["../../src/lib/layer.ts"],"names":[],"mappings":"AAwBA,OAAO,gBAAgB,MAAM,+BAA+B,CAAC;AAG7D,OAAO,EAAY,SAAS,EAAC,MAAM,wBAAwB,CAAC;AAU5D,OAAO,SAAS,MAAM,wBAAwB,CAAC;AAC/C,OAAO,UAAU,EAAE,EAAC,WAAW,EAAC,MAAM,eAAe,CAAC;AAOtD,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,aAAa,CAAC;AAClD,OAAO,KAAK,SAAS,MAAM,uBAAuB,CAAC;AACnD,OAAO,KAAK,EAAC,KAAK,EAAC,MAAM,uBAAuB,CAAC;AACjD,OAAO,KAAK,EAAC,WAAW,EAAE,oBAAoB,EAAC,MAAM,qBAAqB,CAAC;AAC3E,OAAO,KAAK,QAAQ,MAAM,uBAAuB,CAAC;AAClD,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,gBAAgB,CAAC;AACjD,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,yBAAyB,CAAC;AAC1D,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,sBAAsB,CAAC;AACrD,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,iBAAiB,CAAC;AA8HlD,oBAAY,gBAAgB,CAAC,MAAM,SAAS,KAAK,IAAI;IACnD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AO,CAAC,mBAAmB;CAK5B"} \ No newline at end of file diff --git a/modules/core/typed/lib/picking/pick-info.d.ts b/modules/core/typed/lib/picking/pick-info.d.ts new file mode 100644 index 00000000000..a51d35b495c --- /dev/null +++ b/modules/core/typed/lib/picking/pick-info.d.ts @@ -0,0 +1,68 @@ +import type Layer from '../layer'; +import type Viewport from '../../viewports/viewport'; +import type {PickedPixel} from './query-object'; +export interface PickingInfo { + color: Uint8Array | null; + layer: Layer | null; + sourceLayer?: Layer | null; + viewport?: Viewport; + index: number; + picked: boolean; + object?: any; + x: number; + y: number; + pixel?: [number, number]; + coordinate?: number[]; + devicePixel?: [number, number]; + pixelRatio: number; +} +export interface GetPickingInfoParams { + info: PickingInfo; + mode: string; + sourceLayer: Layer | null; +} +/** Generates some basic information of the picking action: x, y, coordinates etc. + * Regardless if anything is picked + */ +export declare function getEmptyPickingInfo({ + pickInfo, + viewports, + pixelRatio, + x, + y, + z +}: { + pickInfo?: PickedPixel; + viewports: Viewport[]; + pixelRatio: number; + x: number; + y: number; + z?: number; +}): PickingInfo; +/** Generates the picking info of a picking operation */ +export declare function processPickInfo(opts: { + pickInfo: PickedPixel; + lastPickedInfo: { + index: number; + layerId: string | null; + info: PickingInfo | null; + }; + mode: string; + layers: Layer[]; + viewports: Viewport[]; + pixelRatio: number; + x: number; + y: number; + z?: number; +}): Map; +/** Walk up the layer composite chain to populate the info object */ +export declare function getLayerPickingInfo({ + layer, + info, + mode +}: { + layer: Layer; + info: PickingInfo; + mode: string; +}): PickingInfo; +// # sourceMappingURL=pick-info.d.ts.map diff --git a/modules/core/typed/lib/picking/pick-info.d.ts.map b/modules/core/typed/lib/picking/pick-info.d.ts.map new file mode 100644 index 00000000000..03227ed2a26 --- /dev/null +++ b/modules/core/typed/lib/picking/pick-info.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"pick-info.d.ts","sourceRoot":"","sources":["../../../src/lib/picking/pick-info.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,KAAK,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tB,cAAc,EAAE;QACd,KAAK,EAAE,MAAM,CAAC;QACd,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;QACvB,IAAI,EAAE,WAAW,GAAG,IAAI,CAAC;KAC1B,CAAC;IACF,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,KAAK,EAAE,CAAC;IAChB,SAAS,EAAE,QAAQ,EAAE,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,CAAC,EAAE,MAAM,CAAC;CACZ,GAAG,GAAG,CAAC,MAAM,GAAG,IAAI,EAAE,WAAW,CAAC,CAqElC;AAED,oEAAoE;AACpE,wBAAgB,mBAAmB,CAAC,EAClC,KAAK,EACL,IAAI,EACJ,IAAI,EACL,EAAE;IACD,KAAK,EAAE,KAAK,CAAC;IACb,IAAI,EAAE,WAAW,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;CACd,GAAG,WAAW,CAgBd"} \ No newline at end of file diff --git a/modules/core/typed/lib/picking/query-object.d.ts b/modules/core/typed/lib/picking/query-object.d.ts new file mode 100644 index 00000000000..5e845432b13 --- /dev/null +++ b/modules/core/typed/lib/picking/query-object.d.ts @@ -0,0 +1,47 @@ +import type Layer from '../layer'; +import type Viewport from '../../viewports/viewport'; +import type {PickingColorDecoder} from '../../passes/pick-layers-pass'; +export declare type PickedPixel = { + pickedColor: Uint8Array | null; + pickedLayer?: Layer; + pickedViewports?: Viewport[]; + pickedX?: number; + pickedY?: number; + pickedObjectIndex: number; +}; +/** + * Pick at a specified pixel with a tolerance radius + * Returns the closest object to the pixel in shape `{pickedColor, pickedLayer, pickedObjectIndex}` + */ +export declare function getClosestObject({ + pickedColors, + decodePickingColor, + deviceX, + deviceY, + deviceRadius, + deviceRect +}: { + pickedColors: Uint8Array; + decodePickingColor: PickingColorDecoder; + deviceX: number; + deviceY: number; + deviceRadius: number; + deviceRect: { + x: number; + y: number; + width: number; + height: number; + }; +}): PickedPixel; +/** + * Examines a picking buffer for unique colors + * Returns array of unique objects in shape `{x, y, pickedColor, pickedLayer, pickedObjectIndex}` + */ +export declare function getUniqueObjects({ + pickedColors, + decodePickingColor +}: { + pickedColors: Uint8Array; + decodePickingColor: PickingColorDecoder; +}): PickedPixel[]; +// # sourceMappingURL=query-object.d.ts.map diff --git a/modules/core/typed/lib/picking/query-object.d.ts.map b/modules/core/typed/lib/picking/query-object.d.ts.map new file mode 100644 index 00000000000..fc75c0543b1 --- /dev/null +++ b/modules/core/typed/lib/picking/query-object.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"query-object.d.ts","sourceRoot":"","sources":["../../../src/lib/picking/query-object.ts"],"names":[],"mappings":"AAqBA,OAAO,KAAK,KAAK,MAAM,UAAU,CAAC;AAClC,OAAO,KAAK,QAAQ,MAAM,0BAA0B,CAAC;AACrD,OAAO,KAAK,EAAC,mBAAmB,EAAC,MAAM,+BAA+B,CAAC;AAEvE,oBAAY,WAAW,GAAG;IACxB,WAAW,EAAE,UAAU,GAAG,IAAI,CAAC;IAC/B,WAAW,CAAC,EAAE,KAAK,CAAC;IACpB,eAAe,CAAC,EAAE,QAAQ,EAAE,CAAC;IAC7B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,iBAAiB,EAAE,MAAM,CAAC;CAC3B,CAAC;AAQF;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,YAAY,EACZ,kBAAkB,EAClB,OAAO,EACP,OAAO,EACP,YAAY,EACZ,UAAU,EACX,EAAE;IACD,YAAY,EAAE,UAAU,CAAC;IACzB,kBAAkB,EAAE,mBAAmB,CAAC;IACxC,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE;QAAC,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAC,CAAC;CACnE,GAAG,WAAW,CAmDd;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,YAAY,EACZ,kBAAkB,EACnB,EAAE;IACD,YAAY,EAAE,UAAU,CAAC;IACzB,kBAAkB,EAAE,mBAAmB,CAAC;CACzC,GAAG,WAAW,EAAE,CA8BhB"} \ No newline at end of file diff --git a/modules/core/typed/lib/resource/resource-manager.d.ts b/modules/core/typed/lib/resource/resource-manager.d.ts new file mode 100644 index 00000000000..dedff20dcd3 --- /dev/null +++ b/modules/core/typed/lib/resource/resource-manager.d.ts @@ -0,0 +1,45 @@ +import {Device} from '@luma.gl/api'; +export declare type ResourceManagerContext = { + device: Device; + resourceManager: ResourceManager; + /** @deprecated */ + gl: WebGLRenderingContext; +}; +export default class ResourceManager { + protocol: string; + private _context; + private _resources; + private _consumers; + private _pruneRequest; + constructor(props: {device: Device; protocol?: string}); + contains(resourceId: string): boolean; + add({ + resourceId, + data, + forceUpdate, + persistent + }: { + resourceId: string; + data: any; + forceUpdate?: boolean; + persistent?: boolean; + }): void; + remove(resourceId: string): void; + unsubscribe({consumerId}: {consumerId: string}): void; + subscribe({ + resourceId, + onChange, + consumerId, + requestId + }: { + resourceId: string; + onChange: (data: T | Promise) => void; + consumerId: string; + requestId: string; + }): T | Promise | undefined; + prune(): void; + finalize(): void; + private _track; + private _prune; +} +// # sourceMappingURL=resource-manager.d.ts.map diff --git a/modules/core/typed/lib/resource/resource-manager.d.ts.map b/modules/core/typed/lib/resource/resource-manager.d.ts.map new file mode 100644 index 00000000000..998185756e7 --- /dev/null +++ b/modules/core/typed/lib/resource/resource-manager.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"resource-manager.d.ts","sourceRoot":"","sources":["../../../src/lib/resource/resource-manager.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,MAAM,EAAC,MAAM,cAAc,CAAC;AAIpC,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,MAAM;IA8Bd,OAAO,CAAC,MAAM;CAWf"} \ No newline at end of file diff --git a/modules/core/typed/lib/resource/resource.d.ts b/modules/core/typed/lib/resource/resource.d.ts new file mode 100644 index 00000000000..a43a5dfc141 --- /dev/null +++ b/modules/core/typed/lib/resource/resource.d.ts @@ -0,0 +1,24 @@ +import type {ResourceManagerContext} from './resource-manager'; +export declare type ResourceSubscriber = { + onChange: (data: T | Promise) => void; +}; +export default class Resource { + id: string; + context: ResourceManagerContext; + isLoaded: boolean; + persistent?: boolean; + private _loadCount; + private _subscribers; + private _data; + private _loader?; + private _error?; + private _content?; + constructor(id: string, data: T | Promise | string, context: ResourceManagerContext); + subscribe(consumer: ResourceSubscriber): void; + unsubscribe(consumer: ResourceSubscriber): void; + inUse(): boolean; + delete(): void; + getData(): T | Promise; + setData(data: any, forceUpdate?: boolean): void; +} +// # sourceMappingURL=resource.d.ts.map diff --git a/modules/core/typed/lib/resource/resource.d.ts.map b/modules/core/typed/lib/resource/resource.d.ts.map new file mode 100644 index 00000000000..b1fabcffa6a --- /dev/null +++ b/modules/core/typed/lib/resource/resource.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"resource.d.ts","sourceRoot":"","sources":["../../../src/lib/resource/resource.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,sBAAsB,EAAC,MAAM,oBAAoB,CAAC;AAE/D,oBAAY,kBAAkB,CAAC,CAAC,GAAG,GAAG,IAAI;IACxC,QAAQ,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC;CAC1C,CAAC;AAEF,MAAM,CAAC,OAAO,OAAO,QAAQ,CAAC,CAAC,GAAG,GAAG;IACnC,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,sBAAsB,CAAC;IAChC,QAAQ,EAAG,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB,OAAO,CAAC,UAAU,CAAa;IAC/B,OAAO,CAAC,YAAY,CAAoC;IACxD,OAAO,CAAC,KAAK,CAA2B;IACxC,OAAO,CAAC,OAAO,CAAC,CAAgB;IAChC,OAAO,CAAC,MAAM,CAAC,CAAQ;IACvB,OAAO,CAAC,QAAQ,CAAC,CAAI;gBAET,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,MAAM,EAAE,OAAO,EAAE,sBAAsB;IAQtF,SAAS,CAAC,QAAQ,EAAE,kBAAkB,CAAC,CAAC,CAAC,GAAG,IAAI;IAIhD,WAAW,CAAC,QAAQ,EAAE,kBAAkB,CAAC,CAAC,CAAC,GAAG,IAAI;IAIlD,KAAK,IAAI,OAAO;IAIhB,MAAM,IAAI,IAAI;IAId,OAAO,IAAI,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;IAQzB,OAAO,CAAC,IAAI,EAAE,GAAG,EAAE,WAAW,CAAC,EAAE,OAAO;CAsCzC"} \ No newline at end of file diff --git a/modules/core/typed/lib/tooltip.d.ts b/modules/core/typed/lib/tooltip.d.ts new file mode 100644 index 00000000000..f9e0ed1b34f --- /dev/null +++ b/modules/core/typed/lib/tooltip.d.ts @@ -0,0 +1,17 @@ +export declare type TooltipContent = + | null + | string + | { + text?: string; + html?: string; + className?: string; + style?: Partial; + }; +export default class Tooltip { + private el; + isVisible: boolean; + constructor(canvas: HTMLCanvasElement); + setTooltip(displayInfo: TooltipContent, x?: number, y?: number): void; + remove(): void; +} +// # sourceMappingURL=tooltip.d.ts.map diff --git a/modules/core/typed/lib/tooltip.d.ts.map b/modules/core/typed/lib/tooltip.d.ts.map new file mode 100644 index 00000000000..07ce937a9e4 --- /dev/null +++ b/modules/core/typed/lib/tooltip.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"tooltip.d.ts","sourceRoot":"","sources":["../../src/lib/tooltip.ts"],"names":[],"mappings":"AAiCA,oBAAY,cAAc,GACtB,IAAI,GACJ,MAAM,GACN;IACE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,OAAO,CAAC,mBAAmB,CAAC,CAAC;CACtC,CAAC;AAEN,MAAM,CAAC,OAAO,OAAO,OAAO;IAC1B,OAAO,CAAC,EAAE,CAA+B;IAEzC,SAAS,EAAE,OAAO,CAAS;gBAEf,MAAM,EAAE,iBAAiB;IAUrC,UAAU,CAAC,WAAW,EAAE,cAAc,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE,MAAM,GAAG,IAAI;IA6BrE,MAAM,IAAI,IAAI;CAMf"} \ No newline at end of file diff --git a/modules/core/typed/lib/uniform-transition-manager.d.ts b/modules/core/typed/lib/uniform-transition-manager.d.ts new file mode 100644 index 00000000000..4aacf73d96c --- /dev/null +++ b/modules/core/typed/lib/uniform-transition-manager.d.ts @@ -0,0 +1,11 @@ +export default class UniformTransitionManager { + transitions: Map; + timeline: any; + constructor(timeline: any); + get active(): boolean; + add(key: any, fromValue: any, toValue: any, settings: any): void; + remove(key: any): void; + update(): {}; + clear(): void; +} +// # sourceMappingURL=uniform-transition-manager.d.ts.map diff --git a/modules/core/typed/lib/uniform-transition-manager.d.ts.map b/modules/core/typed/lib/uniform-transition-manager.d.ts.map new file mode 100644 index 00000000000..a93e8e3a3a4 --- /dev/null +++ b/modules/core/typed/lib/uniform-transition-manager.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"uniform-transition-manager.d.ts","sourceRoot":"","sources":["../../src/lib/uniform-transition-manager.ts"],"names":[],"mappings":"AAUA,MAAM,CAAC,OAAO,OAAO,wBAAwB;IAC3C,WAAW,gBAAa;IACxB,QAAQ,MAAC;gBAEG,QAAQ,KAAA;IAIpB,IAAI,MAAM,YAET;IAED,GAAG,CAAC,GAAG,KAAA,EAAE,SAAS,KAAA,EAAE,OAAO,KAAA,EAAE,QAAQ,KAAA;IA8BrC,MAAM,CAAC,GAAG,KAAA;IAQV,MAAM;IAeN,KAAK;CAKN"} \ No newline at end of file diff --git a/modules/core/typed/lib/view-manager.d.ts b/modules/core/typed/lib/view-manager.d.ts new file mode 100644 index 00000000000..129fb3698a4 --- /dev/null +++ b/modules/core/typed/lib/view-manager.d.ts @@ -0,0 +1,98 @@ +import type Controller from '../controllers/controller'; +import type {ViewStateChangeParameters, InteractionState} from '../controllers/controller'; +import type Viewport from '../viewports/viewport'; +import type View from '../views/view'; +import type {Timeline} from '@luma.gl/engine'; +import type {EventManager} from 'mjolnir.js'; +export default class ViewManager { + width: number; + height: number; + views: View[]; + viewState: any; + controllers: { + [viewId: string]: Controller | null; + }; + timeline: Timeline; + private _viewports; + private _viewportMap; + private _isUpdating; + private _needsRedraw; + private _needsUpdate; + private _eventManager; + private _eventCallbacks; + constructor(props: { + timeline: Timeline; + eventManager: EventManager; + onViewStateChange?: ( + params: ViewStateChangeParameters & { + viewId: string; + } + ) => void; + onInteractionStateChange?: (state: InteractionState) => void; + views?: View[]; + viewState?: any; + width?: number; + height?: number; + }); + /** Remove all resources and event listeners */ + finalize(): void; + /** Check if a redraw is needed */ + needsRedraw(opts?: { + /** Reset redraw flags to false */ + clearRedrawFlags?: boolean; + }): string | false; + /** Mark the manager as dirty. Will rebuild all viewports and update controllers. */ + setNeedsUpdate(reason: string): void; + /** Checks each viewport for transition updates */ + updateViewStates(): void; + /** Get a set of viewports for a given width and height + * TODO - Intention is for deck.gl to autodeduce width and height and drop the need for props + * @param rect (object, optional) - filter the viewports + * + not provided - return all viewports + * + {x, y} - only return viewports that contain this pixel + * + {x, y, width, height} - only return viewports that overlap with this rectangle + */ + getViewports(rect?: {x: number; y: number; width?: number; height?: number}): Viewport[]; + /** Get a map of all views */ + getViews(): { + [viewId: string]: View; + }; + /** Resolves a viewId string to a View */ + getView(viewId: string): View | undefined; + /** Returns the viewState for a specific viewId. Matches the viewState by + 1. view.viewStateId + 2. view.id + 3. root viewState + then applies the view's filter if any */ + getViewState(viewOrViewId: string | View): any; + getViewport(viewId: string): Viewport | undefined; + /** + * Unproject pixel coordinates on screen onto world coordinates, + * (possibly [lon, lat]) on map. + * - [x, y] => [lng, lat] + * - [x, y, z] => [lng, lat, Z] + * @param {Array} xyz - + * @param {Object} opts - options + * @param {Object} opts.topLeft=true - Whether origin is top left + * @return {Array|null} - [lng, lat, Z] or [X, Y, Z] + */ + unproject( + xyz: number[], + opts?: { + topLeft?: boolean; + } + ): number[] | null; + /** Update the manager with new Deck props */ + setProps(props: {views?: View[]; viewState?: any; width?: number; height?: number}): void; + private _update; + private _setSize; + private _setViews; + private _setViewState; + private _onViewStateChange; + private _createController; + private _updateController; + private _rebuildViewports; + _buildViewportMap(): void; + _diffViews(newViews: View[], oldViews: View[]): boolean; +} +// # sourceMappingURL=view-manager.d.ts.map diff --git a/modules/core/typed/lib/view-manager.d.ts.map b/modules/core/typed/lib/view-manager.d.ts.map new file mode 100644 index 00000000000..acb2e4a461a --- /dev/null +++ b/modules/core/typed/lib/view-manager.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"view-manager.d.ts","sourceRoot":"","sources":["../../src/lib/view-manager.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,UAAU,MAAM,2BAA2B,CAAC;AACxD,OAAO,KAAK,EAAC,yBAAyB,EAAE,gBAAgB,EAAC,MAAM,2BAA2B,CAAC;AAC3F,OAAO,KAAK,QAAQ,MAAM,uBAAuB,CAAC;AAClD,OAAO,KAAK,IAAI,MAAM,eAAe,CAAC;AACtC,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,iBAAiB,CAAC;AAC9C,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,YAAY,CAAC;AAG7C,MAAM,CAAC,OAAO,OAAO,WAAW;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,IAAI,EAAE,CAAC;IACd,SAAS,EAAE,GAAG,CAAC;IACf,WAAW,EAAE;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GAAG,QAAQ,EAAE;IAOxF,6BAA6B;IAC7B,QAAQ,IAAI;QAAC,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;KAAC;IAQpC,yCAAyC;IACzC,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS;IAIzC;;;;8CAI0C;IAC1C,YAAY,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI,GAAG,GAAG;IAQ9C,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,QAAQ,GAAG,SAAS;IAIjD;;;;;;;;;OASG;IACH,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,IAAI,CAAC,EAAE;QAAC,OAAO,CAAC,EAAE,OAAO,CAAA;KAAC,GAAG,MAAM,EAAE,GAAG,IAAI;IAerE,6CAA6C;IAC7C,QAAQ,CAAC,KAAK,EAAE;QAAC,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC;QAAC,SAAS,CAAC,EAAE,GAAG,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAC;IAyBlF,OAAO,CAAC,OAAO;IAmBf,OAAO,CAAC,QAAQ;IAUhB,OAAO,CAAC,SAAS;IAWjB,OAAO,CAAC,aAAa;IAcrB,OAAO,CAAC,kBAAkB;IAM1B,OAAO,CAAC,iBAAiB;IAuBzB,OAAO,CAAC,iBAAiB;IA+BzB,OAAO,CAAC,iBAAiB;IA4CzB,iBAAiB,IAAI,IAAI;IAazB,UAAU,CAAC,QAAQ,EAAE,IAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,OAAO;CAOxD"} \ No newline at end of file diff --git a/modules/core/typed/lifecycle/component-state.d.ts b/modules/core/typed/lifecycle/component-state.d.ts new file mode 100644 index 00000000000..315191806b8 --- /dev/null +++ b/modules/core/typed/lifecycle/component-state.d.ts @@ -0,0 +1,32 @@ +import type Component from './component'; +declare const EMPTY_PROPS: Readonly<{}>; +export default class ComponentState { + component: ComponentT; + onAsyncPropUpdated: (propName: string, value: any) => void; + private asyncProps; + private oldProps; + private oldAsyncProps; + constructor(component: ComponentT); + finalize(): void; + getOldProps(): ComponentT['props'] | typeof EMPTY_PROPS; + resetOldProps(): void; + hasAsyncProp(propName: string): boolean; + getAsyncProp(propName: string): any; + isAsyncPropLoading(propName?: string): boolean; + reloadAsyncProp(propName: string, value: any): void; + setAsyncProps(props: ComponentT['props']): void; + protected _fetch(propName: string, url: string): any; + protected _onResolve(propName: string, value: any): void; + protected _onError(propName: string, error: Error): void; + private _updateAsyncProp; + private _freezeAsyncOldProps; + private _didAsyncInputValueChange; + private _setPropValue; + private _setAsyncPropValue; + private _watchPromise; + private _resolveAsyncIterable; + private _postProcessValue; + private _createAsyncPropData; +} +export {}; +// # sourceMappingURL=component-state.d.ts.map diff --git a/modules/core/typed/lifecycle/component-state.d.ts.map b/modules/core/typed/lifecycle/component-state.d.ts.map new file mode 100644 index 00000000000..a96b8303142 --- /dev/null +++ b/modules/core/typed/lifecycle/component-state.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"component-state.d.ts","sourceRoot":"","sources":["../../src/lifecycle/component-state.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,SAAS,MAAM,aAAa,CAAC;AAGzC,QAAA,MAAM,WAAW,cAAoB,CAAC;AAUtC,MAAM,CAAC,OAAO,OAAO,cAAc,CAAC,UAAU,SAAS,SAAS;IAC9D,SAAS,EAAE,UAAU,CAAC;IACtB,kBAAkB,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC;IAE3D,OAAO,CAAC,UAAU,CAA0C;IAC5D,OAAO,CAAC,QAAQ,CAA6B;IAC7C,OAAO,CAAC,aAAa,CAA6B;gBAEtC,SAAS,EAAE,UAAU;IAQjC,QAAQ;IAgBR,WAAW,IAAI,UAAU,CAAC,OAAO,CAAC,GAAG,OAAO,WAAW;IAIvD,aAAa;IAMb,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO;IAKvC,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,GAAG;IAKnC,kBAAkB,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO;IAkB9C,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG;IAM5C,aAAa,CAAC,KAAK,EAAE,UAAU,CAAC,OAAO,CAAC;IAyBxC,SAAS,CAAC,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,GAAG;IAIpD,SAAS,CAAC,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG;IAEjD,SAAS,CAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK;IAGjD,OAAO,CAAC,gBAAgB;IA4BxB,OAAO,CAAC,oBAAoB;IAe5B,OAAO,CAAC,yBAAyB;IAWjC,OAAO,CAAC,aAAa;IAcrB,OAAO,CAAC,kBAAkB;IAiB1B,OAAO,CAAC,aAAa;YAiBP,qBAAqB;IA2CnC,OAAO,CAAC,iBAAiB;IAczB,OAAO,CAAC,oBAAoB;CAe7B"} \ No newline at end of file diff --git a/modules/core/typed/lifecycle/component.d.ts b/modules/core/typed/lifecycle/component.d.ts new file mode 100644 index 00000000000..2fc7a721a3f --- /dev/null +++ b/modules/core/typed/lifecycle/component.d.ts @@ -0,0 +1,23 @@ +import { + COMPONENT_SYMBOL, + ASYNC_ORIGINAL_SYMBOL, + ASYNC_RESOLVED_SYMBOL, + ASYNC_DEFAULTS_SYMBOL +} from './constants'; +export declare type StatefulComponentProps = PropsT & { + id: string; + [COMPONENT_SYMBOL]: Component; + [ASYNC_DEFAULTS_SYMBOL]: Partial; + [ASYNC_ORIGINAL_SYMBOL]: Partial; + [ASYNC_RESOLVED_SYMBOL]: Partial; +}; +export default class Component { + static componentName: string; + static defaultProps: Readonly<{}>; + id: string; + props: StatefulComponentProps; + count: number; + constructor(...propObjects: Partial[]); + clone(newProps: Partial): any; +} +// # sourceMappingURL=component.d.ts.map diff --git a/modules/core/typed/lifecycle/component.d.ts.map b/modules/core/typed/lifecycle/component.d.ts.map new file mode 100644 index 00000000000..7b79dc3facd --- /dev/null +++ b/modules/core/typed/lifecycle/component.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../src/lifecycle/component.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,qBAAqB,EACrB,qBAAqB,EACrB,qBAAqB,EACtB,MAAM,aAAa,CAAC;AAKrB,oBAAY,sBAAsB,CAAC,MAAM,IAAI,MAAM,GAAG;IACpD,EAAE,EAAE,MAAM,CAAC;IACX,CAAC,gBAAgB,CAAC,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;IACtC,CAAC,qBAAqB,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IACzC,CAAC,qBAAqB,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IACzC,CAAC,qBAAqB,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;CAC1C,CAAC;AAEF,MAAM,CAAC,OAAO,OAAO,SAAS,CAAC,MAAM,GAAG,EAAE;IACxC,MAAM,CAAC,aAAa,EAAE,MAAM,CAAe;IAC3C,MAAM,CAAC,YAAY,EAAE,QAAQ,CAAC,EAAE,CAAC,CAAM;IAEvC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,sBAAsB,CAAC,MAAM,CAAC,CAAC;IACtC,KAAK,EAAE,MAAM,CAAC;gBAEF,GAAG,WAAW,EAAE,OAAO,CAAC,MAAM,CAAC,EAAE;IAW7C,KAAK,CAAC,QAAQ,EAAE,OAAO,CAAC,MAAM,CAAC;CAmBhC"} \ No newline at end of file diff --git a/modules/core/typed/lifecycle/constants.d.ts b/modules/core/typed/lifecycle/constants.d.ts new file mode 100644 index 00000000000..5269b5e6b6f --- /dev/null +++ b/modules/core/typed/lifecycle/constants.d.ts @@ -0,0 +1,14 @@ +export declare const LIFECYCLE: { + readonly NO_STATE: 'Awaiting state'; + readonly MATCHED: 'Matched. State transferred from previous layer'; + readonly INITIALIZED: 'Initialized'; + readonly AWAITING_GC: 'Discarded. Awaiting garbage collection'; + readonly AWAITING_FINALIZATION: 'No longer matched. Awaiting garbage collection'; + readonly FINALIZED: 'Finalized! Awaiting garbage collection'; +}; +export declare type Lifecycle = (typeof LIFECYCLE)[keyof typeof LIFECYCLE]; +export declare const COMPONENT_SYMBOL: unique symbol; +export declare const ASYNC_DEFAULTS_SYMBOL: unique symbol; +export declare const ASYNC_ORIGINAL_SYMBOL: unique symbol; +export declare const ASYNC_RESOLVED_SYMBOL: unique symbol; +// # sourceMappingURL=constants.d.ts.map diff --git a/modules/core/typed/lifecycle/constants.d.ts.map b/modules/core/typed/lifecycle/constants.d.ts.map new file mode 100644 index 00000000000..ee46c273329 --- /dev/null +++ b/modules/core/typed/lifecycle/constants.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/lifecycle/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS;;;;;;;CAOZ,CAAC;AAEX,oBAAY,SAAS,GAAG,OAAO,SAAS,CAAC,MAAM,OAAO,SAAS,CAAC,CAAC;AAMjE,eAAO,MAAM,gBAAgB,EAAE,OAAO,MAAgC,CAAC;AACvE,eAAO,MAAM,qBAAqB,EAAE,OAAO,MAAwC,CAAC;AACpF,eAAO,MAAM,qBAAqB,EAAE,OAAO,MAAwC,CAAC;AACpF,eAAO,MAAM,qBAAqB,EAAE,OAAO,MAAwC,CAAC"} \ No newline at end of file diff --git a/modules/core/typed/lifecycle/create-props.d.ts b/modules/core/typed/lifecycle/create-props.d.ts new file mode 100644 index 00000000000..5948a481345 --- /dev/null +++ b/modules/core/typed/lifecycle/create-props.d.ts @@ -0,0 +1,7 @@ +import {StatefulComponentProps} from './component'; +import type Component from './component'; +export declare function createProps( + component: Component, + propObjects: Partial[] +): StatefulComponentProps; +// # sourceMappingURL=create-props.d.ts.map diff --git a/modules/core/typed/lifecycle/create-props.d.ts.map b/modules/core/typed/lifecycle/create-props.d.ts.map new file mode 100644 index 00000000000..c14381ff4fa --- /dev/null +++ b/modules/core/typed/lifecycle/create-props.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"create-props.d.ts","sourceRoot":"","sources":["../../src/lifecycle/create-props.ts"],"names":[],"mappings":"AASA,OAAO,EAAC,sBAAsB,EAAC,MAAM,aAAa,CAAC;AACnD,OAAO,KAAK,SAAS,MAAM,aAAa,CAAC;AAGzC,wBAAgB,WAAW,CAAC,CAAC,EAC3B,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC,EACvB,WAAW,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,GACxB,sBAAsB,CAAC,CAAC,CAAC,CA8B3B"} \ No newline at end of file diff --git a/modules/core/typed/lifecycle/prop-types.d.ts b/modules/core/typed/lifecycle/prop-types.d.ts new file mode 100644 index 00000000000..1a06c32386e --- /dev/null +++ b/modules/core/typed/lifecycle/prop-types.d.ts @@ -0,0 +1,94 @@ +import type Component from './component'; +import type {Color, Texture} from '../types/layer-props'; +declare type BasePropType = { + value: ValueT; + async?: boolean; + validate?: (value: any, propType: PropType) => boolean; + equal?: (value1: ValueT, value2: ValueT, propType: PropType) => boolean; +}; +/** + * Normalized prop type definition + */ +export declare type PropType = BasePropType & { + type: string; + name: string; + transform?: (value: any, propType: PropType, component: Component) => any; + release?: (value: any, propType: PropType, component: Component) => void; +}; +declare type DefaultProp = + | T + | DeprecatedProp + | BooleanPropType + | NumberPropType + | ColorPropType + | ImagePropType + | DataPropType + | ArrayPropType + | ObjectPropType + | AccessorPropType + | FunctionPropType; +export declare type DefaultProps> = { + [propName in keyof T]?: DefaultProp[propName]>; +}; +declare type BooleanPropType = BasePropType & { + type: 'boolean'; +}; +declare type NumberPropType = BasePropType & { + type: 'number'; + min?: number; + max?: number; +}; +declare type ColorPropType = BasePropType & { + type: 'color'; + optional?: boolean; +}; +declare type ArrayPropType = BasePropType & { + type: 'array'; + optional?: boolean; + compare?: boolean; +}; +declare type AccessorPropType = BasePropType & { + type: 'accessor'; +}; +declare type FunctionPropType = BasePropType & { + type: 'function'; + optional?: boolean; + compare?: boolean; +}; +declare type DataPropType = BasePropType & { + type: 'data'; +}; +declare type ImagePropType = BasePropType & { + type: 'image'; +}; +declare type ObjectPropType = BasePropType & { + type: 'object'; + optional?: boolean; + compare?: boolean; +}; +declare type DeprecatedProp = { + deprecatedFor?: string | string[]; +}; +declare type PropTypeDef = + | DeprecatedProp + | boolean + | BooleanPropType + | number + | NumberPropType + | string + | DataPropType + | number[] + | ColorPropType + | ArrayPropType + | AccessorPropType + | FunctionPropType + | ImagePropType + | ObjectPropType + | null; +export declare function parsePropTypes(propDefs: Record): { + propTypes: Record; + defaultProps: Record; + deprecatedProps: Record; +}; +export {}; +// # sourceMappingURL=prop-types.d.ts.map diff --git a/modules/core/typed/lifecycle/prop-types.d.ts.map b/modules/core/typed/lifecycle/prop-types.d.ts.map new file mode 100644 index 00000000000..9678683a8dd --- /dev/null +++ b/modules/core/typed/lifecycle/prop-types.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"prop-types.d.ts","sourceRoot":"","sources":["../../src/lifecycle/prop-types.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,SAAS,MAAM,aAAa,CAAC;AACzC,OAAO,KAAK,EAAC,KAAK,EAAE,OAAO,EAAC,MAAM,sBAAsB,CAAC;AAEzD,aAAK,YAAY,CAAC,MAAM,IAAI;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,QAAQ,KAAK,OAAO,CAAC;IACvD,KAAK,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,M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,EAAE,GACR,aAAa,GACb,aAAa,GACb,gBAAgB,GAChB,gBAAgB,GAChB,aAAa,GACb,cAAc,GACd,IAAI,CAAC;AAmGT,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,GAAG;IACrE,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IACpC,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAClC,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;CAC3C,CAgBA"} \ No newline at end of file diff --git a/modules/core/typed/lifecycle/props.d.ts b/modules/core/typed/lifecycle/props.d.ts new file mode 100644 index 00000000000..41ddfdd9696 --- /dev/null +++ b/modules/core/typed/lifecycle/props.d.ts @@ -0,0 +1,40 @@ +export declare function validateProps(props: any): void; +export declare function diffProps( + props: any, + oldProps: any +): { + dataChanged: + | string + | false + | { + startRow: number; + endRow?: number; + }[]; + propsChanged: string | false; + updateTriggersChanged: Record | false; + extensionsChanged: boolean; + transitionsChanged: Record | false; +}; +/** + * Performs equality by iterating through keys on an object and returning false + * when any key has values which are not strictly equal between the arguments. + * @param {Object} opt.oldProps - object with old key/value pairs + * @param {Object} opt.newProps - object with new key/value pairs + * @param {Object} opt.ignoreProps={} - object, keys that should not be compared + * @returns {null|String} - null when values of all keys are strictly equal. + * if unequal, returns a string explaining what changed. + */ +export declare function compareProps({ + newProps, + oldProps, + ignoreProps, + propTypes, + triggerName +}: { + newProps: any; + oldProps: any; + ignoreProps?: {}; + propTypes?: {}; + triggerName?: string; +}): string | false; +// # sourceMappingURL=props.d.ts.map diff --git a/modules/core/typed/lifecycle/props.d.ts.map b/modules/core/typed/lifecycle/props.d.ts.map new file mode 100644 index 00000000000..f6472fc5092 --- /dev/null +++ b/modules/core/typed/lifecycle/props.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../src/lifecycle/props.ts"],"names":[],"mappings":"AAGA,wBAAgB,aAAa,CAAC,KAAK,KAAA,QAUlC;AAGD,wBAAgB,SAAS,CACvB,KAAK,KAAA,EACL,QAAQ,KAAA,GACP;IACD,WAAW,EAAE,MAAM,GAAG,KAAK,GAAG;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAC,EAAE,CAAC;IACpE,YAAY,EAAE,MAAM,GAAG,KAAK,CAAC;IAC7B,qBAAqB,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,GAAG,KAAK,CAAC;IACpD,iBAAiB,EAAE,OAAO,CAAC;IAC3B,kBAAkB,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,GAAG,KAAK,CAAC;CAClD,CA0BA;AAsBD;;;;;;;;GAQG;AAOH,wBAAgB,YAAY,CAAC,EAC3B,QAAQ,EACR,QAAQ,EACR,WAAgB,EAChB,SAAc,EACd,WAAqB,EACtB;;;;;;CAAA,GAAG,MAAM,GAAG,KAAK,CA6CjB"} \ No newline at end of file diff --git a/modules/core/typed/passes/draw-layers-pass.d.ts b/modules/core/typed/passes/draw-layers-pass.d.ts new file mode 100644 index 00000000000..29056673997 --- /dev/null +++ b/modules/core/typed/passes/draw-layers-pass.d.ts @@ -0,0 +1,5 @@ +import LayersPass from './layers-pass'; +export default class DrawLayersPass extends LayersPass { + shouldDrawLayer(layer: any): boolean; +} +// # sourceMappingURL=draw-layers-pass.d.ts.map diff --git a/modules/core/typed/passes/draw-layers-pass.d.ts.map b/modules/core/typed/passes/draw-layers-pass.d.ts.map new file mode 100644 index 00000000000..e33896bb245 --- /dev/null +++ b/modules/core/typed/passes/draw-layers-pass.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"draw-layers-pass.d.ts","sourceRoot":"","sources":["../../src/passes/draw-layers-pass.ts"],"names":[],"mappings":"AACA,OAAO,UAAU,MAAM,eAAe,CAAC;AAEvC,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,UAAU;IACpD,eAAe,CAAC,KAAK,KAAA;CAGtB"} \ No newline at end of file diff --git a/modules/core/typed/passes/layers-pass.d.ts b/modules/core/typed/passes/layers-pass.d.ts new file mode 100644 index 00000000000..0e0a852ccd7 --- /dev/null +++ b/modules/core/typed/passes/layers-pass.d.ts @@ -0,0 +1,57 @@ +import type {Framebuffer} from '@luma.gl/webgl-legacy'; +import Pass from './pass'; +import type Viewport from '../viewports/viewport'; +import type View from '../views/view'; +import type Layer from '../lib/layer'; +import type {Effect} from '../lib/effect'; +export declare type Rect = { + x: number; + y: number; + width: number; + height: number; +}; +export declare type LayersPassRenderOptions = { + target?: Framebuffer; + pass: string; + layers: Layer[]; + viewports: Viewport[]; + onViewportActive: (viewport: Viewport) => void; + cullRect?: Rect; + views?: Record; + effects?: Effect[]; + /** If true, recalculates render index (z) from 0. Set to false if a stack of layers are rendered in multiple passes. */ + clearStack?: boolean; + clearCanvas?: boolean; + layerFilter?: (context: FilterContext) => boolean; + moduleParameters?: any; +}; +export declare type FilterContext = { + layer: Layer; + viewport: Viewport; + isPicking: boolean; + renderPass: string; + cullRect?: Rect; +}; +export declare type RenderStats = { + totalCount: number; + visibleCount: number; + compositeCount: number; + pickableCount: number; +}; +export default class LayersPass extends Pass { + _lastRenderIndex: number; + render(options: LayersPassRenderOptions): any; + private _drawLayers; + private _getDrawLayerParams; + private _drawLayersInViewport; + protected shouldDrawLayer(layer: Layer): boolean; + protected getModuleParameters(layer: Layer, effects?: Effect[]): any; + protected getLayerParameters(layer: Layer, layerIndex: number, viewport: Viewport): any; + private _shouldDrawLayer; + private _getModuleParameters; +} +export declare function layerIndexResolver( + startIndex?: number, + layerIndices?: Record +): (layer: Layer, isDrawn: boolean) => number; +// # sourceMappingURL=layers-pass.d.ts.map diff --git a/modules/core/typed/passes/layers-pass.d.ts.map b/modules/core/typed/passes/layers-pass.d.ts.map new file mode 100644 index 00000000000..83a0e5ea64f --- /dev/null +++ b/modules/core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AAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,IAAI,CAAC;CACjB,CAAC;AAEF,oBAAY,WAAW,GAAG;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,IAAI;IAC1C,gBAAgB,EAAE,MAAM,CAAM;IAE9B,MAAM,CAAC,OAAO,EAAE,uBAAuB,GAAG,GAAG;IAM7C,OAAO,CAAC,WAAW;IAuDnB,OAAO,CAAC,mBAAmB;IAmD3B,OAAO,CAAC,qBAAqB;IAuE7B,SAAS,CAAC,eAAe,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO;IAIhD,SAAS,CAAC,mBAAmB,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,GAAG,GAAG;IAIpE,SAAS,CAAC,kBAAkB,CAAC,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,GAAG,GAAG;IAKvF,OAAO,CAAC,gBAAgB;IAwCxB,OAAO,CAAC,oBAAoB;CA6B7B;AAQD,wBAAgB,kBAAkB,CAChC,UAAU,GAAE,MAAU,EACtB,YAAY,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAM,GACxC,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,KAAK,MAAM,CAqC5C"} \ No newline at end of file diff --git a/modules/core/typed/passes/mask-pass.d.ts b/modules/core/typed/passes/mask-pass.d.ts new file mode 100644 index 00000000000..2060ae7a0a2 --- /dev/null +++ b/modules/core/typed/passes/mask-pass.d.ts @@ -0,0 +1,24 @@ +import type {Device} from '@luma.gl/api'; +import {Framebuffer, Texture2D} from '@luma.gl/webgl-legacy'; +import LayersPass from './layers-pass'; +import type {LayersPassRenderOptions} from './layers-pass'; +declare type MaskPassRenderOptions = LayersPassRenderOptions & { + /** The channel to render into, 0:red, 1:green, 2:blue, 3:alpha */ + channel: number; +}; +export default class MaskPass extends LayersPass { + maskMap: Texture2D; + fbo: Framebuffer; + constructor( + device: Device, + props: { + id: string; + mapSize?: number; + } + ); + render(options: MaskPassRenderOptions): any; + shouldDrawLayer(layer: any): boolean; + delete(): void; +} +export {}; +// # sourceMappingURL=mask-pass.d.ts.map diff --git a/modules/core/typed/passes/mask-pass.d.ts.map b/modules/core/typed/passes/mask-pass.d.ts.map new file mode 100644 index 00000000000..75a42eaefe9 --- /dev/null +++ b/modules/core/typed/passes/mask-pass.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"mask-pass.d.ts","sourceRoot":"","sources":["../../src/passes/mask-pass.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,cAAc,CAAC;AACzC,OAAO,EAAK,WAAW,EAAE,SAAS,EAAiB,MAAM,uBAAuB,CAAC;AAEjF,OAAO,UAAU,MAAM,eAAe,CAAC;AAEvC,OAAO,KAAK,EAAC,uBAAuB,EAAC,MAAM,eAAe,CAAC;AAE3D,aAAK,qBAAqB,GAAG,uBAAuB,GAAG;IACrD,kEAAkE;IAClE,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,UAAU;IAC9C,OAAO,EAAE,SAAS,CAAC;IACnB,GAAG,EAAE,WAAW,CAAC;gBAEL,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE;QAAC,EAAE,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAC;IA0BjE,MAAM,CAAC,OAAO,EAAE,qBAAqB;IAkBrC,eAAe,CAAC,KAAK,KAAA;IAIrB,MAAM;CAIP"} \ No newline at end of file diff --git a/modules/core/typed/passes/pass.d.ts b/modules/core/typed/passes/pass.d.ts new file mode 100644 index 00000000000..addc736c3c3 --- /dev/null +++ b/modules/core/typed/passes/pass.d.ts @@ -0,0 +1,16 @@ +import type {Device} from '@luma.gl/api'; +export default class Pass { + id: string; + device: Device; + props: any; + constructor( + device: Device, + props?: { + id: string; + } + ); + setProps(props: any): void; + render(params: any): void; + cleanup(): void; +} +// # sourceMappingURL=pass.d.ts.map diff --git a/modules/core/typed/passes/pass.d.ts.map b/modules/core/typed/passes/pass.d.ts.map new file mode 100644 index 00000000000..f54a27b4a24 --- /dev/null +++ b/modules/core/typed/passes/pass.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"pass.d.ts","sourceRoot":"","sources":["../../src/passes/pass.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,cAAc,CAAC;AAEzC,MAAM,CAAC,OAAO,OAAO,IAAI;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,GAAG,CAAC;gBAEC,MAAM,EAAE,MAAM,EAAE,KAAK,GAAE;QAAC,EAAE,EAAE,MAAM,CAAA;KAAgB;IAO9D,QAAQ,CAAC,KAAK,KAAA,GAAG,IAAI;IAIrB,MAAM,CAAC,MAAM,KAAA,GAAG,IAAI;IAEpB,OAAO;CACR"} \ No newline at end of file diff --git a/modules/core/typed/passes/pick-layers-pass.d.ts b/modules/core/typed/passes/pick-layers-pass.d.ts new file mode 100644 index 00000000000..8f02acffcce --- /dev/null +++ b/modules/core/typed/passes/pick-layers-pass.d.ts @@ -0,0 +1,46 @@ +import LayersPass, {LayersPassRenderOptions, RenderStats, Rect} from './layers-pass'; +import type {Framebuffer} from '@luma.gl/webgl-legacy'; +import type Viewport from '../viewports/viewport'; +import type Layer from '../lib/layer'; +declare type PickLayersPassRenderOptions = LayersPassRenderOptions & { + pickingFBO: Framebuffer; + deviceRect: Rect; + pickZ: boolean; +}; +export declare type PickingColorDecoder = (pickedColor: number[] | Uint8Array) => + | { + pickedLayer: Layer; + pickedViewports: Viewport[]; + pickedObjectIndex: number; + } + | undefined; +export default class PickLayersPass extends LayersPass { + private pickZ?; + private _colors; + render(props: PickLayersPassRenderOptions): any; + _drawPickingBuffer({ + layers, + layerFilter, + views, + viewports, + onViewportActive, + pickingFBO, + deviceRect: {x, y, width, height}, + cullRect, + effects, + pass, + pickZ + }: PickLayersPassRenderOptions): { + decodePickingColor: PickingColorDecoder | null; + stats: RenderStats; + }; + protected shouldDrawLayer(layer: Layer): boolean; + protected getModuleParameters(): { + pickingActive: number; + pickingAttribute: boolean; + lightSources: {}; + }; + protected getLayerParameters(layer: Layer, layerIndex: number, viewport: Viewport): any; +} +export {}; +// # sourceMappingURL=pick-layers-pass.d.ts.map diff --git a/modules/core/typed/passes/pick-layers-pass.d.ts.map b/modules/core/typed/passes/pick-layers-pass.d.ts.map new file mode 100644 index 00000000000..197eb86d41a --- /dev/null +++ b/modules/core/typed/passes/pick-layers-pass.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"pick-layers-pass.d.ts","sourceRoot":"","sources":["../../src/passes/pick-layers-pass.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,EAAE,EAAC,uBAAuB,EAAE,WAAW,EAAE,IAAI,EAAC,MAAM,eAAe,CAAC;AAMrF,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,uBAAuB,CAAC;AACvD,OAAO,KAAK,QAAQ,MAAM,uBAAuB,CAAC;AAClD,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAOtC,aAAK,2BAA2B,GAAG,uBAAuB,GAAG;IAC3D,UAAU,EAAE,WAAW,CAAC;IACxB,UAAU,EAAE,IAAI,CAAC;IACjB,KAAK,EAAE,OAAO,CAAC;CAChB,CAAC;AAQF,oBAAY,mBAAmB,GAAG,CAAC,WAAW,EAAE,MAAM,EAAE,GAAG,UAAU,KACjE;IACE,WAAW,EAAE,KAAK,CAAC;IACnB,eAAe,EAAE,QAAQ,EAAE,CAAC;IAC5B,iBAAiB,EAAE,MAAM,CAAC;CAC3B,GACD,SAAS,CAAC;AAEd,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,UAAU;IACpD,OAAO,CAAC,KAAK,CAAC,CAAU;IACxB,OAAO,CAAC,OAAO,CAGC;IAEhB,MAAM,CAAC,KAAK,EAAE,2BAA2B;IAYzC,kBAAkB,CAAC,EACjB,MAAM,EACN,WAAW,EACX,KAAK,EACL,SAAS,EACT,gBAAgB,EAChB,UAAU,EACV,UAAU,EAAE,EAAC,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAC,EACjC,QAAQ,EACR,OAAO,EACP,IAAgB,EAChB,KAAK,EACN,EAAE,2BAA2B,GAAG;QAC/B,kBAAkB,EAAE,mBAAmB,GAAG,IAAI,CAAC;QAC/C,KAAK,EAAE,WAAW,CAAC;KACpB;IAuDD,SAAS,CAAC,eAAe,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO;IAIhD,SAAS,CAAC,mBAAmB;;;;;IAU7B,SAAS,CAAC,kBAAkB,CAAC,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,GAAG,GAAG;CAaxF"} \ No newline at end of file diff --git a/modules/core/typed/passes/screen-pass.d.ts b/modules/core/typed/passes/screen-pass.d.ts new file mode 100644 index 00000000000..1ad1e10e059 --- /dev/null +++ b/modules/core/typed/passes/screen-pass.d.ts @@ -0,0 +1,31 @@ +import type {Device} from '@luma.gl/api'; +import type {Framebuffer} from '@luma.gl/webgl-legacy'; +import {ClipSpace} from '@luma.gl/webgl-legacy'; +import Pass from './pass'; +import type {ShaderModule} from '../types/types'; +declare type ScreenPassProps = { + module: ShaderModule; + fs?: string; + id: string; + moduleSettings: any; +}; +declare type ScreenPassRenderOptions = { + inputBuffer: Framebuffer; + outputBuffer: Framebuffer; +}; +/** A base render pass. */ +export default class ScreenPass extends Pass { + model: ClipSpace; + constructor(device: Device, props: ScreenPassProps); + render(params: ScreenPassRenderOptions): void; + delete(): void; + /** + * Renders the pass. + * This is an abstract method that should be overridden. + * @param inputBuffer - Frame buffer that contains the result of the previous pass + * @param outputBuffer - Frame buffer that serves as the output render target + */ + protected _renderPass(device: Device, options: ScreenPassRenderOptions): void; +} +export {}; +// # sourceMappingURL=screen-pass.d.ts.map diff --git a/modules/core/typed/passes/screen-pass.d.ts.map b/modules/core/typed/passes/screen-pass.d.ts.map new file mode 100644 index 00000000000..78751d80723 --- /dev/null +++ b/modules/core/typed/passes/screen-pass.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"screen-pass.d.ts","sourceRoot":"","sources":["../../src/passes/screen-pass.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,cAAc,CAAC;AACzC,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAC,SAAS,EAAuC,MAAM,uBAAuB,CAAC;AACtF,OAAO,IAAI,MAAM,QAAQ,CAAC;AAE1B,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,gBAAgB,CAAC;AAEjD,aAAK,eAAe,GAAG;IACrB,MAAM,EAAE,YAAY,CAAC;IACrB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,EAAE,EAAE,MAAM,CAAC;IACX,cAAc,EAAE,GAAG,CAAC;CACrB,CAAC;AAEF,aAAK,uBAAuB,GAAG;IAC7B,WAAW,EAAE,WAAW,CAAC;IACzB,YAAY,EAAE,WAAW,CAAC;CAC3B,CAAC;AAEF,0BAA0B;AAC1B,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,IAAI;IAC1C,KAAK,EAAE,SAAS,CAAC;gBAEL,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,eAAe;IAMlD,MAAM,CAAC,MAAM,EAAE,uBAAuB,GAAG,IAAI;IAW7C,MAAM;IAON;;;;;OAKG;IACH,SAAS,CAAC,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,uBAAuB;CAevE"} \ No newline at end of file diff --git a/modules/core/typed/passes/shadow-pass.d.ts b/modules/core/typed/passes/shadow-pass.d.ts new file mode 100644 index 00000000000..5cc3939b844 --- /dev/null +++ b/modules/core/typed/passes/shadow-pass.d.ts @@ -0,0 +1,21 @@ +import type {Device} from '@luma.gl/api'; +import {Framebuffer, Texture2D, Renderbuffer} from '@luma.gl/webgl-legacy'; +import {default as LayersPass} from './layers-pass'; +export default class ShadowPass extends LayersPass { + shadowMap: Texture2D; + depthBuffer: Renderbuffer; + fbo: Framebuffer; + constructor( + device: Device, + props?: { + id: any; + } + ); + render(params: any): void; + shouldDrawLayer(layer: any): boolean; + getModuleParameters(): { + drawToShadowMap: boolean; + }; + delete(): void; +} +// # sourceMappingURL=shadow-pass.d.ts.map diff --git a/modules/core/typed/passes/shadow-pass.d.ts.map b/modules/core/typed/passes/shadow-pass.d.ts.map new file mode 100644 index 00000000000..beceb245ee2 --- /dev/null +++ b/modules/core/typed/passes/shadow-pass.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"shadow-pass.d.ts","sourceRoot":"","sources":["../../src/passes/shadow-pass.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,cAAc,CAAC;AACzC,OAAO,EAAK,WAAW,EAAE,SAAS,EAAE,YAAY,EAAiB,MAAM,uBAAuB,CAAC;AAC/F,OAAO,EAAC,OAAO,IAAI,UAAU,EAAC,MAAM,eAAe,CAAC;AAEpD,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,UAAU;IAChD,SAAS,EAAE,SAAS,CAAC;IACrB,WAAW,EAAE,YAAY,CAAC;IAC1B,GAAG,EAAE,WAAW,CAAC;gBAGf,MAAM,EAAE,MAAM,EACd,KAAK,CAAC,EAAE;QACN,EAAE,MAAC;KACJ;IAkCH,MAAM,CAAC,MAAM,KAAA;IA0Bb,eAAe,CAAC,KAAK,KAAA;IAIrB,mBAAmB;;;IAMnB,MAAM;CAgBP"} \ No newline at end of file diff --git a/modules/core/typed/shaderlib/index.d.ts b/modules/core/typed/shaderlib/index.d.ts new file mode 100644 index 00000000000..3064b2069b2 --- /dev/null +++ b/modules/core/typed/shaderlib/index.d.ts @@ -0,0 +1,28 @@ +import {Device} from '@luma.gl/api'; +import {ProgramManager} from '@luma.gl/webgl-legacy'; +import {gouraudLighting, phongLighting} from '@luma.gl/shadertools'; +import project from './project/project'; +import project32 from './project32/project32'; +import shadow from './shadow/shadow'; +import picking from './picking/picking'; +export declare function createProgramManager(device: Device): ProgramManager; +export {picking, project, project32, gouraudLighting, phongLighting, shadow}; +export type {ProjectUniforms} from './project/viewport-uniforms'; +export declare type PickingUniforms = { + picking_uActive: boolean; + picking_uAttribute: boolean; + picking_uSelectedColor: [number, number, number]; + picking_uSelectedColorValid: boolean; + picking_uHighlightColor: [number, number, number, number]; +}; +export declare type LightingModuleSettings = { + material: + | boolean + | { + ambient?: number; + diffuse?: number; + shininess?: number; + specularColor?: [number, number, number]; + }; +}; +// # sourceMappingURL=index.d.ts.map diff --git a/modules/core/typed/shaderlib/index.d.ts.map b/modules/core/typed/shaderlib/index.d.ts.map new file mode 100644 index 00000000000..135cba6f695 --- /dev/null +++ b/modules/core/typed/shaderlib/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/shaderlib/index.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAC,MAAM,EAAC,MAAM,cAAc,CAAC;AACpC,OAAO,EAAC,cAAc,EAAC,MAAM,uBAAuB,CAAC;AAErD,OAAO,EAAC,eAAe,EAAE,aAAa,EAAC,MAAM,sBAAsB,CAAC;AACpE,OAAO,OAAO,MAAM,mBAAmB,CAAC;AACxC,OAAO,SAAS,MAAM,uBAAuB,CAAC;AAC9C,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,OAAO,MAAM,mBAAmB,CAAC;AAWxC,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,kBAWlD;AAED,OAAO,EAAC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,EAAC,CAAC;AAG7E,YAAY,EAAC,eAAe,EAAC,MAAM,6BAA6B,CAAC;AAIjE,oBAAY,eAAe,GAAG;IAC5B,eAAe,EAAE,OAAO,CAAC;IACzB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,sBAAsB,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IACjD,2BAA2B,EAAE,OAAO,CAAC;IACrC,uBAAuB,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;CAC3D,CAAC;AAEF,oBAAY,sBAAsB,GAAG;IACnC,QAAQ,EACJ,OAAO,GACP;QACE,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;KAC1C,CAAC;CACP,CAAC"} \ No newline at end of file diff --git a/modules/core/typed/shaderlib/misc/geometry.d.ts b/modules/core/typed/shaderlib/misc/geometry.d.ts new file mode 100644 index 00000000000..051ce961087 --- /dev/null +++ b/modules/core/typed/shaderlib/misc/geometry.d.ts @@ -0,0 +1,4 @@ +import type {ShaderModule} from '../../types/types'; +declare const _default: ShaderModule; +export default _default; +// # sourceMappingURL=geometry.d.ts.map diff --git a/modules/core/typed/shaderlib/misc/geometry.d.ts.map b/modules/core/typed/shaderlib/misc/geometry.d.ts.map new file mode 100644 index 00000000000..dd1191345d5 --- /dev/null +++ b/modules/core/typed/shaderlib/misc/geometry.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"geometry.d.ts","sourceRoot":"","sources":["../../../src/shaderlib/misc/geometry.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,mBAAmB,CAAC;;AAmCpD,wBAA0D"} \ No newline at end of file diff --git a/modules/core/typed/shaderlib/picking/picking.d.ts b/modules/core/typed/shaderlib/picking/picking.d.ts new file mode 100644 index 00000000000..06c5613dd8d --- /dev/null +++ b/modules/core/typed/shaderlib/picking/picking.d.ts @@ -0,0 +1,14 @@ +import type {ShaderModule} from '../../types/types'; +declare type PickingModuleSettings = { + /** Set to a picking color to visually highlight that item */ + pickingSelectedColor?: [number, number, number] | null; + /** Color of the highlight */ + pickingHighlightColor?: [number, number, number, number]; + /** Set to true when rendering to off-screen "picking" buffer */ + pickingActive?: boolean; + /** Set to true when picking an attribute value instead of object index */ + pickingAttribute?: boolean; +}; +declare const _default: ShaderModule; +export default _default; +// # sourceMappingURL=picking.d.ts.map diff --git a/modules/core/typed/shaderlib/picking/picking.d.ts.map b/modules/core/typed/shaderlib/picking/picking.d.ts.map new file mode 100644 index 00000000000..208b6b9ffe5 --- /dev/null +++ b/modules/core/typed/shaderlib/picking/picking.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"picking.d.ts","sourceRoot":"","sources":["../../../src/shaderlib/picking/picking.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,mBAAmB,CAAC;AAEpD,aAAK,qBAAqB,GAAG;IAC3B,6DAA6D;IAC7D,oBAAoB,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAAC;IACvD,6BAA6B;IAC7B,qBAAqB,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IACzD,gEAAgE;IAChE,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,0EAA0E;IAC1E,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B,CAAC;;AAEF,wBAqByC"} \ No newline at end of file diff --git a/modules/core/typed/shaderlib/project/project-functions.d.ts b/modules/core/typed/shaderlib/project/project-functions.d.ts new file mode 100644 index 00000000000..9dcbbb249ce --- /dev/null +++ b/modules/core/typed/shaderlib/project/project-functions.d.ts @@ -0,0 +1,43 @@ +import type {CoordinateSystem} from '../../lib/constants'; +import type Viewport from '../../viewports/viewport'; +import type {NumericArray} from '../../types/types'; +/** Get the common space position from world coordinates in the given coordinate system */ +export declare function getWorldPosition( + position: number[], + { + viewport, + modelMatrix, + coordinateSystem, + coordinateOrigin, + offsetMode + }: { + viewport: Viewport; + modelMatrix?: NumericArray | null; + coordinateSystem: CoordinateSystem; + coordinateOrigin: [number, number, number]; + offsetMode?: boolean; + } +): [number, number, number]; +/** + * Equivalent to project_position in project.glsl + * projects a user supplied position to world position directly with or without + * a reference coordinate system + */ +export declare function projectPosition( + position: number[], + params: { + /** The current viewport */ + viewport: Viewport; + /** The reference coordinate system used to align world position */ + coordinateSystem: CoordinateSystem; + /** The reference coordinate origin used to align world position */ + coordinateOrigin: [number, number, number]; + /** The model matrix of the supplied position */ + modelMatrix?: NumericArray | null; + /** The coordinate system that the supplied position is in. Default to the same as `coordinateSystem`. */ + fromCoordinateSystem?: CoordinateSystem; + /** The coordinate origin that the supplied position is in. Default to the same as `coordinateOrigin`. */ + fromCoordinateOrigin?: [number, number, number]; + } +): [number, number, number]; +// # sourceMappingURL=project-functions.d.ts.map diff --git a/modules/core/typed/shaderlib/project/project-functions.d.ts.map b/modules/core/typed/shaderlib/project/project-functions.d.ts.map new file mode 100644 index 00000000000..c074cfcffbc --- /dev/null +++ b/modules/core/typed/shaderlib/project/project-functions.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"project-functions.d.ts","sourceRoot":"","sources":["../../../src/shaderlib/project/project-functions.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,qBAAqB,CAAC;AAC1D,OAAO,KAAK,QAAQ,MAAM,0BAA0B,CAAC;AACrD,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,mBAAmB,CAAC;AA8DpD,0FAA0F;AAC1F,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,MAAM,EAAE,EAClB,EACE,QAAQ,EACR,WAAW,EACX,gBAAgB,EAChB,gBAAgB,EAChB,UAAU,EACX,EAAE;IACD,QAAQ,EAAE,QAAQ,CAAC;IACnB,WAAW,CAAC,EAAE,YAAY,GAAG,IAAI,CAAC;IAClC,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,gBAAgB,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IAC3C,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,GACA,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CA+B1B;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,MAAM,EAAE,EAClB,MAAM,EAAE;IACN,2BAA2B;IAC3B,QAAQ,EAAE,QAAQ,CAAC;IACnB,mEAAmE;IACnE,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,mEAAmE;IACnE,gBAAgB,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IAC3C,gDAAgD;IAChD,WAAW,CAAC,EAAE,YAAY,GAAG,IAAI,CAAC;IAClC,yGAAyG;IACzG,oBAAoB,CAAC,EAAE,gBAAgB,CAAC;IACxC,yGAAyG;IACzG,oBAAoB,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;CACjD,GACA,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAgC1B"} \ No newline at end of file diff --git a/modules/core/typed/shaderlib/project/project.d.ts b/modules/core/typed/shaderlib/project/project.d.ts new file mode 100644 index 00000000000..2e6067903a1 --- /dev/null +++ b/modules/core/typed/shaderlib/project/project.d.ts @@ -0,0 +1,5 @@ +import type {ProjectModuleSettings} from './viewport-uniforms'; +import type {ShaderModule} from '../../types/types'; +declare const _default: ShaderModule; +export default _default; +// # sourceMappingURL=project.d.ts.map diff --git a/modules/core/typed/shaderlib/project/project.d.ts.map b/modules/core/typed/shaderlib/project/project.d.ts.map new file mode 100644 index 00000000000..00a17ab8e6b --- /dev/null +++ b/modules/core/typed/shaderlib/project/project.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"project.d.ts","sourceRoot":"","sources":["../../../src/shaderlib/project/project.ts"],"names":[],"mappings":"AAyBA,OAAO,KAAK,EAAC,qBAAqB,EAAC,MAAM,qBAAqB,CAAC;AAC/D,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,mBAAmB,CAAC;;AAWpD,wBAKyC"} \ No newline at end of file diff --git a/modules/core/typed/shaderlib/project/project.glsl.d.ts b/modules/core/typed/shaderlib/project/project.glsl.d.ts new file mode 100644 index 00000000000..0a5a60b619e --- /dev/null +++ b/modules/core/typed/shaderlib/project/project.glsl.d.ts @@ -0,0 +1,3 @@ +declare const _default: string; +export default _default; +// # sourceMappingURL=project.glsl.d.ts.map diff --git a/modules/core/typed/shaderlib/project/project.glsl.d.ts.map b/modules/core/typed/shaderlib/project/project.glsl.d.ts.map new file mode 100644 index 00000000000..ba6f5bcf42a --- /dev/null +++ b/modules/core/typed/shaderlib/project/project.glsl.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"project.glsl.d.ts","sourceRoot":"","sources":["../../../src/shaderlib/project/project.glsl.ts"],"names":[],"mappings":";AAiCA,wBAkQE"} \ No newline at end of file diff --git a/modules/core/typed/shaderlib/project/viewport-uniforms.d.ts b/modules/core/typed/shaderlib/project/viewport-uniforms.d.ts new file mode 100644 index 00000000000..c842575006c --- /dev/null +++ b/modules/core/typed/shaderlib/project/viewport-uniforms.d.ts @@ -0,0 +1,61 @@ +import type Viewport from '../../viewports/viewport'; +import type {CoordinateSystem} from '../../lib/constants'; +import type {NumericArray} from '../../types/types'; +declare type Vec3 = [number, number, number]; +declare type Vec4 = [number, number, number, number]; +export declare function getOffsetOrigin( + viewport: Viewport, + coordinateSystem: CoordinateSystem, + coordinateOrigin?: Vec3 +): { + geospatialOrigin: Vec3 | null; + shaderCoordinateOrigin: Vec3; + offsetMode: boolean; +}; +export declare type ProjectUniforms = { + project_uCoordinateSystem: number; + project_uProjectionMode: number; + project_uCoordinateOrigin: Vec3; + project_uCommonOrigin: Vec3; + project_uCenter: Vec4; + project_uPseudoMeters: boolean; + project_uViewportSize: [number, number]; + project_uDevicePixelRatio: number; + project_uFocalDistance: number; + project_uCommonUnitsPerMeter: Vec3; + project_uCommonUnitsPerWorldUnit: Vec3; + project_uCommonUnitsPerWorldUnit2: Vec3; + /** 2^zoom */ + project_uScale: number; + project_uWrapLongitude: boolean; + project_uViewProjectionMatrix: NumericArray; + project_uModelMatrix: NumericArray; + project_uCameraPosition: Vec3; +}; +export declare type ProjectModuleSettings = { + viewport: Viewport; + devicePixelRatio?: number; + modelMatrix?: NumericArray | null; + coordinateSystem?: CoordinateSystem; + coordinateOrigin?: Vec3; + autoWrapLongitude?: boolean; +}; +/** + * Returns uniforms for shaders based on current projection + * includes: projection matrix suitable for shaders + * + * TODO - Ensure this works with any viewport, not just WebMercatorViewports + * + * @param {WebMercatorViewport} viewport - + * @return {Float32Array} - 4x4 projection matrix that can be used in shaders + */ +export declare function getUniformsFromViewport({ + viewport, + devicePixelRatio, + modelMatrix, + coordinateSystem, + coordinateOrigin, + autoWrapLongitude +}: ProjectModuleSettings): ProjectUniforms; +export {}; +// # sourceMappingURL=viewport-uniforms.d.ts.map diff --git a/modules/core/typed/shaderlib/project/viewport-uniforms.d.ts.map b/modules/core/typed/shaderlib/project/viewport-uniforms.d.ts.map new file mode 100644 index 00000000000..abbddf115c0 --- /dev/null +++ b/modules/core/typed/shaderlib/project/viewport-uniforms.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"viewport-uniforms.d.ts","sourceRoot":"","sources":["../../../src/shaderlib/project/viewport-uniforms.ts"],"names":[],"mappings":"AA4BA,OAAO,KAAK,QAAQ,MAAM,0BAA0B,CAAC;AACrD,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,qBAAqB,CAAC;AAC1D,OAAO,K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,EAAE,gBAAgB,CAAC;IACpC,gBAAgB,CAAC,EAAE,IAAI,CAAC;IACxB,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B,CAAC;AAEF;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,CAAC,EACtC,QAAQ,EACR,gBAAoB,EACpB,WAAkB,EAElB,gBAA4C,EAC5C,gBAA4C,EAC5C,iBAAyB,EAC1B,EAAE,qBAAqB,GAAG,eAAe,CAkBzC"} \ No newline at end of file diff --git a/modules/core/typed/shaderlib/project32/project32.d.ts b/modules/core/typed/shaderlib/project32/project32.d.ts new file mode 100644 index 00000000000..0d4e910bc01 --- /dev/null +++ b/modules/core/typed/shaderlib/project32/project32.d.ts @@ -0,0 +1,4 @@ +import type {ShaderModule} from '../../types/types'; +declare const _default: ShaderModule; +export default _default; +// # sourceMappingURL=project32.d.ts.map diff --git a/modules/core/typed/shaderlib/project32/project32.d.ts.map b/modules/core/typed/shaderlib/project32/project32.d.ts.map new file mode 100644 index 00000000000..5b7b27bd9c0 --- /dev/null +++ b/modules/core/typed/shaderlib/project32/project32.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"project32.d.ts","sourceRoot":"","sources":["../../../src/shaderlib/project32/project32.ts"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,mBAAmB,CAAC;;AAyBpD,wBAIkB"} \ No newline at end of file diff --git a/modules/core/typed/shaderlib/shadow/shadow.d.ts b/modules/core/typed/shaderlib/shadow/shadow.d.ts new file mode 100644 index 00000000000..596ea887bed --- /dev/null +++ b/modules/core/typed/shaderlib/shadow/shadow.d.ts @@ -0,0 +1,17 @@ +import {Matrix4} from '@math.gl/core'; +import type {Texture2D} from '@luma.gl/webgl-legacy'; +import type {ShaderModule} from '../../types/types'; +import type Viewport from '../../viewports/viewport'; +declare type ShadowModuleSettings = { + viewport: Viewport; + shadowEnabled?: boolean; + drawToShadowMap?: boolean; + shadowMaps?: Texture2D[]; + dummyShadowMap?: Texture2D; + shadowColor?: number[]; + shadowMatrices?: Matrix4[]; + shadowLightId?: number; +}; +declare const _default: ShaderModule; +export default _default; +// # sourceMappingURL=shadow.d.ts.map diff --git a/modules/core/typed/shaderlib/shadow/shadow.d.ts.map b/modules/core/typed/shaderlib/shadow/shadow.d.ts.map new file mode 100644 index 00000000000..d0006dd2edf --- /dev/null +++ b/modules/core/typed/shaderlib/shadow/shadow.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"shadow.d.ts","sourceRoot":"","sources":["../../../src/shaderlib/shadow/shadow.ts"],"names":[],"mappings":"AAqBA,OAAO,EAAU,OAAO,EAAC,MAAM,eAAe,CAAC;AAI/C,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,uBAAuB,CAAC;AACrD,OAAO,KAAK,EAAC,YAAY,EAAe,MAAM,mBAAmB,CAAC;AAClE,OAAO,KAAK,QAAQ,MAAM,0BAA0B,CAAC;AAkFrD,aAAK,oBAAoB,GAAG;IAC1B,QAAQ,EAAE,QAAQ,CAAC;IACnB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,UAAU,CAAC,EAAE,SAAS,EAAE,CAAC;IACzB,cAAc,CAAC,EAAE,SAAS,CAAC;IAC3B,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,cAAc,CAAC,EAAE,OAAO,EAAE,CAAC;IAC3B,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC;;AA8HF,wBAuBwC"} \ No newline at end of file diff --git a/modules/core/typed/transitions/cpu-interpolation-transition.d.ts b/modules/core/typed/transitions/cpu-interpolation-transition.d.ts new file mode 100644 index 00000000000..c318887c50c --- /dev/null +++ b/modules/core/typed/transitions/cpu-interpolation-transition.d.ts @@ -0,0 +1,7 @@ +import Transition from './transition'; +export default class CPUInterpolationTransition extends Transition { + _value: any; + get value(): any; + _onUpdate(): void; +} +// # sourceMappingURL=cpu-interpolation-transition.d.ts.map diff --git a/modules/core/typed/transitions/cpu-interpolation-transition.d.ts.map b/modules/core/typed/transitions/cpu-interpolation-transition.d.ts.map new file mode 100644 index 00000000000..7a7ace4f945 --- /dev/null +++ b/modules/core/typed/transitions/cpu-interpolation-transition.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"cpu-interpolation-transition.d.ts","sourceRoot":"","sources":["../../src/transitions/cpu-interpolation-transition.ts"],"names":[],"mappings":"AACA,OAAO,UAAU,MAAM,cAAc,CAAC;AAEtC,MAAM,CAAC,OAAO,OAAO,0BAA2B,SAAQ,UAAU;IAChE,MAAM,MAAC;IAEP,IAAI,KAAK,QAER;IAED,SAAS;CAQV"} \ No newline at end of file diff --git a/modules/core/typed/transitions/cpu-spring-transition.d.ts b/modules/core/typed/transitions/cpu-spring-transition.d.ts new file mode 100644 index 00000000000..655728d3366 --- /dev/null +++ b/modules/core/typed/transitions/cpu-spring-transition.d.ts @@ -0,0 +1,8 @@ +import Transition from './transition'; +export default class CPUSpringTransition extends Transition { + _prevValue: any; + _currValue: any; + get value(): any; + _onUpdate(): void; +} +// # sourceMappingURL=cpu-spring-transition.d.ts.map diff --git a/modules/core/typed/transitions/cpu-spring-transition.d.ts.map b/modules/core/typed/transitions/cpu-spring-transition.d.ts.map new file mode 100644 index 00000000000..8a1b632f1ce --- /dev/null +++ b/modules/core/typed/transitions/cpu-spring-transition.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"cpu-spring-transition.d.ts","sourceRoot":"","sources":["../../src/transitions/cpu-spring-transition.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,cAAc,CAAC;AAsDtC,MAAM,CAAC,OAAO,OAAO,mBAAoB,SAAQ,UAAU;IACzD,UAAU,MAAC;IACX,UAAU,MAAC;IAEX,IAAI,KAAK,QAER;IAED,SAAS;CAkBV"} \ No newline at end of file diff --git a/modules/core/typed/transitions/fly-to-interpolator.d.ts b/modules/core/typed/transitions/fly-to-interpolator.d.ts new file mode 100644 index 00000000000..92b5524e9b6 --- /dev/null +++ b/modules/core/typed/transitions/fly-to-interpolator.d.ts @@ -0,0 +1,37 @@ +import TransitionInterpolator from './transition-interpolator'; +/** + * This class adapts mapbox-gl-js Map#flyTo animation so it can be used in + * react/redux architecture. + * mapbox-gl-js flyTo : https://www.mapbox.com/mapbox-gl-js/api/#map#flyto. + * It implements “Smooth and efficient zooming and panning.” algorithm by + * "Jarke J. van Wijk and Wim A.A. Nuij" + */ +export default class FlyToInterpolator extends TransitionInterpolator { + opts: { + curve: number; + speed: number; + screenSpeed?: number; + maxDuration?: number; + }; + constructor(opts?: { + /** The zooming "curve" that will occur along the flight path. Default 1.414 */ + curve?: number; + /** The average speed of the animation defined in relation to `options.curve`, it linearly affects the duration, higher speed returns smaller durations and vice versa. Default 1.2 */ + speed?: number; + /** The average speed of the animation measured in screenfuls per second. Similar to `opts.speed` it linearly affects the duration, when specified `opts.speed` is ignored. */ + screenSpeed?: number; + /** Maximum duration in milliseconds, if calculated duration exceeds this value, `0` is returned. */ + maxDuration?: number; + }); + interpolateProps( + startProps: any, + endProps: any, + t: any + ): { + longitude: number; + latitude: number; + zoom: number; + }; + getDuration(startProps: any, endProps: any): any; +} +// # sourceMappingURL=fly-to-interpolator.d.ts.map diff --git a/modules/core/typed/transitions/fly-to-interpolator.d.ts.map b/modules/core/typed/transitions/fly-to-interpolator.d.ts.map new file mode 100644 index 00000000000..df6cf8f1720 --- /dev/null +++ b/modules/core/typed/transitions/fly-to-interpolator.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"fly-to-interpolator.d.ts","sourceRoot":"","sources":["../../src/transitions/fly-to-interpolator.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,MAAM,2BAA2B,CAAC;AAW/D;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,OAAO,iBAAkB,SAAQ,sBAAsB;IACnE,IAAI,EAAE;QACJ,KAAK,EAAE,MAAM,CAAC;QACd,KAAK,EAAE,MAAM,CAAC;QACd,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,WAAW,CAAC,EAAE,MAAM,CAAC;KACtB,CAAC;gBAGA,IAAI,GAAE;QACJ,+EAA+E;QAC/E,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,sLAAsL;QACtL,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,+KAA+K;QAC/K,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,oGAAoG;QACpG,WAAW,CAAC,EAAE,MAAM,CAAC;KACjB;IAUR,gBAAgB,CAAC,UAAU,KAAA,EAAE,QAAQ,KAAA,EAAE,CAAC,KAAA;;;;;IAgBxC,WAAW,CAAC,UAAU,KAAA,EAAE,QAAQ,KAAA;CAQjC"} \ No newline at end of file diff --git a/modules/core/typed/transitions/gpu-interpolation-transition.d.ts b/modules/core/typed/transitions/gpu-interpolation-transition.d.ts new file mode 100644 index 00000000000..d10d029d3d7 --- /dev/null +++ b/modules/core/typed/transitions/gpu-interpolation-transition.d.ts @@ -0,0 +1,31 @@ +import type {Device} from '@luma.gl/api'; +import {Timeline} from '@luma.gl/engine'; +import Attribute from '../lib/attribute/attribute'; +import {InterpolationTransitionSettings} from '../lib/attribute/attribute-transition-utils'; +import type GPUTransition from './gpu-transition'; +export default class GPUInterpolationTransition implements GPUTransition { + device: Device; + type: string; + attributeInTransition: Attribute; + private settings?; + private attribute; + private transition; + private currentStartIndices; + private currentLength; + private transform; + private buffers; + constructor({ + device, + attribute, + timeline + }: { + device: Device; + attribute: Attribute; + timeline: Timeline; + }); + get inProgress(): boolean; + start(transitionSettings: InterpolationTransitionSettings, numInstances: number): void; + update(): boolean; + cancel(): void; +} +// # sourceMappingURL=gpu-interpolation-transition.d.ts.map diff --git a/modules/core/typed/transitions/gpu-interpolation-transition.d.ts.map b/modules/core/typed/transitions/gpu-interpolation-transition.d.ts.map new file mode 100644 index 00000000000..c6318b7b50f --- /dev/null +++ b/modules/core/typed/transitions/gpu-interpolation-transition.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"gpu-interpolation-transition.d.ts","sourceRoot":"","sources":["../../src/transitions/gpu-interpolation-transition.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,cAAc,CAAC;AACzC,OAAO,EAAC,QAAQ,EAAC,MAAM,iBAAiB,CAAC;AAEzC,OAAO,SAAS,MAAM,4BAA4B,CAAC;AACnD,OAAO,EAML,+BAA+B,EAChC,MAAM,6CAA6C,CAAC;AAIrD,OAAO,KAAK,aAAa,MAAM,kBAAkB,CAAC;AAElD,MAAM,CAAC,OAAO,OAAO,0BAA2B,YAAW,aAAa;IACtE,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,SAAmB;IACvB,qBAAqB,EAAE,SAAS,CAAC;IAEjC,OAAO,CAAC,QAAQ,CAAC,CAAkC;IACnD,OAAO,CAAC,SAAS,CAAY;IAC7B,OAAO,CAAC,UAAU,CAAa;IAC/B,OAAO,CAAC,mBAAmB,CAAsB;IACjD,OAAO,CAAC,aAAa,CAAS;IAC9B,OAAO,CAAC,SAAS,CAAY;IAC7B,OAAO,CAAC,OAAO,CAAW;gBAEd,EACV,MAAM,EACN,SAAS,EACT,QAAQ,EACT,EAAE;QACD,MAAM,EAAE,MAAM,CAAC;QACf,SAAS,EAAE,SAAS,CAAC;QACrB,QAAQ,EAAE,QAAQ,CAAC;KACpB;IAyBD,IAAI,UAAU,IAAI,OAAO,CAExB;IAOD,KAAK,CAAC,kBAAkB,EAAE,+BAA+B,EAAE,YAAY,EAAE,MAAM,GAAG,IAAI;IAiDtF,MAAM,IAAI,OAAO;IAgBjB,MAAM,IAAI,IAAI;CAQf"} \ No newline at end of file diff --git a/modules/core/typed/transitions/gpu-spring-transition.d.ts b/modules/core/typed/transitions/gpu-spring-transition.d.ts new file mode 100644 index 00000000000..774d5e07f58 --- /dev/null +++ b/modules/core/typed/transitions/gpu-spring-transition.d.ts @@ -0,0 +1,33 @@ +import type {Device} from '@luma.gl/api'; +import {SpringTransitionSettings} from '../lib/attribute/attribute-transition-utils'; +import Attribute from '../lib/attribute/attribute'; +import type {Timeline} from '@luma.gl/engine'; +import type GPUTransition from './gpu-transition'; +export default class GPUSpringTransition implements GPUTransition { + device: Device; + type: string; + attributeInTransition: Attribute; + private settings?; + private attribute; + private transition; + private currentStartIndices; + private currentLength; + private texture; + private framebuffer; + private transform; + private buffers; + constructor({ + device, + attribute, + timeline + }: { + device: Device; + attribute: Attribute; + timeline: Timeline; + }); + get inProgress(): boolean; + start(transitionSettings: SpringTransitionSettings, numInstances: number): void; + update(): boolean; + cancel(): void; +} +// # sourceMappingURL=gpu-spring-transition.d.ts.map diff --git a/modules/core/typed/transitions/gpu-spring-transition.d.ts.map b/modules/core/typed/transitions/gpu-spring-transition.d.ts.map new file mode 100644 index 00000000000..b007d779366 --- /dev/null +++ b/modules/core/typed/transitions/gpu-spring-transition.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"gpu-spring-transition.d.ts","sourceRoot":"","sources":["../../src/transitions/gpu-spring-transition.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,cAAc,CAAC;AASzC,OAAO,EAML,wBAAwB,EACzB,MAAM,6CAA6C,CAAC;AACrD,OAAO,SAAS,MAAM,4BAA4B,CAAC;AAGnD,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,iBAAiB,CAAC;AAQ9C,OAAO,KAAK,aAAa,MAAM,kBAAkB,CAAC;AAElD,MAAM,CAAC,OAAO,OAAO,mBAAoB,YAAW,aAAa;IAC/D,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,SAAY;IAChB,qBAAqB,EAAE,SAAS,CAAC;IAEjC,OAAO,CAAC,QAAQ,CAAC,CAA2B;IAC5C,OAAO,CAAC,SAAS,CAAY;IAC7B,OAAO,CAAC,UAAU,CAAa;IAC/B,OAAO,CAAC,mBAAmB,CAAsB;IACjD,OAAO,CAAC,aAAa,CAAS;IAC9B,OAAO,CAAC,OAAO,CAAgB;IAC/B,OAAO,CAAC,WAAW,CAAkB;IACrC,OAAO,CAAC,SAAS,CAAgB;IACjC,OAAO,CAAC,OAAO,CAAe;gBAElB,EACV,MAAM,EACN,SAAS,EACT,QAAQ,EACT,EAAE;QACD,MAAM,EAAE,MAAM,CAAC;QACf,SAAS,EAAE,SAAS,CAAC;QACrB,QAAQ,EAAE,QAAQ,CAAC;KACpB;IA6BD,IAAI,UAAU,IAAI,OAAO,CAExB;IAOD,KAAK,CAAC,kBAAkB,EAAE,wBAAwB,EAAE,YAAY,EAAE,MAAM,GAAG,IAAI;IAuC/E,MAAM;IAmDN,MAAM;CAUP"} \ No newline at end of file diff --git a/modules/core/typed/transitions/gpu-transition.d.ts b/modules/core/typed/transitions/gpu-transition.d.ts new file mode 100644 index 00000000000..cb1cd08e973 --- /dev/null +++ b/modules/core/typed/transitions/gpu-transition.d.ts @@ -0,0 +1,11 @@ +import type Attribute from '../lib/attribute/attribute'; +import type {TransitionSettings} from '../lib/attribute/attribute-transition-utils'; +export default interface GPUTransition { + get type(): string; + get inProgress(): boolean; + get attributeInTransition(): Attribute; + start(transitionSettings: TransitionSettings, numInstances: number): void; + update(): boolean; + cancel(): void; +} +// # sourceMappingURL=gpu-transition.d.ts.map diff --git a/modules/core/typed/transitions/gpu-transition.d.ts.map b/modules/core/typed/transitions/gpu-transition.d.ts.map new file mode 100644 index 00000000000..8beab470ede --- /dev/null +++ b/modules/core/typed/transitions/gpu-transition.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"gpu-transition.d.ts","sourceRoot":"","sources":["../../src/transitions/gpu-transition.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,4BAA4B,CAAC;AACxD,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,6CAA6C,CAAC;AAEpF,MAAM,CAAC,OAAO,WAAW,aAAa;IACpC,IAAI,IAAI,IAAI,MAAM,CAAC;IACnB,IAAI,UAAU,IAAI,OAAO,CAAC;IAC1B,IAAI,qBAAqB,IAAI,SAAS,CAAC;IAEvC,KAAK,CAAC,kBAAkB,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1E,MAAM,IAAI,OAAO,CAAC;IAClB,MAAM,IAAI,IAAI,CAAC;CAChB"} \ No newline at end of file diff --git a/modules/core/typed/transitions/linear-interpolator.d.ts b/modules/core/typed/transitions/linear-interpolator.d.ts new file mode 100644 index 00000000000..611fa770235 --- /dev/null +++ b/modules/core/typed/transitions/linear-interpolator.d.ts @@ -0,0 +1,51 @@ +import TransitionInterpolator from './transition-interpolator'; +import type Viewport from '../viewports/viewport'; +declare type PropsWithAnchor = { + around?: number[]; + aroundPosition?: number[]; + [key: string]: any; +}; +/** + * Performs linear interpolation of two view states. + */ +export default class LinearInterpolator extends TransitionInterpolator { + opts: { + around?: number[]; + makeViewport?: (props: Record) => Viewport; + }; + /** + * @param {Object} opts + * @param {Array} opts.transitionProps - list of props to apply linear transition to. + * @param {Array} opts.around - a screen point to zoom/rotate around. + * @param {Function} opts.makeViewport - construct a viewport instance with given props. + */ + constructor( + opts?: + | string[] + | { + transitionProps?: + | string[] + | { + compare: string[]; + extract?: string[]; + required?: string[]; + }; + around?: number[]; + makeViewport?: (props: Record) => Viewport; + } + ); + initializeProps( + startProps: Record, + endProps: Record + ): { + start: PropsWithAnchor; + end: PropsWithAnchor; + }; + interpolateProps( + startProps: PropsWithAnchor, + endProps: PropsWithAnchor, + t: number + ): Record; +} +export {}; +// # sourceMappingURL=linear-interpolator.d.ts.map diff --git a/modules/core/typed/transitions/linear-interpolator.d.ts.map b/modules/core/typed/transitions/linear-interpolator.d.ts.map new file mode 100644 index 00000000000..44ea76c0fa9 --- /dev/null +++ b/modules/core/typed/transitions/linear-interpolator.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"linear-interpolator.d.ts","sourceRoot":"","sources":["../../src/transitions/linear-interpolator.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,MAAM,2BAA2B,CAAC;AAG/D,OAAO,KAAK,QAAQ,MAAM,uBAAuB,CAAC;AAKlD,aAAK,eAAe,GAAG;IACrB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,kBAAmB,SAAQ,sBAAsB;IACpE,IAAI,EAAE;QACJ,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;QAClB,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,QAAQ,CAAC;KACzD,CAAC;IAEF;;;;;OAKG;gBAED,IAAI,GACA,MAAM,EAAE,GACR;QACE,eAAe,CAAC,EACZ,MAAM,EAAE,GACR;YACE,OAAO,EAAE,MAAM,EAAE,CAAC;YAClB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;YACnB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;SACrB,CAAC;QACN,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;QAClB,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,QAAQ,CAAC;KACpD;IAoBZ,eAAe,CACb,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC/B,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAC5B;QACD,KAAK,EAAE,eAAe,CAAC;QACvB,GAAG,EAAE,eAAe,CAAC;KACtB;IAoBD,gBAAgB,CACd,UAAU,EAAE,eAAe,EAC3B,QAAQ,EAAE,eAAe,EACzB,CAAC,EAAE,MAAM,GACR,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;CAoBvB"} \ No newline at end of file diff --git a/modules/core/typed/transitions/transition-interpolator.d.ts b/modules/core/typed/transitions/transition-interpolator.d.ts new file mode 100644 index 00000000000..15a8aec5e95 --- /dev/null +++ b/modules/core/typed/transitions/transition-interpolator.d.ts @@ -0,0 +1,55 @@ +export default abstract class TransitionInterpolator { + protected _propsToCompare: string[]; + protected _propsToExtract: string[]; + protected _requiredProps?: string[]; + /** + * @param opts {array|object} + * @param opts.compare {array} - prop names used in equality check + * @param opts.extract {array} - prop names needed for interpolation + * @param opts.required {array} - prop names that must be supplied + * alternatively, supply one list of prop names as `opts` if all of the above are the same. + */ + constructor(opts: {compare: string[]; extract?: string[]; required?: string[]}); + /** + * Checks if two sets of props need transition in between + * @param currentProps {object} - a list of viewport props + * @param nextProps {object} - a list of viewport props + * @returns {bool} - true if two props are equivalent + */ + arePropsEqual(currentProps: Record, nextProps: Record): boolean; + /** + * Called before transition starts to validate/pre-process start and end props + * @param startProps {object} - a list of starting viewport props + * @param endProps {object} - a list of target viewport props + * @returns {Object} {start, end} - start and end props to be passed + * to `interpolateProps` + */ + initializeProps( + startProps: Record, + endProps: Record + ): { + start: Record; + end: Record; + }; + /** + * Returns viewport props in transition + * @param startProps {object} - a list of starting viewport props + * @param endProps {object} - a list of target viewport props + * @param t {number} - a time factor between [0, 1] + * @returns {object} - a list of interpolated viewport props + */ + abstract interpolateProps( + startProps: Record, + endProps: Record, + t: number + ): Record; + /** + * Returns transition duration + * @param startProps {object} - a list of starting viewport props + * @param endProps {object} - a list of target viewport props + * @returns {Number} - transition duration in milliseconds + */ + getDuration(startProps: Record, endProps: Record): number; + _checkRequiredProps(props: any): void; +} +// # sourceMappingURL=transition-interpolator.d.ts.map diff --git a/modules/core/typed/transitions/transition-interpolator.d.ts.map b/modules/core/typed/transitions/transition-interpolator.d.ts.map new file mode 100644 index 00000000000..bfd8864c4cd --- /dev/null +++ b/modules/core/typed/transitions/transition-interpolator.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"transition-interpolator.d.ts","sourceRoot":"","sources":["../../src/transitions/transition-interpolator.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,OAAO,CAAC,QAAQ,OAAO,sBAAsB;IAClD,SAAS,CAAC,eAAe,EAAE,MAAM,EAAE,CAAC;IACpC,SAAS,CAAC,eAAe,EAAE,MAAM,EAAE,CAAC;IACpC,SAAS,CAAC,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAEpC;;;;;;OAMG;gBACS,IAAI,EAAE;QAAC,OAAO,EAAE,MAAM,EAAE,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;KAAC;IAQ9E;;;;;OAKG;IACH,aAAa,CAAC,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,OAAO;IAazF;;;;;;OAMG;IACH,eAAe,CACb,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC/B,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAC5B;QACD,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QAC3B,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;KAC1B;IAiBD;;;;;;OAMG;IACH,QAAQ,CAAC,gBAAgB,CACvB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC/B,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC7B,CAAC,EAAE,MAAM,GACR,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAEtB;;;;;OAKG;IACH,WAAW,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM;IAInF,mBAAmB,CAAC,KAAK,KAAA;CAa1B"} \ No newline at end of file diff --git a/modules/core/typed/transitions/transition.d.ts b/modules/core/typed/transitions/transition.d.ts new file mode 100644 index 00000000000..4da55050f48 --- /dev/null +++ b/modules/core/typed/transitions/transition.d.ts @@ -0,0 +1,46 @@ +import type {Timeline} from '@luma.gl/engine'; +export declare type TransitionSettings = { + duration: number; + onStart?: (transition: Transition) => void; + onUpdate?: (transition: Transition) => void; + onInterrupt?: (transition: Transition) => void; + onEnd?: (transition: Transition) => void; +}; +export default class Transition { + private _inProgress; + private _handle; + private _timeline; + time: number; + settings: TransitionSettings & { + fromValue: any; + toValue: any; + duration: any; + easing: any; + damping: any; + stiffness: any; + }; + /** + * @params timeline {Timeline} + */ + constructor(timeline: Timeline); + get inProgress(): boolean; + /** + * (re)start this transition. + * @params props {object} - optional overriding props. see constructor + */ + start(settings: TransitionSettings): void; + /** + * end this transition if it is in progress. + */ + end(): void; + /** + * cancel this transition if it is in progress. + */ + cancel(): void; + /** + * update this transition. Returns `true` if updated. + */ + update(): boolean; + protected _onUpdate(): void; +} +// # sourceMappingURL=transition.d.ts.map diff --git a/modules/core/typed/transitions/transition.d.ts.map b/modules/core/typed/transitions/transition.d.ts.map new file mode 100644 index 00000000000..d32be64aa96 --- /dev/null +++ b/modules/core/typed/transitions/transition.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"transition.d.ts","sourceRoot":"","sources":["../../src/transitions/transition.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,iBAAiB,CAAC;AAE9C,oBAAY,kBAAkB,GAAG;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,CAAC,UAAU,EAAE,UAAU,KAAK,IAAI,CAAC;IAC3C,QAAQ,CAAC,EAAE,CAAC,UAAU,EAAE,UAAU,KAAK,IAAI,CAAC;IAC5C,WAAW,CAAC,EAAE,CAAC,UAAU,EAAE,UAAU,KAAK,IAAI,CAAC;IAC/C,KAAK,CAAC,EAAE,CAAC,UAAU,EAAE,UAAU,KAAK,IAAI,CAAC;CAC1C,CAAC;AAEF,MAAM,CAAC,OAAO,OAAO,UAAU;IAC7B,OAAO,CAAC,WAAW,CAAkB;IACrC,OAAO,CAAC,OAAO,CAAuB;IACtC,OAAO,CAAC,SAAS,CAAW;IAE5B,IAAI,EAAE,MAAM,CAAK;IAEjB,QAAQ,EAAE,kBAAkB,GAAG;QAAC,SAAS,MAAC;QAAC,OAAO,MAAC;QAAC,QAAQ,MAAC;QAAC,MAAM,MAAC;QAAC,OAAO,MAAC;QAAC,SAAS,MAAA;KAAC,CAEvF;IAEF;;OAEG;gBACS,QAAQ,EAAE,QAAQ;IAK9B,IAAI,UAAU,IAAI,OAAO,CAExB;IAED;;;OAGG;IACH,KAAK,CAAC,QAAQ,EAAE,kBAAkB;IAQlC;;OAEG;IACH,GAAG;IASH;;OAEG;IACH,MAAM;IASN;;OAEG;IACH,MAAM;IAiCN,SAAS,CAAC,SAAS;CAGpB"} \ No newline at end of file diff --git a/modules/core/typed/types/layer-props.d.ts b/modules/core/typed/types/layer-props.d.ts new file mode 100644 index 00000000000..9fd0bbc0278 --- /dev/null +++ b/modules/core/typed/types/layer-props.d.ts @@ -0,0 +1,246 @@ +import type {CoordinateSystem} from '../lib/constants'; +import type Layer from '../lib/layer'; +import type {BinaryAttribute} from '../lib/attribute/attribute'; +import type {ConstructorOf, NumericArray, TypedArray} from './types'; +import type {PickingInfo} from '../lib/picking/pick-info'; +import type {MjolnirEvent} from 'mjolnir.js'; +import type {Buffer, Texture2D, Texture2DProps} from '@luma.gl/webgl-legacy'; +import type {Loader} from '@loaders.gl/loader-utils'; +import type {LightingModuleSettings} from '../shaderlib'; +export declare type LayerData = + | Iterable + | { + length: number; + attributes?: Record; + }; +export declare type AccessorContext = { + /** The index of the current iteration */ + index: number; + /** The value of the `data` prop */ + data: LayerData; + /** A pre-allocated array. The accessor function can optionally fill data into this array and return it, + * instead of creating a new array for every object. In some browsers this improves performance significantly + * by reducing garbage collection. */ + target: number[]; +}; +/** Function that returns a value for each object. */ +export declare type AccessorFunction = ( + /** + * The current element in the data stream. + * + * If `data` is an array or an iterable, the element of the current iteration is used. + * If `data` is a non-iterable object, this argument is always `null`. + * */ + object: In, + /** Contextual information of the current element. */ + objectInfo: AccessorContext +) => Out; +/** Either a uniform value for all objects, or a function that returns a value for each object. */ +export declare type Accessor = Out | AccessorFunction; +/** A position in the format of `[lng, lat, alt?]` or `[x, y, z?]` depending on the coordinate system. + * See https://deck.gl/docs/developer-guide/coordinate-systems#positions + */ +export declare type Position = + | [number, number] + | [number, number, number] + | Float32Array + | Float64Array; +/** A color in the format of `[r, g, b, a?]` */ +export declare type Color = + | [number, number, number] + | [number, number, number, number] + | Uint8Array + | Uint8ClampedArray; +export declare type Material = LightingModuleSettings['material']; +/** The unit of dimensions. + * See https://deck.gl/docs/developer-guide/coordinate-systems#dimensions + */ +export declare type Unit = 'meters' | 'common' | 'pixels'; +export declare type Texture = + | Texture2D + | Texture2DProps + | HTMLImageElement + | ImageData + | HTMLCanvasElement + | HTMLVideoElement + | ImageBitmap; +/** + * Base Layer prop types + */ +export declare type LayerProps = { + /** + * Unique identifier of the layer. + */ + id: string; + /** + * The data to visualize. + */ + data?: LayerData | string | AsyncIterable | Promise>; + /** + * Callback to determine if two data values are equal. + */ + dataComparator?: + | ((newData: LayerData, oldData?: LayerData) => boolean) + | null; + /** + * Callback to determine the difference between two data values, in order to perform a partial update. + */ + _dataDiff?: + | (( + newData: LayerData, + oldData?: LayerData + ) => { + startRow: number; + endRow?: number; + }[]) + | null; + /** + * Callback to manipulate remote data when it's fetched and parsed. + */ + dataTransform?: + | ((data: LayerData, previousData?: LayerData) => LayerData) + | null; + /** + * Custom implementation to fetch and parse content from URLs. + */ + fetch?: ( + url: string, + context: { + propName: string; + layer: Layer; + loaders?: Loader[]; + loadOptions?: any; + signal?: AbortSignal; + } + ) => any; + /** + * The dependencies used to trigger re-evaluation of functional accessors (get*). + */ + updateTriggers?: Record; + /** + * The purpose of the layer + */ + operation?: 'draw' | 'mask'; + /** + * If the layer should be rendered. Default true. + */ + visible?: boolean; + /** + * If the layer can be picked on pointer events. Default false. + */ + pickable?: boolean; + /** + * Opacity of the layer, between 0 and 1. Default 1. + */ + opacity?: number; + /** + * The coordinate system of the data. Default to COORDINATE_SYSTEM.LNGLAT in a geospatial view or COORDINATE_SYSTEM.CARTESIAN in a non-geospatial view. + */ + coordinateSystem?: CoordinateSystem; + /** + * The coordinate origin of the data. + */ + coordinateOrigin?: [number, number, number]; + /** + * A 4x4 matrix to transform local coordianates to the world space. + */ + modelMatrix?: NumericArray | null; + /** + * (Geospatial only) normalize geometries that cross the 180th meridian. Default false. + */ + wrapLongitude?: boolean; + /** + * The format of positions, default 'XYZ'. + */ + positionFormat?: 'XYZ' | 'XY'; + /** + * The format of colors, default 'RGBA'. + */ + colorFormat?: 'RGBA' | 'RGB'; + /** + * Override the WebGL parameters used to draw this layer. See https://luma.gl/modules/gltools/docs/api-reference/parameter-setting#parameters + */ + parameters?: any; + /** + * Create smooth transitions when prop values update. + */ + transitions?: Record | null; + /** + * Add additional functionalities to this layer. + */ + extensions?: any[]; + /** + * Add support for additional data formats. + */ + loaders?: Loader[]; + /** + * Options to customize the behavior of loaders + */ + loadOptions?: any; + /** + * Callback to calculate the polygonOffset WebGL parameter. + */ + getPolygonOffset?: ((params: {layerIndex: number}) => [number, number]) | null; + /** + * Enable GPU-based object highlighting. Default false. + */ + autoHighlight?: boolean; + /** + * The index of the data object to highlight. If unspecified, the currently hoverred object is highlighted. + */ + highlightedObjectIndex?: number | null; + /** + * The color of the highlight. + */ + highlightColor?: number[] | ((pickingInfo: PickingInfo) => number[]); + /** + * Called when remote data is fetched and parsed. + */ + onDataLoad?: + | (( + data: LayerData, + context: { + propName: string; + layer: Layer; + } + ) => void) + | null; + /** + * Called when the layer encounters an error. + */ + onError?: ((error: Error) => boolean | void) | null; + /** + * Called when the mouse enters/leaves an object of this layer. + */ + onHover?: ((pickingInfo: PickingInfo, event: MjolnirEvent) => boolean | void) | null; + /** + * Called when the mouse clicks over an object of this layer. + */ + onClick?: ((pickingInfo: PickingInfo, event: MjolnirEvent) => boolean | void) | null; + /** + * Called when the mouse starts dragging an object of this layer. + */ + onDragStart?: ((pickingInfo: PickingInfo, event: MjolnirEvent) => boolean | void) | null; + /** + * Called when the mouse drags an object of this layer. + */ + onDrag?: ((pickingInfo: PickingInfo, event: MjolnirEvent) => boolean | void) | null; + /** + * Called when the mouse releases an object of this layer. + */ + onDragEnd?: ((pickingInfo: PickingInfo, event: MjolnirEvent) => boolean | void) | null; + /** (Advanced) supply attribute size externally */ + numInstances?: number | null; + /** (Advanced) supply variable-width attribute size externally */ + startIndices?: NumericArray | null; +}; +export declare type CompositeLayerProps = LayerProps & { + /** (Experimental) override sub layer props. Only works on a composite layer. */ + _subLayerProps?: { + [subLayerId: string]: { + type?: ConstructorOf; + [propName: string]: any; + }; + } | null; +}; +// # sourceMappingURL=layer-props.d.ts.map diff --git a/modules/core/typed/types/layer-props.d.ts.map b/modules/core/typed/types/layer-props.d.ts.map new file mode 100644 index 00000000000..6e2540cdd3b --- /dev/null +++ b/modules/core/typed/types/layer-props.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"layer-props.d.ts","sourceRoot":"","sources":["../../src/types/layer-props.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,kBAAkB,CAAC;AACvD,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,4BAA4B,CAAC;AAChE,OAAO,KAAK,EAAC,aAAa,EAAE,YAAY,EAAE,UAAU,EAAC,MAAM,SAAS,CAAC;AACrE,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,0BAA0B,CAAC;AAC1D,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,YAAY,CAAC;AAE7C,OAAO,KAAK,EAAC,MAAM,EAAE,SAAS,EAAE,cAAc,EAAC,MAAM,uBAAuB,CAAC;AAC7E,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,0BAA0B,CAAC;A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AAG,IAAI,CAAC;IAE7B,iEAAiE;IACjE,YAAY,CAAC,EAAE,YAAY,GAAG,IAAI,CAAC;CACpC,CAAC;AAEF,oBAAY,mBAAmB,CAAC,QAAQ,GAAG,GAAG,IAAI,UAAU,CAAC,QAAQ,CAAC,GAAG;IACvE,gFAAgF;IAChF,cAAc,CAAC,EAAE;QACf,CAAC,UAAU,EAAE,MAAM,GAAG;YACpB,IAAI,CAAC,EAAE,aAAa,CAAC,KAAK,CAAC,CAAC;YAC5B,CAAC,QAAQ,EAAE,MAAM,GAAG,GAAG,CAAC;SACzB,CAAC;KACH,GAAG,IAAI,CAAC;CACV,CAAC"} \ No newline at end of file diff --git a/modules/core/typed/types/types.d.ts b/modules/core/typed/types/types.d.ts new file mode 100644 index 00000000000..3ffb1bf032b --- /dev/null +++ b/modules/core/typed/types/types.d.ts @@ -0,0 +1,13 @@ +export {TypedArray, TypedArrayConstructor, NumberArray as NumericArray} from '@luma.gl/api'; +export interface ConstructorOf { + new (...args: any[]): T; +} +import {ShaderModule as _ShaderModule} from '@luma.gl/shadertools'; +export declare type ShaderModule = _ShaderModule & { + passes?: { + sampler?: string | boolean; + filter?: boolean; + uniforms?: Record; + }[]; +}; +// # sourceMappingURL=types.d.ts.map diff --git a/modules/core/typed/types/types.d.ts.map b/modules/core/typed/types/types.d.ts.map new file mode 100644 index 00000000000..45f842bcfd6 --- /dev/null +++ b/modules/core/typed/types/types.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types/types.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,UAAU,EAAE,qBAAqB,EAAE,WAAW,IAAI,YAAY,EAAC,MAAM,cAAc,CAAC;AAE5F,MAAM,WAAW,aAAa,CAAC,CAAC;IAC9B,KAAK,GAAG,IAAI,OAAA,GAAG,CAAC,CAAC;CAClB;AAED,OAAO,EAAC,YAAY,IAAI,aAAa,EAAC,MAAM,sBAAsB,CAAC;AAEnE,oBAAY,YAAY,CAAC,SAAS,GAAG,GAAG,IAAI,aAAa,GAAG;IAS1D,MAAM,CAAC,EAAE;QACP,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;QAC3B,MAAM,CAAC,EAAE,OAAO,CAAC;QACjB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;KAChC,EAAE,CAAC;CACL,CAAC"} \ No newline at end of file diff --git a/modules/core/typed/utils/array-utils.d.ts b/modules/core/typed/utils/array-utils.d.ts new file mode 100644 index 00000000000..0b012cdcd22 --- /dev/null +++ b/modules/core/typed/utils/array-utils.d.ts @@ -0,0 +1,16 @@ +export declare function padArray({ + source, + target, + size, + getData, + sourceStartIndices, + targetStartIndices +}: { + source: any; + target: any; + size: any; + getData: any; + sourceStartIndices: any; + targetStartIndices: any; +}): any; +// # sourceMappingURL=array-utils.d.ts.map diff --git a/modules/core/typed/utils/array-utils.d.ts.map b/modules/core/typed/utils/array-utils.d.ts.map new file mode 100644 index 00000000000..efd2616d6ad --- /dev/null +++ b/modules/core/typed/utils/array-utils.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"array-utils.d.ts","sourceRoot":"","sources":["../../src/utils/array-utils.ts"],"names":[],"mappings":"AAuEA,wBAAgB,QAAQ,CAAC,EAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAC;;;;;;;CAAA,OA+C/F"} \ No newline at end of file diff --git a/modules/core/typed/utils/assert.d.ts b/modules/core/typed/utils/assert.d.ts new file mode 100644 index 00000000000..7a81bcbfac7 --- /dev/null +++ b/modules/core/typed/utils/assert.d.ts @@ -0,0 +1,2 @@ +export default function assert(condition: any, message?: string): asserts condition; +// # sourceMappingURL=assert.d.ts.map diff --git a/modules/core/typed/utils/assert.d.ts.map b/modules/core/typed/utils/assert.d.ts.map new file mode 100644 index 00000000000..420a75884a2 --- /dev/null +++ b/modules/core/typed/utils/assert.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"assert.d.ts","sourceRoot":"","sources":["../../src/utils/assert.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,SAAS,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAIlF"} \ No newline at end of file diff --git a/modules/core/typed/utils/color.d.ts b/modules/core/typed/utils/color.d.ts new file mode 100644 index 00000000000..ff079baedeb --- /dev/null +++ b/modules/core/typed/utils/color.d.ts @@ -0,0 +1,14 @@ +import {NumericArray} from '../types/types'; +/** Parse array or string color */ +declare function parseColor( + color: NumericArray, + target?: NumericArray, + index?: number +): NumericArray; +declare function applyOpacity(color: NumericArray, opacity?: number): NumericArray; +declare const _default: { + parseColor: typeof parseColor; + applyOpacity: typeof applyOpacity; +}; +export default _default; +// # sourceMappingURL=color.d.ts.map diff --git a/modules/core/typed/utils/color.d.ts.map b/modules/core/typed/utils/color.d.ts.map new file mode 100644 index 00000000000..fb4e0869363 --- /dev/null +++ b/modules/core/typed/utils/color.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"color.d.ts","sourceRoot":"","sources":["../../src/utils/color.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,YAAY,EAAC,MAAM,gBAAgB,CAAC;AAE5C,kCAAkC;AAClC,iBAAS,UAAU,CACjB,KAAK,EAAE,YAAY,EACnB,MAAM,GAAE,YAAiB,EACzB,KAAK,GAAE,MAAU,GAChB,YAAY,CAoBd;AAoBD,iBAAS,YAAY,CAAC,KAAK,EAAE,YAAY,EAAE,OAAO,GAAE,MAAY,GAAG,YAAY,CAE9E;;;;;AAKD,wBAA0C"} \ No newline at end of file diff --git a/modules/core/typed/utils/count.d.ts b/modules/core/typed/utils/count.d.ts new file mode 100644 index 00000000000..dc666da7e3a --- /dev/null +++ b/modules/core/typed/utils/count.d.ts @@ -0,0 +1,9 @@ +/** + * Deduces numer of elements in a JavaScript container. + * - Auto-deduction for ES6 containers that define a count() method + * - Auto-deduction for ES6 containers that define a size member + * - Auto-deduction for Classic Arrays via the built-in length attribute + * - Also handles objects, although note that this an O(N) operation + */ +export declare function count(container: any): number; +// # sourceMappingURL=count.d.ts.map diff --git a/modules/core/typed/utils/count.d.ts.map b/modules/core/typed/utils/count.d.ts.map new file mode 100644 index 00000000000..71499553f15 --- /dev/null +++ b/modules/core/typed/utils/count.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"count.d.ts","sourceRoot":"","sources":["../../src/utils/count.ts"],"names":[],"mappings":"AAuBA;;;;;;GAMG;AACH,wBAAgB,KAAK,CAAC,SAAS,EAAE,GAAG,GAAG,MAAM,CA4B5C"} \ No newline at end of file diff --git a/modules/core/typed/utils/deep-equal.d.ts b/modules/core/typed/utils/deep-equal.d.ts new file mode 100644 index 00000000000..14961eb00ec --- /dev/null +++ b/modules/core/typed/utils/deep-equal.d.ts @@ -0,0 +1,2 @@ +export declare function deepEqual(a: any, b: any): boolean; +// # sourceMappingURL=deep-equal.d.ts.map diff --git a/modules/core/typed/utils/deep-equal.d.ts.map b/modules/core/typed/utils/deep-equal.d.ts.map new file mode 100644 index 00000000000..b95ae4b9dc4 --- /dev/null +++ b/modules/core/typed/utils/deep-equal.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"deep-equal.d.ts","sourceRoot":"","sources":["../../src/utils/deep-equal.ts"],"names":[],"mappings":"AACA,wBAAgB,SAAS,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,GAAG,OAAO,CAkBjD"} \ No newline at end of file diff --git a/modules/core/typed/utils/flatten.d.ts b/modules/core/typed/utils/flatten.d.ts new file mode 100644 index 00000000000..73bfa10f1c4 --- /dev/null +++ b/modules/core/typed/utils/flatten.d.ts @@ -0,0 +1,29 @@ +declare type NestedArray = (T | NestedArray)[]; +/** + * Flattens a nested array into a single level array, + * or a single value into an array with one value + * @example flatten([[1, [2]], [3], 4]) => [1, 2, 3, 4] + * @example flatten(1) => [1] + * @param array The array to flatten. + * @param filter= - Optional predicate called on each `value` to + * determine if it should be included (pushed onto) the resulting array. + * @return Returns the new flattened array (new array or `result` if provided) + */ +export declare function flatten( + array: T | NestedArray, + filter?: (element: T) => boolean +): T[]; +/** Uses copyWithin to significantly speed up typed array value filling */ +export declare function fillArray({ + target, + source, + start, + count +}: { + target: any; + source: any; + start?: number; + count?: number; +}): any; +export {}; +// # sourceMappingURL=flatten.d.ts.map diff --git a/modules/core/typed/utils/flatten.d.ts.map b/modules/core/typed/utils/flatten.d.ts.map new file mode 100644 index 00000000000..d88c936f898 --- /dev/null +++ b/modules/core/typed/utils/flatten.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"flatten.d.ts","sourceRoot":"","sources":["../../src/utils/flatten.ts"],"names":[],"mappings":"AAoBA,aAAK,WAAW,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AAE7C;;;;;;;;;GASG;AACH,wBAAgB,OAAO,CAAC,CAAC,EACvB,KAAK,EAAE,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,EACzB,MAAM,GAAE,CAAC,OAAO,EAAE,CAAC,KAAK,OAAoB,GAC3C,CAAC,EAAE,CAOL;AAgBD,0EAA0E;AAC1E,wBAAgB,SAAS,CAAC,EAAC,MAAM,EAAE,MAAM,EAAE,KAAS,EAAE,KAAS,EAAC;;;;;CAAA,OAqB/D"} \ No newline at end of file diff --git a/modules/core/typed/utils/iterable-utils.d.ts b/modules/core/typed/utils/iterable-utils.d.ts new file mode 100644 index 00000000000..0ef27d4558b --- /dev/null +++ b/modules/core/typed/utils/iterable-utils.d.ts @@ -0,0 +1,26 @@ +import type {NumericArray} from '../types/types'; +import type {AccessorFunction} from '../types/layer-props'; +export declare function createIterable( + data: any, + startRow?: number, + endRow?: number +): { + iterable: Iterable; + objectInfo: { + index: number; + data: any; + target: any[]; + }; +}; +export declare function isAsyncIterable(data: any): boolean; +export declare function getAccessorFromBuffer( + typedArray: any, + options: { + size: number; + stride?: number; + offset?: number; + startIndices?: NumericArray; + nested?: boolean; + } +): AccessorFunction; +// # sourceMappingURL=iterable-utils.d.ts.map diff --git a/modules/core/typed/utils/iterable-utils.d.ts.map b/modules/core/typed/utils/iterable-utils.d.ts.map new file mode 100644 index 00000000000..07caca720cb --- /dev/null +++ b/modules/core/typed/utils/iterable-utils.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"iterable-utils.d.ts","sourceRoot":"","sources":["../../src/utils/iterable-utils.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,gBAAgB,CAAC;AACjD,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,sBAAsB,CAAC;AAU3D,wBAAgB,cAAc,CAC5B,IAAI,KAAA,EACJ,QAAQ,SAAI,EACZ,MAAM,SAAW,GAChB;IACD,QAAQ,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC;IACxB,UAAU,EAAE;QACV,KAAK,EAAE,MAAM,CAAC;QACd,IAAI,EAAE,GAAG,CAAC;QACV,MAAM,EAAE,GAAG,EAAE,CAAC;KACf,CAAC;CACH,CA0BA;AAKD,wBAAgB,eAAe,CAAC,IAAI,KAAA,GAAG,OAAO,CAE7C;AAKD,wBAAgB,qBAAqB,CACnC,UAAU,KAAA,EACV,OAAO,EAAE;IACP,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,GACA,gBAAgB,CAAC,GAAG,EAAE,YAAY,CAAC,CA+CrC"} \ No newline at end of file diff --git a/modules/core/typed/utils/json-loader.d.ts b/modules/core/typed/utils/json-loader.d.ts new file mode 100644 index 00000000000..85e2e48dfd6 --- /dev/null +++ b/modules/core/typed/utils/json-loader.d.ts @@ -0,0 +1,4 @@ +import type {Loader} from '@loaders.gl/loader-utils'; +declare const _default: Loader; +export default _default; +// # sourceMappingURL=json-loader.d.ts.map diff --git a/modules/core/typed/utils/json-loader.d.ts.map b/modules/core/typed/utils/json-loader.d.ts.map new file mode 100644 index 00000000000..e2275161cf4 --- /dev/null +++ b/modules/core/typed/utils/json-loader.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"json-loader.d.ts","sourceRoot":"","sources":["../../src/utils/json-loader.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,0BAA0B,CAAC;;AASrD,wBAUY"} \ No newline at end of file diff --git a/modules/core/typed/utils/log.d.ts b/modules/core/typed/utils/log.d.ts new file mode 100644 index 00000000000..fa390f6d1d7 --- /dev/null +++ b/modules/core/typed/utils/log.d.ts @@ -0,0 +1,4 @@ +import {Log} from '@probe.gl/log'; +declare const _default: Log; +export default _default; +// # sourceMappingURL=log.d.ts.map diff --git a/modules/core/typed/utils/log.d.ts.map b/modules/core/typed/utils/log.d.ts.map new file mode 100644 index 00000000000..56d9ec6efb2 --- /dev/null +++ b/modules/core/typed/utils/log.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"log.d.ts","sourceRoot":"","sources":["../../src/utils/log.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,GAAG,EAAC,MAAM,eAAe,CAAC;;AAElC,wBAAqC"} \ No newline at end of file diff --git a/modules/core/typed/utils/math-utils.d.ts b/modules/core/typed/utils/math-utils.d.ts new file mode 100644 index 00000000000..ada6c0937c7 --- /dev/null +++ b/modules/core/typed/utils/math-utils.d.ts @@ -0,0 +1,44 @@ +import {Vector3, NumericArray} from '@math.gl/core'; +import type {Matrix4} from '@math.gl/core'; +export declare function createMat4(): number[]; +export declare function mod(value: number, divisor: number): number; +export declare function getCameraPosition( + viewMatrixInverse: Matrix4 | NumericArray +): [number, number, number]; +export declare type FrustumPlane = { + distance: number; + normal: Vector3; +}; +export declare function getFrustumPlanes(viewProjectionMatrix: Matrix4 | NumericArray): { + left: FrustumPlane; + right: FrustumPlane; + top: FrustumPlane; + bottom: FrustumPlane; + near: FrustumPlane; + far: FrustumPlane; +}; +/** + * Calculate the low part of a WebGL 64 bit float + * @param x {number} - the input float number + * @returns {number} - the lower 32 bit of the number + */ +export declare function fp64LowPart(x: number): number; +/** + * Split a Float64Array into a double-length Float32Array + * @param typedArray + * @param options + * @param options.size - per attribute size + * @param options.startIndex - start index in the source array + * @param options.endIndex - end index in the source array + * @returns {} - high part, low part for each attribute: + [1xHi, 1yHi, 1zHi, 1xLow, 1yLow, 1zLow, 2xHi, ...] + */ +export declare function toDoublePrecisionArray( + typedArray: Float64Array, + options: { + size?: number; + startIndex?: number; + endIndex?: number; + } +): Float32Array; +// # sourceMappingURL=math-utils.d.ts.map diff --git a/modules/core/typed/utils/math-utils.d.ts.map b/modules/core/typed/utils/math-utils.d.ts.map new file mode 100644 index 00000000000..1a16df4d5a9 --- /dev/null +++ b/modules/core/typed/utils/math-utils.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"math-utils.d.ts","sourceRoot":"","sources":["../../src/utils/math-utils.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,OAAO,EAAE,YAAY,EAAC,MAAM,eAAe,CAAC;AAEpD,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,eAAe,CAAC;AAG3C,wBAAgB,UAAU,IAAI,MAAM,EAAE,CAErC;AAED,wBAAgB,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAG1D;AAGD,wBAAgB,iBAAiB,CAC/B,iBAAiB,EAAE,OAAO,GAAG,YAAY,GACxC,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAG1B;AAED,oBAAY,YAAY,GAAG;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC;CACjB,CAAC;AAGF,wBAAgB,gBAAgB,CAAC,oBAAoB,EAAE,OAAO,GAAG,YAAY,GAAG;IAC9E,IAAI,EAAE,YAAY,CAAC;IACnB,KAAK,EAAE,YAAY,CAAC;IACpB,GAAG,EAAE,YAAY,CAAC;IAClB,MAAM,EAAE,YAAY,CAAC;IACrB,IAAI,EAAE,YAAY,CAAC;IACnB,GAAG,EAAE,YAAY,CAAC;CACnB,CAuCA;AAUD;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAE7C;AAID;;;;;;;;;GASG;AACH,wBAAgB,sBAAsB,CACpC,UAAU,EAAE,YAAY,EACxB,OAAO,EAAE;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAC,GAC/D,YAAY,CAuBd"} \ No newline at end of file diff --git a/modules/core/typed/utils/memoize.d.ts b/modules/core/typed/utils/memoize.d.ts new file mode 100644 index 00000000000..5b8b0d41d54 --- /dev/null +++ b/modules/core/typed/utils/memoize.d.ts @@ -0,0 +1,7 @@ +/** + * Speed up consecutive function calls by caching the result of calls with identical input + * https://en.wikipedia.org/wiki/Memoization + * @param {function} compute - the function to be memoized + */ +export default function memoize(compute: (args: In) => Out): (args: In) => Out; +// # sourceMappingURL=memoize.d.ts.map diff --git a/modules/core/typed/utils/memoize.d.ts.map b/modules/core/typed/utils/memoize.d.ts.map new file mode 100644 index 00000000000..1ac5a453249 --- /dev/null +++ b/modules/core/typed/utils/memoize.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"memoize.d.ts","sourceRoot":"","sources":["../../src/utils/memoize.ts"],"names":[],"mappings":"AAsBA;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,OAAO,CAAC,EAAE,EAAE,GAAG,EAAE,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE,KAAK,GAAG,GAAG,CAAC,IAAI,EAAE,EAAE,KAAK,GAAG,CActF"} \ No newline at end of file diff --git a/modules/core/typed/utils/positions.d.ts b/modules/core/typed/utils/positions.d.ts new file mode 100644 index 00000000000..422ae7b9c05 --- /dev/null +++ b/modules/core/typed/utils/positions.d.ts @@ -0,0 +1,7 @@ +export declare type Position = { + position: number; + relative: boolean; +}; +export declare function parsePosition(value: number | string): Position; +export declare function getPosition(position: Position, extent: number): number; +// # sourceMappingURL=positions.d.ts.map diff --git a/modules/core/typed/utils/positions.d.ts.map b/modules/core/typed/utils/positions.d.ts.map new file mode 100644 index 00000000000..e30839d43ed --- /dev/null +++ b/modules/core/typed/utils/positions.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"positions.d.ts","sourceRoot":"","sources":["../../src/utils/positions.ts"],"names":[],"mappings":"AAEA,oBAAY,QAAQ,GAAG;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;CACnB,CAAC;AAGF,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,QAAQ,CAwB9D;AAED,wBAAgB,WAAW,CAAC,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAEtE"} \ No newline at end of file diff --git a/modules/core/typed/utils/range.d.ts b/modules/core/typed/utils/range.d.ts new file mode 100644 index 00000000000..f37345e93d6 --- /dev/null +++ b/modules/core/typed/utils/range.d.ts @@ -0,0 +1,4 @@ +export declare const EMPTY: any[]; +export declare const FULL: number[][]; +export declare function add(rangeList: any, range: any): any; +// # sourceMappingURL=range.d.ts.map diff --git a/modules/core/typed/utils/range.d.ts.map b/modules/core/typed/utils/range.d.ts.map new file mode 100644 index 00000000000..59258156fb7 --- /dev/null +++ b/modules/core/typed/utils/range.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"range.d.ts","sourceRoot":"","sources":["../../src/utils/range.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,KAAK,OAAK,CAAC;AACxB,eAAO,MAAM,IAAI,YAAkB,CAAC;AAGpC,wBAAgB,GAAG,CAAC,SAAS,KAAA,EAAE,KAAK,KAAA,OAmCnC"} \ No newline at end of file diff --git a/modules/core/typed/utils/shader.d.ts b/modules/core/typed/utils/shader.d.ts new file mode 100644 index 00000000000..e0253923f1a --- /dev/null +++ b/modules/core/typed/utils/shader.d.ts @@ -0,0 +1,2 @@ +export declare function mergeShaders(target: any, source: any): any; +// # sourceMappingURL=shader.d.ts.map diff --git a/modules/core/typed/utils/shader.d.ts.map b/modules/core/typed/utils/shader.d.ts.map new file mode 100644 index 00000000000..09da59890e3 --- /dev/null +++ b/modules/core/typed/utils/shader.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"shader.d.ts","sourceRoot":"","sources":["../../src/utils/shader.ts"],"names":[],"mappings":"AAqBA,wBAAgB,YAAY,CAAC,MAAM,KAAA,EAAE,MAAM,KAAA,OAgC1C"} \ No newline at end of file diff --git a/modules/core/typed/utils/tesselator.d.ts b/modules/core/typed/utils/tesselator.d.ts new file mode 100644 index 00000000000..65c1445aa60 --- /dev/null +++ b/modules/core/typed/utils/tesselator.d.ts @@ -0,0 +1,68 @@ +import {Buffer} from '@luma.gl/webgl-legacy'; +import type {BinaryAttribute} from '../lib/attribute/attribute'; +import type {TypedArray} from '../types/types'; +import type {AccessorFunction} from '../types/layer-props'; +import type {TypedArrayManager} from './typed-array-manager'; +declare type ExternalBuffer = TypedArray | Buffer | BinaryAttribute; +declare type TesselatorOptions = ExtraOptionsT & { + attributes?: Record; + getGeometry?: AccessorFunction; + data?: any; + buffers?: Record; + geometryBuffer?: ExternalBuffer; + positionFormat?: 'XY' | 'XYZ'; + dataChanged?: + | { + startRow: number; + endRow?: number; + }[] + | string + | false; + normalize?: boolean; +}; +export declare type GeometryUpdateContext = { + vertexStart: number; + indexStart: number; + geometrySize: number; + geometryIndex: number; +}; +export default abstract class Tesselator { + opts: TesselatorOptions; + typedArrayManager: TypedArrayManager; + indexStarts: number[]; + vertexStarts: number[]; + vertexCount: number; + instanceCount: number; + attributes: Record; + protected _attributeDefs: any; + protected data: any; + protected getGeometry?: AccessorFunction | null; + protected geometryBuffer?: ExternalBuffer; + protected buffers: Record; + protected positionSize: number; + protected normalize: boolean; + constructor(opts: TesselatorOptions); + updateGeometry(opts: TesselatorOptions): void; + updatePartialGeometry({startRow, endRow}: {startRow: number; endRow: number}): void; + /** Convert geometry to a uniform shape */ + protected abstract normalizeGeometry(geometry: GeometryT): NormalizedGeometryT; + /** Update the positions buffer of a single geometry */ + protected abstract updateGeometryAttributes( + geometry: NormalizedGeometryT | null, + context: GeometryUpdateContext + ): any; + /** Get the number of vertices in a geometry */ + protected abstract getGeometrySize(geometry: NormalizedGeometryT): number; + protected getGeometryFromBuffer( + geometryBuffer: ExternalBuffer + ): AccessorFunction | null; + private _allocate; + /** + * Visit all objects + * `data` is expected to be an iterable consistent with the base Layer expectation + */ + private _forEachGeometry; + private _rebuildGeometry; +} +export {}; +// # sourceMappingURL=tesselator.d.ts.map diff --git a/modules/core/typed/utils/tesselator.d.ts.map b/modules/core/typed/utils/tesselator.d.ts.map new file mode 100644 index 00000000000..11d6ca50a56 --- /dev/null +++ b/modules/core/typed/utils/tesselator.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"tesselator.d.ts","sourceRoot":"","sources":["../../src/utils/tesselator.ts"],"names":[],"mappings":"AAuBA,OAAO,EAAC,MAAM,EAAC,MAAM,uBAAuB,CAAC;AAE7C,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,4BAA4B,CAAC;AAChE,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,gBAAgB,CAAC;AAC/C,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,sBAAsB,CAAC;AAC3D,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,uBAAuB,CAAC;AAE7D,aAAK,cAAc,GAAG,UAAU,GAAG,MAAM,GAAG,eAAe,CAAC;AAE5D,aAAK,iBAAiB,CAAC,SAAS,EAAE,aAAa,IAAI,aAAa,GAAG;IACjE,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,E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Ac,CAAC;IAC1C,SAAS,CAAC,OAAO,EAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;IACnD,SAAS,CAAC,YAAY,EAAG,MAAM,CAAC;IAChC,SAAS,CAAC,SAAS,EAAG,OAAO,CAAC;gBAElB,IAAI,EAAE,iBAAiB,CAAC,SAAS,EAAE,aAAa,CAAC;IAY7D,cAAc,CAAC,IAAI,EAAE,iBAAiB,CAAC,SAAS,EAAE,aAAa,CAAC,GAAG,IAAI;IA0CvE,qBAAqB,CAAC,EAAC,QAAQ,EAAE,MAAM,EAAC,EAAE;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAC,GAAG,IAAI;IAMnF,0CAA0C;IAC1C,SAAS,CAAC,QAAQ,CAAC,iBAAiB,CAAC,QAAQ,EAAE,SAAS,GAAG,mBAAmB;IAE9E,uDAAuD;IACvD,SAAS,CAAC,QAAQ,CAAC,wBAAwB,CACzC,QAAQ,EAAE,mBAAmB,GAAG,IAAI,EACpC,OAAO,EAAE,qBAAqB;IAGhC,+CAA+C;IAC/C,SAAS,CAAC,QAAQ,CAAC,eAAe,CAAC,QAAQ,EAAE,mBAAmB,GAAG,MAAM;IAEzE,SAAS,CAAC,qBAAqB,CAC7B,cAAc,EAAE,cAAc,GAC7B,gBAAgB,CAAC,GAAG,EAAE,SAAS,CAAC,GAAG,IAAI;IAiB1C,OAAO,CAAC,SAAS;IAoBjB;;;OAGG;IACH,OAAO,CAAC,gBAAgB;IAexB,OAAO,CAAC,gBAAgB;CAkFzB"} \ No newline at end of file diff --git a/modules/core/typed/utils/texture.d.ts b/modules/core/typed/utils/texture.d.ts new file mode 100644 index 00000000000..1df780fda45 --- /dev/null +++ b/modules/core/typed/utils/texture.d.ts @@ -0,0 +1,5 @@ +import {Texture2D} from '@luma.gl/webgl-legacy'; +import type Layer from '../lib/layer'; +export declare function createTexture(layer: Layer, image: any): Texture2D | null; +export declare function destroyTexture(texture: Texture2D): void; +// # sourceMappingURL=texture.d.ts.map diff --git a/modules/core/typed/utils/texture.d.ts.map b/modules/core/typed/utils/texture.d.ts.map new file mode 100644 index 00000000000..5f8aee7c7e9 --- /dev/null +++ b/modules/core/typed/utils/texture.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"texture.d.ts","sourceRoot":"","sources":["../../src/utils/texture.ts"],"names":[],"mappings":"AAAA,OAAO,EAAK,SAAS,EAAC,MAAM,uBAAuB,CAAC;AAEpD,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAYtC,wBAAgB,aAAa,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,GAAG,SAAS,GAAG,IAAI,CAoCxE;AAED,wBAAgB,cAAc,CAAC,OAAO,EAAE,SAAS,QAQhD"} \ No newline at end of file diff --git a/modules/core/typed/utils/typed-array-manager.d.ts b/modules/core/typed/utils/typed-array-manager.d.ts new file mode 100644 index 00000000000..08b5d562c5c --- /dev/null +++ b/modules/core/typed/utils/typed-array-manager.d.ts @@ -0,0 +1,39 @@ +import {TypedArray, TypedArrayConstructor} from '../types/types'; +export declare type TypedArrayManagerOptions = { + overAlloc?: number; + poolSize?: number; +}; +export declare class TypedArrayManager { + private _pool; + opts: { + overAlloc: number; + poolSize: number; + }; + constructor(options?: TypedArrayManagerOptions); + setOptions(options: TypedArrayManagerOptions): void; + allocate( + typedArray: T | null | undefined, + count: number, + { + size, + type, + padding, + copy, + initialize, + maxCount + }: { + size?: number; + type?: TypedArrayConstructor; + padding?: number; + copy?: boolean; + initialize?: boolean; + maxCount?: number; + } + ): T; + release(typedArray: TypedArray | null | undefined): void; + private _allocate; + private _release; +} +declare const _default: TypedArrayManager; +export default _default; +// # sourceMappingURL=typed-array-manager.d.ts.map diff --git a/modules/core/typed/utils/typed-array-manager.d.ts.map b/modules/core/typed/utils/typed-array-manager.d.ts.map new file mode 100644 index 00000000000..a6fb2ff04e4 --- /dev/null +++ b/modules/core/typed/utils/typed-array-manager.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"typed-array-manager.d.ts","sourceRoot":"","sources":["../../src/utils/typed-array-manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAE,qBAAqB,EAAC,MAAM,gBAAgB,CAAC;AAEjE,oBAAY,wBAAwB,GAAG;IACrC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,KAAK,CAAqB;IAClC,IAAI,EAAE;QACJ,SAAS,EAAE,MAAM,CAAC;QAClB,QAAQ,EAAE,MAAM,CAAC;KAClB,CAAiC;gBAEtB,OAAO,GAAE,wBAA6B;IAIlD,UAAU,CAAC,OAAO,EAAE,wBAAwB;IAI5C,QAAQ,CAAC,CAAC,SAAS,UAAU,EAC3B,UAAU,EAAE,CAAC,GAAG,IAAI,GAAG,SAAS,EAChC,KAAK,EAAE,MAAM,EACb,EACE,IAAQ,EACR,IAAI,EACJ,OAAW,EACX,IAAY,EACZ,UAAkB,EAClB,QAAQ,EACT,EAAE;QACD,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,IAAI,CAAC,EAAE,qBAAqB,CAAC;QAC7B,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,IAAI,CAAC,EAAE,OAAO,CAAC;QACf,UAAU,CAAC,EAAE,OAAO,CAAC;QACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB,GACA,CAAC;IAgCJ,OAAO,CAAC,UAAU,EAAE,UAAU,GAAG,IAAI,GAAG,SAAS;IAIjD,OAAO,CAAC,SAAS;IA6BjB,OAAO,CAAC,QAAQ;CAqBjB;;AAED,wBAAuC"} \ No newline at end of file diff --git a/modules/core/typed/viewports/first-person-viewport.d.ts b/modules/core/typed/viewports/first-person-viewport.d.ts new file mode 100644 index 00000000000..064f8e01a1b --- /dev/null +++ b/modules/core/typed/viewports/first-person-viewport.d.ts @@ -0,0 +1,43 @@ +import Viewport from '../viewports/viewport'; +export declare type FirstPersonViewportOptions = { + /** Name of the viewport */ + id?: string; + /** Left offset from the canvas edge, in pixels */ + x?: number; + /** Top offset from the canvas edge, in pixels */ + y?: number; + /** Viewport width in pixels */ + width?: number; + /** Viewport height in pixels */ + height?: number; + /** Longitude of the camera, in the geospatial case. */ + longitude?: number; + /** Latitude of the camera, in the geospatial case. */ + latitude?: number; + /** Meter offsets of the camera from the lng-lat anchor point. Default `[0, 0, 0]`. */ + position?: [number, number, number]; + /** Bearing (heading) of the camera in degrees. Default `0` (north). */ + bearing?: number; + /** Pitch (tilt) of the camera in degrees. Default `0` (horizontal). */ + pitch?: number; + /** Transform applied to the camera position and direction */ + modelMatrix?: number[] | null; + /** Custom projection matrix */ + projectionMatrix?: number[]; + /** The up direction, default positive z axis. */ + up?: [number, number, number]; + /** Field of view covered by camera, in degrees. Default `75`. */ + fovy?: number; + /** Distance of near clipping plane. Default `0.1`. */ + near?: number; + /** Distance of far clipping plane. Default `1000`. */ + far?: number; + /** Modifier of viewport scale. Corresponds to the number of pixels per meter. Default `1`. */ + focalDistance?: number; +}; +export default class FirstPersonViewport extends Viewport { + longitude?: number; + latitude?: number; + constructor(props: FirstPersonViewportOptions); +} +// # sourceMappingURL=first-person-viewport.d.ts.map diff --git a/modules/core/typed/viewports/first-person-viewport.d.ts.map b/modules/core/typed/viewports/first-person-viewport.d.ts.map new file mode 100644 index 00000000000..610d580e9b5 --- /dev/null +++ b/modules/core/typed/viewports/first-person-viewport.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"first-person-viewport.d.ts","sourceRoot":"","sources":["../../src/viewports/first-person-viewport.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,uBAAuB,CAAC;AAI7C,oBAAY,0BAA0B,GAAG;IACvC,2BAA2B;IAC3B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,kDAAkD;IAClD,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,iDAAiD;IACjD,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,+BAA+B;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gCAAgC;IAChC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,uDAAuD;IACvD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sDAAsD;IACtD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,sFAAsF;IACtF,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,uEAAuE;IACvE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,uEAAuE;IACvE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,6DAA6D;IAC7D,WAAW,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IAC9B,+BAA+B;IAC/B,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC5B,iDAAiD;IACjD,EAAE,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9B,iEAAiE;IACjE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,sDAAsD;IACtD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,sDAAsD;IACtD,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,8FAA8F;IAC9F,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF,MAAM,CAAC,OAAO,OAAO,mBAAoB,SAAQ,QAAQ;IACvD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;gBAEN,KAAK,EAAE,0BAA0B;CA6B9C"} \ No newline at end of file diff --git a/modules/core/typed/viewports/globe-viewport.d.ts b/modules/core/typed/viewports/globe-viewport.d.ts new file mode 100644 index 00000000000..20645bc7525 --- /dev/null +++ b/modules/core/typed/viewports/globe-viewport.d.ts @@ -0,0 +1,55 @@ +import Viewport from './viewport'; +export declare type GlobeViewportOptions = { + /** Name of the viewport */ + id?: string; + /** Left offset from the canvas edge, in pixels */ + x?: number; + /** Top offset from the canvas edge, in pixels */ + y?: number; + /** Viewport width in pixels */ + width?: number; + /** Viewport height in pixels */ + height?: number; + /** Longitude in degrees */ + longitude?: number; + /** Latitude in degrees */ + latitude?: number; + /** Camera altitude relative to the viewport height, used to control the FOV. Default `1.5` */ + altitude?: number; + position?: number[]; + /** Zoom level */ + zoom?: number; + /** Use orthographic projection */ + orthographic?: boolean; + /** Scaler for the near plane, 1 unit equals to the height of the viewport. Default `0.1` */ + nearZMultiplier?: number; + /** Scaler for the far plane, 1 unit equals to the distance from the camera to the edge of the screen. Default `2` */ + farZMultiplier?: number; + /** The resolution at which to turn flat features into 3D meshes, in degrees. Smaller numbers will generate more detailed mesh. Default `10` */ + resolution?: number; +}; +export default class GlobeViewport extends Viewport { + longitude: number; + latitude: number; + resolution: number; + constructor(opts?: GlobeViewportOptions); + get projectionMode(): 2; + getDistanceScales(): import('./viewport').DistanceScales; + getBounds(options?: {z?: number}): [number, number, number, number]; + unproject( + xyz: number[], + { + topLeft, + targetZ + }?: { + topLeft?: boolean; + targetZ?: number; + } + ): number[]; + projectPosition(xyz: number[]): [number, number, number]; + unprojectPosition(xyz: number[]): [number, number, number]; + projectFlat(xyz: number[]): [number, number]; + unprojectFlat(xyz: number[]): [number, number]; + panByPosition(coords: number[], pixel: number[]): GlobeViewportOptions; +} +// # sourceMappingURL=globe-viewport.d.ts.map diff --git a/modules/core/typed/viewports/globe-viewport.d.ts.map b/modules/core/typed/viewports/globe-viewport.d.ts.map new file mode 100644 index 00000000000..c4dceee6282 --- /dev/null +++ b/modules/core/typed/viewports/globe-viewport.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"globe-viewport.d.ts","sourceRoot":"","sources":["../../src/viewports/globe-viewport.ts"],"names":[],"mappings":"AACA,OAAO,QAAQ,MAAM,YAAY,CAAC;AAyBlC,oBAAY,oBAAoB,GAAG;IACjC,2BAA2B;IAC3B,EAAE,CAAC,EAAE,MAAM,C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M,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC;IAUxD,iBAAiB,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC;IAY1D,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC;IAI5C,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC;IAI9C,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,oBAAoB;CAOvE"} \ No newline at end of file diff --git a/modules/core/typed/viewports/orbit-viewport.d.ts b/modules/core/typed/viewports/orbit-viewport.d.ts new file mode 100644 index 00000000000..1c0420ff2d6 --- /dev/null +++ b/modules/core/typed/viewports/orbit-viewport.d.ts @@ -0,0 +1,47 @@ +import Viewport from '../viewports/viewport'; +export declare type OrbitViewportOptions = { + /** Name of the viewport */ + id?: string; + /** Left offset from the canvas edge, in pixels */ + x?: number; + /** Top offset from the canvas edge, in pixels */ + y?: number; + /** Viewport width in pixels */ + width?: number; + /** Viewport height in pixels */ + height?: number; + /** Axis with 360 degrees rotating freedom, either `'Y'` or `'Z'`, default to `'Z'`. */ + orbitAxis?: 'Y' | 'Z'; + /** The world position at the center of the viewport. Default `[0, 0, 0]`. */ + target?: [number, number, number]; + /** The zoom level of the viewport. `zoom: 0` maps one unit distance to one pixel on screen, and increasing `zoom` by `1` scales the same object to twice as large. Default `0`. */ + zoom?: number; + /** Rotating angle around orbit axis. Default `0`. */ + rotationOrbit?: number; + /** Rotating angle around orbit axis. Default `0`. */ + rotationX?: number; + /** Custom projection matrix */ + projectionMatrix?: number[]; + /** Field of view covered by camera, in the perspective case. In degrees. Default `50`. */ + fovy?: number; + /** Distance of near clipping plane. Default `0.1`. */ + near?: number; + /** Distance of far clipping plane. Default `1000`. */ + far?: number; + /** Whether to create an orthographic or perspective projection matrix. Default is `false` (perspective projection). */ + orthographic?: boolean; +}; +export default class OrbitViewport extends Viewport { + projectedCenter: number[]; + constructor(props: OrbitViewportOptions); + unproject( + xyz: number[], + { + topLeft + }?: { + topLeft?: boolean; + } + ): [number, number, number]; + panByPosition(coords: number[], pixel: number[]): OrbitViewportOptions; +} +// # sourceMappingURL=orbit-viewport.d.ts.map diff --git a/modules/core/typed/viewports/orbit-viewport.d.ts.map b/modules/core/typed/viewports/orbit-viewport.d.ts.map new file mode 100644 index 00000000000..f66e4bfe676 --- /dev/null +++ b/modules/core/typed/viewports/orbit-viewport.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"orbit-viewport.d.ts","sourceRoot":"","sources":["../../src/viewports/orbit-viewport.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,uBAAuB,CAAC;AAkD7C,oBAAY,oBAAoB,GAAG;IACjC,2BAA2B;IAC3B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,kDAAkD;IAClD,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,iDAAiD;IACjD,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,+BAA+B;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gCAAgC;IAChC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,uFAAuF;IACvF,SAAS,CAAC,EAAE,GAAG,GAAG,GAAG,CAAC;IACtB,6EAA6E;IAC7E,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IAClC,mLAAmL;IACnL,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,qDAAqD;IACrD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,qDAAqD;IACrD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,+BAA+B;IAC/B,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC5B,0FAA0F;IAC1F,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,sDAAsD;IACtD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,sDAAsD;IACtD,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,uHAAuH;IACvH,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB,CAAC;AAEF,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,QAAQ;IACjD,eAAe,EAAE,MAAM,EAAE,CAAC;gBAEd,KAAK,EAAE,oBAAoB;IAwCvC,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,EAAC,OAAc,EAAC,GAAE;QAAC,OAAO,CAAC,EAAE,OAAO,CAAA;KAAM,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC;IAQ9F,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,oBAAoB;CAWvE"} \ No newline at end of file diff --git a/modules/core/typed/viewports/orthographic-viewport.d.ts b/modules/core/typed/viewports/orthographic-viewport.d.ts new file mode 100644 index 00000000000..1e75af2bf92 --- /dev/null +++ b/modules/core/typed/viewports/orthographic-viewport.d.ts @@ -0,0 +1,34 @@ +import Viewport from '../viewports/viewport'; +import type {Padding} from './viewport'; +export declare type OrthographicViewportOptions = { + /** Name of the viewport */ + id?: string; + /** Left offset from the canvas edge, in pixels */ + x?: number; + /** Top offset from the canvas edge, in pixels */ + y?: number; + /** Viewport width in pixels */ + width?: number; + /** Viewport height in pixels */ + height?: number; + /** The world position at the center of the viewport. Default `[0, 0, 0]`. */ + target?: [number, number, number] | [number, number]; + /** The zoom level of the viewport. `zoom: 0` maps one unit distance to one pixel on screen, and increasing `zoom` by `1` scales the same object to twice as large. + * To apply independent zoom levels to the X and Y axes, supply an array `[zoomX, zoomY]`. Default `0`. */ + zoom?: number | [number, number]; + /** Padding around the viewport, in pixels. */ + padding?: Padding | null; + /** Distance of near clipping plane. Default `0.1`. */ + near?: number; + /** Distance of far clipping plane. Default `1000`. */ + far?: number; + /** Whether to use top-left coordinates (`true`) or bottom-left coordinates (`false`). Default `true`. */ + flipY?: boolean; +}; +export default class OrthographicViewport extends Viewport { + constructor(props: OrthographicViewportOptions); + projectFlat([X, Y]: number[]): [number, number]; + unprojectFlat([x, y]: number[]): [number, number]; + panByPosition(coords: number[], pixel: number[]): OrthographicViewportOptions; +} +// # sourceMappingURL=orthographic-viewport.d.ts.map diff --git a/modules/core/typed/viewports/orthographic-viewport.d.ts.map b/modules/core/typed/viewports/orthographic-viewport.d.ts.map new file mode 100644 index 00000000000..3ce603fbeaf --- /dev/null +++ b/modules/core/typed/viewports/orthographic-viewport.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"orthographic-viewport.d.ts","sourceRoot":"","sources":["../../src/viewports/orthographic-viewport.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,uBAAuB,CAAC;AAM7C,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,YAAY,CAAC;AAyCxC,oBAAY,2BAA2B,GAAG;IACxC,2BAA2B;IAC3B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,kDAAkD;IAClD,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,iDAAiD;IACjD,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,+BAA+B;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gCAAgC;IAChC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,6EAA6E;IAC7E,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACrD;gHAC4G;IAC5G,IAAI,CAAC,EAAE,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,8CAA8C;IAC9C,OAAO,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IACzB,sDAAsD;IACtD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,sDAAsD;IACtD,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,yGAAyG;IACzG,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF,MAAM,CAAC,OAAO,OAAO,oBAAqB,SAAQ,QAAQ;gBAC5C,KAAK,EAAE,2BAA2B;IA8C9C,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC;IAK/C,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC;IAMjD,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,2BAA2B;CAS9E"} \ No newline at end of file diff --git a/modules/core/typed/viewports/viewport.d.ts b/modules/core/typed/viewports/viewport.d.ts new file mode 100644 index 00000000000..cd5012b6133 --- /dev/null +++ b/modules/core/typed/viewports/viewport.d.ts @@ -0,0 +1,189 @@ +import {FrustumPlane} from '../utils/math-utils'; +export declare type DistanceScales = { + unitsPerMeter: number[]; + metersPerUnit: number[]; +}; +export declare type Padding = { + left?: number; + right?: number; + top?: number; + bottom?: number; +}; +export declare type ViewportOptions = { + /** Name of the viewport */ + id?: string; + /** Left offset from the canvas edge, in pixels */ + x?: number; + /** Top offset from the canvas edge, in pixels */ + y?: number; + /** Viewport width in pixels */ + width?: number; + /** Viewport height in pixels */ + height?: number; + /** Longitude in degrees (geospatial only) */ + longitude?: number; + /** Latitude in degrees (geospatial only) */ + latitude?: number; + /** Viewport center in world space. If geospatial, refers to meter offsets from lng, lat */ + position?: number[]; + /** Zoom level */ + zoom?: number; + /** Padding around the viewport, in pixels. */ + padding?: Padding | null; + distanceScales?: DistanceScales; + /** Model matrix of viewport center */ + modelMatrix?: number[] | null; + /** Custom view matrix */ + viewMatrix?: number[]; + /** Custom projection matrix */ + projectionMatrix?: number[]; + /** Modifier of viewport scale. Corresponds to the number of pixels per common unit at zoom 0. */ + focalDistance?: number; + /** Use orthographic projection */ + orthographic?: boolean; + /** fovy in radians. If supplied, overrides fovy */ + fovyRadians?: number; + /** fovy in degrees. */ + fovy?: number; + /** Near plane of the projection matrix */ + near?: number; + /** Far plane of the projection matrix */ + far?: number; +}; +/** + * Manages coordinate system transformations. + * + * Note: The Viewport is immutable in the sense that it only has accessors. + * A new viewport instance should be created if any parameters have changed. + */ +export default class Viewport { + static displayName: string; + /** Init parameters */ + id: string; + x: number; + y: number; + width: number; + height: number; + padding?: Padding | null; + isGeospatial: boolean; + zoom: number; + focalDistance: number; + position: number[]; + modelMatrix: number[] | null; + /** Derived parameters */ + distanceScales: DistanceScales; /** scale factors between world space and common space */ + scale: number; /** scale factor, equals 2^zoom */ + center: number[]; /** viewport center in common space */ + cameraPosition: number[]; /** Camera position in common space */ + projectionMatrix: number[]; + viewMatrix: number[]; + viewMatrixUncentered: number[]; + viewMatrixInverse: number[]; + viewProjectionMatrix: number[]; + pixelProjectionMatrix: number[]; + pixelUnprojectionMatrix: number[]; + resolution?: number; + private _frustumPlanes; + constructor(opts?: ViewportOptions); + get metersPerPixel(): number; + get projectionMode(): number; + equals(viewport: Viewport): boolean; + /** + * Projects xyz (possibly latitude and longitude) to pixel coordinates in window + * using viewport projection parameters + * - [longitude, latitude] to [x, y] + * - [longitude, latitude, Z] => [x, y, z] + * Note: By default, returns top-left coordinates for canvas/SVG type render + * + * @param {Array} lngLatZ - [lng, lat] or [lng, lat, Z] + * @param {Object} opts - options + * @param {Object} opts.topLeft=true - Whether projected coords are top left + * @return {Array} - [x, y] or [x, y, z] in top left coords + */ + project( + xyz: number[], + { + topLeft + }?: { + topLeft?: boolean; + } + ): number[]; + /** + * Unproject pixel coordinates on screen onto world coordinates, + * (possibly [lon, lat]) on map. + * - [x, y] => [lng, lat] + * - [x, y, z] => [lng, lat, Z] + * @param {Array} xyz - + * @param {Object} opts - options + * @param {Object} opts.topLeft=true - Whether origin is top left + * @return {Array|null} - [lng, lat, Z] or [X, Y, Z] + */ + unproject( + xyz: number[], + { + topLeft, + targetZ + }?: { + topLeft?: boolean; + targetZ?: number; + } + ): number[]; + projectPosition(xyz: number[]): [number, number, number]; + unprojectPosition(xyz: number[]): [number, number, number]; + /** + * Project [lng,lat] on sphere onto [x,y] on 512*512 Mercator Zoom 0 tile. + * Performs the nonlinear part of the web mercator projection. + * Remaining projection is done with 4x4 matrices which also handles + * perspective. + * @param {Array} lngLat - [lng, lat] coordinates + * Specifies a point on the sphere to project onto the map. + * @return {Array} [x,y] coordinates. + */ + projectFlat(xyz: number[]): [number, number]; + /** + * Unproject world point [x,y] on map onto {lat, lon} on sphere + * @param {object|Vector} xy - object with {x,y} members + * representing point on projected map plane + * @return {GeoCoordinates} - object with {lat,lon} of point on sphere. + * Has toArray method if you need a GeoJSON Array. + * Per cartographic tradition, lat and lon are specified as degrees. + */ + unprojectFlat(xyz: number[]): [number, number]; + /** + * Get bounds of the current viewport + * @return {Array} - [minX, minY, maxX, maxY] + */ + getBounds(options?: {z?: number}): [number, number, number, number]; + getDistanceScales(coordinateOrigin?: number[]): DistanceScales; + containsPixel({ + x, + y, + width, + height + }: { + x: number; + y: number; + width?: number; + height?: number; + }): boolean; + getFrustumPlanes(): { + left: FrustumPlane; + right: FrustumPlane; + bottom: FrustumPlane; + top: FrustumPlane; + near: FrustumPlane; + far: FrustumPlane; + }; + /** + * Needed by panning and linear transition + * Pan the viewport to place a given world coordinate at screen point [x, y] + * + * @param {Array} coords - world coordinates + * @param {Array} pixel - [x,y] coordinates on screen + * @return {Object} props of the new viewport + */ + panByPosition(coords: number[], pixel: number[]): any; + private _initProps; + private _initMatrices; +} +// # sourceMappingURL=viewport.d.ts.map diff --git a/modules/core/typed/viewports/viewport.d.ts.map b/modules/core/typed/viewports/viewport.d.ts.map new file mode 100644 index 00000000000..7e0032460d8 --- /dev/null +++ b/modules/core/typed/viewports/viewport.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"viewport.d.ts","sourceRoot":"","sources":["../../src/viewports/viewport.ts"],"names":[],"mappings":"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,CAAC,EAAE,MAAM,CAAC;QACf,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB,GAAG,OAAO;IAUX,gBAAgB,IAAI;QAClB,IAAI,EAAE,YAAY,CAAC;QACnB,KAAK,EAAE,YAAY,CAAC;QACpB,MAAM,EAAE,YAAY,CAAC;QACrB,GAAG,EAAE,YAAY,CAAC;QAClB,IAAI,EAAE,YAAY,CAAC;QACnB,GAAG,EAAE,YAAY,CAAC;KACnB;IAcD;;;;;;;OAOG;IACH,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,GAAG;IAOrD,OAAO,CAAC,UAAU;IAmClB,OAAO,CAAC,aAAa;CA6EtB"} \ No newline at end of file diff --git a/modules/core/typed/viewports/web-mercator-viewport.d.ts b/modules/core/typed/viewports/web-mercator-viewport.d.ts new file mode 100644 index 00000000000..587e7a4207b --- /dev/null +++ b/modules/core/typed/viewports/web-mercator-viewport.d.ts @@ -0,0 +1,105 @@ +import Viewport from './viewport'; +import {Padding} from './viewport'; +export declare type WebMercatorViewportOptions = { + /** Name of the viewport */ + id?: string; + /** Left offset from the canvas edge, in pixels */ + x?: number; + /** Top offset from the canvas edge, in pixels */ + y?: number; + /** Viewport width in pixels */ + width?: number; + /** Viewport height in pixels */ + height?: number; + /** Longitude in degrees */ + longitude?: number; + /** Latitude in degrees */ + latitude?: number; + /** Tilt of the camera in degrees */ + pitch?: number; + /** Heading of the camera in degrees */ + bearing?: number; + /** Camera altitude relative to the viewport height, legacy property used to control the FOV. Default `1.5` */ + altitude?: number; + /** Camera fovy in degrees. If provided, overrides `altitude` */ + fovy?: number; + /** Viewport center in world space. If geospatial, refers to meter offsets from lng, lat */ + position?: number[]; + /** Zoom level */ + zoom?: number; + /** Padding around the viewport, in pixels. */ + padding?: Padding | null; + /** Model matrix of viewport center */ + modelMatrix?: number[] | null; + /** Custom projection matrix */ + projectionMatrix?: number[]; + /** Use orthographic projection */ + orthographic?: boolean; + /** Scaler for the near plane, 1 unit equals to the height of the viewport. Default `0.1` */ + nearZMultiplier?: number; + /** Scaler for the far plane, 1 unit equals to the distance from the camera to the edge of the screen. Default `1.01` */ + farZMultiplier?: number; + /** Render multiple copies of the world */ + repeat?: boolean; + /** Internal use */ + worldOffset?: number; + /** @deprecated Revert to approximated meter size calculation prior to v8.5 */ + legacyMeterSizes?: boolean; +}; +/** + * Manages transformations to/from WGS84 coordinates using the Web Mercator Projection. + */ +export default class WebMercatorViewport extends Viewport { + static displayName: string; + longitude: number; + latitude: number; + pitch: number; + bearing: number; + altitude: number; + fovy: number; + orthographic: boolean; + /** Each sub viewport renders one copy of the world if repeat:true. The list is generated and cached on first request. */ + private _subViewports; + /** @deprecated Revert to approximated meter size calculation prior to v8.5 */ + private _pseudoMeters; + constructor(opts?: WebMercatorViewportOptions); + get subViewports(): WebMercatorViewport[] | null; + projectPosition(xyz: number[]): [number, number, number]; + unprojectPosition(xyz: number[]): [number, number, number]; + /** + * Add a meter delta to a base lnglat coordinate, returning a new lnglat array + * + * Note: Uses simple linear approximation around the viewport center + * Error increases with size of offset (roughly 1% per 100km) + * + * @param {[Number,Number]|[Number,Number,Number]) lngLatZ - base coordinate + * @param {[Number,Number]|[Number,Number,Number]) xyz - array of meter deltas + * @return {[Number,Number]|[Number,Number,Number]) array of [lng,lat,z] deltas + */ + addMetersToLngLat(lngLatZ: number[], xyz: number[]): number[]; + panByPosition(coords: number[], pixel: number[]): WebMercatorViewportOptions; + getBounds(options?: {z?: number}): [number, number, number, number]; + /** + * Returns a new viewport that fit around the given rectangle. + * Only supports non-perspective mode. + */ + fitBounds( + /** [[lon, lat], [lon, lat]] */ + bounds: [[number, number], [number, number]], + options?: { + /** If not supplied, will use the current width of the viewport (default `1`) */ + width?: number; + /** If not supplied, will use the current height of the viewport (default `1`) */ + height?: number; + /** In degrees, 0.01 would be about 1000 meters */ + minExtent?: number; + /** Max zoom level */ + maxZoom?: number; + /** Extra padding in pixels */ + padding?: number | Required; + /** Center shift in pixels */ + offset?: number[]; + } + ): WebMercatorViewport; +} +// # sourceMappingURL=web-mercator-viewport.d.ts.map diff --git a/modules/core/typed/viewports/web-mercator-viewport.d.ts.map b/modules/core/typed/viewports/web-mercator-viewport.d.ts.map new file mode 100644 index 00000000000..99caf5b87ae --- /dev/null +++ b/modules/core/typed/viewports/web-mercator-viewport.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"web-mercator-viewport.d.ts","sourceRoot":"","sources":["../../src/viewports/web-mercator-viewport.ts"],"names":[],"mappings":"AAsBA,OAAO,QAAQ,MAAM,YAAY,CAAC;AAalC,OAAO,EAAC,OAAO,EAAC,MAAM,YAAY,CAAC;AAMnC,oBAAY,0BAA0B,GAAG;IACvC,2BAA2B;IAC3B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,kDAAkD;IAClD,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,iDAAiD;IACjD,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,+BAA+B;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gCAAgC;IAChC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,2BAA2B;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,0BAA0B;IAC1B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,oCAAoC;IACpC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,uCAAuC;IACvC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,8GAA8G;IAC9G,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gEAAgE;IAChE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,2FAA2F;IAC3F,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,iBAAiB;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,8CAA8C;IAC9C,OAAO,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IACzB,sCAAsC;IACtC,WAAW,CAAC,EAAE,MAAM,EAAE,GAAG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E,KAAK,EAAE,MAAM,EAAE,GAAG,0BAA0B;IAW5E,SAAS,CAAC,OAAO,GAAE;QAAC,CAAC,CAAC,EAAE,MAAM,CAAA;KAAM,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC;IAYvE;;;OAGG;IACH,SAAS;IACP,+BAA+B;IAC/B,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,EAC5C,OAAO,GAAE;QACP,gFAAgF;QAChF,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,iFAAiF;QACjF,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,kDAAkD;QAClD,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,qBAAqB;QACrB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,8BAA8B;QAC9B,OAAO,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAC;QACrC,6BAA6B;QAC7B,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;KACd;CAMT"} \ No newline at end of file diff --git a/modules/core/typed/views/first-person-view.d.ts b/modules/core/typed/views/first-person-view.d.ts new file mode 100644 index 00000000000..50579ceef64 --- /dev/null +++ b/modules/core/typed/views/first-person-view.d.ts @@ -0,0 +1,40 @@ +import View, {CommonViewState} from './view'; +import FirstPersonViewport from '../viewports/first-person-viewport'; +import FirstPersonController from '../controllers/first-person-controller'; +export declare type FirstPersonViewState = { + /** Longitude of the camera, in the geospatial case. */ + longitude?: number; + /** Latitude of the camera, in the geospatial case. */ + latitude?: number; + /** Meter offsets of the camera from the lng-lat anchor point. Default `[0, 0, 0]`. */ + position?: [number, number, number]; + /** Bearing (heading) of the camera in degrees. Default `0` (north). */ + bearing?: number; + /** Pitch (tilt) of the camera in degrees. Default `0` (horizontal). */ + pitch?: number; + /** Min pitch angle. Default `-90` (up). */ + minPitch?: number; + /** Max pitch angle. Default `90` (down). */ + maxPitch?: number; + /** Transform applied to the camera position and direction */ + modelMatrix?: number[] | null; +} & CommonViewState; +declare type FirstPersonViewProps = { + /** Custom projection matrix */ + projectionMatrix?: number[]; + /** Field of view covered by camera, in degrees. Default `75`. */ + fovy?: number; + /** Distance of near clipping plane. Default `0.1`. */ + near?: number; + /** Distance of far clipping plane. Default `1000`. */ + far?: number; + /** Modifier of viewport scale. Corresponds to the number of pixels per meter. Default `1`. */ + focalDistance?: number; +}; +export default class FirstPersonView extends View { + static displayName: string; + get ViewportType(): typeof FirstPersonViewport; + get ControllerType(): typeof FirstPersonController; +} +export {}; +// # sourceMappingURL=first-person-view.d.ts.map diff --git a/modules/core/typed/views/first-person-view.d.ts.map b/modules/core/typed/views/first-person-view.d.ts.map new file mode 100644 index 00000000000..e32fd0fe20e --- /dev/null +++ b/modules/core/typed/views/first-person-view.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"first-person-view.d.ts","sourceRoot":"","sources":["../../src/views/first-person-view.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,EAAE,EAAC,eAAe,EAAC,MAAM,QAAQ,CAAC;AAC7C,OAAO,mBAAmB,MAAM,oCAAoC,CAAC;AACrE,OAAO,qBAAqB,MAAM,wCAAwC,CAAC;AAE3E,oBAAY,oBAAoB,GAAG;IACjC,uDAAuD;IACvD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sDAAsD;IACtD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,sFAAsF;IACtF,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,uEAAuE;IACvE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,uEAAuE;IACvE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,2CAA2C;IAC3C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,4CAA4C;IAC5C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,6DAA6D;IAC7D,WAAW,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;CAC/B,GAAG,eAAe,CAAC;AAEpB,aAAK,oBAAoB,GAAG;IAC1B,+BAA+B;IAC/B,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC5B,iEAAiE;IACjE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,sDAAsD;IACtD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,sDAAsD;IACtD,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,8FAA8F;IAC9F,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,IAAI,CAAC,oBAAoB,EAAE,oBAAoB,CAAC;IAC3F,MAAM,CAAC,WAAW,SAAqB;IAEvC,IAAI,YAAY,+BAEf;IAED,IAAI,cAAc,iCAEjB;CACF"} \ No newline at end of file diff --git a/modules/core/typed/views/globe-view.d.ts b/modules/core/typed/views/globe-view.d.ts new file mode 100644 index 00000000000..0998ab537c0 --- /dev/null +++ b/modules/core/typed/views/globe-view.d.ts @@ -0,0 +1,32 @@ +import View, {CommonViewState} from './view'; +import GlobeViewport from '../viewports/globe-viewport'; +import GlobeController from '../controllers/globe-controller'; +export declare type GlobeViewState = { + /** Longitude of the map center */ + longitude: number; + /** Latitude of the map center */ + latitude: number; + /** Zoom level */ + zoom: number; + /** Min zoom, default `0` */ + minZoom?: number; + /** Max zoom, default `20` */ + maxZoom?: number; +} & CommonViewState; +declare type GlobeViewProps = { + /** The resolution at which to turn flat features into 3D meshes, in degrees. Smaller numbers will generate more detailed mesh. Default `10`. */ + resolution?: number; + /** Scaler for the near plane, 1 unit equals to the height of the viewport. Default to `0.1`. Overwrites the `near` parameter. */ + nearZMultiplier?: boolean; + /** Scaler for the far plane, 1 unit equals to the distance from the camera to the top edge of the screen. Default to `1.01`. Overwrites the `far` parameter. */ + farZMultiplier?: boolean; + /** Distance of the camera relative to viewport height. Default `1.5`. */ + altitude?: number; +}; +export default class GlobeView extends View { + static displayName: string; + get ViewportType(): typeof GlobeViewport; + get ControllerType(): typeof GlobeController; +} +export {}; +// # sourceMappingURL=globe-view.d.ts.map diff --git a/modules/core/typed/views/globe-view.d.ts.map b/modules/core/typed/views/globe-view.d.ts.map new file mode 100644 index 00000000000..89886f5150e --- /dev/null +++ b/modules/core/typed/views/globe-view.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"globe-view.d.ts","sourceRoot":"","sources":["../../src/views/globe-view.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,EAAE,EAAC,eAAe,EAAC,MAAM,QAAQ,CAAC;AAC7C,OAAO,aAAa,MAAM,6BAA6B,CAAC;AACxD,OAAO,eAAe,MAAM,iCAAiC,CAAC;AAE9D,oBAAY,cAAc,GAAG;IAC3B,kCAAkC;IAClC,SAAS,EAAE,MAAM,CAAC;IAClB,iCAAiC;IACjC,QAAQ,EAAE,MAAM,CAAC;IACjB,iBAAiB;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,4BAA4B;IAC5B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,6BAA6B;IAC7B,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,GAAG,eAAe,CAAC;AAEpB,aAAK,cAAc,GAAG;IACpB,gJAAgJ;IAChJ,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,iIAAiI;IACjI,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,gKAAgK;IAChK,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,yEAAyE;IACzE,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,CAAC,OAAO,OAAO,SAAU,SAAQ,IAAI,CAAC,cAAc,EAAE,cAAc,CAAC;IACzE,MAAM,CAAC,WAAW,SAAe;IAEjC,IAAI,YAAY,yBAEf;IAED,IAAI,cAAc,2BAEjB;CACF"} \ No newline at end of file diff --git a/modules/core/typed/views/map-view.d.ts b/modules/core/typed/views/map-view.d.ts new file mode 100644 index 00000000000..055f85c7ea9 --- /dev/null +++ b/modules/core/typed/views/map-view.d.ts @@ -0,0 +1,49 @@ +import View, {CommonViewState} from './view'; +import WebMercatorViewport from '../viewports/web-mercator-viewport'; +import MapController from '../controllers/map-controller'; +import type {NumericArray} from '../types/types'; +export declare type MapViewState = { + /** Longitude of the map center */ + longitude: number; + /** Latitude of the map center */ + latitude: number; + /** Zoom level */ + zoom: number; + /** Pitch (tilt) of the map, in degrees. `0` looks top down */ + pitch?: number; + /** Bearing (rotation) of the map, in degrees. `0` is north up */ + bearing?: number; + /** Min zoom, default `0` */ + minZoom?: number; + /** Max zoom, default `20` */ + maxZoom?: number; + /** Min pitch, default `0` */ + minPitch?: number; + /** Max pitch, default `60` */ + maxPitch?: number; + /** Viewport center offsets from lng, lat in meters */ + position?: number[]; +} & CommonViewState; +declare type MapViewProps = { + /** Whether to render multiple copies of the map at low zoom levels. Default `false`. */ + repeat?: boolean; + /** Scaler for the near plane, 1 unit equals to the height of the viewport. Default to `0.1`. Overwrites the `near` parameter. */ + nearZMultiplier?: boolean; + /** Scaler for the far plane, 1 unit equals to the distance from the camera to the top edge of the screen. Default to `1.01`. Overwrites the `far` parameter. */ + farZMultiplier?: boolean; + /** Custom projection matrix */ + projectionMatrix?: NumericArray; + /** Field of view covered by the camera, in the perspective case. In degrees. If not supplied, will be calculated from `altitude`. */ + fovy?: number; + /** Distance of the camera relative to viewport height. Default `1.5`. */ + altitude?: number; + /** Whether to create an orthographic or perspective projection matrix. Default is `false` (perspective projection). */ + orthographic?: boolean; +}; +export default class MapView extends View { + static displayName: string; + get ViewportType(): typeof WebMercatorViewport; + get ControllerType(): typeof MapController; +} +export {}; +// # sourceMappingURL=map-view.d.ts.map diff --git a/modules/core/typed/views/map-view.d.ts.map b/modules/core/typed/views/map-view.d.ts.map new file mode 100644 index 00000000000..9d53de473b2 --- /dev/null +++ b/modules/core/typed/views/map-view.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"map-view.d.ts","sourceRo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IAAI,CAAC,YAAY,EAAE,YAAY,CAAC;IACnE,MAAM,CAAC,WAAW,SAAa;IAE/B,IAAI,YAAY,+BAEf;IAED,IAAI,cAAc,yBAEjB;CACF"} \ No newline at end of file diff --git a/modules/core/typed/views/orbit-view.d.ts b/modules/core/typed/views/orbit-view.d.ts new file mode 100644 index 00000000000..ab7b76c4c97 --- /dev/null +++ b/modules/core/typed/views/orbit-view.d.ts @@ -0,0 +1,43 @@ +import View, {CommonViewState} from './view'; +import OrbitViewport from '../viewports/orbit-viewport'; +import OrbitController from '../controllers/orbit-controller'; +export declare type OrbitViewState = { + /** The world position at the center of the viewport. Default `[0, 0, 0]`. */ + target: [number, number, number]; + /** The zoom level of the viewport. `zoom: 0` maps one unit distance to one pixel on screen, and increasing `zoom` by `1` scales the same object to twice as large. Default `0`. */ + zoom: number; + /** Rotating angle around orbit axis. Default `0`. */ + rotationOrbit?: number; + /** Rotating angle around orbit axis. Default `0`. */ + rotationX?: number; + /** The min zoom level of the viewport. Default `-Infinity`. */ + minZoom?: number; + /** The max zoom level of the viewport. Default `Infinity`. */ + maxZoom?: number; + /** The min rotating angle around X axis. Default `-90`. */ + minRotationX?: number; + /** The max rotating angle around X axis. Default `90`. */ + maxRotationX?: number; +} & CommonViewState; +declare type OrbitViewProps = { + /** Axis with 360 degrees rotating freedom, either `'Y'` or `'Z'`, default to `'Z'`. */ + orbitAxis?: 'Y' | 'Z'; + /** Custom projection matrix */ + projectionMatrix?: number[]; + /** Field of view covered by camera, in the perspective case. In degrees. Default `50`. */ + fovy?: number; + /** Distance of near clipping plane. Default `0.1`. */ + near?: number; + /** Distance of far clipping plane. Default `1000`. */ + far?: number; + /** Whether to create an orthographic or perspective projection matrix. Default is `false` (perspective projection). */ + orthographic?: boolean; +}; +export default class OrbitView extends View { + static displayName: string; + constructor(props?: OrbitViewProps); + get ViewportType(): typeof OrbitViewport; + get ControllerType(): typeof OrbitController; +} +export {}; +// # sourceMappingURL=orbit-view.d.ts.map diff --git a/modules/core/typed/views/orbit-view.d.ts.map b/modules/core/typed/views/orbit-view.d.ts.map new file mode 100644 index 00000000000..0c86b29a267 --- /dev/null +++ b/modules/core/typed/views/orbit-view.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"orbit-view.d.ts","sourceRoot":"","sources":["../../src/views/orbit-view.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,EAAE,EAAC,eAAe,EAAC,MAAM,QAAQ,CAAC;AAC7C,OAAO,aAAa,MAAM,6BAA6B,CAAC;AACxD,OAAO,eAAe,MAAM,iCAAiC,CAAC;AAE9D,oBAAY,cAAc,GAAG;IAC3B,6EAA6E;IAC7E,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,mLAAmL;IACnL,IAAI,EAAE,MAAM,CAAC;IACb,qDAAqD;IACrD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,qDAAqD;IACrD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,+DAA+D;IAC/D,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,8DAA8D;IAC9D,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,2DAA2D;IAC3D,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,0DAA0D;IAC1D,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,GAAG,eAAe,CAAC;AAEpB,aAAK,cAAc,GAAG;IACpB,uFAAuF;IACvF,SAAS,CAAC,EAAE,GAAG,GAAG,GAAG,CAAC;IACtB,+BAA+B;IAC/B,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC5B,0FAA0F;IAC1F,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,sDAAsD;IACtD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,sDAAsD;IACtD,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,uHAAuH;IACvH,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB,CAAC;AAEF,MAAM,CAAC,OAAO,OAAO,SAAU,SAAQ,IAAI,CAAC,cAAc,EAAE,cAAc,CAAC;IACzE,MAAM,CAAC,WAAW,SAAe;gBAErB,KAAK,GAAE,cAAmB;IAKtC,IAAI,YAAY,yBAEf;IAED,IAAI,cAAc,2BAEjB;CACF"} \ No newline at end of file diff --git a/modules/core/typed/views/orthographic-view.d.ts b/modules/core/typed/views/orthographic-view.d.ts new file mode 100644 index 00000000000..84d3c56a10b --- /dev/null +++ b/modules/core/typed/views/orthographic-view.d.ts @@ -0,0 +1,29 @@ +import View, {CommonViewState} from './view'; +import OrthographicViewport from '../viewports/orthographic-viewport'; +import OrthographicController from '../controllers/orthographic-controller'; +export declare type OrthographicViewState = { + /** The world position at the center of the viewport. Default `[0, 0, 0]`. */ + target?: [number, number, number] | [number, number]; + /** The zoom level of the viewport. `zoom: 0` maps one unit distance to one pixel on screen, and increasing `zoom` by `1` scales the same object to twice as large. + * To apply independent zoom levels to the X and Y axes, supply an array `[zoomX, zoomY]`. Default `0`. */ + zoom?: number | [number, number]; + /** The min zoom level of the viewport. Default `-Infinity`. */ + minZoom?: number; + /** The max zoom level of the viewport. Default `Infinity`. */ + maxZoom?: number; +} & CommonViewState; +declare type OrthographicViewProps = { + /** Distance of near clipping plane. Default `0.1`. */ + near?: number; + /** Distance of far clipping plane. Default `1000`. */ + far?: number; + /** Whether to use top-left coordinates (`true`) or bottom-left coordinates (`false`). Default `true`. */ + flipY?: boolean; +}; +export default class OrthographicView extends View { + static displayName: string; + get ViewportType(): typeof OrthographicViewport; + get ControllerType(): typeof OrthographicController; +} +export {}; +// # sourceMappingURL=orthographic-view.d.ts.map diff --git a/modules/core/typed/views/orthographic-view.d.ts.map b/modules/core/typed/views/orthographic-view.d.ts.map new file mode 100644 index 00000000000..198d83d8f2e --- /dev/null +++ b/modules/core/typed/views/orthographic-view.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"orthographic-view.d.ts","sourceRoot":"","sources":["../../src/views/orthographic-view.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,EAAE,EAAC,eAAe,EAAC,MAAM,QAAQ,CAAC;AAC7C,OAAO,oBAAoB,MAAM,oCAAoC,CAAC;AACtE,OAAO,sBAAsB,MAAM,wCAAwC,CAAC;AAE5E,oBAAY,qBAAqB,GAAG;IAClC,6EAA6E;IAC7E,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACrD;gHAC4G;IAC5G,IAAI,CAAC,EAAE,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,+DAA+D;IAC/D,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,8DAA8D;IAC9D,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,GAAG,eAAe,CAAC;AAEpB,aAAK,qBAAqB,GAAG;IAC3B,sDAAsD;IACtD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,sDAAsD;IACtD,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,yGAAyG;IACzG,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,IAAI,CAAC,qBAAqB,EAAE,qBAAqB,CAAC;IAC9F,MAAM,CAAC,WAAW,SAAsB;IAExC,IAAI,YAAY,gCAEf;IAED,IAAI,cAAc,kCAEjB;CACF"} \ No newline at end of file diff --git a/modules/core/typed/views/view.d.ts b/modules/core/typed/views/view.d.ts new file mode 100644 index 00000000000..53a2ad3cb55 --- /dev/null +++ b/modules/core/typed/views/view.d.ts @@ -0,0 +1,86 @@ +import Viewport from '../viewports/viewport'; +import type Controller from '../controllers/controller'; +import type {ControllerOptions} from '../controllers/controller'; +import type {TransitionProps} from '../controllers/transition-manager'; +import type {Padding} from '../viewports/viewport'; +import type {ConstructorOf} from '../types/types'; +export declare type CommonViewState = TransitionProps; +declare type CommonViewProps = { + /** A unique id of the view. In a multi-view use case, this is important for matching view states and place contents into this view. */ + id?: string; + /** A relative (e.g. `'50%'`) or absolute position. Default `0`. */ + x?: number | string; + /** A relative (e.g. `'50%'`) or absolute position. Default `0`. */ + y?: number | string; + /** A relative (e.g. `'50%'`) or absolute extent. Default `'100%'`. */ + width?: number | string; + /** A relative (e.g. `'50%'`) or absolute extent. Default `'100%'`. */ + height?: number | string; + /** Padding around the view, expressed in either relative (e.g. `'50%'`) or absolute pixels. Default `null`. */ + padding?: { + left?: number | string; + right?: number | string; + top?: number | string; + bottom?: number | string; + } | null; + /** State of the view */ + viewState?: + | string + | ({ + id?: string; + } & Partial); + /** Options for viewport interactivity. */ + controller?: + | null + | boolean + | ConstructorOf> + | (ControllerOptions & { + type?: ConstructorOf>; + }); + /** @deprecated Directly wrap a viewport instance */ + viewportInstance?: Viewport; +}; +export default abstract class View< + ViewState extends CommonViewState = CommonViewState, + ViewProps = {} +> { + id: string; + abstract get ViewportType(): ConstructorOf; + abstract get ControllerType(): ConstructorOf>; + private viewportInstance?; + private _x; + private _y; + private _width; + private _height; + private _padding; + readonly props: ViewProps & CommonViewProps; + constructor(props: ViewProps & CommonViewProps); + equals(view: View): boolean; + /** Make viewport from canvas dimensions and view state */ + makeViewport({ + width, + height, + viewState + }: { + width: number; + height: number; + viewState: any; + }): Viewport; + getViewStateId(): string; + filterViewState(viewState: ViewState): ViewState; + /** Resolve the dimensions of the view from overall canvas dimensions */ + getDimensions({width, height}: {width: number; height: number}): { + x: number; + y: number; + width: number; + height: number; + padding?: Padding; + }; + get controller(): + | (ControllerOptions & { + type: ConstructorOf>; + }) + | null; +} +export {}; +// # sourceMappingURL=view.d.ts.map diff --git a/modules/core/typed/views/view.d.ts.map b/modules/core/typed/views/view.d.ts.map new file mode 100644 index 00000000000..73349da5c0a --- /dev/null +++ b/modules/core/typed/views/view.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"view.d.ts","sourceRoot":"","sources":["../../src/views/view.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,uB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EAAE,MAAM,CAAC;QACV,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,CAAC;QACf,OAAO,CAAC,EAAE,OAAO,CAAC;KACnB;IA0BD,IAAI,UAAU,IAAI,CAAC,iBAAiB,GAAG;QAAC,IAAI,EAAE,aAAa,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAA;KAAC,CAAC,GAAG,IAAI,CAapF;CACF"} \ No newline at end of file diff --git a/modules/extensions/typed/brushing/brushing.d.ts b/modules/extensions/typed/brushing/brushing.d.ts new file mode 100644 index 00000000000..a66608ba8c2 --- /dev/null +++ b/modules/extensions/typed/brushing/brushing.d.ts @@ -0,0 +1,44 @@ +import {LayerExtension} from '@deck.gl/core'; +import type {Layer, LayerContext, Accessor} from '@deck.gl/core'; +export declare type BrushingExtensionProps = { + /** + * Called to retrieve an arbitrary position for each object that it will be filtered by. + * Only effective if `brushingTarget` is set to `custom`. + */ + getBrushingTarget?: Accessor; + /** + * Enable/disable brushing. If brushing is disabled, all objects are rendered. + * @default true + */ + brushingEnabled?: boolean; + /** + * The position used to filter each object by. + */ + brushingTarget?: 'source' | 'target' | 'source_target' | 'custom'; + /** The brushing radius centered at the pointer, in meters. If a data object is within this circle, it is rendered; otherwise it is hidden. + * @default 10000 + */ + brushingRadius?: number; +}; +/** Adds GPU-based data brushing functionalities to layers. It allows the layer to show/hide objects based on the current pointer position. */ +export default class BrushingExtension extends LayerExtension { + static defaultProps: { + getBrushingTarget: { + type: string; + value: number[]; + }; + brushingTarget: string; + brushingEnabled: boolean; + brushingRadius: number; + }; + static extensionName: string; + getShaders(): any; + initializeState( + this: Layer, + context: LayerContext, + extension: this + ): void; + finalizeState(this: Layer, context: LayerContext, extension: this): void; + useConstantTargetPositions(attribute: any): void; +} +// # sourceMappingURL=brushing.d.ts.map diff --git a/modules/extensions/typed/brushing/brushing.d.ts.map b/modules/extensions/typed/brushing/brushing.d.ts.map new file mode 100644 index 00000000000..c4cc6a4b97b --- /dev/null +++ b/modules/extensions/typed/brushing/brushing.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"brushing.d.ts","sourceRoot":"","sources":["../../src/brushing/brushing.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAC,cAAc,EAAC,MAAM,eAAe,CAAC;AAG7C,OAAO,KAAK,EAAC,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAC,MAAM,eAAe,CAAC;AAUjE,oBAAY,sBAAsB,CAAC,KAAK,GAAG,GAAG,IAAI;IAChD;;;OAGG;IACH,iBAAiB,CAAC,EAAE,QAAQ,CAAC,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IACtD;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;OAEG;IACH,cAAc,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,eAAe,GAAG,QAAQ,CAAC;IAClE;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,8IAA8I;AAC9I,MAAM,CAAC,OAAO,OAAO,iBAAkB,SAAQ,cAAc;IAC3D,MAAM,CAAC,YAAY;;;;;;;;MAAgB;IACnC,MAAM,CAAC,aAAa,SAAuB;IAE3C,UAAU,IAAI,GAAG;IAMjB,eAAe,CAAC,IAAI,EAAE,KAAK,CAAC,sBAAsB,CAAC,EAAE,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,IAAI;IAsC3F,aAAa,CAAC,IAAI,EAAE,KAAK,CAAC,sBAAsB,CAAC,EAAE,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,IAAI;IAWzF,0BAA0B,CAAC,SAAS,KAAA;CAKrC"} \ No newline at end of file diff --git a/modules/extensions/typed/brushing/shader-module.d.ts b/modules/extensions/typed/brushing/shader-module.d.ts new file mode 100644 index 00000000000..4fc64ce0b20 --- /dev/null +++ b/modules/extensions/typed/brushing/shader-module.d.ts @@ -0,0 +1,12 @@ +import type {Viewport, _ShaderModule as ShaderModule} from '@deck.gl/core'; +import type {BrushingExtensionProps} from './brushing'; +declare type BrushingModuleSettings = { + viewport: Viewport; + mousePosition?: { + x: number; + y: number; + }; +} & BrushingExtensionProps; +declare const _default: ShaderModule; +export default _default; +// # sourceMappingURL=shader-module.d.ts.map diff --git a/modules/extensions/typed/brushing/shader-module.d.ts.map b/modules/extensions/typed/brushing/shader-module.d.ts.map new file mode 100644 index 00000000000..0ff603d79c4 --- /dev/null +++ b/modules/extensions/typed/brushing/shader-module.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"shader-module.d.ts","sourceRoot":"","sources":["../../src/brushing/shader-module.ts"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAC,QAAQ,EAAE,aAAa,IAAI,YAAY,EAAC,MAAM,eAAe,CAAC;AAE3E,OAAO,KAAK,EAAC,sBAAsB,EAAC,MAAM,YAAY,CAAC;AAEvD,aAAK,sBAAsB,GAAG;IAE5B,QAAQ,EAAE,QAAQ,CAAC;IACnB,aAAa,CAAC,EAAE;QAAC,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAC,CAAC;CACxC,GAAG,sBAAsB,CAAC;;AAkF3B,wBA4B0C"} \ No newline at end of file diff --git a/modules/extensions/typed/clip/clip.d.ts b/modules/extensions/typed/clip/clip.d.ts new file mode 100644 index 00000000000..04c01d7275e --- /dev/null +++ b/modules/extensions/typed/clip/clip.d.ts @@ -0,0 +1,29 @@ +import {LayerExtension, _ShaderModule as ShaderModule} from '@deck.gl/core'; +import type {Layer} from '@deck.gl/core'; +export declare type ClipExtensionProps = { + /** Rectangular bounds to be used for clipping the rendered region, in `[left, bottom, right, top]`. + * @default [0, 0, 1, 1] + */ + clipBounds?: [number, number, number, number]; + /** + * Controls whether an object is clipped by its anchor (e.g. icon, point) or by its geometry (e.g. path, polygon). + * If not specified, it is automatically deduced from the layer. + */ + clipByInstance?: boolean; +}; +/** Adds support for clipping rendered layers by rectangular bounds. */ +export default class ClipExtension extends LayerExtension { + static defaultProps: any; + static extensionName: string; + getShaders(this: Layer): { + modules: ShaderModule[]; + inject: { + 'vs:#decl': string; + 'vs:DECKGL_FILTER_GL_POSITION': string; + 'fs:#decl': string; + 'fs:DECKGL_FILTER_COLOR': string; + }; + }; + draw(this: Layer, {uniforms}: any): void; +} +// # sourceMappingURL=clip.d.ts.map diff --git a/modules/extensions/typed/clip/clip.d.ts.map b/modules/extensions/typed/clip/clip.d.ts.map new file mode 100644 index 00000000000..b8424010b51 --- /dev/null +++ b/modules/extensions/typed/clip/clip.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"clip.d.ts","sourceRoot":"","sources":["../../src/clip/clip.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAC,cAAc,EAAE,aAAa,IAAI,YAAY,EAAC,MAAM,eAAe,CAAC;AAE5E,OAAO,KAAK,EAAC,KAAK,EAAC,MAAM,eAAe,CAAC;AAOzC,oBAAY,kBAAkB,GAAG;IAC/B;;OAEG;IACH,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9C;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B,CAAC;AA0DF,uEAAuE;AACvE,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,cAAc;IACvD,MAAM,CAAC,YAAY,EAAE,GAAG,CAAgB;IACxC,MAAM,CAAC,aAAa,SAAmB;IAEvC,UAAU,CAAC,IAAI,EAAE,KAAK,CAAC,kBAAkB,CAAC;;;;;;;;;IAwB1C,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,kBAAkB,CAAC,EAAE,EAAC,QAAQ,EAAC,EAAE,GAAG,GAAG,IAAI;CAgB7D"} \ No newline at end of file diff --git a/modules/extensions/typed/data-filter/aggregator.d.ts b/modules/extensions/typed/data-filter/aggregator.d.ts new file mode 100644 index 00000000000..0d9c18d61f1 --- /dev/null +++ b/modules/extensions/typed/data-filter/aggregator.d.ts @@ -0,0 +1,16 @@ +import {Device} from '@luma.gl/api'; +import {GL, Model, Framebuffer} from '@luma.gl/webgl-legacy'; +export declare function supportsFloatTarget(device: Device): boolean; +export declare function getFramebuffer(device: Device, useFloatTarget: boolean): Framebuffer; +export declare function getModel( + device: Device, + shaderOptions: any, + useFloatTarget: boolean +): Model; +export declare const parameters: { + blend: boolean; + blendFunc: GL[]; + blendEquation: GL[]; + depthTest: boolean; +}; +// # sourceMappingURL=aggregator.d.ts.map diff --git a/modules/extensions/typed/data-filter/aggregator.d.ts.map b/modules/extensions/typed/data-filter/aggregator.d.ts.map new file mode 100644 index 00000000000..51b3aafe90c --- /dev/null +++ b/modules/extensions/typed/data-filter/aggregator.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"aggregator.d.ts","sourceRoot":"","sources":["../../src/data-filter/aggregator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,MAAM,EAAC,MAAM,cAAc,CAAC;AACpC,OAAO,EAAC,EAAE,EAAE,KAAK,EAAa,WAAW,EAAC,MAAM,uBAAuB,CAAC;AAiDxE,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAY3D;AAGD,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,OAAO,GAAG,WAAW,CAmBnF;AAGD,wBAAgB,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,GAAG,EAAE,cAAc,EAAE,OAAO,GAAG,KAAK,CAe3F;AAED,eAAO,MAAM,UAAU;;;;;CAKtB,CAAC"} \ No newline at end of file diff --git a/modules/extensions/typed/data-filter/data-filter.d.ts b/modules/extensions/typed/data-filter/data-filter.d.ts new file mode 100644 index 00000000000..d8e70e448ed --- /dev/null +++ b/modules/extensions/typed/data-filter/data-filter.d.ts @@ -0,0 +1,97 @@ +import type {Layer, LayerContext, Accessor, UpdateParameters} from '@deck.gl/core'; +import {LayerExtension} from '@deck.gl/core'; +export declare type DataFilterExtensionProps = { + /** + * Accessor to retrieve the value for each object that it will be filtered by. + * Returns either a number (if `filterSize: 1`) or an array of numbers. + */ + getFilterValue?: Accessor; + /** + * Enable/disable the data filter. If the data filter is disabled, all objects are rendered. + * @default true + */ + filterEnabled?: boolean; + /** + * The [min, max] bounds which defines whether an object should be rendered. + * If an object's filtered value is within the bounds, the object will be rendered; otherwise it will be hidden. + * @default [-1, 1] + */ + filterRange?: [number, number] | [number, number][]; + /** + * If specified, objects will be faded in/out instead of abruptly shown/hidden. + * When the filtered value is outside of the bounds defined by `filterSoftRange` but still within the bounds defined by `filterRange`, the object will be rendered as "faded." + * @default null + */ + filterSoftRange?: [number, number] | [number, number][] | null; + /** + * When an object is "faded", manipulate its size so that it appears smaller or thinner. Only works if `filterSoftRange` is specified. + * @default true + */ + filterTransformSize?: boolean; + /** + * When an object is "faded", manipulate its opacity so that it appears more translucent. Only works if `filterSoftRange` is specified. + * @default true + */ + filterTransformColor?: boolean; + /** + * Only called if the `countItems` option is enabled. + */ + onFilteredItemsChange?: (evt: { + /** The id of the source layer. */ + id: string; + /** The number of data objects that pass the filter. */ + count: number; + }) => void; +}; +declare type DataFilterExtensionOptions = { + /** + * The size of the filter (number of columns to filter by). The data filter can show/hide data based on 1-4 numeric properties of each object. + * @default 1 + */ + filterSize: number; + /** + * Use 64-bit precision instead of 32-bit. + * @default false + */ + fp64: boolean; + /** + * If `true`, reports the number of filtered objects with the `onFilteredItemsChange` callback. + * @default `false`. + */ + countItems: boolean; +}; +/** Adds GPU-based data filtering functionalities to layers. It allows the layer to show/hide objects based on user-defined properties. */ +export default class DataFilterExtension extends LayerExtension { + static defaultProps: { + getFilterValue: { + type: string; + value: number; + }; + onFilteredItemsChange: { + type: string; + value: any; + compare: boolean; + }; + filterEnabled: boolean; + filterRange: number[]; + filterSoftRange: any; + filterTransformSize: boolean; + filterTransformColor: boolean; + }; + static extensionName: string; + constructor({filterSize, fp64, countItems}?: Partial); + getShaders(this: Layer, extension: this): any; + initializeState( + this: Layer, + context: LayerContext, + extension: this + ): void; + updateState( + this: Layer, + {props, oldProps}: UpdateParameters> + ): void; + draw(this: Layer, params: any, extension: this): void; + finalizeState(this: Layer): void; +} +export {}; +// # sourceMappingURL=data-filter.d.ts.map diff --git a/modules/extensions/typed/data-filter/data-filter.d.ts.map b/modules/extensions/typed/data-filter/data-filter.d.ts.map new file mode 100644 index 00000000000..21199e14ea5 --- /dev/null +++ b/modules/extensions/typed/data-filter/data-filter.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"data-filter.d.ts","sourceRoot":"","sources":["../../src/data-filter/data-filter.ts"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAC,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,gBAAgB,EAAC,MAAM,eAAe,CAAC;AACnF,OAAO,EAAC,cAAc,EAAC,MAAM,eAAe,CAAC;AAe7C,oBAAY,wBAAwB,CAAC,KAAK,GAAG,GAAG,IAAI;IAClD;;;OAGG;IACH,cAAc,CAAC,EAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,CAAC;IACpD;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;;;OAIG;IACH,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC;IACpD;;;;OAIG;IACH,eAAe,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,GAAG,IAAI,CAAC;IAC/D;;;OAGG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B;;;OAGG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B;;OAEG;IACH,qBAAqB,CAAC,EAAE,CAAC,GAAG,EAAE;QAC5B,kCAAkC;QAClC,EAAE,EAAE,MAAM,CAAC;QACX,uDAAuD;QACvD,KAAK,EAAE,MAAM,CAAC;KACf,KAAK,IAAI,CAAC;CACZ,CAAC;AAEF,aAAK,0BAA0B,GAAG;IAChC;;;OAGG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,IAAI,EAAE,OAAO,CAAC;IACd;;;OAGG;IACH,UAAU,EAAE,OAAO,CAAC;CACrB,CAAC;AASF,0IAA0I;AAC1I,MAAM,CAAC,OAAO,OAAO,mBAAoB,SAAQ,cAAc,CAAC,0BAA0B,CAAC;IACzF,MAAM,CAAC,YAAY;;;;;;;;;;;;;;;MAAgB;IACnC,MAAM,CAAC,aAAa,SAAyB;gBAEjC,EACV,UAAc,EACd,IAAY,EACZ,UAAkB,EACnB,GAAE,OAAO,CAAC,0BAA0B,CAAM;IAQ3C,UAAU,CAAC,IAAI,EAAE,KAAK,CAAC,wBAAwB,CAAC,EAAE,SAAS,EAAE,IAAI,GAAG,GAAG;IAYvE,eAAe,CAAC,IAAI,EAAE,KAAK,CAAC,wBAAwB,CAAC,EAAE,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,IAAI;IAyD7F,WAAW,CACT,IAAI,EAAE,KAAK,CAAC,wBAAwB,CAAC,EACrC,EAAC,KAAK,EAAE,QAAQ,EAAC,EAAE,gBAAgB,CAAC,KAAK,CAAC,wBAAwB,CAAC,CAAC;IAgBtE,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,wBAAwB,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,IAAI;IAmCxE,aAAa,CAAC,IAAI,EAAE,KAAK,CAAC,wBAAwB,CAAC;CAQpD"} \ No newline at end of file diff --git a/modules/extensions/typed/data-filter/shader-module.d.ts b/modules/extensions/typed/data-filter/shader-module.d.ts new file mode 100644 index 00000000000..185ecb5b2aa --- /dev/null +++ b/modules/extensions/typed/data-filter/shader-module.d.ts @@ -0,0 +1,9 @@ +import {_ShaderModule as ShaderModule} from '@deck.gl/core/typed'; +import type {DataFilterExtensionProps} from './data-filter'; +declare type DataFilterModuleSettings = { + extensions: any[]; +} & DataFilterExtensionProps; +export declare const shaderModule: ShaderModule; +export declare const shaderModule64: ShaderModule; +export {}; +// # sourceMappingURL=shader-module.d.ts.map diff --git a/modules/extensions/typed/data-filter/shader-module.d.ts.map b/modules/extensions/typed/data-filter/shader-module.d.ts.map new file mode 100644 index 00000000000..c2740eb6bfa --- /dev/null +++ b/modules/extensions/typed/data-filter/shader-module.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"shader-module.d.ts","sourceRoot":"","sources":["../../src/data-filter/shader-module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,IAAI,YAAY,EAAC,MAAM,qBAAqB,CAAC;AAElE,OAAO,KAAK,EAAC,wBAAwB,EAAC,MAAM,eAAe,CAAC;AAmE5D,aAAK,wBAAwB,GAAG;IAC9B,UAAU,EAAE,GAAG,EAAE,CAAC;CACnB,GAAG,wBAAwB,CAAC;AA2F7B,eAAO,MAAM,YAAY,EAAE,YAAY,CAAC,wBAAwB,CAM/D,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,YAAY,CAAC,wBAAwB,CAMjE,CAAC"} \ No newline at end of file diff --git a/modules/extensions/typed/fill-style/fill-style.d.ts b/modules/extensions/typed/fill-style/fill-style.d.ts new file mode 100644 index 00000000000..eea4be7062c --- /dev/null +++ b/modules/extensions/typed/fill-style/fill-style.d.ts @@ -0,0 +1,97 @@ +import {LayerExtension} from '@deck.gl/core'; +import type { + Layer, + LayerContext, + Accessor, + AccessorFunction, + Texture, + UpdateParameters +} from '@deck.gl/core'; +export declare type FillStyleExtensionProps = { + /** Cheap toggle to enable/disable pattern fill. Requires the `pattern` option to be on. + * @default true + */ + fillPatternEnabled?: boolean; + /** Sprite image url or texture that packs all your patterns into one layout. */ + fillPatternAtlas?: Texture; + /** Pattern names mapped to pattern definitions, or a url that points to a JSON file. */ + fillPatternMapping?: + | string + | Record< + string, + { + /** Left position of the pattern on the atlas */ + x: number; + /** Top position of the pattern on the atlas */ + y: number; + /** Width of the pattern */ + width: number; + /** Height of the pattern */ + height: number; + } + >; + /** + * Whether to treat the patterns as transparency masks. + * @default true + */ + fillPatternMask?: boolean; + /** Accessor for the name of the pattern. */ + getFillPattern?: AccessorFunction; + /** Accessor for the scale of the pattern, relative to the original size. If the pattern is 24 x 24 pixels, scale `1` roughly yields 24 meters. + * @default 1 + */ + getFillPatternScale?: Accessor; + /** + * Accessor for the offset of the pattern, relative to the original size. Offset `[0.5, 0.5]` shifts the pattern alignment by half. + * @default [0, 0] + */ + getFillPatternOffset?: Accessor; +}; +declare type FillStyleExtensionOptions = { + /** If `true`, adds the ability to tile the filled area with a pattern. + * @default false + */ + pattern: boolean; +}; +/** Adds selected features to layers that render a "fill", such as the `PolygonLayer` and `ScatterplotLayer`. */ +export default class FillStyleExtension extends LayerExtension { + static defaultProps: { + fillPatternEnabled: boolean; + fillPatternAtlas: any; + fillPatternMapping: any; + fillPatternMask: boolean; + getFillPattern: { + type: string; + value: (d: any) => any; + }; + getFillPatternScale: { + type: string; + value: number; + }; + getFillPatternOffset: { + type: string; + value: number[]; + }; + }; + static extensionName: string; + constructor({pattern}?: Partial); + isEnabled(layer: Layer): boolean; + getShaders(this: Layer, extension: this): any; + initializeState( + this: Layer, + context: LayerContext, + extension: this + ): void; + updateState( + this: Layer, + {props, oldProps}: UpdateParameters>, + extension: this + ): void; + draw(this: Layer, params: any, extension: this): void; + finalizeState(this: Layer): void; + loadPatternAtlas(this: Layer): Promise; + loadPatternMapping(this: Layer): Promise; + getPatternFrame(this: Layer, name: string): any[]; +} +export {}; +// # sourceMappingURL=fill-style.d.ts.map diff --git a/modules/extensions/typed/fill-style/fill-style.d.ts.map b/modules/extensions/typed/fill-style/fill-style.d.ts.map new file mode 100644 index 00000000000..5927a09f637 --- /dev/null +++ b/modules/extensions/typed/fill-style/fill-style.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"fill-style.d.ts","sourceRoot":"","sources":["../../src/fill-style/fill-style.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,E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AK,EAAE,KAAK,CAAC,uBAAuB,CAAC,GAAG,OAAO;IAIzD,UAAU,CAAC,IAAI,EAAE,KAAK,CAAC,uBAAuB,CAAC,EAAE,SAAS,EAAE,IAAI,GAAG,GAAG;IAUtE,eAAe,CAAC,IAAI,EAAE,KAAK,CAAC,uBAAuB,CAAC,EAAE,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,IAAI;IA0D5F,WAAW,CACT,IAAI,EAAE,KAAK,CAAC,uBAAuB,CAAC,EACpC,EAAC,KAAK,EAAE,QAAQ,EAAC,EAAE,gBAAgB,CAAC,KAAK,CAAC,uBAAuB,CAAC,CAAC,EACnE,SAAS,EAAE,IAAI;IAcjB,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,uBAAuB,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,IAAI;IAWvE,aAAa,CAAC,IAAI,EAAE,KAAK,CAAC,uBAAuB,CAAC;IAM5C,gBAAgB,CAAC,IAAI,EAAE,KAAK,CAAC,uBAAuB,CAAC;IAmBrD,kBAAkB,CAAC,IAAI,EAAE,KAAK,CAAC,uBAAuB,CAAC;IAe7D,eAAe,CAAC,IAAI,EAAE,KAAK,CAAC,uBAAuB,CAAC,EAAE,IAAI,EAAE,MAAM;CAKnE"} \ No newline at end of file diff --git a/modules/extensions/typed/fill-style/shaders.glsl.d.ts b/modules/extensions/typed/fill-style/shaders.glsl.d.ts new file mode 100644 index 00000000000..76fbd45f3f9 --- /dev/null +++ b/modules/extensions/typed/fill-style/shaders.glsl.d.ts @@ -0,0 +1,14 @@ +import type {Viewport, _ShaderModule as ShaderModule} from '@deck.gl/core'; +import type {Texture2D} from '@luma.gl/webgl-legacy'; +declare type FillStyleModuleSettings = + | { + viewport: Viewport; + fillPatternEnabled?: boolean; + fillPatternMask?: boolean; + } + | { + fillPatternTexture: Texture2D; + }; +export declare const patternShaders: ShaderModule; +export {}; +// # sourceMappingURL=shaders.glsl.d.ts.map diff --git a/modules/extensions/typed/fill-style/shaders.glsl.d.ts.map b/modules/extensions/typed/fill-style/shaders.glsl.d.ts.map new file mode 100644 index 00000000000..bc537aeff59 --- /dev/null +++ b/modules/extensions/typed/fill-style/shaders.glsl.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"shaders.glsl.d.ts","sourceRoot":"","sources":["../../src/fill-style/shaders.glsl.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,QAAQ,EAAE,aAAa,IAAI,YAAY,EAAkB,MAAM,eAAe,CAAC;AAE5F,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,uBAAuB,CAAC;AAwErD,aAAK,uBAAuB,GACxB;IACE,QAAQ,EAAE,QAAQ,CAAC;IACnB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,GACD;IACE,kBAAkB,EAAE,SAAS,CAAC;CAC/B,CAAC;AAqCN,eAAO,MAAM,cAAc,EAAE,YAAY,CAAC,uBAAuB,CAOhE,CAAC"} \ No newline at end of file diff --git a/modules/extensions/typed/fp64/fp64.d.ts b/modules/extensions/typed/fp64/fp64.d.ts new file mode 100644 index 00000000000..436ba55b7bc --- /dev/null +++ b/modules/extensions/typed/fp64/fp64.d.ts @@ -0,0 +1,8 @@ +import {LayerExtension} from '@deck.gl/core'; +import type {Layer} from '@deck.gl/core'; +/** @deprecated Adds the legacy 64-bit precision to geospatial layers. */ +export default class Fp64Extension extends LayerExtension { + static extensionName: string; + getShaders(this: Layer): any; +} +// # sourceMappingURL=fp64.d.ts.map diff --git a/modules/extensions/typed/fp64/fp64.d.ts.map b/modules/extensions/typed/fp64/fp64.d.ts.map new file mode 100644 index 00000000000..391e034412d --- /dev/null +++ b/modules/extensions/typed/fp64/fp64.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"fp64.d.ts","sourceRoot":"","sources":["../../src/fp64/fp64.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAC,cAAc,EAAoB,MAAM,eAAe,CAAC;AAGhE,OAAO,KAAK,EAAC,KAAK,EAAC,MAAM,eAAe,CAAC;AAEzC,yEAAyE;AACzE,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,cAAc;IACvD,MAAM,CAAC,aAAa,SAAmB;IAEvC,UAAU,CAAC,IAAI,EAAE,KAAK,GAAG,GAAG;CAa7B"} \ No newline at end of file diff --git a/modules/extensions/typed/fp64/project64.d.ts b/modules/extensions/typed/fp64/project64.d.ts new file mode 100644 index 00000000000..347c16a0fe9 --- /dev/null +++ b/modules/extensions/typed/fp64/project64.d.ts @@ -0,0 +1,7 @@ +import type {Viewport, _ShaderModule as ShaderModule} from '@deck.gl/core'; +declare type Project64ModuleSettings = { + viewport: Viewport; +}; +declare const _default: ShaderModule; +export default _default; +// # sourceMappingURL=project64.d.ts.map diff --git a/modules/extensions/typed/fp64/project64.d.ts.map b/modules/extensions/typed/fp64/project64.d.ts.map new file mode 100644 index 00000000000..4d3b7b60342 --- /dev/null +++ b/modules/extensions/typed/fp64/project64.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"project64.d.ts","sourceRoot":"","sources":["../../src/fp64/project64.ts"],"names":[],"mappings":"AAyBA,OAAO,KAAK,EAAC,QAAQ,EAAE,aAAa,IAAI,YAAY,EAAC,MAAM,eAAe,CAAC;AAG3E,aAAK,uBAAuB,GAAG;IAC7B,QAAQ,EAAE,QAAQ,CAAC;CACpB,CAAC;;AAEF,wBAK2C"} \ No newline at end of file diff --git a/modules/extensions/typed/fp64/project64.glsl.d.ts b/modules/extensions/typed/fp64/project64.glsl.d.ts new file mode 100644 index 00000000000..b48020e8579 --- /dev/null +++ b/modules/extensions/typed/fp64/project64.glsl.d.ts @@ -0,0 +1,3 @@ +declare const _default: '\nconst vec2 WORLD_SCALE_FP64 = vec2(81.4873275756836, 0.0000032873668232014097);\n\nuniform vec2 project_uViewProjectionMatrixFP64[16];\n\n// longitude: lnglat_fp64.xy; latitude: lnglat_fp64.zw\nvoid mercatorProject_fp64(vec4 lnglat_fp64, out vec2 out_val[2]) {\n\n#if defined(NVIDIA_FP64_WORKAROUND)\n out_val[0] = sum_fp64(radians_fp64(lnglat_fp64.xy), PI_FP64 * ONE);\n#else\n out_val[0] = sum_fp64(radians_fp64(lnglat_fp64.xy), PI_FP64);\n#endif\n out_val[1] = sum_fp64(PI_FP64,\n log_fp64(tan_fp64(sum_fp64(PI_4_FP64, radians_fp64(lnglat_fp64.zw) / 2.0))));\n return;\n}\n\nvoid project_position_fp64(vec4 position_fp64, out vec2 out_val[2]) {\n vec2 pos_fp64[2];\n mercatorProject_fp64(position_fp64, pos_fp64);\n out_val[0] = mul_fp64(pos_fp64[0], WORLD_SCALE_FP64);\n out_val[1] = mul_fp64(pos_fp64[1], WORLD_SCALE_FP64);\n\n return;\n}\n\nvoid project_position_fp64(vec2 position, vec2 position64xyLow, out vec2 out_val[2]) {\n vec4 position64xy = vec4(\n position.x, position64xyLow.x,\n position.y, position64xyLow.y);\n\n project_position_fp64(position64xy, out_val);\n}\n\nvec4 project_common_position_to_clipspace_fp64(vec2 vertex_pos_modelspace[4]) {\n vec2 vertex_pos_clipspace[4];\n mat4_vec4_mul_fp64(project_uViewProjectionMatrixFP64, vertex_pos_modelspace,\n vertex_pos_clipspace);\n return vec4(\n vertex_pos_clipspace[0].x,\n vertex_pos_clipspace[1].x,\n vertex_pos_clipspace[2].x,\n vertex_pos_clipspace[3].x\n );\n}\n\nvec4 project_position_to_clipspace(\n vec3 position, vec3 position64xyLow, vec3 offset, out vec4 commonPosition\n) {\n // This is the local offset to the instance position\n vec2 offset64[4];\n vec4_fp64(vec4(offset, 0.0), offset64);\n\n float z = project_size(position.z);\n\n // Apply web mercator projection (depends on coordinate system imn use)\n vec2 projectedPosition64xy[2];\n project_position_fp64(position.xy, position64xyLow.xy, projectedPosition64xy);\n\n vec2 commonPosition64[4];\n commonPosition64[0] = sum_fp64(offset64[0], projectedPosition64xy[0]);\n commonPosition64[1] = sum_fp64(offset64[1], projectedPosition64xy[1]);\n commonPosition64[2] = sum_fp64(offset64[2], vec2(z, 0.0));\n commonPosition64[3] = vec2(1.0, 0.0);\n\n commonPosition = vec4(projectedPosition64xy[0].x, projectedPosition64xy[1].x, z, 1.0);\n\n return project_common_position_to_clipspace_fp64(commonPosition64);\n}\n\nvec4 project_position_to_clipspace(\n vec3 position, vec3 position64xyLow, vec3 offset\n) {\n vec4 commonPosition;\n return project_position_to_clipspace(\n position, position64xyLow, offset, commonPosition\n );\n}\n'; +export default _default; +// # sourceMappingURL=project64.glsl.d.ts.map diff --git a/modules/extensions/typed/fp64/project64.glsl.d.ts.map b/modules/extensions/typed/fp64/project64.glsl.d.ts.map new file mode 100644 index 00000000000..9d3338d8e90 --- /dev/null +++ b/modules/extensions/typed/fp64/project64.glsl.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"project64.glsl.d.ts","sourceRoot":"","sources":["../../src/fp64/project64.glsl.ts"],"names":[],"mappings":";AAoBA,wBAgFE"} \ No newline at end of file diff --git a/modules/extensions/typed/index.d.ts b/modules/extensions/typed/index.d.ts new file mode 100644 index 00000000000..4df4fd39ce0 --- /dev/null +++ b/modules/extensions/typed/index.d.ts @@ -0,0 +1,15 @@ +export {default as BrushingExtension} from './brushing/brushing'; +export {default as DataFilterExtension} from './data-filter/data-filter'; +export {default as Fp64Extension} from './fp64/fp64'; +export {default as PathStyleExtension} from './path-style/path-style'; +export {default as FillStyleExtension} from './fill-style/fill-style'; +export {default as ClipExtension} from './clip/clip'; +export {default as MaskExtension} from './mask/mask'; +export {default as project64} from './fp64/project64'; +export type {BrushingExtensionProps} from './brushing/brushing'; +export type {DataFilterExtensionProps} from './data-filter/data-filter'; +export type {PathStyleExtensionProps} from './path-style/path-style'; +export type {FillStyleExtensionProps} from './fill-style/fill-style'; +export type {ClipExtensionProps} from './clip/clip'; +export type {MaskExtensionProps} from './mask/mask'; +// # sourceMappingURL=index.d.ts.map diff --git a/modules/extensions/typed/index.d.ts.map b/modules/extensions/typed/index.d.ts.map new file mode 100644 index 00000000000..1aba0518af0 --- /dev/null +++ b/modules/extensions/typed/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,IAAI,iBAAiB,EAAC,MAAM,qBAAqB,CAAC;AACjE,OAAO,EAAC,OAAO,IAAI,mBAAmB,EAAC,MAAM,2BAA2B,CAAC;AACzE,OAAO,EAAC,OAAO,IAAI,aAAa,EAAC,MAAM,aAAa,CAAC;AACrD,OAAO,EAAC,OAAO,IAAI,kBAAkB,EAAC,MAAM,yBAAyB,CAAC;AACtE,OAAO,EAAC,OAAO,IAAI,kBAAkB,EAAC,MAAM,yBAAyB,CAAC;AACtE,OAAO,EAAC,OAAO,IAAI,aAAa,EAAC,MAAM,aAAa,CAAC;AACrD,OAAO,EAAC,OAAO,IAAI,aAAa,EAAC,MAAM,aAAa,CAAC;AAGrD,OAAO,EAAC,OAAO,IAAI,SAAS,EAAC,MAAM,kBAAkB,CAAC;AAGtD,YAAY,EAAC,sBAAsB,EAAC,MAAM,qBAAqB,CAAC;AAChE,YAAY,EAAC,wBAAwB,EAAC,MAAM,2BAA2B,CAAC;AACxE,YAAY,EAAC,uBAAuB,EAAC,MAAM,yBAAyB,CAAC;AACrE,YAAY,EAAC,uBAAuB,EAAC,MAAM,yBAAyB,CAAC;AACrE,YAAY,EAAC,kBAAkB,EAAC,MAAM,aAAa,CAAC;AACpD,YAAY,EAAC,kBAAkB,EAAC,MAAM,aAAa,CAAC"} \ No newline at end of file diff --git a/modules/extensions/typed/mask/mask.d.ts b/modules/extensions/typed/mask/mask.d.ts new file mode 100644 index 00000000000..e7b020087d0 --- /dev/null +++ b/modules/extensions/typed/mask/mask.d.ts @@ -0,0 +1,25 @@ +import {LayerExtension} from '@deck.gl/core'; +import type {Layer} from '@deck.gl/core'; +export declare type MaskExtensionProps = { + /** + * Id of the layer that defines the mask. The mask layer must use the prop `operation: 'mask'`. + * Masking is disabled if `maskId` is empty or no valid mask layer with the specified id is found. + */ + maskId?: string; + /** + * controls whether an object is clipped by its anchor (usually defined by an accessor called `getPosition`, e.g. icon, scatterplot) or by its geometry (e.g. path, polygon). + * If not specified, it is automatically deduced from the layer. + */ + maskByInstance?: boolean; +}; +/** Allows layers to show/hide objects by a geofence. */ +export default class MaskExtension extends LayerExtension { + static defaultProps: { + maskId: string; + maskByInstance: any; + }; + static extensionName: string; + getShaders(this: Layer): any; + draw(this: Layer, {uniforms, context, moduleParameters}: any): void; +} +// # sourceMappingURL=mask.d.ts.map diff --git a/modules/extensions/typed/mask/mask.d.ts.map b/modules/extensions/typed/mask/mask.d.ts.map new file mode 100644 index 00000000000..85c45bda738 --- /dev/null +++ b/modules/extensions/typed/mask/mask.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"mask.d.ts","sourceRoot":"","sources":["../../src/mask/mask.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,cAAc,EAAM,MAAM,eAAe,CAAC;AAGrE,OAAO,KAAK,EAAC,KAAK,EAAC,MAAM,eAAe,CAAC;AAOzC,oBAAY,kBAAkB,GAAG;IAC/B;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B,CAAC;AAEF,wDAAwD;AACxD,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,cAAc;IACvD,MAAM,CAAC,YAAY;;;MAAgB;IACnC,MAAM,CAAC,aAAa,SAAmB;IAEvC,UAAU,CAAC,IAAI,EAAE,KAAK,CAAC,kBAAkB,CAAC,GAAG,GAAG;IAehD,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,kBAAkB,CAAC,EAAE,EAAC,QAAQ,EAAE,OAAO,EAAE,gBAAgB,EAAC,EAAE,GAAG;CA2BjF"} \ No newline at end of file diff --git a/modules/extensions/typed/mask/shader-module.d.ts b/modules/extensions/typed/mask/shader-module.d.ts new file mode 100644 index 00000000000..194dd218588 --- /dev/null +++ b/modules/extensions/typed/mask/shader-module.d.ts @@ -0,0 +1,8 @@ +import type {_ShaderModule as ShaderModule} from '@deck.gl/core'; +import type {Texture2D} from '@luma.gl/webgl-legacy'; +declare type MaskModuleSettings = { + maskMap?: Texture2D; +}; +declare const _default: ShaderModule; +export default _default; +// # sourceMappingURL=shader-module.d.ts.map diff --git a/modules/extensions/typed/mask/shader-module.d.ts.map b/modules/extensions/typed/mask/shader-module.d.ts.map new file mode 100644 index 00000000000..7aacd907786 --- /dev/null +++ b/modules/extensions/typed/mask/shader-module.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"shader-module.d.ts","sourceRoot":"","sources":["../../src/mask/shader-module.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,aAAa,IAAI,YAAY,EAAC,MAAM,eAAe,CAAC;AACjE,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,uBAAuB,CAAC;AA8DrD,aAAK,kBAAkB,GAAG;IACxB,OAAO,CAAC,EAAE,SAAS,CAAC;CACrB,CAAC;;AAYF,wBAOsC"} \ No newline at end of file diff --git a/modules/extensions/typed/path-style/path-style.d.ts b/modules/extensions/typed/path-style/path-style.d.ts new file mode 100644 index 00000000000..6d21b034106 --- /dev/null +++ b/modules/extensions/typed/path-style/path-style.d.ts @@ -0,0 +1,74 @@ +import {LayerExtension} from '@deck.gl/core'; +import type {Layer, LayerContext, Accessor, UpdateParameters} from '@deck.gl/core'; +export declare type PathStyleExtensionProps = { + /** + * Accessor for the dash array to draw each path with: `[dashSize, gapSize]` relative to the width of the path. + * Requires the `dash` option to be on. + */ + getDashArray?: Accessor; + /** + * Accessor for the offset to draw each path with, relative to the width of the path. + * Negative offset is to the left hand side, and positive offset is to the right hand side. + * @default 0 + */ + getOffset?: Accessor; + /** + * If `true`, adjust gaps for the dashes to align at both ends. + * @default false + */ + dashJustified?: boolean; + /** + * If `true`, gaps between solid strokes are pickable. If `false`, only the solid strokes are pickable. + * @default false + */ + dashGapPickable?: boolean; +}; +declare type PathStyleExtensionOptions = { + /** + * Add capability to render dashed lines. + * @default false + */ + dash: boolean; + /** + * Add capability to offset lines. + * @default false + */ + offset: boolean; + /** + * Improve dash rendering quality in certain circumstances. Note that this option introduces additional performance overhead. + * @default false + */ + highPrecisionDash: boolean; +}; +/** Adds selected features to the `PathLayer` and composite layers that render the `PathLayer`. */ +export default class PathStyleExtension extends LayerExtension { + static defaultProps: { + getDashArray: { + type: string; + value: number[]; + }; + getOffset: { + type: string; + value: number; + }; + dashJustified: boolean; + dashGapPickable: boolean; + }; + static extensionName: string; + constructor({dash, offset, highPrecisionDash}?: Partial); + isEnabled(layer: Layer): boolean; + getShaders(this: Layer, extension: this): any; + initializeState( + this: Layer, + context: LayerContext, + extension: this + ): void; + updateState( + this: Layer, + params: UpdateParameters>, + extension: this + ): void; + getDashOffsets(this: Layer, path: number[] | number[][]): number[]; +} +export {}; +// # sourceMappingURL=path-style.d.ts.map diff --git a/modules/extensions/typed/path-style/path-style.d.ts.map b/modules/extensions/typed/path-style/path-style.d.ts.map new file mode 100644 index 00000000000..83f228cd660 --- /dev/null +++ b/modules/extensions/typed/path-style/path-style.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"path-style.d.ts","sourceRoot":"","sources":["../../src/path-style/path-style.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAC,cAAc,EAAgC,MAAM,eAAe,CAAC;AAI5E,OAAO,KAAK,EAAC,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,gBAAgB,EAAC,MAAM,eAAe,CAAC;AASnF,oBAAY,uBAAuB,CAAC,KAAK,GAAG,GAAG,IAAI;IACjD;;;OAGG;IACH,YAAY,CAAC,EAAE,QAAQ,CAAC,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IACjD;;;;OAIG;IACH,SAAS,CAAC,EAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACpC;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,CAAC;AAEF,aAAK,yBAAyB,GAAG;IAC/B;;;OAGG;IACH,IAAI,EAAE,OAAO,CAAC;IACd;;;OAGG;IACH,MAAM,EAAE,OAAO,CAAC;IAChB;;;OAGG;IACH,iBAAiB,EAAE,OAAO,CAAC;CAC5B,CAAC;AAEF,kGAAkG;AAClG,MAAM,CAAC,OAAO,OAAO,kBAAmB,SAAQ,cAAc,CAAC,yBAAyB,CAAC;IACvF,MAAM,CAAC,YAAY;;;;;;;;;;;MAAgB;IACnC,MAAM,CAAC,aAAa,SAAwB;gBAEhC,EACV,IAAY,EACZ,MAAc,EACd,iBAAyB,EAC1B,GAAE,OAAO,CAAC,yBAAyB,CAAM;IAI1C,SAAS,CAAC,KAAK,EAAE,KAAK,CAAC,uBAAuB,CAAC,GAAG,OAAO;IAIzD,UAAU,CAAC,IAAI,EAAE,KAAK,CAAC,uBAAuB,CAAC,EAAE,SAAS,EAAE,IAAI,GAAG,GAAG;IAiBtE,eAAe,CAAC,IAAI,EAAE,KAAK,CAAC,uBAAuB,CAAC,EAAE,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,IAAI;IA4B5F,WAAW,CACT,IAAI,EAAE,KAAK,CAAC,uBAAuB,CAAC,EACpC,MAAM,EAAE,gBAAgB,CAAC,KAAK,CAAC,uBAAuB,CAAC,CAAC,EACxD,SAAS,EAAE,IAAI;IAgBjB,cAAc,CAAC,IAAI,EAAE,KAAK,CAAC,uBAAuB,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,EAAE,GAAG,MAAM,EAAE;CAoB5F"} \ No newline at end of file diff --git a/modules/extensions/typed/path-style/shaders.glsl.d.ts b/modules/extensions/typed/path-style/shaders.glsl.d.ts new file mode 100644 index 00000000000..61283d5a5c0 --- /dev/null +++ b/modules/extensions/typed/path-style/shaders.glsl.d.ts @@ -0,0 +1,17 @@ +export declare const dashShaders: { + inject: { + 'vs:#decl': string; + 'vs:#main-end': string; + 'fs:#decl': string; + 'fs:#main-start': string; + }; +}; +export declare const offsetShaders: { + inject: { + 'vs:#decl': string; + 'vs:DECKGL_FILTER_SIZE': string; + 'vCornerOffset = offsetVec;': string; + 'fs:#main-start': string; + }; +}; +// # sourceMappingURL=shaders.glsl.d.ts.map diff --git a/modules/extensions/typed/path-style/shaders.glsl.d.ts.map b/modules/extensions/typed/path-style/shaders.glsl.d.ts.map new file mode 100644 index 00000000000..b483f593bcc --- /dev/null +++ b/modules/extensions/typed/path-style/shaders.glsl.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"shaders.glsl.d.ts","sourceRoot":"","sources":["../../src/path-style/shaders.glsl.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW;;;;;;;CAwEvB,CAAC;AAEF,eAAO,MAAM,aAAa;;;;;;;CAsBzB,CAAC"} \ No newline at end of file diff --git a/modules/geo-layers/typed/geo-cell-layer/GeoCellLayer.d.ts b/modules/geo-layers/typed/geo-cell-layer/GeoCellLayer.d.ts new file mode 100644 index 00000000000..69ec21d2dc5 --- /dev/null +++ b/modules/geo-layers/typed/geo-cell-layer/GeoCellLayer.d.ts @@ -0,0 +1,15 @@ +import {CompositeLayer, CompositeLayerProps, Layer, LayersList, DefaultProps} from '@deck.gl/core'; +import {PolygonLayerProps} from '@deck.gl/layers'; +/** All properties supported by GeoCellLayer. */ +export declare type GeoCellLayerProps = PolygonLayerProps & + CompositeLayerProps; +export default class GeoCellLayer extends CompositeLayer< + Required> & ExtraProps +> { + static layerName: string; + static defaultProps: DefaultProps>; + /** Implement to generate props to create geometry. */ + indexToBounds(): Partial | null; + renderLayers(): Layer | null | LayersList; +} +// # sourceMappingURL=GeoCellLayer.d.ts.map diff --git a/modules/geo-layers/typed/geo-cell-layer/GeoCellLayer.d.ts.map b/modules/geo-layers/typed/geo-cell-layer/GeoCellLayer.d.ts.map new file mode 100644 index 00000000000..4eda4628fa0 --- /dev/null +++ b/modules/geo-layers/typed/geo-cell-layer/GeoCellLayer.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"GeoCellLayer.d.ts","sourceRoot":"","sources":["../../src/geo-cell-layer/GeoCellLayer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAE,mBAAmB,EAAE,KAAK,EAAE,UAAU,EAAE,YAAY,EAAC,MAAM,eAAe,CAAC;AACnG,OAAO,EAAe,iBAAiB,EAAC,MAAM,iBAAiB,CAAC;AAMhE,gDAAgD;AAChD,oBAAY,iBAAiB,CAAC,KAAK,GAAG,GAAG,IAAI,iBAAiB,CAAC,KAAK,CAAC,GAAG,mBAAmB,CAAC,KAAK,CAAC,CAAC;AAEnG,MAAM,CAAC,OAAO,OAAO,YAAY,CAAC,KAAK,GAAG,GAAG,EAAE,UAAU,GAAG,EAAE,CAAE,SAAQ,cAAc,CACpF,QAAQ,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC,GAAG,UAAU,CAChD;IACC,MAAM,CAAC,SAAS,SAAkB;IAClC,MAAM,CAAC,YAAY,uCAAgB;IAEnC,sDAAsD;IACtD,aAAa,IAAI,OAAO,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,GAAG,IAAI;IAItD,YAAY,IAAI,KAAK,GAAG,IAAI,GAAG,UAAU;CA+D1C"} \ No newline at end of file diff --git a/modules/geo-layers/typed/geohash-layer/geohash-layer.d.ts b/modules/geo-layers/typed/geohash-layer/geohash-layer.d.ts new file mode 100644 index 00000000000..3a28a4ad96d --- /dev/null +++ b/modules/geo-layers/typed/geohash-layer/geohash-layer.d.ts @@ -0,0 +1,24 @@ +import {AccessorFunction} from '@deck.gl/core'; +import GeoCellLayer from '../geo-cell-layer/GeoCellLayer'; +/** + * Properties of `GeohashLayer`. + */ +declare type GeohashLayerProps = { + /** + * Called for each data object to retrieve the geohash string identifier. + * + * By default, it reads `geohash` property of data object. + */ + getGeohash?: AccessorFunction; +}; +/** Render filled and/or stroked polygons based on the [Geohash](https://en.wikipedia.org/wiki/Geohash) geospatial indexing system. */ +export default class GeohashLayer extends GeoCellLayer< + DataT, + Required & ExtraProps +> { + static layerName: string; + static defaultProps: any; + indexToBounds(): Partial | null; +} +export {}; +// # sourceMappingURL=geohash-layer.d.ts.map diff --git a/modules/geo-layers/typed/geohash-layer/geohash-layer.d.ts.map b/modules/geo-layers/typed/geohash-layer/geohash-layer.d.ts.map new file mode 100644 index 00000000000..c2361c6ff95 --- /dev/null +++ b/modules/geo-layers/typed/geohash-layer/geohash-layer.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"geohash-layer.d.ts","sourceRoot":"","sources":["../../src/geohash-layer/geohash-layer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,gBAAgB,EAAC,MAAM,eAAe,CAAC;AAC/C,OAAO,YAAY,MAAM,gCAAgC,CAAC;AAO1D;;GAEG;AACH,aAAK,iBAAiB,CAAC,KAAK,GAAG,GAAG,IAAI;IACpC;;;;OAIG;IACH,UAAU,CAAC,EAAE,gBAAgB,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;CAC9C,CAAC;AAEF,sIAAsI;AACtI,MAAM,CAAC,OAAO,OAAO,YAAY,CAAC,KAAK,GAAG,GAAG,EAAE,UAAU,GAAG,EAAE,CAAE,SAAQ,YAAY,CAClF,KAAK,EACL,QAAQ,CAAC,iBAAiB,CAAC,GAAG,UAAU,CACzC;IACC,MAAM,CAAC,SAAS,SAAkB;IAClC,MAAM,CAAC,YAAY,EAAE,GAAG,CAAgB;IAExC,aAAa,IAAI,OAAO,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,GAAG,IAAI;CAUvD"} \ No newline at end of file diff --git a/modules/geo-layers/typed/geohash-layer/geohash-utils.d.ts b/modules/geo-layers/typed/geohash-layer/geohash-utils.d.ts new file mode 100644 index 00000000000..9cf99b873de --- /dev/null +++ b/modules/geo-layers/typed/geohash-layer/geohash-utils.d.ts @@ -0,0 +1,3 @@ +export declare function getGeohashBounds(geohash: string): number[]; +export declare function getGeohashPolygon(geohash: string): number[]; +// # sourceMappingURL=geohash-utils.d.ts.map diff --git a/modules/geo-layers/typed/geohash-layer/geohash-utils.d.ts.map b/modules/geo-layers/typed/geohash-layer/geohash-utils.d.ts.map new file mode 100644 index 00000000000..050fb99eece --- /dev/null +++ b/modules/geo-layers/typed/geohash-layer/geohash-utils.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"geohash-utils.d.ts","sourceRoot":"","sources":["../../src/geohash-layer/geohash-utils.ts"],"names":[],"mappings":"AAYA,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAmC1D;AAED,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAI3D"} \ No newline at end of file diff --git a/modules/geo-layers/typed/great-circle-layer/great-circle-layer.d.ts b/modules/geo-layers/typed/great-circle-layer/great-circle-layer.d.ts new file mode 100644 index 00000000000..a4d005fb756 --- /dev/null +++ b/modules/geo-layers/typed/great-circle-layer/great-circle-layer.d.ts @@ -0,0 +1,12 @@ +import {ArcLayer, ArcLayerProps} from '@deck.gl/layers'; +/** All properties supported by GreatCircleLayer. */ +export declare type GreatCircleLayerProps = ArcLayerProps; +/** @deprecated Use ArcLayer with `greatCircle: true` instead */ +export default class GreatCircleLayer extends ArcLayer< + DataT, + ExtraProps +> { + static layerName: string; + static defaultProps: any; +} +// # sourceMappingURL=great-circle-layer.d.ts.map diff --git a/modules/geo-layers/typed/great-circle-layer/great-circle-layer.d.ts.map b/modules/geo-layers/typed/great-circle-layer/great-circle-layer.d.ts.map new file mode 100644 index 00000000000..f92a177147d --- /dev/null +++ b/modules/geo-layers/typed/great-circle-layer/great-circle-layer.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"great-circle-layer.d.ts","sourceRoot":"","sources":["../../src/great-circle-layer/great-circle-layer.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAC,QAAQ,EAAE,aAAa,EAAC,MAAM,iBAAiB,CAAC;AAOxD,oDAAoD;AACpD,oBAAY,qBAAqB,CAAC,KAAK,GAAG,GAAG,IAAI,aAAa,CAAC,KAAK,CAAC,CAAC;AAItE,gEAAgE;AAChE,MAAM,CAAC,OAAO,OAAO,gBAAgB,CAAC,KAAK,GAAG,GAAG,EAAE,UAAU,GAAG,EAAE,CAAE,SAAQ,QAAQ,CAClF,KAAK,EACL,UAAU,CACX;IACC,MAAM,CAAC,SAAS,SAAsB;IACtC,MAAM,CAAC,YAAY,EAAE,GAAG,CAAgB;CACzC"} \ No newline at end of file diff --git a/modules/geo-layers/typed/h3-layers/h3-cluster-layer.d.ts b/modules/geo-layers/typed/h3-layers/h3-cluster-layer.d.ts new file mode 100644 index 00000000000..c228ec67348 --- /dev/null +++ b/modules/geo-layers/typed/h3-layers/h3-cluster-layer.d.ts @@ -0,0 +1,27 @@ +import {H3IndexInput} from 'h3-js'; +import {AccessorFunction, UpdateParameters, DefaultProps} from '@deck.gl/core'; +import GeoCellLayer, {GeoCellLayerProps} from '../geo-cell-layer/GeoCellLayer'; +/** All properties supported by H3ClusterLayer. */ +export declare type H3ClusterLayerProps = _H3ClusterLayerProps & + GeoCellLayerProps; +/** Properties added by H3ClusterLayer. */ +declare type _H3ClusterLayerProps = { + /** + * Called for each data object to retrieve the hexagon identifiers. + * + * By default, it reads `hexagons` property of data object. + */ + getHexagons?: AccessorFunction; +}; +export default class H3ClusterLayer extends GeoCellLayer< + DataT, + Required<_H3ClusterLayerProps> & ExtraProps +> { + static layerName: string; + static defaultProps: DefaultProps>; + initializeState(): void; + updateState({props, changeFlags}: UpdateParameters): void; + indexToBounds(): Partial; +} +export {}; +// # sourceMappingURL=h3-cluster-layer.d.ts.map diff --git a/modules/geo-layers/typed/h3-layers/h3-cluster-layer.d.ts.map b/modules/geo-layers/typed/h3-layers/h3-cluster-layer.d.ts.map new file mode 100644 index 00000000000..865c44979b6 --- /dev/null +++ b/modules/geo-layers/typed/h3-layers/h3-cluster-layer.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"h3-cluster-layer.d.ts","sourceRoot":"","sources":["../../src/h3-layers/h3-cluster-layer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,YAAY,EAAC,MAAM,OAAO,CAAC;AAExD,OAAO,EAAC,gBAAgB,EAAkB,gBAAgB,EAAE,YAAY,EAAC,MAAM,eAAe,CAAC;AAE/F,OAAO,YAAY,EAAE,EAAC,iBAAiB,EAAC,MAAM,gCAAgC,CAAC;AAM/E,kDAAkD;AAClD,oBAAY,mBAAmB,CAAC,KAAK,GAAG,GAAG,IAAI,oBAAoB,CAAC,KAAK,CAAC,GACxE,iBAAiB,CAAC,KAAK,CAAC,CAAC;AAE3B,0CAA0C;AAC1C,aAAK,oBAAoB,CAAC,KAAK,IAAI;IACjC;;;;OAIG;IACH,WAAW,CAAC,EAAE,gBAAgB,CAAC,KAAK,EAAE,YAAY,EAAE,CAAC,CAAC;CACvD,CAAC;AAEF,MAAM,CAAC,OAAO,OAAO,cAAc,CAAC,KAAK,GAAG,GAAG,EAAE,UAAU,GAAG,EAAE,CAAE,SAAQ,YAAY,CACpF,KAAK,EACL,QAAQ,CAAC,oBAAoB,CAAC,KAAK,CAAC,CAAC,GAAG,UAAU,CACnD;IACC,MAAM,CAAC,SAAS,SAAoB;IACpC,MAAM,CAAC,YAAY,yCAAgB;IAEnC,eAAe,IAAI,IAAI;IAIvB,WAAW,CAAC,EAAC,KAAK,EAAE,WAAW,EAAC,EAAE,gBAAgB,CAAC,IAAI,CAAC,GAAG,IAAI;IAuB/D,aAAa,IAAI,OAAO,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;CAMhD"} \ No newline at end of file diff --git a/modules/geo-layers/typed/h3-layers/h3-hexagon-layer.d.ts b/modules/geo-layers/typed/h3-layers/h3-hexagon-layer.d.ts new file mode 100644 index 00000000000..f4a8f972bc5 --- /dev/null +++ b/modules/geo-layers/typed/h3-layers/h3-hexagon-layer.d.ts @@ -0,0 +1,75 @@ +import {H3Index} from 'h3-js'; +import { + AccessorFunction, + CompositeLayer, + CompositeLayerProps, + Layer, + LayersList, + UpdateParameters, + DefaultProps +} from '@deck.gl/core'; +import {PolygonLayerProps} from '@deck.gl/layers'; +export declare function normalizeLongitudes(vertices: number[][], refLng?: number): void; +export declare function scalePolygon(hexId: H3Index, vertices: number[][], factor: number): void; +/** All properties supported by H3HexagonLayer */ +export declare type H3HexagonLayerProps = _H3HexagonLayerProps & + PolygonLayerProps & + CompositeLayerProps; +/** Props added by the H3HexagonLayer */ +declare type _H3HexagonLayerProps = { + /** + * Whether or not draw hexagons with high precision. + * @default 'auto' + */ + highPrecision?: boolean | 'auto'; + /** + * Coverage of hexagon in cell. + * @default 1 + */ + coverage?: number; + /** + * Center hexagon that best represents the shape of the set. If not specified, the hexagon closest to the center of the viewport is used. + */ + centerHexagon?: H3Index | null; + /** + * Called for each data object to retrieve the quadkey string identifier. + * + * By default, it reads `hexagon` property of data object. + */ + getHexagon?: AccessorFunction; + /** + * Whether to extrude polygons. + * @default true + */ + extruded?: boolean; +}; +/** + * Render hexagons from the [H3](https://h3geo.org/) geospatial indexing system. + */ +export default class H3HexagonLayer extends CompositeLayer< + ExtraPropsT & Required<_H3HexagonLayerProps & Required>> +> { + static defaultProps: DefaultProps>; + static layerName: string; + static _checkH3Lib: () => void; + initializeState(): void; + state: { + centerHex?: H3Index; + edgeLengthKM: number; + hasMultipleRes?: boolean; + hasPentagon?: boolean; + resolution: number; + vertices?: number[][]; + }; + shouldUpdateState({changeFlags}: UpdateParameters): boolean; + updateState({props, changeFlags}: UpdateParameters): void; + private _calculateH3DataProps; + private _shouldUseHighPrecision; + private _updateVertices; + renderLayers(): Layer | null | LayersList; + private _getForwardProps; + private _renderPolygonLayer; + private _renderColumnLayer; +} +export {}; +// # sourceMappingURL=h3-hexagon-layer.d.ts.map diff --git a/modules/geo-layers/typed/h3-layers/h3-hexagon-layer.d.ts.map b/modules/geo-layers/typed/h3-layers/h3-hexagon-layer.d.ts.map new file mode 100644 index 00000000000..51466967952 --- /dev/null +++ b/modules/geo-layers/typed/h3-layers/h3-hexagon-layer.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"h3-hexagon-layer.d.ts","sourceRoot":"","sources":["../../src/h3-layers/h3-hexagon-layer.ts"],"names":[],"mappings":"AAAA,OAAO,EAQL,OAAO,EACR,MAAM,OAAO,CAAC;AAEf,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,mBAAmB,EAEnB,KAAK,EACL,UAAU,EACV,gBAAgB,EAEhB,YAAY,EACb,MAAM,eAAe,CAAC;AACvB,OAAO,EAA4B,iBAAiB,EAAC,MAAM,iBAAiB,CAAC;AAQ7E,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAU/E;AAGD,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAcvF;AAqDD,iDAAiD;AACjD,oBAAY,mBAAmB,CAAC,KAAK,GAAG,GAAG,IAAI,oBAAoB,CAAC,KAAK,CAAC,GACxE,iBAAiB,CAAC,KAAK,CAAC,GACxB,mBAAmB,CAAC,KAAK,CAAC,CAAC;AAE7B,wCAAwC;AACxC,aAAK,oBAAoB,CAAC,KAAK,IAAI;IACjC;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IACjC;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IAC/B;;;;OAIG;IACH,UAAU,CAAC,EAAE,gBAAgB,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IAC7C;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,cAAc,CAAC,KAAK,GAAG,GAAG,EAAE,WAAW,GAAG,EAAE,CAAE,SAAQ,cAAc,CACvF,WAAW,GAAG,QAAQ,CAAC,oBAAoB,CAAC,KAAK,CAAC,GAAG,QAAQ,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC,CAAC,CACzF;IACC,MAAM,CAAC,YAAY,yCAAgB;IACnC,MAAM,CAAC,SAAS,SAAoB;IAGpC,MAAM,CAAC,WAAW,aAAY;IAE9B,eAAe;IAQf,KAAK,EAAG;QACN,SAAS,CAAC,EAAE,OAAO,CAAC;QACpB,YAAY,EAAE,MAAM,CAAC;QACrB,cAAc,CAAC,EAAE,OAAO,CAAC;QACzB,WAAW,CAAC,EAAE,OAAO,CAAC;QACtB,UAAU,EAAE,MAAM,CAAC;QACnB,QAAQ,CAAC,EAAE,MAAM,EAAE,EAAE,CAAC;KACvB,CAAC;IAEF,iBAAiB,CAAC,EAAC,WAAW,EAAC,EAAE,gBAAgB,CAAC,IAAI,CAAC,GAAG,OAAO;IAMjE,WAAW,CAAC,EAAC,KAAK,EAAE,WAAW,EAAC,EAAE,gBAAgB,CAAC,IAAI,CAAC,GAAG,IAAI;IAa/D,OAAO,CAAC,qBAAqB;IAgC7B,OAAO,CAAC,uBAAuB;IAe/B,OAAO,CAAC,eAAe;IAuCvB,YAAY,IAAI,KAAK,GAAG,IAAI,GAAG,UAAU;IAIzC,OAAO,CAAC,gBAAgB;IAsDxB,OAAO,CAAC,mBAAmB;IA0B3B,OAAO,CAAC,kBAAkB;CAuB3B"} \ No newline at end of file diff --git a/modules/geo-layers/typed/index.d.ts b/modules/geo-layers/typed/index.d.ts new file mode 100644 index 00000000000..3a472ad3269 --- /dev/null +++ b/modules/geo-layers/typed/index.d.ts @@ -0,0 +1,28 @@ +export {default as GreatCircleLayer} from './great-circle-layer/great-circle-layer'; +export {default as S2Layer} from './s2-layer/s2-layer'; +export {default as QuadkeyLayer} from './quadkey-layer/quadkey-layer'; +export {default as TileLayer} from './tile-layer/tile-layer'; +export {default as TripsLayer} from './trips-layer/trips-layer'; +export {default as H3ClusterLayer} from './h3-layers/h3-cluster-layer'; +export {default as H3HexagonLayer} from './h3-layers/h3-hexagon-layer'; +export {default as Tile3DLayer} from './tile-3d-layer/tile-3d-layer'; +export {default as TerrainLayer} from './terrain-layer/terrain-layer'; +export {default as MVTLayer} from './mvt-layer/mvt-layer'; +export {default as GeohashLayer} from './geohash-layer/geohash-layer'; +export {default as _GeoCellLayer} from './geo-cell-layer/GeoCellLayer'; +export {getURLFromTemplate as _getURLFromTemplate} from './tile-layer/utils'; +export {default as _Tileset2D} from './tile-layer/tileset-2d'; +export {default as _Tile2DHeader} from './tile-layer/tile-2d-header'; +export type {H3ClusterLayerProps} from './h3-layers/h3-cluster-layer'; +export type {H3HexagonLayerProps} from './h3-layers/h3-hexagon-layer'; +export type {GreatCircleLayerProps} from './great-circle-layer/great-circle-layer'; +export type {S2LayerProps} from './s2-layer/s2-layer'; +export type {TileLayerProps} from './tile-layer/tile-layer'; +export type {GeoBoundingBox, NonGeoBoundingBox} from './tile-layer/types'; +export type {QuadkeyLayerProps} from './quadkey-layer/quadkey-layer'; +export type {TileLoadProps as _TileLoadProps} from './tile-layer/types'; +export type {TerrainLayerProps} from './terrain-layer/terrain-layer'; +export type {Tile3DLayerProps} from './tile-3d-layer/tile-3d-layer'; +export type {MVTLayerProps} from './mvt-layer/mvt-layer'; +export type {GeoCellLayerProps as _GeoCellLayerProps} from './geo-cell-layer/GeoCellLayer'; +// # sourceMappingURL=index.d.ts.map diff --git a/modules/geo-layers/typed/index.d.ts.map b/modules/geo-layers/typed/index.d.ts.map new file mode 100644 index 00000000000..4cead571c9e --- /dev/null +++ b/modules/geo-layers/typed/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAqBA,OAAO,EAAC,OAAO,IAAI,gBAAgB,EAAC,MAAM,yCAAyC,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Y,EAAC,iBAAiB,EAAC,MAAM,+BAA+B,CAAC;AACrE,YAAY,EAAC,aAAa,IAAI,cAAc,EAAC,MAAM,oBAAoB,CAAC;AACxE,YAAY,EAAC,iBAAiB,EAAC,MAAM,+BAA+B,CAAC;AACrE,YAAY,EAAC,gBAAgB,EAAC,MAAM,+BAA+B,CAAC;AACpE,YAAY,EAAC,aAAa,EAAC,MAAM,uBAAuB,CAAC;AACzD,YAAY,EAAC,iBAAiB,IAAI,kBAAkB,EAAC,MAAM,+BAA+B,CAAC"} \ No newline at end of file diff --git a/modules/geo-layers/typed/mesh-layer/mesh-layer-fragment.glsl.d.ts b/modules/geo-layers/typed/mesh-layer/mesh-layer-fragment.glsl.d.ts new file mode 100644 index 00000000000..9b3618359bc --- /dev/null +++ b/modules/geo-layers/typed/mesh-layer/mesh-layer-fragment.glsl.d.ts @@ -0,0 +1,3 @@ +declare const _default: '#version 300 es\n#define SHADER_NAME simple-mesh-layer-fs\n\nprecision highp float;\n\nuniform bool hasTexture;\nuniform sampler2D sampler;\nuniform bool flatShading;\nuniform float opacity;\n\nin vec2 vTexCoord;\nin vec3 cameraPosition;\nin vec3 normals_commonspace;\nin vec4 position_commonspace;\nin vec4 vColor;\n\nout vec4 fragColor;\n\nvoid main(void) {\n \n#ifdef MODULE_PBR\n\n fragColor = vColor * pbr_filterColor(vec4(0));\n geometry.uv = pbr_vUV;\n fragColor.a *= opacity;\n\n#else\n\n geometry.uv = vTexCoord;\n\n vec3 normal;\n if (flatShading) {\n\n// NOTE(Tarek): This is necessary because\n// headless.gl reports the extension as\n// available but does not support it in\n// the shader.\n#ifdef DERIVATIVES_AVAILABLE\n normal = normalize(cross(dFdx(position_commonspace.xyz), dFdy(position_commonspace.xyz)));\n#else\n normal = vec3(0.0, 0.0, 1.0);\n#endif\n } else {\n normal = normals_commonspace;\n }\n\n vec4 color = hasTexture ? texture(sampler, vTexCoord) : vColor;\n vec3 lightColor = lighting_getLightColor(color.rgb, cameraPosition, position_commonspace.xyz, normal);\n fragColor = vec4(lightColor, color.a * opacity);\n\n#endif\n\n DECKGL_FILTER_COLOR(fragColor, geometry);\n}\n'; +export default _default; +// # sourceMappingURL=mesh-layer-fragment.glsl.d.ts.map diff --git a/modules/geo-layers/typed/mesh-layer/mesh-layer-fragment.glsl.d.ts.map b/modules/geo-layers/typed/mesh-layer/mesh-layer-fragment.glsl.d.ts.map new file mode 100644 index 00000000000..db969b4739b --- /dev/null +++ b/modules/geo-layers/typed/mesh-layer/mesh-layer-fragment.glsl.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"mesh-layer-fragment.glsl.d.ts","sourceRoot":"","sources":["../../src/mesh-layer/mesh-layer-fragment.glsl.ts"],"names":[],"mappings":";AAAA,wBAsDE"} \ No newline at end of file diff --git a/modules/geo-layers/typed/mesh-layer/mesh-layer-vertex.glsl.d.ts b/modules/geo-layers/typed/mesh-layer/mesh-layer-vertex.glsl.d.ts new file mode 100644 index 00000000000..007838f3c72 --- /dev/null +++ b/modules/geo-layers/typed/mesh-layer/mesh-layer-vertex.glsl.d.ts @@ -0,0 +1,3 @@ +declare const _default: '#version 300 es\n#define SHADER_NAME simple-mesh-layer-vs\n\n// Scale the model\nuniform float sizeScale;\nuniform bool composeModelMatrix;\nuniform bool pickFeatureIds;\n\n// Primitive attributes\nin vec3 positions;\nin vec3 normals;\nin vec3 colors;\nin vec2 texCoords;\nin vec4 uvRegions;\nin vec3 featureIdsPickingColors;\n\n// Instance attributes\nin vec4 instanceColors;\nin vec3 instancePickingColors;\nin mat3 instanceModelMatrix;\n\n// Outputs to fragment shader\nout vec2 vTexCoord;\nout vec3 cameraPosition;\nout vec3 normals_commonspace;\nout vec4 position_commonspace;\nout vec4 vColor;\n\nvec2 applyUVRegion(vec2 uv) {\n #ifdef HAS_UV_REGIONS\n // https://github.com/Esri/i3s-spec/blob/master/docs/1.7/geometryUVRegion.cmn.md\n return fract(uv) * (uvRegions.zw - uvRegions.xy) + uvRegions.xy;\n #else\n return uv;\n #endif\n}\n\nvoid main(void) {\n vec2 uv = applyUVRegion(texCoords);\n geometry.uv = uv;\n\n if (pickFeatureIds) {\n geometry.pickingColor = featureIdsPickingColors;\n } else {\n geometry.pickingColor = instancePickingColors;\n }\n\n vTexCoord = uv;\n cameraPosition = project_uCameraPosition;\n vColor = vec4(colors * instanceColors.rgb, instanceColors.a);\n\n vec3 pos = (instanceModelMatrix * positions) * sizeScale;\n vec3 projectedPosition = project_position(positions);\n position_commonspace = vec4(projectedPosition, 1.0);\n gl_Position = project_common_position_to_clipspace(position_commonspace);\n\n geometry.position = position_commonspace;\n normals_commonspace = project_normal(instanceModelMatrix * normals);\n geometry.normal = normals_commonspace;\n\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n #ifdef MODULE_PBR\n // set PBR data\n pbr_vPosition = geometry.position.xyz;\n #ifdef HAS_NORMALS\n pbr_vNormal = geometry.normal;\n #endif\n\n #ifdef HAS_UV\n pbr_vUV = uv;\n #else\n pbr_vUV = vec2(0., 0.);\n #endif\n geometry.uv = pbr_vUV;\n #endif\n\n DECKGL_FILTER_COLOR(vColor, geometry);\n}\n'; +export default _default; +// # sourceMappingURL=mesh-layer-vertex.glsl.d.ts.map diff --git a/modules/geo-layers/typed/mesh-layer/mesh-layer-vertex.glsl.d.ts.map b/modules/geo-layers/typed/mesh-layer/mesh-layer-vertex.glsl.d.ts.map new file mode 100644 index 00000000000..362a7778350 --- /dev/null +++ b/modules/geo-layers/typed/mesh-layer/mesh-layer-vertex.glsl.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"mesh-layer-vertex.glsl.d.ts","sourceRoot":"","sources":["../../src/mesh-layer/mesh-layer-vertex.glsl.ts"],"names":[],"mappings":";AAAA,wBA+EE"} \ No newline at end of file diff --git a/modules/geo-layers/typed/mesh-layer/mesh-layer.d.ts b/modules/geo-layers/typed/mesh-layer/mesh-layer.d.ts new file mode 100644 index 00000000000..2a6be241856 --- /dev/null +++ b/modules/geo-layers/typed/mesh-layer/mesh-layer.d.ts @@ -0,0 +1,42 @@ +import type {NumericArray} from '@math.gl/core'; +import {GLTFMaterialParser} from '@luma.gl/experimental'; +import {Model} from '@luma.gl/webgl-legacy'; +import type {MeshAttribute, MeshAttributes} from '@loaders.gl/schema'; +import type {UpdateParameters, DefaultProps, LayerContext} from '@deck.gl/core'; +import {SimpleMeshLayer, SimpleMeshLayerProps} from '@deck.gl/mesh-layers'; +export declare type Mesh = { + attributes: MeshAttributes; + indices?: MeshAttribute; +}; +/** All properties supported by MeshLayer. */ +export declare type MeshLayerProps = _MeshLayerProps & + SimpleMeshLayerProps; +/** Properties added by MeshLayer. */ +declare type _MeshLayerProps = { + /** + * PBR material object. _lighting must be pbr for this to work + */ + pbrMaterial?: any; + /** + * List of feature ids. + */ + featureIds?: NumericArray | null; +}; +export default class MeshLayer extends SimpleMeshLayer< + DataT, + Required<_MeshLayerProps> & ExtraProps +> { + static layerName: string; + static defaultProps: DefaultProps>; + getShaders(): any; + initializeState(): void; + updateState(params: UpdateParameters): void; + draw(opts: any): void; + protected getModel(mesh: Mesh): Model; + updatePbrMaterialUniforms(pbrMaterial: any): void; + parseMaterial(pbrMaterial: any, mesh: any): GLTFMaterialParser; + calculateFeatureIdsPickingColors(attribute: any): void; + finalizeState(context: LayerContext): void; +} +export {}; +// # sourceMappingURL=mesh-layer.d.ts.map diff --git a/modules/geo-layers/typed/mesh-layer/mesh-layer.d.ts.map b/modules/geo-layers/typed/mesh-layer/mesh-layer.d.ts.map new file mode 100644 index 00000000000..503bf4c4712 --- /dev/null +++ b/modules/geo-layers/typed/mesh-layer/mesh-layer.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"mesh-layer.d.ts","sourceRoot":"","sources":["../../src/mesh-layer/mesh-layer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,eAAe,CAAC;AAChD,OAAO,EAAC,kBAAkB,EAAC,MAAM,uBAAuB,CAAC;AAEzD,OAAO,EAAK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;CAKpC"} \ No newline at end of file diff --git a/modules/geo-layers/typed/mvt-layer/coordinate-transform.d.ts b/modules/geo-layers/typed/mvt-layer/coordinate-transform.d.ts new file mode 100644 index 00000000000..5d3ef525bcb --- /dev/null +++ b/modules/geo-layers/typed/mvt-layer/coordinate-transform.d.ts @@ -0,0 +1,4 @@ +import {Viewport} from '@deck.gl/core'; +import {GeoBoundingBox} from '../tile-layer/types'; +export declare function transform(geometry: any, bbox: GeoBoundingBox, viewport: Viewport): any; +// # sourceMappingURL=coordinate-transform.d.ts.map diff --git a/modules/geo-layers/typed/mvt-layer/coordinate-transform.d.ts.map b/modules/geo-layers/typed/mvt-layer/coordinate-transform.d.ts.map new file mode 100644 index 00000000000..0f45349de50 --- /dev/null +++ b/modules/geo-layers/typed/mvt-layer/coordinate-transform.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"coordinate-transform.d.ts","sourceRoot":"","sources":["../../src/mvt-layer/coordinate-transform.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,eAAe,CAAC;AAEvC,OAAO,EAAC,cAAc,EAAC,MAAM,qBAAqB,CAAC;AA0CnD,wBAAgB,SAAS,CAAC,QAAQ,KAAA,EAAE,IAAI,EAAE,cAAc,EAAE,QAAQ,EAAE,QAAQ,OAa3E"} \ No newline at end of file diff --git a/modules/geo-layers/typed/mvt-layer/find-index-binary.d.ts b/modules/geo-layers/typed/mvt-layer/find-index-binary.d.ts new file mode 100644 index 00000000000..8e9c584f1fc --- /dev/null +++ b/modules/geo-layers/typed/mvt-layer/find-index-binary.d.ts @@ -0,0 +1,17 @@ +import type {BinaryFeatures} from '@loaders.gl/schema'; +/** + * Return the index of feature (numericProps or featureIds) for given feature id + * Example: findIndexBinary(data, 'id', 33) will return the index in the array of numericProps + * of the feature 33. + * @param {Object} data - The data in binary format + * @param {String} uniqueIdProperty - Name of the unique id property + * @param {Number|String} featureId - feature id to find + * @param {String} layerName - the layer to search in + */ +export default function findIndexBinary( + data: BinaryFeatures, + uniqueIdProperty: string, + featureId: string | number, + layerName: string +): number; +// # sourceMappingURL=find-index-binary.d.ts.map diff --git a/modules/geo-layers/typed/mvt-layer/find-index-binary.d.ts.map b/modules/geo-layers/typed/mvt-layer/find-index-binary.d.ts.map new file mode 100644 index 00000000000..17d364f6cb1 --- /dev/null +++ b/modules/geo-layers/typed/mvt-layer/find-index-binary.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"find-index-binary.d.ts","sourceRoot":"","sources":["../../src/mvt-layer/find-index-binary.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EAIf,MAAM,oBAAoB,CAAC;AAK5B;;;;;;;;GAQG;AACH,MAAM,CAAC,OAAO,UAAU,eAAe,CACrC,IAAI,EAAE,cAAc,EACpB,gBAAgB,EAAE,MAAM,EACxB,SAAS,EAAE,MAAM,GAAG,MAAM,EAC1B,SAAS,EAAE,MAAM,GAChB,MAAM,CASR"} \ No newline at end of file diff --git a/modules/geo-layers/typed/mvt-layer/mvt-layer.d.ts b/modules/geo-layers/typed/mvt-layer/mvt-layer.d.ts new file mode 100644 index 00000000000..001934e286a --- /dev/null +++ b/modules/geo-layers/typed/mvt-layer/mvt-layer.d.ts @@ -0,0 +1,94 @@ +import { + Layer, + LayersList, + PickingInfo, + UpdateParameters, + GetPickingInfoParams, + DefaultProps +} from '@deck.gl/core'; +import {GeoJsonLayerProps} from '@deck.gl/layers'; +import type {Loader} from '@loaders.gl/loader-utils'; +import type {BinaryFeatures} from '@loaders.gl/schema'; +import type {Feature} from 'geojson'; +import TileLayer, {TiledPickingInfo, TileLayerProps} from '../tile-layer/tile-layer'; +import {Tileset2DProps} from '../tile-layer/tileset-2d'; +import {TileLoadProps} from '../tile-layer/types'; +import Tile2DHeader from '../tile-layer/tile-2d-header'; +export declare type TileJson = { + tilejson: string; + tiles: string[]; + vector_layers: any[]; + attribution?: string; + scheme?: string; + maxzoom?: number; + minzoom?: number; + version?: string; +}; +declare type ParsedMvtTile = Feature[] | BinaryFeatures; +/** All props supported by the MVTLayer */ +export declare type MVTLayerProps = _MVTLayerProps & + GeoJsonLayerProps & + TileLayerProps; +/** Props added by the MVTLayer */ +export declare type _MVTLayerProps = { + /** Called if `data` is a TileJSON URL when it is successfully fetched. */ + onDataLoad?: ((tilejson: TileJson | null) => void) | null; + /** Needed for highlighting a feature split across two or more tiles. */ + uniqueIdProperty?: string; + /** A feature with ID corresponding to the supplied value will be highlighted. */ + highlightedFeatureId?: string | null; + /** + * Use tile data in binary format. + * + * @default true + */ + binary?: boolean; + /** + * Loaders used to transform tiles into `data` property passed to `renderSubLayers`. + * + * @default [MVTWorkerLoader] from `@loaders.gl/mvt` + */ + loaders?: Loader[]; +}; +/** Render data formatted as [Mapbox Vector Tiles](https://docs.mapbox.com/vector-tiles/specification/). */ +export default class MVTLayer extends TileLayer< + ParsedMvtTile, + Required<_MVTLayerProps> & ExtraProps +> { + static layerName: string; + static defaultProps: DefaultProps< + MVTLayerProps< + Feature< + import('geojson').Geometry, + { + [name: string]: any; + } + > + > + >; + initializeState(): void; + get isLoaded(): boolean; + updateState({props, oldProps, context, changeFlags}: UpdateParameters): void; + private _updateTileData; + _getTilesetOptions(): Tileset2DProps; + renderLayers(): Layer | null | LayersList; + getTileData(loadProps: TileLoadProps): Promise; + renderSubLayers( + props: TileLayer['props'] & { + id: string; + data: ParsedMvtTile; + _offset: number; + tile: Tile2DHeader; + } + ): Layer | null | LayersList; + protected _updateAutoHighlight(info: PickingInfo): void; + getPickingInfo(params: GetPickingInfoParams): TiledPickingInfo; + getSubLayerPropsByTile(tile: Tile2DHeader): Record; + private getHighlightedObjectIndex; + private _pickObjects; + /** Get the rendered features in the current viewport. */ + getRenderedFeatures(maxFeatures?: number | null): DataT[]; + private _setWGS84PropertyForTiles; +} +export {}; +// # sourceMappingURL=mvt-layer.d.ts.map diff --git a/modules/geo-layers/typed/mvt-layer/mvt-layer.d.ts.map b/modules/geo-layers/typed/mvt-layer/mvt-layer.d.ts.map new file mode 100644 index 00000000000..c403ebdf92d --- /dev/null +++ b/modules/geo-layers/typed/mvt-layer/mvt-layer.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"mvt-layer.d.ts","sourceRoot":"","sources":["../../src/mvt-layer/mvt-layer.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,EACL,UAAU,EAEV,WAAW,EACX,gBAAgB,EAChB,oBAAoB,EAGpB,YAAY,EACb,MAAM,eAAe,CAAC;AACvB,OAAO,EAAe,iBAAiB,EAAC,MAAM,iBAAiB,CAAC;AAMhE,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,0BAA0B,CAAC;AACrD,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,oBAAoB,CAAC;AACvD,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,SAAS,CAAC;AAErC,OAAO,SAAS,EAAE,EAAC,gBAAgB,EAAE,cAAc,EAAC,MAAM,0BAA0B,CAAC;AACrF,OAAkB,EAAC,cAAc,EAAC,MAAM,0BAA0B,CAAC;AAEnE,OAAO,EAAiB,aAAa,EAAC,MAAM,qBAAqB,CAAC;AAClE,OAAO,YAAY,MAAM,8BAA8B,CAAC;AAexD,oBAAY,QAAQ,GAAG;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,EAAE,CAAC;IAEhB,aAAa,EAAE,GAAG,EAAE,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,aAAK,aAAa,GAAG,OAAO,EAAE,GAAG,cAAc,CAAC;AAEhD,0CAA0C;AAC1C,oBAAY,aAAa,CAAC,KAAK,SAAS,OAAO,GAAG,OAAO,IAAI,cAAc,GACzE,iBAAiB,CAAC,KAAK,CAAC,GACx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,KAAK,GAAG,IAAI,GAAG,UAAU;IA8B5B,SAAS,CAAC,oBAAoB,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI;IA6BvD,cAAc,CAAC,MAAM,EAAE,oBAAoB,GAAG,gBAAgB;IAoB9D,sBAAsB,CAAC,IAAI,EAAE,YAAY,CAAC,aAAa,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAO9E,OAAO,CAAC,yBAAyB;IAqCjC,OAAO,CAAC,YAAY;IAUpB,yDAAyD;IACzD,mBAAmB,CAAC,WAAW,GAAE,MAAM,GAAG,IAAW,GAAG,KAAK,EAAE;IAqB/D,OAAO,CAAC,yBAAyB;CAoClC"} \ No newline at end of file diff --git a/modules/geo-layers/typed/quadkey-layer/quadkey-layer.d.ts b/modules/geo-layers/typed/quadkey-layer/quadkey-layer.d.ts new file mode 100644 index 00000000000..979bec9aba3 --- /dev/null +++ b/modules/geo-layers/typed/quadkey-layer/quadkey-layer.d.ts @@ -0,0 +1,25 @@ +import {AccessorFunction, DefaultProps} from '@deck.gl/core'; +import GeoCellLayer, {GeoCellLayerProps} from '../geo-cell-layer/GeoCellLayer'; +/** All properties supported by QuadkeyLayer. */ +export declare type QuadkeyLayerProps = _QuadkeyLayerProps & + GeoCellLayerProps; +/** Properties added by QuadkeyLayer. */ +declare type _QuadkeyLayerProps = { + /** + * Called for each data object to retrieve the quadkey string identifier. + * + * By default, it reads `quadkey` property of data object. + */ + getQuadkey?: AccessorFunction; +}; +/** Render filled and/or stroked polygons based on the [Quadkey](https://towardsdatascience.com/geospatial-indexing-with-quadkeys-d933dff01496) geospatial indexing system. */ +export default class QuadkeyLayer extends GeoCellLayer< + DataT, + Required<_QuadkeyLayerProps> & ExtraProps +> { + static layerName: string; + static defaultProps: DefaultProps>; + indexToBounds(): Partial | null; +} +export {}; +// # sourceMappingURL=quadkey-layer.d.ts.map diff --git a/modules/geo-layers/typed/quadkey-layer/quadkey-layer.d.ts.map b/modules/geo-layers/typed/quadkey-layer/quadkey-layer.d.ts.map new file mode 100644 index 00000000000..1f8daa6fa1a --- /dev/null +++ b/modules/geo-layers/typed/quadkey-layer/quadkey-layer.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"quadkey-layer.d.ts","sourceRoot":"","sources":["../../src/quadkey-layer/quadkey-layer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,gBAAgB,EAAE,YAAY,EAAC,MAAM,eAAe,CAAC;AAC7D,OAAO,YAAY,EAAE,EAAC,iBAAiB,EAAC,MAAM,gCAAgC,CAAC;AAO/E,gDAAgD;AAChD,oBAAY,iBAAiB,CAAC,KAAK,GAAG,GAAG,IAAI,kBAAkB,CAAC,KAAK,CAAC,GAAG,iBAAiB,CAAC,KAAK,CAAC,CAAC;AAElG,wCAAwC;AACxC,aAAK,kBAAkB,CAAC,KAAK,IAAI;IAC/B;;;;OAIG;IACH,UAAU,CAAC,EAAE,gBAAgB,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;CAC9C,CAAC;AAEF,8KAA8K;AAC9K,MAAM,CAAC,OAAO,OAAO,YAAY,CAAC,KAAK,GAAG,GAAG,EAAE,UAAU,GAAG,EAAE,CAAE,SAAQ,YAAY,CAClF,KAAK,EACL,QAAQ,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC,GAAG,UAAU,CACjD;IACC,MAAM,CAAC,SAAS,SAAkB;IAClC,MAAM,CAAC,YAAY,uCAAgB;IAEnC,aAAa,IAAI,OAAO,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,GAAG,IAAI;CAWvD"} \ No newline at end of file diff --git a/modules/geo-layers/typed/quadkey-layer/quadkey-utils.d.ts b/modules/geo-layers/typed/quadkey-layer/quadkey-utils.d.ts new file mode 100644 index 00000000000..d6d3e4fb53b --- /dev/null +++ b/modules/geo-layers/typed/quadkey-layer/quadkey-utils.d.ts @@ -0,0 +1,3 @@ +export declare function quadkeyToWorldBounds(quadkey: string): [number[], number[]]; +export declare function getQuadkeyPolygon(quadkey: string): number[]; +// # sourceMappingURL=quadkey-utils.d.ts.map diff --git a/modules/geo-layers/typed/quadkey-layer/quadkey-utils.d.ts.map b/modules/geo-layers/typed/quadkey-layer/quadkey-utils.d.ts.map new file mode 100644 index 00000000000..4457416f679 --- /dev/null +++ b/modules/geo-layers/typed/quadkey-layer/quadkey-utils.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"quadkey-utils.d.ts","sourceRoot":"","sources":["../../src/quadkey-layer/quadkey-utils.ts"],"names":[],"mappings":"AAIA,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,CAAC,CAgB1E;AAED,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAK3D"} \ No newline at end of file diff --git a/modules/geo-layers/typed/s2-layer/s2-geometry.d.ts b/modules/geo-layers/typed/s2-layer/s2-geometry.d.ts new file mode 100644 index 00000000000..4f521451912 --- /dev/null +++ b/modules/geo-layers/typed/s2-layer/s2-geometry.d.ts @@ -0,0 +1,18 @@ +export declare function IJToST( + ij: [number, number], + order: number, + offsets: [number, number] +): [number, number]; +export declare function STToUV(st: [number, number]): [number, number]; +export declare function FaceUVToXYZ( + face: number, + [u, v]: [number, number] +): [number, number, number]; +export declare function XYZToLngLat([x, y, z]: [number, number, number]): [number, number]; +export declare function toHilbertQuadkey(idS: string): string; +export declare function FromHilbertQuadKey(hilbertQuadkey: string): { + face: number; + ij: [number, number]; + level: number; +}; +// # sourceMappingURL=s2-geometry.d.ts.map diff --git a/modules/geo-layers/typed/s2-layer/s2-geometry.d.ts.map b/modules/geo-layers/typed/s2-layer/s2-geometry.d.ts.map new file mode 100644 index 00000000000..fec94a85f1f --- /dev/null +++ b/modules/geo-layers/typed/s2-layer/s2-geometry.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"s2-geometry.d.ts","sourceRoot":"","sources":["../../src/s2-layer/s2-geometry.ts"],"names":[],"mappings":"AAuBA,wBAAgB,MAAM,CACpB,EAAE,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EACpB,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,GACxB,CAAC,MAAM,EAAE,MAAM,CAAC,CAIlB;AASD,wBAAgB,MAAM,CAAC,EAAE,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAE7D;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAiB5F;AAED,wBAAgB,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAKjF;AAED,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CA0BpD;AAeD,wBAAgB,kBAAkB,CAAC,cAAc,EAAE,MAAM,GAAG;IAC1D,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;CACf,CAoCA"} \ No newline at end of file diff --git a/modules/geo-layers/typed/s2-layer/s2-layer.d.ts b/modules/geo-layers/typed/s2-layer/s2-layer.d.ts new file mode 100644 index 00000000000..b5838a5288f --- /dev/null +++ b/modules/geo-layers/typed/s2-layer/s2-layer.d.ts @@ -0,0 +1,24 @@ +import {AccessorFunction, DefaultProps} from '@deck.gl/core'; +import GeoCellLayer, {GeoCellLayerProps} from '../geo-cell-layer/GeoCellLayer'; +/** All properties supported by S2Layer. */ +export declare type S2LayerProps = _S2LayerProps & GeoCellLayerProps; +/** Properties added by S2Layer. */ +declare type _S2LayerProps = { + /** + * Called for each data object to retrieve the quadkey string identifier. + * + * By default, it reads `token` property of data object. + */ + getS2Token?: AccessorFunction; +}; +/** Render filled and/or stroked polygons based on the [S2](http://s2geometry.io/) geospatial indexing system. */ +export default class S2Layer extends GeoCellLayer< + DataT, + Required<_S2LayerProps> & ExtraProps +> { + static layerName: string; + static defaultProps: DefaultProps>; + indexToBounds(): Partial | null; +} +export {}; +// # sourceMappingURL=s2-layer.d.ts.map diff --git a/modules/geo-layers/typed/s2-layer/s2-layer.d.ts.map b/modules/geo-layers/typed/s2-layer/s2-layer.d.ts.map new file mode 100644 index 00000000000..e9cb299ec6d --- /dev/null +++ b/modules/geo-layers/typed/s2-layer/s2-layer.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"s2-layer.d.ts","sourceRoot":"","sources":["../../src/s2-layer/s2-layer.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAC,gBAAgB,EAAE,YAAY,EAAC,MAAM,eAAe,CAAC;AAC7D,OAAO,YAAY,EAAE,EAAC,iBAAiB,EAAC,MAAM,gCAAgC,CAAC;AAO/E,2CAA2C;AAC3C,oBAAY,YAAY,CAAC,KAAK,GAAG,GAAG,IAAI,aAAa,CAAC,KAAK,CAAC,GAAG,iBAAiB,CAAC,KAAK,CAAC,CAAC;AAExF,mCAAmC;AACnC,aAAK,aAAa,CAAC,KAAK,IAAI;IAC1B;;;;OAIG;IACH,UAAU,CAAC,EAAE,gBAAgB,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;CAC9C,CAAC;AAEF,iHAAiH;AACjH,MAAM,CAAC,OAAO,OAAO,OAAO,CAAC,KAAK,GAAG,GAAG,EAAE,UAAU,GAAG,EAAE,CAAE,SAAQ,YAAY,CAC7E,KAAK,EACL,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,GAAG,UAAU,CAC5C;IACC,MAAM,CAAC,SAAS,SAAa;IAC7B,MAAM,CAAC,YAAY,kCAAgB;IAEnC,aAAa,IAAI,OAAO,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,GAAG,IAAI;CAUvD"} \ No newline at end of file diff --git a/modules/geo-layers/typed/s2-layer/s2-utils.d.ts b/modules/geo-layers/typed/s2-layer/s2-utils.d.ts new file mode 100644 index 00000000000..3627af2e251 --- /dev/null +++ b/modules/geo-layers/typed/s2-layer/s2-utils.d.ts @@ -0,0 +1,9 @@ +export declare function getS2QuadKey(token: string | number): string; +/** + * Get a polygon with corner coordinates for an s2 cell + * @param {*} cell - This can be an S2 key or token + * @return {Float64Array} - a simple polygon in flat array format: [lng0, lat0, lng1, lat1, ...] + * - the polygon is closed, i.e. last coordinate is a copy of the first coordinate + */ +export declare function getS2Polygon(token: string | number): Float64Array; +// # sourceMappingURL=s2-utils.d.ts.map diff --git a/modules/geo-layers/typed/s2-layer/s2-utils.d.ts.map b/modules/geo-layers/typed/s2-layer/s2-utils.d.ts.map new file mode 100644 index 00000000000..4d13ed33e8a --- /dev/null +++ b/modules/geo-layers/typed/s2-layer/s2-utils.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"s2-utils.d.ts","sourceRoot":"","sources":["../../src/s2-layer/s2-utils.ts"],"names":[],"mappings":"AAwFA,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAW3D;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,YAAY,CAKjE"} \ No newline at end of file diff --git a/modules/geo-layers/typed/terrain-layer/terrain-layer.d.ts b/modules/geo-layers/typed/terrain-layer/terrain-layer.d.ts new file mode 100644 index 00000000000..3e1daa7bbcd --- /dev/null +++ b/modules/geo-layers/typed/terrain-layer/terrain-layer.d.ts @@ -0,0 +1,86 @@ +import { + Color, + CompositeLayer, + CompositeLayerProps, + DefaultProps, + Layer, + LayersList, + Material, + Texture, + UpdateParameters +} from '@deck.gl/core'; +import {SimpleMeshLayer} from '@deck.gl/mesh-layers'; +import type {MeshAttributes} from '@loaders.gl/schema'; +import {TileLayerProps} from '../tile-layer/tile-layer'; +import Tile2DHeader from '../tile-layer/tile-2d-header'; +import {Bounds, TileLoadProps, ZRange} from '../tile-layer/types'; +declare type URLTemplate = string | string[]; +declare type ElevationDecoder = { + rScaler: number; + gScaler: number; + bScaler: number; + offset: number; +}; +declare type TerrainLoadProps = { + bounds: Bounds; + elevationData: string | null; + elevationDecoder: ElevationDecoder; + meshMaxError: number; + signal?: AbortSignal; +}; +declare type MeshAndTexture = [MeshAttributes | null, Texture | null]; +/** All properties supported by TerrainLayer */ +export declare type TerrainLayerProps = _TerrainLayerProps & + TileLayerProps & + CompositeLayerProps; +/** Props added by the TerrainLayer */ +declare type _TerrainLayerProps = { + /** Image url that encodes height data. **/ + elevationData: URLTemplate; + /** Image url to use as texture. **/ + texture?: URLTemplate | null; + /** Martini error tolerance in meters, smaller number -> more detailed mesh. **/ + meshMaxError?: number; + /** Bounding box of the terrain image, [minX, minY, maxX, maxY] in world coordinates. **/ + bounds?: Bounds | null; + /** Color to use if texture is unavailable. **/ + color?: Color; + /** Object to decode height data, from (r, g, b) to height in meters. **/ + elevationDecoder?: ElevationDecoder; + /** Whether to render the mesh in wireframe mode. **/ + wireframe?: boolean; + /** Material props for lighting effect. **/ + material?: Material; +}; +/** Render mesh surfaces from height map images. */ +export default class TerrainLayer extends CompositeLayer< + ExtraPropsT & Required<_TerrainLayerProps & Required>> +> { + static defaultProps: DefaultProps; + static layerName: string; + state: { + isTiled?: boolean; + terrain: MeshAttributes; + zRange?: ZRange | null; + }; + updateState({props, oldProps}: UpdateParameters): void; + loadTerrain({ + elevationData, + bounds, + elevationDecoder, + meshMaxError, + signal + }: TerrainLoadProps): Promise | null; + getTiledTerrainData(tile: TileLoadProps): Promise; + renderSubLayers( + props: TileLayerProps & { + id: string; + data: MeshAndTexture; + tile: Tile2DHeader; + } + ): SimpleMeshLayer; + onViewportLoad(tiles?: Tile2DHeader[]): void; + renderLayers(): Layer | null | LayersList; +} +export {}; +// # sourceMappingURL=terrain-layer.d.ts.map diff --git a/modules/geo-layers/typed/terrain-layer/terrain-layer.d.ts.map b/modules/geo-layers/typed/terrain-layer/terrain-layer.d.ts.map new file mode 100644 index 00000000000..31d424cc278 --- /dev/null +++ b/modules/geo-layers/typed/terrain-layer/terrain-layer.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"terrain-layer.d.ts","sourceRoot":"","sources":["../../src/terrain-layer/terrain-layer.ts"],"names":[],"mappings":"AAoBA,OAAO,EACL,KAAK,EACL,cAAc,EACd,mBAAmB,EACnB,YAAY,EACZ,KAAK,EACL,UAAU,EAEV,QAAQ,EACR,OAAO,EACP,gBAAgB,EACjB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAC,eAAe,EAAC,MAAM,sBAAsB,CAAC;AAErD,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,oBAAoB,CAAC;AAEvD,OAAkB,EAAC,cAAc,EAAC,MAAM,0BAA0B,CAAC;AACnE,OAAO,YAAY,MAAM,8BAA8B,CAAC;AACxD,OAAO,EAAC,MAAM,EAAmC,aAAa,EAAE,MAAM,EAAC,MAAM,qBAAqB,CAAC;AAoCnG,aAAK,WAAW,GAAG,MAAM,GAAG,MAAM,EAAE,CAAC;AAUrC,aAAK,gBAAgB,GAAG;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAC,CAAC;AAC5F,aAAK,gBAAgB,GAAG;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB,CAAC;AAEF,aAAK,cAAc,GAAG,CAAC,cAAc,GAAG,IAAI,EAAE,OAAO,GAAG,IAAI,CAAC,CA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IAAI;IAmBpD,mBAAmB,CAAC,IAAI,EAAE,aAAa,GAAG,OAAO,CAAC,cAAc,CAAC;IAmCjE,eAAe,CACb,KAAK,EAAE,cAAc,CAAC,cAAc,CAAC,GAAG;QACtC,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,cAAc,CAAC;QACrB,IAAI,EAAE,YAAY,CAAC,cAAc,CAAC,CAAC;KACpC;IA2BH,cAAc,CAAC,KAAK,CAAC,EAAE,YAAY,CAAC,cAAc,CAAC,EAAE,GAAG,IAAI;IAyB5D,YAAY,IAAI,KAAK,GAAG,IAAI,GAAG,UAAU;CAwE1C"} \ No newline at end of file diff --git a/modules/geo-layers/typed/tile-3d-layer/tile-3d-layer.d.ts b/modules/geo-layers/typed/tile-3d-layer/tile-3d-layer.d.ts new file mode 100644 index 00000000000..a0161974ba5 --- /dev/null +++ b/modules/geo-layers/typed/tile-3d-layer/tile-3d-layer.d.ts @@ -0,0 +1,76 @@ +import { + Accessor, + Color, + CompositeLayer, + CompositeLayerProps, + FilterContext, + GetPickingInfoParams, + Layer, + LayersList, + PickingInfo, + UpdateParameters, + Viewport +} from '@deck.gl/core'; +import {Tileset3D, Tile3D} from '@loaders.gl/tiles'; +import {Tiles3DLoader} from '@loaders.gl/3d-tiles'; +/** All properties supported by Tile3DLayer */ +export declare type Tile3DLayerProps = _Tile3DLayerProps & + CompositeLayerProps; +/** Props added by the Tile3DLayer */ +declare type _Tile3DLayerProps = { + /** Color Accessor for point clouds. **/ + getPointColor?: Accessor; + /** Global radius of all points in pixels. **/ + pointSize?: number; + /** A loader which is used to decode the fetched tiles. + * @deprecated Use `loaders` instead + */ + loader?: typeof Tiles3DLoader; + /** Called when Tileset JSON file is loaded. **/ + onTilesetLoad?: (tile: Tileset3D) => void; + /** Called when a tile in the tileset hierarchy is loaded. **/ + onTileLoad?: (tile: Tile3D) => void; + /** Called when a tile is unloaded. **/ + onTileUnload?: (tile: Tile3D) => void; + /** Called when a tile fails to load. **/ + onTileError?: (tile: Tile3D, url: string, message: string) => void; + /** (Experimental) Accessor to change color of mesh based on properties. **/ + _getMeshColor?: (tile: Tile3D) => Color; +}; +/** Render 3d tiles data formatted according to the [3D Tiles Specification](https://www.opengeospatial.org/standards/3DTiles) and [`ESRI I3S`](https://github.com/Esri/i3s-spec) */ +export default class Tile3DLayer extends CompositeLayer< + ExtraPropsT & Required<_Tile3DLayerProps> +> { + static defaultProps: any; + static layerName: string; + state: { + activeViewports: {}; + frameNumber?: number; + lastUpdatedViewports: { + [viewportId: string]: Viewport; + } | null; + layerMap: { + [layerId: string]: any; + }; + tileset3d: Tileset3D | null; + }; + initializeState(): void; + get isLoaded(): boolean; + shouldUpdateState({changeFlags}: UpdateParameters): boolean; + updateState({props, oldProps, changeFlags}: UpdateParameters): void; + activateViewport(viewport: Viewport): void; + getPickingInfo({info, sourceLayer}: GetPickingInfoParams): PickingInfo; + filterSubLayer({layer, viewport}: FilterContext): boolean; + protected _updateAutoHighlight(info: PickingInfo): void; + private _loadTileset; + private _onTileLoad; + private _onTileUnload; + private _updateTileset; + private _getSubLayer; + private _makePointCloudLayer; + private _make3DModelLayer; + private _makeSimpleMeshLayer; + renderLayers(): Layer | null | LayersList; +} +export {}; +// # sourceMappingURL=tile-3d-layer.d.ts.map diff --git a/modules/geo-layers/typed/tile-3d-layer/tile-3d-layer.d.ts.map b/modules/geo-layers/typed/tile-3d-layer/tile-3d-layer.d.ts.map new file mode 100644 index 00000000000..ca1219aa363 --- /dev/null +++ b/modules/geo-layers/typed/tile-3d-layer/tile-3d-layer.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"tile-3d-layer.d.ts","sourceRoot":"","sources":["../../src/tile-3d-layer/tile-3d-layer.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,QAAQ,EACR,KAAK,EACL,cAAc,EACd,mBAAmB,EAEnB,aAAa,EACb,oBAAoB,EACpB,KAAK,EACL,UAAU,EAEV,WAAW,EACX,gBAAgB,EAChB,QAAQ,EA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AiB;IAEjC,KAAK,EAAG;QACN,eAAe,EAAE,EAAE,CAAC;QACpB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,oBAAoB,EAAE;YAAC,CAAC,UAAU,EAAE,MAAM,GAAG,QAAQ,CAAA;SAAC,GAAG,IAAI,CAAC;QAC9D,QAAQ,EAAE;YAAC,CAAC,OAAO,EAAE,MAAM,GAAG,GAAG,CAAA;SAAC,CAAC;QACnC,SAAS,EAAE,SAAS,GAAG,IAAI,CAAC;KAC7B,CAAC;IAEF,eAAe;IAaf,IAAI,QAAQ,IAAI,OAAO,CAGtB;IAED,iBAAiB,CAAC,EAAC,WAAW,EAAC,EAAE,gBAAgB,CAAC,IAAI,CAAC,GAAG,OAAO;IAIjE,WAAW,CAAC,EAAC,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAC,EAAE,gBAAgB,CAAC,IAAI,CAAC,GAAG,IAAI;IAsBzE,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI;IAY1C,cAAc,CAAC,EAAC,IAAI,EAAE,WAAW,EAAC,EAAE,oBAAoB;IAaxD,cAAc,CAAC,EAAC,KAAK,EAAE,QAAQ,EAAC,EAAE,aAAa,GAAG,OAAO;IAOzD,SAAS,CAAC,oBAAoB,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI;YAMzC,YAAY;IAwC1B,OAAO,CAAC,WAAW;IAOnB,OAAO,CAAC,aAAa;IAMrB,OAAO,CAAC,cAAc;IAkBtB,OAAO,CAAC,YAAY;IAoBpB,OAAO,CAAC,oBAAoB;IA4C5B,OAAO,CAAC,iBAAiB;IA4BzB,OAAO,CAAC,oBAAoB;IA2C5B,YAAY,IAAI,KAAK,GAAG,IAAI,GAAG,UAAU;CA2B1C"} \ No newline at end of file diff --git a/modules/geo-layers/typed/tile-layer/tile-2d-header.d.ts b/modules/geo-layers/typed/tile-layer/tile-2d-header.d.ts new file mode 100644 index 00000000000..311c92026b6 --- /dev/null +++ b/modules/geo-layers/typed/tile-layer/tile-2d-header.d.ts @@ -0,0 +1,40 @@ +import {Layer} from '@deck.gl/core'; +import {RequestScheduler} from '@loaders.gl/loader-utils'; +import {TileBoundingBox, TileIndex, TileLoadProps} from './types'; +export declare type TileLoadDataProps = { + requestScheduler: RequestScheduler; + getData: (props: TileLoadProps) => Promise; + onLoad: (tile: Tile2DHeader) => void; + onError: (error: any, tile: Tile2DHeader) => void; +}; +export default class Tile2DHeader { + index: TileIndex; + isVisible: boolean; + isSelected: boolean; + parent: Tile2DHeader | null; + children: Tile2DHeader[] | null; + content: DataT | null; + state?: number; + layers?: Layer[] | null; + id: string; + bbox: TileBoundingBox; + zoom: number; + userData?: Record; + private _abortController; + private _loader; + private _loaderId; + private _isLoaded; + private _isCancelled; + private _needsReload; + constructor(index: TileIndex); + get data(): Promise | DataT | null; + get isLoaded(): boolean; + get isLoading(): boolean; + get needsReload(): boolean; + get byteLength(): number; + private _loadData; + loadData(opts: TileLoadDataProps): Promise; + setNeedsReload(): void; + abort(): void; +} +// # sourceMappingURL=tile-2d-header.d.ts.map diff --git a/modules/geo-layers/typed/tile-layer/tile-2d-header.d.ts.map b/modules/geo-layers/typed/tile-layer/tile-2d-header.d.ts.map new file mode 100644 index 00000000000..963e1f6204d --- /dev/null +++ b/modules/geo-layers/typed/tile-layer/tile-2d-header.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"tile-2d-header.d.ts","sourceRoot":"","sources":["../../src/tile-layer/tile-2d-header.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,KAAK,EAAM,MAAM,eAAe,CAAC;AACzC,OAAO,EAAC,gBAAgB,EAAC,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAC,eAAe,EAAE,SAAS,EAAE,aAAa,EAAC,MAAM,SAAS,CAAC;AAElE,oBAAY,iBAAiB,CAAC,KAAK,GAAG,GAAG,IAAI;IAC3C,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,OAAO,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,OAA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AQ,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;IAShD,cAAc,IAAI,IAAI;IAQtB,KAAK,IAAI,IAAI;CAQd"} \ No newline at end of file diff --git a/modules/geo-layers/typed/tile-layer/tile-2d-traversal.d.ts b/modules/geo-layers/typed/tile-layer/tile-2d-traversal.d.ts new file mode 100644 index 00000000000..199b764636f --- /dev/null +++ b/modules/geo-layers/typed/tile-layer/tile-2d-traversal.d.ts @@ -0,0 +1,9 @@ +import {Viewport} from '@deck.gl/core'; +import {Bounds, TileIndex, ZRange} from './types'; +export declare function getOSMTileIndices( + viewport: Viewport, + maxZ: number, + zRange: ZRange | undefined, + bounds?: Bounds +): TileIndex[]; +// # sourceMappingURL=tile-2d-traversal.d.ts.map diff --git a/modules/geo-layers/typed/tile-layer/tile-2d-traversal.d.ts.map b/modules/geo-layers/typed/tile-layer/tile-2d-traversal.d.ts.map new file mode 100644 index 00000000000..ef7a3abd493 --- /dev/null +++ b/modules/geo-layers/typed/tile-layer/tile-2d-traversal.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"tile-2d-traversal.d.ts","sourceRoot":"","sources":["../../src/tile-layer/tile-2d-traversal.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,QAAQ,EAAsC,MAAM,eAAe,CAAC;AAQ5E,OAAO,EAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAC,MAAM,SAAS,CAAC;AA2KlD,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,MAAM,CAAC,EAAE,MAAM,GACd,SAAS,EAAE,CAiEb"} \ No newline at end of file diff --git a/modules/geo-layers/typed/tile-layer/tile-layer.d.ts b/modules/geo-layers/typed/tile-layer/tile-layer.d.ts new file mode 100644 index 00000000000..926959228d9 --- /dev/null +++ b/modules/geo-layers/typed/tile-layer/tile-layer.d.ts @@ -0,0 +1,129 @@ +import { + CompositeLayer, + CompositeLayerProps, + Layer, + LayerProps, + UpdateParameters, + PickingInfo, + GetPickingInfoParams, + FilterContext +} from '@deck.gl/core'; +import {LayersList} from '@deck.gl/core'; +import Tile2DHeader from './tile-2d-header'; +import Tileset2D, {RefinementStrategy, Tileset2DProps} from './tileset-2d'; +import {TileLoadProps, ZRange} from './types'; +/** All props supported by the TileLayer */ +export declare type TileLayerProps = CompositeLayerProps & _TileLayerProps; +/** Props added by the TileLayer */ +declare type _TileLayerProps = { + /** + * Optionally implement a custom indexing scheme. + */ + TilesetClass: typeof Tileset2D; + /** + * Renders one or an array of Layer instances. + */ + renderSubLayers?: ( + props: TileLayerProps & { + id: string; + data: DataT; + _offset: number; + tile: Tile2DHeader; + } + ) => Layer | null | LayersList; + /** + * If supplied, `getTileData` is called to retrieve the data of each tile. + */ + getTileData?: ((props: TileLoadProps) => Promise | DataT) | null; + /** Called when all tiles in the current viewport are loaded. */ + onViewportLoad?: ((tiles: Tile2DHeader[]) => void) | null; + /** Called when a tile successfully loads. */ + onTileLoad?: (tile: Tile2DHeader) => void; + /** Called when a tile is cleared from cache. */ + onTileUnload?: (tile: Tile2DHeader) => void; + /** Called when a tile failed to load. */ + onTileError?: (err: any) => void; + /** The bounding box of the layer's data. */ + extent?: number[] | null; + /** The pixel dimension of the tiles, usually a power of 2. */ + tileSize?: number; + /** The max zoom level of the layer's data. + * @default null + */ + maxZoom?: number | null; + /** The min zoom level of the layer's data. + * @default 0 + */ + minZoom?: number | null; + /** The maximum number of tiles that can be cached. */ + maxCacheSize?: number | null; + /** + * The maximum memory used for caching tiles. + * + * @default null + */ + maxCacheByteSize?: number | null; + /** + * How the tile layer refines the visibility of tiles. + * + * @default 'best-available' + */ + refinementStrategy?: RefinementStrategy; + /** Range of minimum and maximum heights in the tile. */ + zRange?: ZRange | null; + /** + * The maximum number of concurrent getTileData calls. + * + * @default 6 + */ + maxRequests?: number; + /** + * This offset changes the zoom level at which the tiles are fetched. + * + * Needs to be an integer. + * + * @default 0 + */ + zoomOffset?: number; +}; +export declare type TiledPickingInfo = PickingInfo & { + tile?: Tile2DHeader; +}; +/** + * The TileLayer is a composite layer that makes it possible to visualize very large datasets. + * + * Instead of fetching the entire dataset, it only loads and renders what's visible in the current viewport. + */ +export default class TileLayer extends CompositeLayer< + ExtraPropsT & Required<_TileLayerProps> +> { + static defaultProps: any; + static layerName: string; + initializeState(): void; + finalizeState(): void; + get isLoaded(): boolean; + shouldUpdateState({changeFlags}: {changeFlags: any}): boolean; + updateState({changeFlags}: UpdateParameters): void; + _getTilesetOptions(): Tileset2DProps; + private _updateTileset; + _onViewportLoad(): void; + _onTileLoad(tile: Tile2DHeader): void; + _onTileError(error: any, tile: Tile2DHeader): void; + _onTileUnload(tile: Tile2DHeader): void; + getTileData(tile: TileLoadProps): Promise | DataT | null; + renderSubLayers( + props: TileLayer['props'] & { + id: string; + data: DataT; + _offset: number; + tile: Tile2DHeader; + } + ): Layer | null | LayersList; + getSubLayerPropsByTile(tile: Tile2DHeader): Partial | null; + getPickingInfo({info, sourceLayer}: GetPickingInfoParams): TiledPickingInfo; + protected _updateAutoHighlight(info: PickingInfo): void; + renderLayers(): Layer | null | LayersList; + filterSubLayer({layer, cullRect}: FilterContext): any; +} +export {}; +// # sourceMappingURL=tile-layer.d.ts.map diff --git a/modules/geo-layers/typed/tile-layer/tile-layer.d.ts.map b/modules/geo-layers/typed/tile-layer/tile-layer.d.ts.map new file mode 100644 index 00000000000..d59fbf36239 --- /dev/null +++ b/modules/geo-layers/typed/tile-layer/tile-layer.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"tile-layer.d.ts","sourceRoot":"","sources":["../../src/tile-layer/tile-layer.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,mBAAmB,EACnB,KAAK,EACL,UAAU,EACV,gBAAgB,EAChB,WAAW,EACX,oBAAoB,EAEpB,aAAa,EAEd,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAC,UAAU,EAAC,M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AAC,cAAc;IAqBtB,eAAe,IAAI,IAAI;IASvB,WAAW,CAAC,IAAI,EAAE,YAAY,CAAC,KAAK,CAAC,GAAG,IAAI;IAO5C,YAAY,CAAC,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,YAAY,CAAC,KAAK,CAAC;IAOlD,aAAa,CAAC,IAAI,EAAE,YAAY,CAAC,KAAK,CAAC;IAMvC,WAAW,CAAC,IAAI,EAAE,aAAa,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,KAAK,GAAG,IAAI;IAgB/D,eAAe,CACb,KAAK,EAAE,SAAS,CAAC,OAAO,CAAC,GAAG;QAC1B,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,KAAK,CAAC;QACZ,OAAO,EAAE,MAAM,CAAC;QAChB,IAAI,EAAE,YAAY,CAAC,KAAK,CAAC,CAAC;KAC3B,GACA,KAAK,GAAG,IAAI,GAAG,UAAU;IAI5B,sBAAsB,CAAC,IAAI,EAAE,YAAY,GAAG,OAAO,CAAC,UAAU,CAAC,GAAG,IAAI;IAItE,cAAc,CAAC,EAAC,IAAI,EAAE,WAAW,EAAC,EAAE,oBAAoB,GAAG,gBAAgB,CAAC,KAAK,CAAC;IAOlF,SAAS,CAAC,oBAAoB,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI;IAMvD,YAAY,IAAI,KAAK,GAAG,IAAI,GAAG,UAAU;IAiCzC,cAAc,CAAC,EAAC,KAAK,EAAE,QAAQ,EAAC,EAAE,aAAa;CAIhD"} \ No newline at end of file diff --git a/modules/geo-layers/typed/tile-layer/tileset-2d.d.ts b/modules/geo-layers/typed/tile-layer/tileset-2d.d.ts new file mode 100644 index 00000000000..05d2480b12f --- /dev/null +++ b/modules/geo-layers/typed/tile-layer/tileset-2d.d.ts @@ -0,0 +1,127 @@ +import Tile2DHeader from './tile-2d-header'; +import {Matrix4} from '@math.gl/core'; +import {Viewport} from '@deck.gl/core'; +import {TileIndex, ZRange} from './types'; +import {TileLayerProps} from './tile-layer'; +export declare const STRATEGY_NEVER = 'never'; +export declare const STRATEGY_REPLACE = 'no-overlap'; +export declare const STRATEGY_DEFAULT = 'best-available'; +export declare type RefinementStrategyFunction = (tiles: Tile2DHeader[]) => void; +export declare type RefinementStrategy = + | typeof STRATEGY_NEVER + | typeof STRATEGY_REPLACE + | typeof STRATEGY_DEFAULT + | RefinementStrategyFunction; +export declare type Tileset2DProps = Pick< + Required, + | 'tileSize' + | 'maxCacheSize' + | 'maxCacheByteSize' + | 'refinementStrategy' + | 'extent' + | 'maxZoom' + | 'minZoom' + | 'maxRequests' + | 'zoomOffset' +> & { + getTileData: NonNullable; + onTileLoad: (tile: Tile2DHeader) => void; + onTileUnload: (tile: Tile2DHeader) => void; + onTileError: (error: any, tile: Tile2DHeader) => void; +}; +/** + * Manages loading and purging of tile data. This class caches recently visited tiles + * and only creates new tiles if they are present. + */ +export default class Tileset2D { + private opts; + private _requestScheduler; + private _cache; + private _dirty; + private _tiles; + private _cacheByteSize; + private _viewport; + private _zRange?; + private _selectedTiles; + private _frameNumber; + private _modelMatrix; + private _modelMatrixInverse; + private _maxZoom?; + private _minZoom?; + private onTileLoad; + /** + * Takes in a function that returns tile data, a cache size, and a max and a min zoom level. + * Cache size defaults to 5 * number of tiles in the current viewport + */ + constructor(opts: Tileset2DProps); + get tiles(): Tile2DHeader[]; + get selectedTiles(): Tile2DHeader[] | null; + get isLoaded(): boolean; + get needsReload(): boolean; + setOptions(opts: Tileset2DProps): void; + finalize(): void; + reloadAll(): void; + /** + * Update the cache with the given viewport and model matrix and triggers callback onUpdate. + */ + update( + viewport: Viewport, + { + zRange, + modelMatrix + }?: { + zRange?: ZRange; + modelMatrix?: Matrix4; + } + ): number; + isTileVisible( + tile: Tile2DHeader, + cullRect?: { + x: number; + y: number; + width: number; + height: number; + } + ): boolean; + /** Returns array of tile indices in the current viewport */ + getTileIndices({ + viewport, + maxZoom, + minZoom, + zRange, + modelMatrix, + modelMatrixInverse + }: { + viewport: Viewport; + maxZoom?: number; + minZoom?: number; + zRange: ZRange | undefined; + tileSize?: number; + modelMatrix?: Matrix4; + modelMatrixInverse?: Matrix4; + zoomOffset?: number; + }): TileIndex[]; + /** Returns unique string key for a tile index */ + getTileId(index: TileIndex): string; + /** Returns a zoom level for a tile index */ + getTileZoom(index: TileIndex): number; + /** Returns additional metadata to add to tile, bbox by default */ + getTileMetadata(index: TileIndex): Record; + /** Returns index of the parent tile */ + getParentIndex(index: TileIndex): { + x: number; + y: number; + z: number; + }; + private updateTileStates; + private _getCullBounds; + private _pruneRequests; + private _rebuildTree; + /** + * Clear tiles that are not visible when the cache is full + */ + private _resizeCache; + private _getTile; + _getNearestAncestor(tile: Tile2DHeader): Tile2DHeader | null; +} +// # sourceMappingURL=tileset-2d.d.ts.map diff --git a/modules/geo-layers/typed/tile-layer/tileset-2d.d.ts.map b/modules/geo-layers/typed/tile-layer/tileset-2d.d.ts.map new file mode 100644 index 00000000000..be3d6ef2226 --- /dev/null +++ b/modules/geo-layers/typed/tile-layer/tileset-2d.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"tileset-2d.d.ts","sourceRoot":"","sources":["../../src/tile-layer/tileset-2d.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,kBAAkB,CAAC;AAG5C,OAAO,EAAC,OAAO,EAAS,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAC,QAAQ,EAAC,MAAM,eAAe,CAAC;AACvC,OAAO,EAAS,SAAS,EAAE,MAAM,EAAC,MAAM,SAAS,CAAC;AAClD,OAAO,EAAC,cAAc,EAAC,MAAM,cAAc,CAAC;AAyB5C,eAAO,MAAM,cAAc,UAAU,CAAC;AACtC,eAAO,MAAM,gBAAgB,eAAe,CAAC;AAC7C,eAAO,MAAM,gBAAgB,mBAAmB,CAAC;AAEjD,oBAAY,0BAA0B,GAAG,CAAC,KAAK,EAAE,YAAY,EAAE,KAAK,IAAI,CAAC;AACzE,oBAAY,kBAAkB,GAC1B,OAAO,cAAc,GACrB,O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CxB,OAAO,CAAC,cAAc,CAA0B;IAEhD,OAAO,CAAC,cAAc;IAwBtB,OAAO,CAAC,YAAY;IAqBpB;;OAEG;IAEH,OAAO,CAAC,YAAY;IAmCpB,OAAO,CAAC,QAAQ;IA8BhB,mBAAmB,CAAC,IAAI,EAAE,YAAY,GAAG,YAAY,GAAG,IAAI;CAa7D"} \ No newline at end of file diff --git a/modules/geo-layers/typed/tile-layer/types.d.ts b/modules/geo-layers/typed/tile-layer/types.d.ts new file mode 100644 index 00000000000..af8a1de1105 --- /dev/null +++ b/modules/geo-layers/typed/tile-layer/types.d.ts @@ -0,0 +1,30 @@ +export declare type ZRange = [minZ: number, maxZ: number]; +export declare type Bounds = [minX: number, minY: number, maxX: number, maxY: number]; +export declare type GeoBoundingBox = { + west: number; + north: number; + east: number; + south: number; +}; +export declare type NonGeoBoundingBox = { + left: number; + top: number; + right: number; + bottom: number; +}; +export declare type TileBoundingBox = NonGeoBoundingBox | GeoBoundingBox; +export declare type TileIndex = { + x: number; + y: number; + z: number; +}; +export declare type TileLoadProps = { + index: TileIndex; + id: string; + bbox: TileBoundingBox; + url?: string | null; + signal?: AbortSignal; + userData?: Record; + zoom?: number; +}; +// # sourceMappingURL=types.d.ts.map diff --git a/modules/geo-layers/typed/tile-layer/types.d.ts.map b/modules/geo-layers/typed/tile-layer/types.d.ts.map new file mode 100644 index 00000000000..804c127211f --- /dev/null +++ b/modules/geo-layers/typed/tile-layer/types.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/tile-layer/types.ts"],"names":[],"mappings":"AAAA,oBAAY,MAAM,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;AAElD,oBAAY,MAAM,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;AAE9E,oBAAY,cAAc,GAAG;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAC,CAAC;AACxF,oBAAY,iBAAiB,GAAG;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAC,CAAC;AAE3F,oBAAY,eAAe,GAAG,iBAAiB,GAAG,cAAc,CAAC;AAEjE,oBAAY,SAAS,GAAG;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAC,CAAC;AAE1D,oBAAY,aAAa,GAAG;IAC1B,KAAK,EAAE,SAAS,CAAC;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,eAAe,CAAC;IACtB,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC/B,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC"} \ No newline at end of file diff --git a/modules/geo-layers/typed/tile-layer/utils.d.ts b/modules/geo-layers/typed/tile-layer/utils.d.ts new file mode 100644 index 00000000000..0eee1cab0a0 --- /dev/null +++ b/modules/geo-layers/typed/tile-layer/utils.d.ts @@ -0,0 +1,74 @@ +import {Viewport} from '@deck.gl/core'; +import {Matrix4} from '@math.gl/core'; +import {Bounds, GeoBoundingBox, TileBoundingBox, TileIndex, ZRange} from './types'; +export declare const urlType: { + type: string; + value: any; + validate: (value: any, propType: any) => boolean; + equals: (value1: any, value2: any) => boolean; +}; +export declare function getURLFromTemplate( + template: string | string[], + tile: { + index: TileIndex; + id: string; + } +): string | null; +/** Get culling bounds in world space */ +export declare function getCullBounds({ + viewport, + z, + cullRect +}: { + /** Current viewport */ + viewport: Viewport; + /** Current z range */ + z: ZRange | number | undefined; + /** Culling rectangle in screen space */ + cullRect: { + x: number; + y: number; + width: number; + height: number; + }; +}): [number, number, number, number]; +export declare function osmTile2lngLat(x: number, y: number, z: number): [number, number]; +export declare function tileToBoundingBox( + viewport: Viewport, + x: number, + y: number, + z: number, + tileSize?: number +): TileBoundingBox; +/** + * Returns all tile indices in the current viewport. If the current zoom level is smaller + * than minZoom, return an empty array. If the current zoom level is greater than maxZoom, + * return tiles that are on maxZoom. + */ +export declare function getTileIndices({ + viewport, + maxZoom, + minZoom, + zRange, + extent, + tileSize, + modelMatrix, + modelMatrixInverse, + zoomOffset +}: { + viewport: Viewport; + maxZoom?: number; + minZoom?: number; + zRange: ZRange | undefined; + extent?: Bounds; + tileSize?: number; + modelMatrix?: Matrix4; + modelMatrixInverse?: Matrix4; + zoomOffset?: number; +}): TileIndex[]; +/** + * Returns true if s is a valid URL template + */ +export declare function isURLTemplate(s: string): boolean; +export declare function isGeoBoundingBox(v: any): v is GeoBoundingBox; +// # sourceMappingURL=utils.d.ts.map diff --git a/modules/geo-layers/typed/tile-layer/utils.d.ts.map b/modules/geo-layers/typed/tile-layer/utils.d.ts.map new file mode 100644 index 00000000000..25bda72cb2e --- /dev/null +++ b/modules/geo-layers/typed/tile-layer/utils.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/tile-layer/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,eAAe,CAAC;AACvC,OAAO,EAAC,OAAO,EAAC,MAAM,eAAe,CAAC;AAEtC,OAAO,EAAC,MAAM,EAAE,cAAc,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,EAAC,MAAM,SAAS,CAAC;AAKnF,eAAO,MAAM,OAAO;;;;;CAyBnB,CAAC;AA8BF,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,MAAM,GA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AQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,eA0BA;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAEhD;AAED,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,GAAG,GAAG,CAAC,IAAI,cAAc,CAO5D"} \ No newline at end of file diff --git a/modules/geo-layers/typed/trips-layer/trips-layer.d.ts b/modules/geo-layers/typed/trips-layer/trips-layer.d.ts new file mode 100644 index 00000000000..00da3facaa2 --- /dev/null +++ b/modules/geo-layers/typed/trips-layer/trips-layer.d.ts @@ -0,0 +1,40 @@ +import type {NumericArray} from '@math.gl/core'; +import {AccessorFunction, DefaultProps} from '@deck.gl/core'; +import {PathLayer, PathLayerProps} from '@deck.gl/layers'; +/** All properties supported by TripsLayer. */ +export declare type TripsLayerProps = _TripsLayerProps & PathLayerProps; +/** Properties added by TripsLayer. */ +declare type _TripsLayerProps = { + /** + * Whether or not the path fades out. + * @default true + */ + fadeTrail?: boolean; + /** + * Trail length. + * @default 120 + */ + trailLength?: number; + /** + * The current time of the frame. + * @default 0 + */ + currentTime?: number; + /** + * Timestamp accessor. + */ + getTimestamps?: AccessorFunction; +}; +/** Render animated paths that represent vehicle trips. */ +export default class TripsLayer extends PathLayer< + DataT, + Required<_TripsLayerProps> & ExtraProps +> { + static layerName: string; + static defaultProps: DefaultProps>; + getShaders(): any; + initializeState(): void; + draw(params: any): void; +} +export {}; +// # sourceMappingURL=trips-layer.d.ts.map diff --git a/modules/geo-layers/typed/trips-layer/trips-layer.d.ts.map b/modules/geo-layers/typed/trips-layer/trips-layer.d.ts.map new file mode 100644 index 00000000000..530e4933228 --- /dev/null +++ b/modules/geo-layers/typed/trips-layer/trips-layer.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"trips-layer.d.ts","sourceRoot":"","sources":["../../src/trips-layer/trips-layer.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,eAAe,CAAC;AAChD,OAAO,EAAC,gBAAgB,EAAE,YAAY,EAAC,MAAM,eAAe,CAAC;AAC7D,OAAO,EAAC,SAAS,EAAE,cAAc,EAAC,MAAM,iBAAiB,CAAC;AAS1D,8CAA8C;AAC9C,oBAAY,eAAe,CAAC,KAAK,GAAG,GAAG,IAAI,gBAAgB,CAAC,KAAK,CAAC,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC;AAE3F,sCAAsC;AACtC,aAAK,gBAAgB,CAAC,KAAK,GAAG,GAAG,IAAI;IACnC;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,aAAa,CAAC,EAAE,gBAAgB,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC;CACvD,CAAC;AAEF,0DAA0D;AAC1D,MAAM,CAAC,OAAO,OAAO,UAAU,CAAC,KAAK,GAAG,GAAG,EAAE,UAAU,GAAG,EAAE,CAAE,SAAQ,SAAS,CAC7E,KAAK,EACL,QAAQ,CAAC,gBAAgB,CAAC,GAAG,UAAU,CACxC;IACC,MAAM,CAAC,SAAS,SAAgB;IAChC,MAAM,CAAC,YAAY,qCAAgB;IAEnC,UAAU;IAmCV,eAAe;IAoBf,IAAI,CAAC,MAAM,KAAA;CAYZ"} \ No newline at end of file diff --git a/modules/google-maps/typed/google-maps-overlay.d.ts b/modules/google-maps/typed/google-maps-overlay.d.ts new file mode 100644 index 00000000000..e9d12099e34 --- /dev/null +++ b/modules/google-maps/typed/google-maps-overlay.d.ts @@ -0,0 +1,35 @@ +// / +import type {DeckProps} from '@deck.gl/core'; +export declare type GoogleMapsOverlayProps = DeckProps & { + interleaved?: boolean; +}; +export default class GoogleMapsOverlay { + private props; + private _map; + private _deck; + private _overlay; + constructor(props: GoogleMapsOverlayProps); + /** Add/remove the overlay from a map. */ + setMap(map: google.maps.Map | null): void; + /** + * Update (partial) props. + */ + setProps(props: Partial): void; + /** Equivalent of `deck.pickObject`. */ + pickObject(params: any): import('@deck.gl/core').PickingInfo; + /** Equivalent of `deck.pickObjects`. */ + pickMultipleObjects(params: any): import('@deck.gl/core').PickingInfo[]; + /** Equivalent of `deck.pickMultipleObjects`. */ + pickObjects(params: any): import('@deck.gl/core').PickingInfo[]; + /** Remove the overlay and release all underlying resources. */ + finalize(): void; + _createOverlay(map: google.maps.Map): void; + _onAdd(): void; + _onContextRestored({gl}: {gl: any}): void; + _onContextLost(): void; + _onRemove(): void; + _onDrawRaster(): void; + _onDrawVectorInterleaved({gl, transformer}: {gl: any; transformer: any}): void; + _onDrawVectorOverlay({transformer}: {transformer: any}): void; +} +// # sourceMappingURL=google-maps-overlay.d.ts.map diff --git a/modules/google-maps/typed/google-maps-overlay.d.ts.map b/modules/google-maps/typed/google-maps-overlay.d.ts.map new file mode 100644 index 00000000000..658a046f219 --- /dev/null +++ b/modules/google-maps/typed/google-maps-overlay.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"google-maps-overlay.d.ts","sourceRoot":"","sources":["../src/google-maps-overlay.ts"],"names":[],"mappings":";AAWA,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,eAAe,CAAC;AAkB7C,oBAAY,sBAAsB,GAAG,SAAS,GAAG;IAC/C,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC;AAEF,MAAM,CAAC,OAAO,OAAO,iBAAiB;IACpC,OAAO,CAAC,KAAK,CAA8B;IAC3C,OAAO,CAAC,IAAI,CAAgC;IAC5C,OAAO,CAAC,KAAK,CAAqB;IAClC,OAAO,CAAC,QAAQ,CAAuE;gBAE3E,KAAK,EAAE,sBAAsB;IAMzC,yCAAyC;IACzC,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,GAAG,IAAI,GAAG,IAAI;IAsBzC;;OAEG;IACH,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC,sBAAsB,CAAC,GAAG,IAAI;IAatD,uCAAuC;IACvC,UAAU,CAAC,MAAM,KAAA;IAIjB,yCAAyC;IACzC,mBAAmB,CAAC,MAAM,KAAA;IAI1B,gDAAgD;IAChD,WAAW,CAAC,MAAM,KAAA;IAIlB,+DAA+D;IAC/D,QAAQ;IASR,cAAc,CAAC,GAAG,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG;IAiCnC,MAAM;IAKN,kBAAkB,CAAC,EAAC,EAAE,EAAC;;KAAA;IA8BvB,cAAc;IAQd,SAAS;IAIT,aAAa;IA2Bb,wBAAwB,CAAC,EAAC,EAAE,EAAE,WAAW,EAAC;;;KAAA;IA2C1C,oBAAoB,CAAC,EAAC,WAAW,EAAC;;KAAA;CAYnC"} \ No newline at end of file diff --git a/modules/google-maps/typed/index.d.ts b/modules/google-maps/typed/index.d.ts new file mode 100644 index 00000000000..059f0202ab5 --- /dev/null +++ b/modules/google-maps/typed/index.d.ts @@ -0,0 +1,3 @@ +export {default as GoogleMapsOverlay} from './google-maps-overlay'; +export type {GoogleMapsOverlayProps} from './google-maps-overlay'; +// # sourceMappingURL=index.d.ts.map diff --git a/modules/google-maps/typed/index.d.ts.map b/modules/google-maps/typed/index.d.ts.map new file mode 100644 index 00000000000..61544dc099f --- /dev/null +++ b/modules/google-maps/typed/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,IAAI,iBAAiB,EAAC,MAAM,uBAAuB,CAAC;AACnE,YAAY,EAAC,sBAAsB,EAAC,MAAM,uBAAuB,CAAC"} \ No newline at end of file diff --git a/modules/google-maps/typed/utils.d.ts b/modules/google-maps/typed/utils.d.ts new file mode 100644 index 00000000000..462a62239be --- /dev/null +++ b/modules/google-maps/typed/utils.d.ts @@ -0,0 +1,74 @@ +// / +import {Deck} from '@deck.gl/core'; +import {Matrix4} from '@math.gl/core'; +/** + * Get a new deck instance + * @param map (google.maps.Map) - The parent Map instance + * @param overlay (google.maps.OverlayView) - A maps Overlay instance + * @param [deck] (Deck) - a previously created instances + */ +export declare function createDeckInstance( + map: google.maps.Map, + overlay: google.maps.OverlayView | google.maps.WebGLOverlayView, + deck: Deck | null | undefined, + props: any +): Deck; +/** + * Safely remove a deck instance + * @param deck (Deck) - a previously created instances + */ +export declare function destroyDeckInstance(deck: Deck): void; +/** + * Get the current view state + * @param map (google.maps.Map) - The parent Map instance + * @param overlay (google.maps.OverlayView) - A maps Overlay instance + */ +export declare function getViewPropsFromOverlay( + map: google.maps.Map, + overlay: google.maps.OverlayView +): + | { + width: number; + height: number; + left: number; + top: number; + zoom?: undefined; + bearing?: undefined; + pitch?: undefined; + latitude?: undefined; + longitude?: undefined; + } + | { + width: number; + height: number; + left: number; + top: number; + zoom: number; + bearing: number; + pitch: number; + latitude: number; + longitude: number; + }; +/** + * Get the current view state + * @param map (google.maps.Map) - The parent Map instance + * @param transformer (google.maps.CoordinateTransformer) - A CoordinateTransformer instance + */ +export declare function getViewPropsFromCoordinateTransformer( + map: google.maps.Map, + transformer: google.maps.CoordinateTransformer +): { + width: number; + height: number; + viewState: { + altitude: number; + bearing: number; + latitude: number; + longitude: number; + pitch: number; + projectionMatrix: Matrix4; + repeat: boolean; + zoom: number; + }; +}; +// # sourceMappingURL=utils.d.ts.map diff --git a/modules/google-maps/typed/utils.d.ts.map b/modules/google-maps/typed/utils.d.ts.map new file mode 100644 index 00000000000..64c381e9c1c --- /dev/null +++ b/modules/google-maps/typed/utils.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";AACA,OAAO,EAAC,IAAI,EAAC,MAAM,eAAe,CAAC;AACnC,OAAO,EAAC,OAAO,EAAU,MAAM,eAAe,CAAC;AAW/C;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAChC,GAAG,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,EACpB,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,WAAW,GAAG,MAAM,CAAC,IAAI,CAAC,gBAAgB,EAC/D,IAAI,EAAE,IAAI,GAAG,IAAI,GAAG,SAAS,EAC7B,KAAK,KAAA,GACJ,IAAI,CAyCN;AAqBD;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,IAAI,QAY7C;AAGD;;;;GAIG;AAEH,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,WAAW;;;;;;;;;;;;;;;;;;;;EAyF7F;AAID;;;;GAIG;AACH,wBAAgB,qCAAqC,CACnD,GAAG,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,EACpB,WAAW,EAAE,MAAM,CAAC,IAAI,CAAC,qBAAqB;;;;;;;;;;;;;EAoC/C"} \ No newline at end of file diff --git a/modules/json/typed/helpers/convert-functions.d.ts b/modules/json/typed/helpers/convert-functions.d.ts new file mode 100644 index 00000000000..f60ada8026e --- /dev/null +++ b/modules/json/typed/helpers/convert-functions.d.ts @@ -0,0 +1,2 @@ +export default function convertFunctions(props: any, configuration: any): {}; +// # sourceMappingURL=convert-functions.d.ts.map diff --git a/modules/json/typed/helpers/convert-functions.d.ts.map b/modules/json/typed/helpers/convert-functions.d.ts.map new file mode 100644 index 00000000000..7f4643140f2 --- /dev/null +++ b/modules/json/typed/helpers/convert-functions.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"convert-functions.d.ts","sourceRoot":"","sources":["../../src/helpers/convert-functions.ts"],"names":[],"mappings":"AAcA,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,KAAK,KAAA,EAAE,aAAa,KAAA,MAmB5D"} \ No newline at end of file diff --git a/modules/json/typed/helpers/execute-function.d.ts b/modules/json/typed/helpers/execute-function.d.ts new file mode 100644 index 00000000000..48cb74fa160 --- /dev/null +++ b/modules/json/typed/helpers/execute-function.d.ts @@ -0,0 +1,2 @@ +export declare function executeFunction(targetFunction: any, props: any, configuration: any): any; +// # sourceMappingURL=execute-function.d.ts.map diff --git a/modules/json/typed/helpers/execute-function.d.ts.map b/modules/json/typed/helpers/execute-function.d.ts.map new file mode 100644 index 00000000000..2cd472015d7 --- /dev/null +++ b/modules/json/typed/helpers/execute-function.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"execute-function.d.ts","sourceRoot":"","sources":["../../src/helpers/execute-function.ts"],"names":[],"mappings":"AACA,wBAAgB,eAAe,CAAC,cAAc,KAAA,EAAE,KAAK,KAAA,EAAE,aAAa,KAAA,OAenE"} \ No newline at end of file diff --git a/modules/json/typed/helpers/instantiate-class.d.ts b/modules/json/typed/helpers/instantiate-class.d.ts new file mode 100644 index 00000000000..fbbafab1953 --- /dev/null +++ b/modules/json/typed/helpers/instantiate-class.d.ts @@ -0,0 +1,2 @@ +export declare function instantiateClass(type: any, props: any, configuration: any): any; +// # sourceMappingURL=instantiate-class.d.ts.map diff --git a/modules/json/typed/helpers/instantiate-class.d.ts.map b/modules/json/typed/helpers/instantiate-class.d.ts.map new file mode 100644 index 00000000000..6d89a169763 --- /dev/null +++ b/modules/json/typed/helpers/instantiate-class.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"instantiate-class.d.ts","sourceRoot":"","sources":["../../src/helpers/instantiate-class.ts"],"names":[],"mappings":"AAGA,wBAAgB,gBAAgB,CAAC,IAAI,KAAA,EAAE,KAAK,KAAA,EAAE,aAAa,KAAA,OAoB1D"} \ No newline at end of file diff --git a/modules/json/typed/helpers/parse-expression-string.d.ts b/modules/json/typed/helpers/parse-expression-string.d.ts new file mode 100644 index 00000000000..d61b37ffd3e --- /dev/null +++ b/modules/json/typed/helpers/parse-expression-string.d.ts @@ -0,0 +1,2 @@ +export default function parseExpressionString(propValue: any, configuration: any): any; +// # sourceMappingURL=parse-expression-string.d.ts.map diff --git a/modules/json/typed/helpers/parse-expression-string.d.ts.map b/modules/json/typed/helpers/parse-expression-string.d.ts.map new file mode 100644 index 00000000000..034cf987230 --- /dev/null +++ b/modules/json/typed/helpers/parse-expression-string.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"parse-expression-string.d.ts","sourceRoot":"","sources":["../../src/helpers/parse-expression-string.ts"],"names":[],"mappings":"AAYA,MAAM,CAAC,OAAO,UAAU,qBAAqB,CAAC,SAAS,KAAA,EAAE,aAAa,KAAA,OA+BrE"} \ No newline at end of file diff --git a/modules/json/typed/helpers/parse-json.d.ts b/modules/json/typed/helpers/parse-json.d.ts new file mode 100644 index 00000000000..005266f8005 --- /dev/null +++ b/modules/json/typed/helpers/parse-json.d.ts @@ -0,0 +1,2 @@ +export default function parseJSON(json: any): any; +// # sourceMappingURL=parse-json.d.ts.map diff --git a/modules/json/typed/helpers/parse-json.d.ts.map b/modules/json/typed/helpers/parse-json.d.ts.map new file mode 100644 index 00000000000..e67f977c1dd --- /dev/null +++ b/modules/json/typed/helpers/parse-json.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"parse-json.d.ts","sourceRoot":"","sources":["../../src/helpers/parse-json.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,IAAI,KAAA,OAErC"} \ No newline at end of file diff --git a/modules/json/typed/index.d.ts b/modules/json/typed/index.d.ts new file mode 100644 index 00000000000..9a4c63a9b9e --- /dev/null +++ b/modules/json/typed/index.d.ts @@ -0,0 +1,7 @@ +export {default as JSONConverter} from './json-converter'; +export {default as JSONConfiguration} from './json-configuration'; +export {default as Transport} from './transports/transport'; +export {default as _convertFunctions} from './helpers/convert-functions'; +export {default as _parseExpressionString} from './helpers/parse-expression-string'; +export {shallowEqualObjects as _shallowEqualObjects} from './utils/shallow-equal-objects'; +// # sourceMappingURL=index.d.ts.map diff --git a/modules/json/typed/index.d.ts.map b/modules/json/typed/index.d.ts.map new file mode 100644 index 00000000000..ef8a63a87ba --- /dev/null +++ b/modules/json/typed/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,OAAO,IAAI,aAAa,EAAC,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAC,OAAO,IAAI,iBAAiB,EAAC,MAAM,sBAAsB,CAAC;AAGlE,OAAO,EAAC,OAAO,IAAI,SAAS,EAAC,MAAM,wBAAwB,CAAC;AAG5D,OAAO,EAAC,OAAO,IAAI,iBAAiB,EAAC,MAAM,6BAA6B,CAAC;AACzE,OAAO,EAAC,OAAO,IAAI,sBAAsB,EAAC,MAAM,mCAAmC,CAAC;AACpF,OAAO,EAAC,mBAAmB,IAAI,oBAAoB,EAAC,MAAM,+BAA+B,CAAC"} \ No newline at end of file diff --git a/modules/json/typed/json-configuration.d.ts b/modules/json/typed/json-configuration.d.ts new file mode 100644 index 00000000000..2f53a75fba6 --- /dev/null +++ b/modules/json/typed/json-configuration.d.ts @@ -0,0 +1,18 @@ +import parseExpressionString from './helpers/parse-expression-string'; +export default class JSONConfiguration { + typeKey: string; + functionKey: string; + log: Console; + classes: {}; + reactComponents: {}; + enumerations: {}; + constants: {}; + functions: {}; + convertFunction: typeof parseExpressionString; + preProcessClassProps: (Class: any, props: any) => any; + postProcessConvertedJson: (json: any) => any; + constructor(...configurations: any[]); + merge(configuration: any): void; + validate(configuration: any): boolean; +} +// # sourceMappingURL=json-configuration.d.ts.map diff --git a/modules/json/typed/json-configuration.d.ts.map b/modules/json/typed/json-configuration.d.ts.map new file mode 100644 index 00000000000..10c59276f3d --- /dev/null +++ b/modules/json/typed/json-configuration.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"json-configuration.d.ts","sourceRoot":"","sources":["../src/json-configuration.ts"],"names":[],"mappings":"AACA,OAAO,qBAAqB,MAAM,mCAAmC,CAAC;AAOtE,MAAM,CAAC,OAAO,OAAO,iBAAiB;IACpC,OAAO,SAAY;IACnB,WAAW,SAAgB;IAC3B,GAAG,UAAW;IACd,OAAO,KAAM;IACb,eAAe,KAAM;IACrB,YAAY,KAAM;IAClB,SAAS,KAAM;IACf,SAAS,KAAM;IAEf,eAAe,+BAAyB;IACxC,oBAAoB,kCAA2B;IAC/C,wBAAwB,qBAAgB;gBAE5B,GAAG,cAAc,OAAA;IAoB7B,KAAK,CAAC,aAAa,KAAA;IAkBnB,QAAQ,CAAC,aAAa,KAAA;CAKvB"} \ No newline at end of file diff --git a/modules/json/typed/json-converter.d.ts b/modules/json/typed/json-converter.d.ts new file mode 100644 index 00000000000..5059b7d8d3a --- /dev/null +++ b/modules/json/typed/json-converter.d.ts @@ -0,0 +1,19 @@ +import JSONConfiguration from './json-configuration'; +export declare type JSONConverterProps = { + configuration: JSONConfiguration | Record; + onJSONChange: any; +}; +export default class JSONConverter { + log: Console; + configuration: JSONConfiguration; + onJSONChange: () => void; + json: any; + convertedJson: any; + constructor(props: any); + finalize(): void; + setProps(props: JSONConverterProps): void; + mergeConfiguration(config: any): void; + convert(json: any): any; + convertJson(json: any): any; +} +// # sourceMappingURL=json-converter.d.ts.map diff --git a/modules/json/typed/json-converter.d.ts.map b/modules/json/typed/json-converter.d.ts.map new file mode 100644 index 00000000000..080e1852e67 --- /dev/null +++ b/modules/json/typed/json-converter.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"json-converter.d.ts","sourceRoot":"","sources":["../src/json-converter.ts"],"names":[],"mappings":"AAWA,OAAO,iBAAiB,MAAM,sBAAsB,CAAC;AASrD,oBAAY,kBAAkB,GAAG;IAC/B,aAAa,EAAE,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACvD,YAAY,MAAC;CACd,CAAC;AAEF,MAAM,CAAC,OAAO,OAAO,aAAa;IAChC,GAAG,UAAW;IACd,aAAa,EAAE,iBAAiB,CAAC;IACjC,YAAY,aAAY;IACxB,IAAI,MAAQ;IACZ,aAAa,MAAQ;gBAET,KAAK,KAAA;IAIjB,QAAQ;IAER,QAAQ,CAAC,KAAK,EAAE,kBAAkB;IAelC,kBAAkB,CAAC,MAAM,KAAA;IAIzB,OAAO,CAAC,IAAI,KAAA;IAqBZ,WAAW,CAAC,IAAI,KAAA;CAGjB"} \ No newline at end of file diff --git a/modules/json/typed/syntactic-sugar.d.ts b/modules/json/typed/syntactic-sugar.d.ts new file mode 100644 index 00000000000..82dbed33063 --- /dev/null +++ b/modules/json/typed/syntactic-sugar.d.ts @@ -0,0 +1,6 @@ +declare const FUNCTION_IDENTIFIER = '@@='; +declare const CONSTANT_IDENTIFIER = '@@#'; +declare const TYPE_KEY = '@@type'; +declare const FUNCTION_KEY = '@@function'; +export {FUNCTION_IDENTIFIER, CONSTANT_IDENTIFIER, TYPE_KEY, FUNCTION_KEY}; +// # sourceMappingURL=syntactic-sugar.d.ts.map diff --git a/modules/json/typed/syntactic-sugar.d.ts.map b/modules/json/typed/syntactic-sugar.d.ts.map new file mode 100644 index 00000000000..cf39fcc0888 --- /dev/null +++ b/modules/json/typed/syntactic-sugar.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"syntactic-sugar.d.ts","sourceRoot":"","sources":["../src/syntactic-sugar.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,mBAAmB,QAAQ,CAAC;AAClC,QAAA,MAAM,mBAAmB,QAAQ,CAAC;AAClC,QAAA,MAAM,QAAQ,WAAW,CAAC;AAC1B,QAAA,MAAM,YAAY,eAAe,CAAC;AAElC,OAAO,EAAC,mBAAmB,EAAE,mBAAmB,EAAE,QAAQ,EAAE,YAAY,EAAC,CAAC"} \ No newline at end of file diff --git a/modules/json/typed/transports/transport.d.ts b/modules/json/typed/transports/transport.d.ts new file mode 100644 index 00000000000..ce538d71c44 --- /dev/null +++ b/modules/json/typed/transports/transport.d.ts @@ -0,0 +1,35 @@ +export default class Transport { + static setCallbacks({ + onInitialize, + onFinalize, + onMessage + }: { + onInitialize: any; + onFinalize: any; + onMessage: any; + }): void; + name: string; + _messageQueue: any[]; + userData: {}; + _destroyed: boolean; + constructor(name?: string); + /** + * Return a root DOM element for this transport connection + * @return {HTMLElement} default implementation returns document.body + * Jupyter Notebook transports will return an element associated with the notebook cell + */ + getRootDOMElement(): HTMLElement; + /** + * Back-channel messaging + */ + sendJSONMessage(): void; + /** + * Back-channel messaging + */ + sendBinaryMessage(): void; + _initialize(options?: {}): void; + _finalize(options?: {}): void; + _messageReceived(message?: {}): void; + static _stringifyJSONSafe(v: any): string; +} +// # sourceMappingURL=transport.d.ts.map diff --git a/modules/json/typed/transports/transport.d.ts.map b/modules/json/typed/transports/transport.d.ts.map new file mode 100644 index 00000000000..7079a05949e --- /dev/null +++ b/modules/json/typed/transports/transport.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"transport.d.ts","sourceRoot":"","sources":["../../src/transports/transport.ts"],"names":[],"mappings":"AAOA,MAAM,CAAC,OAAO,OAAO,SAAS;IAC5B,MAAM,CAAC,YAAY,CAAC,EAAC,YAAY,EAAE,UAAU,EAAE,SAAS,EAAC;;;;KAAA;IAazD,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,QAAM;IACnB,QAAQ,KAAM;IACd,UAAU,EAAE,OAAO,CAAS;gBAEhB,IAAI,SAAc;IAI9B;;;;OAIG;IACH,iBAAiB;IAIjB;;OAEG;IACH,eAAe;IAKf;;OAEG;IACH,iBAAiB;IASjB,WAAW,CAAC,OAAO,KAAK;IAQxB,SAAS,CAAC,OAAO,KAAK;IAQtB,gBAAgB,CAAC,OAAO,KAAK;IAoC7B,MAAM,CAAC,kBAAkB,CAAC,CAAC,KAAA;CAoB5B"} \ No newline at end of file diff --git a/modules/json/typed/utils/assert.d.ts b/modules/json/typed/utils/assert.d.ts new file mode 100644 index 00000000000..a823f40e10b --- /dev/null +++ b/modules/json/typed/utils/assert.d.ts @@ -0,0 +1,2 @@ +export default function assert(condition: any, message?: string): void; +// # sourceMappingURL=assert.d.ts.map diff --git a/modules/json/typed/utils/assert.d.ts.map b/modules/json/typed/utils/assert.d.ts.map new file mode 100644 index 00000000000..22daeb01aac --- /dev/null +++ b/modules/json/typed/utils/assert.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"assert.d.ts","sourceRoot":"","sources":["../../src/utils/assert.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,SAAS,KAAA,EAAE,OAAO,SAAK,QAIrD"} \ No newline at end of file diff --git a/modules/json/typed/utils/get.d.ts b/modules/json/typed/utils/get.d.ts new file mode 100644 index 00000000000..f9c3316b931 --- /dev/null +++ b/modules/json/typed/utils/get.d.ts @@ -0,0 +1,9 @@ +/** + * Access properties of nested containers using dot-path notation + * Returns `undefined` if any container is not valid, instead of throwing + * @param {Object} container - container that supports get + * @param {String|*} compositeKey - key to access, can be '.'-separated string + * @return {*} - value in the final key of the nested container, or `undefined` + */ +export declare function get(container: any, compositeKey: any): any; +// # sourceMappingURL=get.d.ts.map diff --git a/modules/json/typed/utils/get.d.ts.map b/modules/json/typed/utils/get.d.ts.map new file mode 100644 index 00000000000..1191c35bbff --- /dev/null +++ b/modules/json/typed/utils/get.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"get.d.ts","sourceRoot":"","sources":["../../src/utils/get.ts"],"names":[],"mappings":"AAoBA;;;;;;GAMG;AACH,wBAAgB,GAAG,CAAC,SAAS,KAAA,EAAE,YAAY,KAAA,OAU1C"} \ No newline at end of file diff --git a/modules/json/typed/utils/shallow-equal-objects.d.ts b/modules/json/typed/utils/shallow-equal-objects.d.ts new file mode 100644 index 00000000000..34db4af7499 --- /dev/null +++ b/modules/json/typed/utils/shallow-equal-objects.d.ts @@ -0,0 +1,2 @@ +export declare function shallowEqualObjects(a: any, b: any): boolean; +// # sourceMappingURL=shallow-equal-objects.d.ts.map diff --git a/modules/json/typed/utils/shallow-equal-objects.d.ts.map b/modules/json/typed/utils/shallow-equal-objects.d.ts.map new file mode 100644 index 00000000000..9f6456a7c3b --- /dev/null +++ b/modules/json/typed/utils/shallow-equal-objects.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"shallow-equal-objects.d.ts","sourceRoot":"","sources":["../../src/utils/shallow-equal-objects.ts"],"names":[],"mappings":"AAKA,wBAAgB,mBAAmB,CAAC,CAAC,KAAA,EAAE,CAAC,KAAA,WAwBvC"} \ No newline at end of file diff --git a/modules/layers/typed/arc-layer/arc-layer-fragment.glsl.d.ts b/modules/layers/typed/arc-layer/arc-layer-fragment.glsl.d.ts new file mode 100644 index 00000000000..df12f188743 --- /dev/null +++ b/modules/layers/typed/arc-layer/arc-layer-fragment.glsl.d.ts @@ -0,0 +1,3 @@ +declare const _default: '#define SHADER_NAME arc-layer-fragment-shader\n\nprecision highp float;\n\nvarying vec4 vColor;\nvarying vec2 uv;\nvarying float isValid;\n\nvoid main(void) {\n if (isValid == 0.0) {\n discard;\n }\n\n gl_FragColor = vColor;\n geometry.uv = uv;\n\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n'; +export default _default; +// # sourceMappingURL=arc-layer-fragment.glsl.d.ts.map diff --git a/modules/layers/typed/arc-layer/arc-layer-fragment.glsl.d.ts.map b/modules/layers/typed/arc-layer/arc-layer-fragment.glsl.d.ts.map new file mode 100644 index 00000000000..3d1d26a06b8 --- /dev/null +++ b/modules/layers/typed/arc-layer/arc-layer-fragment.glsl.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"arc-layer-fragment.glsl.d.ts","sourceRoot":"","sources":["../../src/arc-layer/arc-layer-fragment.glsl.ts"],"names":[],"mappings":";AAoBA,wBAmBE"} \ No newline at end of file diff --git a/modules/layers/typed/arc-layer/arc-layer-vertex.glsl.d.ts b/modules/layers/typed/arc-layer/arc-layer-vertex.glsl.d.ts new file mode 100644 index 00000000000..b0cc162fd1a --- /dev/null +++ b/modules/layers/typed/arc-layer/arc-layer-vertex.glsl.d.ts @@ -0,0 +1,3 @@ +declare const _default: "#define SHADER_NAME arc-layer-vertex-shader\n\nattribute vec3 positions;\nattribute vec4 instanceSourceColors;\nattribute vec4 instanceTargetColors;\nattribute vec3 instanceSourcePositions;\nattribute vec3 instanceSourcePositions64Low;\nattribute vec3 instanceTargetPositions;\nattribute vec3 instanceTargetPositions64Low;\nattribute vec3 instancePickingColors;\nattribute float instanceWidths;\nattribute float instanceHeights;\nattribute float instanceTilts;\n\nuniform bool greatCircle;\nuniform bool useShortestPath;\nuniform float numSegments;\nuniform float opacity;\nuniform float widthScale;\nuniform float widthMinPixels;\nuniform float widthMaxPixels;\nuniform int widthUnits;\n\nvarying vec4 vColor;\nvarying vec2 uv;\nvarying float isValid;\n\nfloat paraboloid(float distance, float sourceZ, float targetZ, float ratio) {\n // d: distance on the xy plane\n // r: ratio of the current point\n // p: ratio of the peak of the arc\n // h: height multiplier\n // z = f(r) = sqrt(r * (p * 2 - r)) * d * h\n // f(0) = 0\n // f(1) = dz\n\n float deltaZ = targetZ - sourceZ;\n float dh = distance * instanceHeights;\n if (dh == 0.0) {\n return sourceZ + deltaZ * ratio;\n }\n float unitZ = deltaZ / dh;\n float p2 = unitZ * unitZ + 1.0;\n\n // sqrt does not deal with negative values, manually flip source and target if delta.z < 0\n float dir = step(deltaZ, 0.0);\n float z0 = mix(sourceZ, targetZ, dir);\n float r = mix(ratio, 1.0 - ratio, dir);\n return sqrt(r * (p2 - r)) * dh + z0;\n}\n\n// offset vector by strokeWidth pixels\n// offset_direction is -1 (left) or 1 (right)\nvec2 getExtrusionOffset(vec2 line_clipspace, float offset_direction, float width) {\n // normalized direction of the line\n vec2 dir_screenspace = normalize(line_clipspace * project_uViewportSize);\n // rotate by 90 degrees\n dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);\n\n return dir_screenspace * offset_direction * width / 2.0;\n}\n\nfloat getSegmentRatio(float index) {\n return smoothstep(0.0, 1.0, index / (numSegments - 1.0));\n}\n\nvec3 interpolateFlat(vec3 source, vec3 target, float segmentRatio) {\n float distance = length(source.xy - target.xy);\n float z = paraboloid(distance, source.z, target.z, segmentRatio);\n\n float tiltAngle = radians(instanceTilts);\n vec2 tiltDirection = normalize(target.xy - source.xy);\n vec2 tilt = vec2(-tiltDirection.y, tiltDirection.x) * z * sin(tiltAngle);\n\n return vec3(\n mix(source.xy, target.xy, segmentRatio) + tilt,\n z * cos(tiltAngle)\n );\n}\n\n/* Great circle interpolation\n * http://www.movable-type.co.uk/scripts/latlong.html\n */\nfloat getAngularDist (vec2 source, vec2 target) {\n vec2 sourceRadians = radians(source);\n vec2 targetRadians = radians(target);\n vec2 sin_half_delta = sin((sourceRadians - targetRadians) / 2.0);\n vec2 shd_sq = sin_half_delta * sin_half_delta;\n\n float a = shd_sq.y + cos(sourceRadians.y) * cos(targetRadians.y) * shd_sq.x;\n return 2.0 * asin(sqrt(a));\n}\n\nvec3 interpolateGreatCircle(vec3 source, vec3 target, vec3 source3D, vec3 target3D, float angularDist, float t) {\n vec2 lngLat;\n\n // if the angularDist is PI, linear interpolation is applied. otherwise, use spherical interpolation\n if(abs(angularDist - PI) < 0.001) {\n lngLat = (1.0 - t) * source.xy + t * target.xy;\n } else {\n float a = sin((1.0 - t) * angularDist);\n float b = sin(t * angularDist);\n vec3 p = source3D.yxz * a + target3D.yxz * b;\n lngLat = degrees(vec2(atan(p.y, -p.x), atan(p.z, length(p.xy))));\n }\n\n float z = paraboloid(angularDist * EARTH_RADIUS, source.z, target.z, t);\n\n return vec3(lngLat, z);\n}\n\n/* END GREAT CIRCLE */\n\nvoid main(void) {\n geometry.worldPosition = instanceSourcePositions;\n geometry.worldPositionAlt = instanceTargetPositions;\n\n float segmentIndex = positions.x;\n float segmentRatio = getSegmentRatio(segmentIndex);\n float prevSegmentRatio = getSegmentRatio(max(0.0, segmentIndex - 1.0));\n float nextSegmentRatio = getSegmentRatio(min(numSegments - 1.0, segmentIndex + 1.0));\n\n // if it's the first point, use next - current as direction\n // otherwise use current - prev\n float indexDir = mix(-1.0, 1.0, step(segmentIndex, 0.0));\n isValid = 1.0;\n\n uv = vec2(segmentRatio, positions.y);\n geometry.uv = uv;\n geometry.pickingColor = instancePickingColors;\n\n vec4 curr;\n vec4 next;\n vec3 source;\n vec3 target;\n\n if ((greatCircle || project_uProjectionMode == PROJECTION_MODE_GLOBE) && project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\n source = project_globe_(vec3(instanceSourcePositions.xy, 0.0));\n target = project_globe_(vec3(instanceTargetPositions.xy, 0.0));\n float angularDist = getAngularDist(instanceSourcePositions.xy, instanceTargetPositions.xy);\n\n vec3 prevPos = interpolateGreatCircle(instanceSourcePositions, instanceTargetPositions, source, target, angularDist, prevSegmentRatio);\n vec3 currPos = interpolateGreatCircle(instanceSourcePositions, instanceTargetPositions, source, target, angularDist, segmentRatio);\n vec3 nextPos = interpolateGreatCircle(instanceSourcePositions, instanceTargetPositions, source, target, angularDist, nextSegmentRatio);\n\n if (abs(currPos.x - prevPos.x) > 180.0) {\n indexDir = -1.0;\n isValid = 0.0;\n } else if (abs(currPos.x - nextPos.x) > 180.0) {\n indexDir = 1.0;\n isValid = 0.0;\n }\n nextPos = indexDir < 0.0 ? prevPos : nextPos;\n nextSegmentRatio = indexDir < 0.0 ? prevSegmentRatio : nextSegmentRatio;\n\n if (isValid == 0.0) {\n // split at the 180th meridian\n nextPos.x += nextPos.x > 0.0 ? -360.0 : 360.0;\n float t = ((currPos.x > 0.0 ? 180.0 : -180.0) - currPos.x) / (nextPos.x - currPos.x);\n currPos = mix(currPos, nextPos, t);\n segmentRatio = mix(segmentRatio, nextSegmentRatio, t);\n }\n\n vec3 currPos64Low = mix(instanceSourcePositions64Low, instanceTargetPositions64Low, segmentRatio);\n vec3 nextPos64Low = mix(instanceSourcePositions64Low, instanceTargetPositions64Low, nextSegmentRatio);\n \n curr = project_position_to_clipspace(currPos, currPos64Low, vec3(0.0), geometry.position);\n next = project_position_to_clipspace(nextPos, nextPos64Low, vec3(0.0));\n \n } else {\n vec3 source_world = instanceSourcePositions;\n vec3 target_world = instanceTargetPositions;\n if (useShortestPath) {\n source_world.x = mod(source_world.x + 180., 360.0) - 180.;\n target_world.x = mod(target_world.x + 180., 360.0) - 180.;\n\n float deltaLng = target_world.x - source_world.x;\n if (deltaLng > 180.) target_world.x -= 360.;\n if (deltaLng < -180.) source_world.x -= 360.;\n }\n source = project_position(source_world, instanceSourcePositions64Low);\n target = project_position(target_world, instanceTargetPositions64Low);\n\n // common x at longitude=-180\n float antiMeridianX = 0.0;\n\n if (useShortestPath) {\n if (project_uProjectionMode == PROJECTION_MODE_WEB_MERCATOR_AUTO_OFFSET) {\n antiMeridianX = -(project_uCoordinateOrigin.x + 180.) / 360. * TILE_SIZE;\n }\n float thresholdRatio = (antiMeridianX - source.x) / (target.x - source.x);\n\n if (prevSegmentRatio <= thresholdRatio && nextSegmentRatio > thresholdRatio) {\n isValid = 0.0;\n indexDir = sign(segmentRatio - thresholdRatio);\n segmentRatio = thresholdRatio;\n }\n }\n\n nextSegmentRatio = indexDir < 0.0 ? prevSegmentRatio : nextSegmentRatio;\n vec3 currPos = interpolateFlat(source, target, segmentRatio);\n vec3 nextPos = interpolateFlat(source, target, nextSegmentRatio);\n\n if (useShortestPath) {\n if (nextPos.x < antiMeridianX) {\n currPos.x += TILE_SIZE;\n nextPos.x += TILE_SIZE;\n }\n }\n\n curr = project_common_position_to_clipspace(vec4(currPos, 1.0));\n next = project_common_position_to_clipspace(vec4(nextPos, 1.0));\n geometry.position = vec4(currPos, 1.0);\n }\n\n // Multiply out width and clamp to limits\n // mercator pixels are interpreted as screen pixels\n float widthPixels = clamp(\n project_size_to_pixel(instanceWidths * widthScale, widthUnits),\n widthMinPixels, widthMaxPixels\n );\n\n // extrude\n vec3 offset = vec3(\n getExtrusionOffset((next.xy - curr.xy) * indexDir, positions.y, widthPixels),\n 0.0);\n DECKGL_FILTER_SIZE(offset, geometry);\n gl_Position = curr + vec4(project_pixel_size_to_clipspace(offset.xy), 0.0, 0.0);\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n vec4 color = mix(instanceSourceColors, instanceTargetColors, segmentRatio);\n vColor = vec4(color.rgb, color.a * opacity);\n DECKGL_FILTER_COLOR(vColor, geometry);\n}\n"; +export default _default; +// # sourceMappingURL=arc-layer-vertex.glsl.d.ts.map diff --git a/modules/layers/typed/arc-layer/arc-layer-vertex.glsl.d.ts.map b/modules/layers/typed/arc-layer/arc-layer-vertex.glsl.d.ts.map new file mode 100644 index 00000000000..a94e860e45a --- /dev/null +++ b/modules/layers/typed/arc-layer/arc-layer-vertex.glsl.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"arc-layer-vertex.glsl.d.ts","sourceRoot":"","sources":["../../src/arc-layer/arc-layer-vertex.glsl.ts"],"names":[],"mappings":";AAoBA,wBA2OE"} \ No newline at end of file diff --git a/modules/layers/typed/arc-layer/arc-layer.d.ts b/modules/layers/typed/arc-layer/arc-layer.d.ts new file mode 100644 index 00000000000..a766618b64f --- /dev/null +++ b/modules/layers/typed/arc-layer/arc-layer.d.ts @@ -0,0 +1,95 @@ +import { + Layer, + UpdateParameters, + LayerProps, + Unit, + AccessorFunction, + Position, + Accessor, + Color, + DefaultProps +} from '@deck.gl/core'; +import {Model} from '@luma.gl/webgl-legacy'; +/** All properties supported by ArcLayer. */ +export declare type ArcLayerProps = _ArcLayerProps & LayerProps; +/** Properties added by ArcLayer. */ +declare type _ArcLayerProps = { + /** + * If `true`, create the arc along the shortest path on the earth surface. + * @default false + */ + greatCircle?: boolean; + /** + * The units of the line width, one of `'meters'`, `'common'`, and `'pixels'` + * @default 'pixels' + */ + widthUnits?: Unit; + /** + * The scaling multiplier for the width of each line. + * @default 1 + */ + widthScale?: number; + /** + * The minimum line width in pixels. + * @default 0 + */ + widthMinPixels?: number; + /** + * The maximum line width in pixels. + * @default Number.MAX_SAFE_INTEGER + */ + widthMaxPixels?: number; + /** + * Method called to retrieve the source position of each object. + * @default object => object.sourcePosition + */ + getSourcePosition?: AccessorFunction; + /** + * Method called to retrieve the target position of each object. + * @default object => object.targetPosition + */ + getTargetPosition?: AccessorFunction; + /** + * The rgba color is in the format of `[r, g, b, [a]]`. + * @default [0, 0, 0, 255] + */ + getSourceColor?: Accessor; + /** + * The rgba color is in the format of `[r, g, b, [a]]`. + * @default [0, 0, 0, 255] + */ + getTargetColor?: Accessor; + /** + * The line width of each object, in units specified by `widthUnits`. + * @default 1 + */ + getWidth?: Accessor; + /** + * Multiplier of layer height. `0` will make the layer flat. + * @default 1 + */ + getHeight?: Accessor; + /** + * Use to tilt the arc to the side if you have multiple arcs with the same source and target positions. + * @default 0 + */ + getTilt?: Accessor; +}; +/** Render raised arcs joining pairs of source and target coordinates. */ +export default class ArcLayer extends Layer< + ExtraPropsT & Required<_ArcLayerProps> +> { + static layerName: string; + static defaultProps: DefaultProps>; + state: Layer['state'] & { + model?: Model; + }; + getShaders(): any; + get wrapLongitude(): boolean; + initializeState(): void; + updateState(opts: UpdateParameters): void; + draw({uniforms}: {uniforms: any}): void; + protected _getModel(): Model; +} +export {}; +// # sourceMappingURL=arc-layer.d.ts.map diff --git a/modules/layers/typed/arc-layer/arc-layer.d.ts.map b/modules/layers/typed/arc-layer/arc-layer.d.ts.map new file mode 100644 index 00000000000..90bdbe27fde --- /dev/null +++ b/modules/layers/typed/arc-layer/arc-layer.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"arc-layer.d.ts","sourceRoot":"","sources":["../../src/arc-layer/arc-layer.ts"],"names":[],"mappings":"AAoBA,OAAO,EACL,KAAK,EAIL,gBAAgB,EAChB,UAAU,EACV,IAAI,EACJ,gBAAgB,EAChB,QAAQ,EACR,QAAQ,EACR,KAAK,EACL,YAAY,EACb,MAAM,eAAe,CAAC;AAGvB,OAAO,EAAK,KAAK,EAAC,MAAM,uBAAuB,CAAC;AAwBhD,4CAA4C;AAC5C,oBAAY,aAAa,CAAC,KAAK,GAAG,GAAG,IAAI,cAAc,CAAC,KAAK,CAAC,GAAG,UAAU,CAAC,KAA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KAAK,CAAC;KACf,CAAC;IAEF,UAAU;IAKV,IAAI,aAAa,YAEhB;IAED,eAAe;IAyDf,WAAW,CAAC,IAAI,EAAE,gBAAgB,CAAC,IAAI,CAAC,GAAG,IAAI;IAU/C,IAAI,CAAC,EAAC,QAAQ,EAAC;;KAAA;IAiBf,SAAS,CAAC,SAAS,IAAI,KAAK;CA8B7B"} \ No newline at end of file diff --git a/modules/layers/typed/bitmap-layer/bitmap-layer-fragment.d.ts b/modules/layers/typed/bitmap-layer/bitmap-layer-fragment.d.ts new file mode 100644 index 00000000000..a012077faa4 --- /dev/null +++ b/modules/layers/typed/bitmap-layer/bitmap-layer-fragment.d.ts @@ -0,0 +1,3 @@ +declare const _default: string; +export default _default; +// # sourceMappingURL=bitmap-layer-fragment.d.ts.map diff --git a/modules/layers/typed/bitmap-layer/bitmap-layer-fragment.d.ts.map b/modules/layers/typed/bitmap-layer/bitmap-layer-fragment.d.ts.map new file mode 100644 index 00000000000..4c329dd053c --- /dev/null +++ b/modules/layers/typed/bitmap-layer/bitmap-layer-fragment.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"bitmap-layer-fragment.d.ts","sourceRoot":"","sources":["../../src/bitmap-layer/bitmap-layer-fragment.ts"],"names":[],"mappings":";AA0BA,wBA2FE"} \ No newline at end of file diff --git a/modules/layers/typed/bitmap-layer/bitmap-layer-vertex.d.ts b/modules/layers/typed/bitmap-layer/bitmap-layer-vertex.d.ts new file mode 100644 index 00000000000..81f5332595f --- /dev/null +++ b/modules/layers/typed/bitmap-layer/bitmap-layer-vertex.d.ts @@ -0,0 +1,3 @@ +declare const _default: '\n#define SHADER_NAME bitmap-layer-vertex-shader\n\nattribute vec2 texCoords;\nattribute vec3 positions;\nattribute vec3 positions64Low;\n\nvarying vec2 vTexCoord;\nvarying vec2 vTexPos;\n\nuniform float coordinateConversion;\n\nconst vec3 pickingColor = vec3(1.0, 0.0, 0.0);\n\nvoid main(void) {\n geometry.worldPosition = positions;\n geometry.uv = texCoords;\n geometry.pickingColor = pickingColor;\n\n gl_Position = project_position_to_clipspace(positions, positions64Low, vec3(0.0), geometry.position);\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n vTexCoord = texCoords;\n\n if (coordinateConversion < -0.5) {\n vTexPos = geometry.position.xy + project_uCommonOrigin.xy;\n } else if (coordinateConversion > 0.5) {\n vTexPos = geometry.worldPosition.xy;\n }\n\n vec4 color = vec4(0.0);\n DECKGL_FILTER_COLOR(color, geometry);\n}\n'; +export default _default; +// # sourceMappingURL=bitmap-layer-vertex.d.ts.map diff --git a/modules/layers/typed/bitmap-layer/bitmap-layer-vertex.d.ts.map b/modules/layers/typed/bitmap-layer/bitmap-layer-vertex.d.ts.map new file mode 100644 index 00000000000..d715ddee078 --- /dev/null +++ b/modules/layers/typed/bitmap-layer/bitmap-layer-vertex.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"bitmap-layer-vertex.d.ts","sourceRoot":"","sources":["../../src/bitmap-layer/bitmap-layer-vertex.ts"],"names":[],"mappings":";AAAA,wBAiCE"} \ No newline at end of file diff --git a/modules/layers/typed/bitmap-layer/bitmap-layer.d.ts b/modules/layers/typed/bitmap-layer/bitmap-layer.d.ts new file mode 100644 index 00000000000..55074ba63c0 --- /dev/null +++ b/modules/layers/typed/bitmap-layer/bitmap-layer.d.ts @@ -0,0 +1,101 @@ +import { + Layer, + CoordinateSystem, + LayerProps, + PickingInfo, + GetPickingInfoParams, + UpdateParameters, + Color, + Texture, + Position, + DefaultProps +} from '@deck.gl/core'; +import {Model} from '@luma.gl/webgl-legacy'; +/** All properties supported by BitmapLayer. */ +export declare type BitmapLayerProps = _BitmapLayerProps & LayerProps; +export declare type BitmapBoundingBox = + | [left: number, bottom: number, right: number, top: number] + | [Position, Position, Position, Position]; +/** Properties added by BitmapLayer. */ +declare type _BitmapLayerProps = { + /** + * The image to display. + * + * @default null + */ + image?: string | Texture | null; + /** + * Supported formats: + * - Coordinates of the bounding box of the bitmap `[left, bottom, right, top]` + * - Coordinates of four corners of the bitmap, should follow the sequence of `[[left, bottom], [left, top], [right, top], [right, bottom]]`. + * Each position could optionally contain a third component `z`. + * @default [1, 0, 0, 1] + */ + bounds?: BitmapBoundingBox; + /** + * > Note: this prop is experimental. + * + * Specifies how image coordinates should be geographically interpreted. + * @default COORDINATE_SYSTEM.DEFAULT + */ + _imageCoordinateSystem?: CoordinateSystem; + /** + * The desaturation of the bitmap. Between `[0, 1]`. + * @default 0 + */ + desaturate?: number; + /** + * The color to use for transparent pixels, in `[r, g, b, a]`. + * @default [0, 0, 0, 0] + */ + transparentColor?: Color; + /** + * The color to tint the bitmap by, in `[r, g, b]`. + * @default [255, 255, 255] + */ + tintColor?: Color; + /** Customize the [texture parameters](https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/texParameter). */ + textureParameters?: Record | null; +}; +/** Render a bitmap at specified boundaries. */ +export default class BitmapLayer extends Layer< + ExtraPropsT & Required<_BitmapLayerProps> +> { + static layerName: string; + static defaultProps: DefaultProps; + state: Layer['state'] & { + disablePicking?: boolean; + model?: Model; + mesh?: any; + coordinateConversion?: number; + bounds?: number[]; + }; + getShaders(): any; + initializeState(): void; + updateState({props, oldProps, changeFlags}: UpdateParameters): void; + getPickingInfo(params: GetPickingInfoParams): PickingInfo; + disablePickingIndex(): void; + restorePickingColors(): void; + protected _updateAutoHighlight(info: any): void; + protected _createMesh(): + | { + vertexCount: number; + positions: Float64Array; + indices: Uint16Array; + texCoords: Float32Array; + } + | { + vertexCount: number; + positions: Float64Array; + indices: Uint32Array; + texCoords: Float32Array; + }; + protected _getModel(): Model; + draw(opts: any): void; + _getCoordinateUniforms(): { + coordinateConversion: number; + bounds: number[]; + }; +} +export {}; +// # sourceMappingURL=bitmap-layer.d.ts.map diff --git a/modules/layers/typed/bitmap-layer/bitmap-layer.d.ts.map b/modules/layers/typed/bitmap-layer/bitmap-layer.d.ts.map new file mode 100644 index 00000000000..bf863dfe8f4 --- /dev/null +++ b/modules/layers/typed/b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AC,iBAAiB,CAAC,CAC1C;IACC,MAAM,CAAC,SAAS,SAAiB;IACjC,MAAM,CAAC,YAAY,iCAAgB;IAEnC,KAAK,EAAG,KAAK,CAAC,OAAO,CAAC,GAAG;QACvB,cAAc,CAAC,EAAE,OAAO,CAAC;QACzB,KAAK,CAAC,EAAE,KAAK,CAAC;QACd,IAAI,CAAC,EAAE,GAAG,CAAC;QACX,oBAAoB,CAAC,EAAE,MAAM,CAAC;QAC9B,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;KACnB,CAAC;IAEF,UAAU;IAIV,eAAe;IA4Bf,WAAW,CAAC,EAAC,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAC,EAAE,gBAAgB,CAAC,IAAI,CAAC,GAAG,IAAI;IAyBzE,cAAc,CAAC,MAAM,EAAE,oBAAoB,GAAG,WAAW;IAkCzD,mBAAmB;IAInB,oBAAoB;IAIpB,SAAS,CAAC,oBAAoB,CAAC,IAAI,KAAA;IAOnC,SAAS,CAAC,WAAW;;;;;;;;;;;IAwBrB,SAAS,CAAC,SAAS,IAAI,KAAK;IAsB5B,IAAI,CAAC,IAAI,KAAA;IA0BT,sBAAsB;;;;CAgCvB"} \ No newline at end of file diff --git a/modules/layers/typed/bitmap-layer/create-mesh.d.ts b/modules/layers/typed/bitmap-layer/create-mesh.d.ts new file mode 100644 index 00000000000..5aa3e08b5fa --- /dev/null +++ b/modules/layers/typed/bitmap-layer/create-mesh.d.ts @@ -0,0 +1,17 @@ +export default function createMesh( + bounds: any, + resolution: any +): + | { + vertexCount: number; + positions: Float64Array; + indices: Uint16Array; + texCoords: Float32Array; + } + | { + vertexCount: number; + positions: Float64Array; + indices: Uint32Array; + texCoords: Float32Array; + }; +// # sourceMappingURL=create-mesh.d.ts.map diff --git a/modules/layers/typed/bitmap-layer/create-mesh.d.ts.map b/modules/layers/typed/bitmap-layer/create-mesh.d.ts.map new file mode 100644 index 00000000000..c5dc3fc10a6 --- /dev/null +++ b/modules/layers/typed/bitmap-layer/create-mesh.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"create-mesh.d.ts","sourceRoot":"","sources":["../../src/bitmap-layer/create-mesh.ts"],"names":[],"mappings":"AAYA,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,MAAM,KAAA,EAAE,UAAU,KAAA;;;;;;;;;;EAsDpD"} \ No newline at end of file diff --git a/modules/layers/typed/column-layer/column-geometry.d.ts b/modules/layers/typed/column-layer/column-geometry.d.ts new file mode 100644 index 00000000000..777071dd81f --- /dev/null +++ b/modules/layers/typed/column-layer/column-geometry.d.ts @@ -0,0 +1,13 @@ +import {Geometry} from '@luma.gl/engine'; +declare type ColumnGeometryProps = { + id?: string; + radius: number; + height?: number; + nradial?: number; + vertices?: number[]; +}; +export default class ColumnGeometry extends Geometry { + constructor(props: ColumnGeometryProps); +} +export {}; +// # sourceMappingURL=column-geometry.d.ts.map diff --git a/modules/layers/typed/column-layer/column-geometry.d.ts.map b/modules/layers/typed/column-layer/column-geometry.d.ts.map new file mode 100644 index 00000000000..8632d222eed --- /dev/null +++ b/modules/layers/typed/column-layer/column-geometry.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"column-geometry.d.ts","sourceRoot":"","sources":["../../src/column-layer/column-geometry.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,QAAQ,EAAC,MAAM,iBAAiB,CAAC;AAIzC,aAAK,mBAAmB,GAAG;IACzB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACrB,CAAC;AAEF,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,QAAQ;gBACtC,KAAK,EAAE,mBAAmB;CAWvC"} \ No newline at end of file diff --git a/modules/layers/typed/column-layer/column-layer-fragment.glsl.d.ts b/modules/layers/typed/column-layer/column-layer-fragment.glsl.d.ts new file mode 100644 index 00000000000..bfa7b87d474 --- /dev/null +++ b/modules/layers/typed/column-layer/column-layer-fragment.glsl.d.ts @@ -0,0 +1,3 @@ +declare const _default: '#version 300 es\n#define SHADER_NAME column-layer-fragment-shader\n\nprecision highp float;\n\nuniform vec3 project_uCameraPosition;\nuniform bool extruded;\nuniform bool isStroke;\n\nout vec4 fragColor;\n\nin vec4 vColor;\n#ifdef FLAT_SHADING\nin vec4 position_commonspace;\n#endif\n\nvoid main(void) {\n fragColor = vColor;\n#ifdef FLAT_SHADING\n if (extruded && !isStroke && !picking_uActive) {\n vec3 normal = normalize(cross(dFdx(position_commonspace.xyz), dFdy(position_commonspace.xyz)));\n fragColor.rgb = lighting_getLightColor(vColor.rgb, project_uCameraPosition, position_commonspace.xyz, normal);\n }\n#endif\n DECKGL_FILTER_COLOR(fragColor, geometry);\n}\n'; +export default _default; +// # sourceMappingURL=column-layer-fragment.glsl.d.ts.map diff --git a/modules/layers/typed/column-layer/column-layer-fragment.glsl.d.ts.map b/modules/layers/typed/column-layer/column-layer-fragment.glsl.d.ts.map new file mode 100644 index 00000000000..d17f2ab7624 --- /dev/null +++ b/modules/layers/typed/column-layer/column-layer-fragment.glsl.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"column-layer-fragment.glsl.d.ts","sourceRoot":"","sources":["../../src/column-layer/column-layer-fragment.glsl.ts"],"names":[],"mappings":";AAoBA,wBA0BE"} \ No newline at end of file diff --git a/modules/layers/typed/column-layer/column-layer-vertex.glsl.d.ts b/modules/layers/typed/column-layer/column-layer-vertex.glsl.d.ts new file mode 100644 index 00000000000..4d206b5f7bf --- /dev/null +++ b/modules/layers/typed/column-layer/column-layer-vertex.glsl.d.ts @@ -0,0 +1,3 @@ +declare const _default: '#version 300 es\n\n#define SHADER_NAME column-layer-vertex-shader\n\nin vec3 positions;\nin vec3 normals;\n\nin vec3 instancePositions;\nin float instanceElevations;\nin vec3 instancePositions64Low;\nin vec4 instanceFillColors;\nin vec4 instanceLineColors;\nin float instanceStrokeWidths;\n\nin vec3 instancePickingColors;\n\n// Custom uniforms\nuniform float opacity;\nuniform float radius;\nuniform float angle;\nuniform vec2 offset;\nuniform bool extruded;\nuniform bool stroked;\nuniform bool isStroke;\nuniform float coverage;\nuniform float elevationScale;\nuniform float edgeDistance;\nuniform float widthScale;\nuniform float widthMinPixels;\nuniform float widthMaxPixels;\nuniform int radiusUnits;\nuniform int widthUnits;\n\n// Result\nout vec4 vColor;\n#ifdef FLAT_SHADING\nout vec4 position_commonspace;\n#endif\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n\n vec4 color = isStroke ? instanceLineColors : instanceFillColors;\n // rotate primitive position and normal\n mat2 rotationMatrix = mat2(cos(angle), sin(angle), -sin(angle), cos(angle));\n\n // calculate elevation, if 3d not enabled set to 0\n // cylindar gemoetry height are between -1.0 to 1.0, transform it to between 0, 1\n float elevation = 0.0;\n // calculate stroke offset\n float strokeOffsetRatio = 1.0;\n\n if (extruded) {\n elevation = instanceElevations * (positions.z + 1.0) / 2.0 * elevationScale;\n } else if (stroked) {\n float widthPixels = clamp(\n project_size_to_pixel(instanceStrokeWidths * widthScale, widthUnits),\n widthMinPixels, widthMaxPixels) / 2.0;\n float halfOffset = project_pixel_size(widthPixels) / project_size(edgeDistance * coverage * radius);\n if (isStroke) {\n strokeOffsetRatio -= sign(positions.z) * halfOffset;\n } else {\n strokeOffsetRatio -= halfOffset;\n }\n }\n\n // if alpha == 0.0 or z < 0.0, do not render element\n float shouldRender = float(color.a > 0.0 && instanceElevations >= 0.0);\n float dotRadius = radius * coverage * shouldRender;\n\n geometry.pickingColor = instancePickingColors;\n\n // project center of column\n vec3 centroidPosition = vec3(instancePositions.xy, instancePositions.z + elevation);\n vec3 centroidPosition64Low = instancePositions64Low;\n vec2 offset = (rotationMatrix * positions.xy * strokeOffsetRatio + offset) * dotRadius;\n if (radiusUnits == UNIT_METERS) {\n offset = project_size(offset);\n }\n vec3 pos = vec3(offset, 0.);\n DECKGL_FILTER_SIZE(pos, geometry);\n\n gl_Position = project_position_to_clipspace(centroidPosition, centroidPosition64Low, pos, geometry.position);\n geometry.normal = project_normal(vec3(rotationMatrix * normals.xy, normals.z));\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n // Light calculations\n if (extruded && !isStroke) {\n#ifdef FLAT_SHADING\n position_commonspace = geometry.position;\n vColor = vec4(color.rgb, color.a * opacity);\n#else\n vec3 lightColor = lighting_getLightColor(color.rgb, project_uCameraPosition, geometry.position.xyz, geometry.normal);\n vColor = vec4(lightColor, color.a * opacity);\n#endif\n } else {\n vColor = vec4(color.rgb, color.a * opacity);\n }\n DECKGL_FILTER_COLOR(vColor, geometry);\n}\n'; +export default _default; +// # sourceMappingURL=column-layer-vertex.glsl.d.ts.map diff --git a/modules/layers/typed/column-layer/column-layer-vertex.glsl.d.ts.map b/modules/layers/typed/column-layer/column-layer-vertex.glsl.d.ts.map new file mode 100644 index 00000000000..eae5c105123 --- /dev/null +++ b/modules/layers/typed/column-layer/column-layer-vertex.glsl.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"column-layer-vertex.glsl.d.ts","sourceRoot":"","sources":["../../src/column-layer/column-layer-vertex.glsl.ts"],"names":[],"mappings":";AAoBA,wBAoGE"} \ No newline at end of file diff --git a/modules/layers/typed/column-layer/column-layer.d.ts b/modules/layers/typed/column-layer/column-layer.d.ts new file mode 100644 index 00000000000..1be76f86ae6 --- /dev/null +++ b/modules/layers/typed/column-layer/column-layer.d.ts @@ -0,0 +1,176 @@ +import { + Layer, + LayerProps, + UpdateParameters, + Unit, + AccessorFunction, + Position, + Accessor, + Color, + Material, + DefaultProps +} from '@deck.gl/core'; +import {Model} from '@luma.gl/webgl-legacy'; +import ColumnGeometry from './column-geometry'; +/** All properties supported by ColumnLayer. */ +export declare type ColumnLayerProps = _ColumnLayerProps & LayerProps; +/** Properties added by ColumnLayer. */ +declare type _ColumnLayerProps = { + /** + * The number of sides to render the disk as. + * @default 20 + */ + diskResolution?: number; + /** + * isk size in units specified by `radiusUnits`. + * @default 1000 + */ + radius?: number; + /** + * Disk rotation, counter-clockwise in degrees. + * @default 0 + */ + angle?: number; + /** + * Replace the default geometry (regular polygon that fits inside the unit circle) with a custom one. + * @default null + */ + vertices: Position[] | null; + /** + * Disk offset from the position, relative to the radius. + * @default [0,0] + */ + offset?: [number, number]; + /** + * Radius multiplier, between 0 - 1 + * @default 1 + */ + coverage?: number; + /** + * Column elevation multiplier. + * @default 1 + */ + elevationScale?: number; + /** + * Whether to draw a filled column (solid fill). + * @default true + */ + filled?: boolean; + /** + * Whether to draw an outline around the disks. + * @default false + */ + stroked?: boolean; + /** + * Whether to extrude the columns. If set to `false`, all columns will be rendered as flat polygons. + * @default true + */ + extruded?: boolean; + /** + * Whether to generate a line wireframe of the column. + * @default false + */ + wireframe?: boolean; + /** + * If `true`, the vertical surfaces of the columns use [flat shading](https://en.wikipedia.org/wiki/Shading#Flat_vs._smooth_shading). + * @default false + */ + flatShading?: boolean; + /** + * The units of the radius. + * @default 'meters' + */ + radiusUnits?: Unit; + /** + * The units of the line width. + * @default 'meters' + */ + lineWidthUnits?: Unit; + /** + * The line width multiplier that multiplied to all outlines. + * @default 1 + */ + lineWidthScale?: number; + /** + * The minimum outline width in pixels. + * @default 0 + */ + lineWidthMinPixels?: number; + /** + * The maximum outline width in pixels. + * @default Number.MAX_SAFE_INTEGER + */ + lineWidthMaxPixels?: number; + /** + * Material settings for lighting effect. Applies if `extruded: true`. + * + * @default true + * @see https://deck.gl/docs/developer-guide/using-lighting + */ + material?: Material; + /** + * Method called to retrieve the position of each column. + * @default object => object.position + */ + getPosition?: AccessorFunction; + /** + * @deprecated Use getFilledColor and getLineColor instead + */ + getColor?: Accessor; + /** + * Fill collor value or accessor. + * @default [0, 0, 0, 255] + */ + getFillColor?: Accessor; + /** + * Line color value or accessor. + * + * @default [0, 0, 0, 255] + */ + getLineColor?: Accessor; + /** + * The elevation of each cell in meters. + * @default 1000 + */ + getElevation?: Accessor; + /** + * The width of the outline of the column, in units specified by `lineWidthUnits`. + * + * @default 1 + */ + getLineWidth?: Accessor; +}; +/** Render extruded cylinders (tessellated regular polygons) at given coordinates. */ +export default class ColumnLayer extends Layer< + ExtraPropsT & Required<_ColumnLayerProps> +> { + static layerName: string; + static defaultProps: DefaultProps>; + getShaders(): any; + /** + * DeckGL calls initializeState when GL context is available + * Essentially a deferred constructor + */ + initializeState(): void; + updateState(params: UpdateParameters): void; + getGeometry( + diskResolution: number, + vertices: number[] | undefined, + hasThinkness: boolean + ): ColumnGeometry; + protected _getModel(): Model; + protected _updateGeometry({ + diskResolution, + vertices, + extruded, + stroked + }: { + diskResolution: any; + vertices: any; + extruded: any; + stroked: any; + }): void; + draw({uniforms}: {uniforms: any}): void; +} +export {}; +// # sourceMappingURL=column-layer.d.ts.map diff --git a/modules/layers/typed/column-layer/column-layer.d.ts.map b/modules/layers/typed/column-layer/column-layer.d.ts.map new file mode 100644 index 00000000000..7518f5b50b9 --- /dev/null +++ b/modules/layers/typed/column-layer/column-layer.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"column-layer.d.ts","sourceRoot":"","sources":["../../src/column-layer/column-layer.ts"],"names":[],"mappings":"AAoBA,OAAO,EACL,KAAK,EAML,UAAU,EACV,gBAAgB,EAChB,IAAI,EACJ,gBAAgB,EAChB,QAAQ,EACR,QAAQ,EACR,KAAK,EACL,QAAQ,EACR,YAAY,EACb,MAAM,eAAe,CAAC;AACvB,OAAO,EAAK,KAAK,EAAuB,MAAM,uBAAuB,CAAC;AACtE,OAAO,cAAc,MAAM,mBAAmB,CAAC;AAmC/C,+CAA+C;AAC/C,oBAAY,gBAAgB,CAAC,KAAK,GAAG,GAAG,IAAI,iBAAiB,CAAC,KAAK,CAAC,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC;AAEzF,uCAAuC;AACvC,aAAK,iBAAiB,CAAC,KAAK,IAAI;IAC9B;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;I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AEtC;;;OAGG;IACH,YAAY,CAAC,EAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IAEvC;;;;OAIG;IACH,YAAY,CAAC,EAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;CACxC,CAAC;AAEF,qFAAqF;AACrF,MAAM,CAAC,OAAO,OAAO,WAAW,CAAC,KAAK,GAAG,GAAG,EAAE,WAAW,GAAG,EAAE,CAAE,SAAQ,KAAK,CAC3E,WAAW,GAAG,QAAQ,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC,CACjD;IACC,MAAM,CAAC,SAAS,SAAiB;IACjC,MAAM,CAAC,YAAY,sCAAgB;IAEnC,UAAU;IAkBV;;;OAGG;IACH,eAAe;IAyCf,WAAW,CAAC,MAAM,EAAE,gBAAgB,CAAC,IAAI,CAAC,GAAG,IAAI;IAuBjD,WAAW,CAAC,cAAc,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,SAAS,EAAE,YAAY,EAAE,OAAO;IAyBzF,SAAS,CAAC,SAAS,IAAI,KAAK;IAQ5B,SAAS,CAAC,eAAe,CAAC,EAAC,cAAc,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAC;;;;;KAAA;IAWvE,IAAI,CAAC,EAAC,QAAQ,EAAC;;KAAA;CAgEhB"} \ No newline at end of file diff --git a/modules/layers/typed/column-layer/grid-cell-layer.d.ts b/modules/layers/typed/column-layer/grid-cell-layer.d.ts new file mode 100644 index 00000000000..88e4488c63b --- /dev/null +++ b/modules/layers/typed/column-layer/grid-cell-layer.d.ts @@ -0,0 +1,23 @@ +import type {DefaultProps} from '@deck.gl/core'; +import {CubeGeometry} from '@luma.gl/engine'; +import ColumnLayer, {ColumnLayerProps} from './column-layer'; +/** All properties supported by GridCellLayer. */ +export declare type GridCellLayerProps = _GridCellLayerProps & ColumnLayerProps; +/** Properties added by GridCellLayer. */ +declare type _GridCellLayerProps = { + /** + * @default 1000 + */ + cellSize?: number; +}; +export default class GridCellLayer extends ColumnLayer< + DataT, + ExtraPropsT & Required<_GridCellLayerProps> +> { + static layerName: string; + static defaultProps: DefaultProps>; + getGeometry(diskResolution: any): CubeGeometry; + draw({uniforms}: {uniforms: any}): void; +} +export {}; +// # sourceMappingURL=grid-cell-layer.d.ts.map diff --git a/modules/layers/typed/column-layer/grid-cell-layer.d.ts.map b/modules/layers/typed/column-layer/grid-cell-layer.d.ts.map new file mode 100644 index 00000000000..716b29af901 --- /dev/null +++ b/modules/layers/typed/column-layer/grid-cell-layer.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"grid-cell-layer.d.ts","sourceRoot":"","sources":["../../src/column-layer/grid-cell-layer.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,eAAe,CAAC;AAEhD,OAAO,EAAC,YAAY,EAAC,MAAM,iBAAiB,CAAC;AAC7C,OAAO,WAAW,EAAE,EAAC,gBAAgB,EAAC,MAAM,gBAAgB,CAAC;AAO7D,iDAAiD;AACjD,oBAAY,kBAAkB,CAAC,KAAK,GAAG,GAAG,IAAI,mBAAmB,GAAG,gBAAgB,CAAC,KAAK,CAAC,CAAC;AAE5F,yCAAyC;AACzC,aAAK,mBAAmB,GAAG;IACzB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,CAAC,OAAO,OAAO,aAAa,CAAC,KAAK,GAAG,GAAG,EAAE,WAAW,GAAG,EAAE,CAAE,SAAQ,WAAW,CACnF,KAAK,EACL,WAAW,GAAG,QAAQ,CAAC,mBAAmB,CAAC,CAC5C;IACC,MAAM,CAAC,SAAS,SAAmB;IACnC,MAAM,CAAC,YAAY,wCAAgB;IAEnC,WAAW,CAAC,cAAc,KAAA;IAI1B,IAAI,CAAC,EAAC,QAAQ,EAAC;;KAAA;CAiBhB"} \ No newline at end of file diff --git a/modules/layers/typed/geojson-layer/geojson-binary.d.ts b/modules/layers/typed/geojson-layer/geojson-binary.d.ts new file mode 100644 index 00000000000..19f56debcf8 --- /dev/null +++ b/modules/layers/typed/geojson-layer/geojson-binary.d.ts @@ -0,0 +1,25 @@ +import { + BinaryFeatures, + BinaryLineFeatures, + BinaryPointFeatures, + BinaryPolygonFeatures, + Feature +} from '@loaders.gl/schema'; +export declare type BinaryFeatureTypes = + | BinaryPointFeatures + | BinaryLineFeatures + | BinaryPolygonFeatures; +declare type FeaureOnlyProperties = Pick; +/** + * Return the feature for an accesor + */ +export declare function binaryToFeatureForAccesor( + data: BinaryFeatureTypes, + index: number +): FeaureOnlyProperties | null; +export declare function calculatePickingColors( + geojsonBinary: BinaryFeatures, + encodePickingColor: (id: number, result: number[]) => void +): Record; +export {}; +// # sourceMappingURL=geojson-binary.d.ts.map diff --git a/modules/layers/typed/geojson-layer/geojson-binary.d.ts.map b/modules/layers/typed/geojson-layer/geojson-binary.d.ts.map new file mode 100644 index 00000000000..c5279975836 --- /dev/null +++ b/modules/layers/typed/geojson-layer/geojson-binary.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"geojson-binary.d.ts","sourceRoot":"","sources":["../../src/geojson-layer/geojson-binary.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,mBAAmB,EACnB,qBAAqB,EACrB,OAAO,EACR,MAAM,oBAAoB,CAAC;AAE5B,oBAAY,kBAAkB,GAAG,mBAAmB,GAAG,kBAAkB,GAAG,qBAAqB,CAAC;AAElG,aAAK,oBAAoB,GAAG,IAAI,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;AAExD;;GAEG;AACH,wBAAgB,yBAAyB,CACvC,IAAI,EAAE,kBAAkB,EACxB,KAAK,EAAE,MAAM,GACZ,oBAAoB,GAAG,IAAI,CAa7B;AAmBD,wBAAgB,sBAAsB,CACpC,aAAa,EAAE,cAAc,EAC7B,kBAAkB,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,IAAI,GACzD,MAAM,CAAC,MAAM,EAAE,iBAAiB,GAAG,IAAI,CAAC,CAmB1C"} \ No newline at end of file diff --git a/modules/layers/typed/geojson-layer/geojson-layer-props.d.ts b/modules/layers/typed/geojson-layer/geojson-layer-props.d.ts new file mode 100644 index 00000000000..c703085344b --- /dev/null +++ b/modules/layers/typed/geojson-layer/geojson-layer-props.d.ts @@ -0,0 +1,26 @@ +import {BinaryAttribute, LayerProps} from '@deck.gl/core'; +import {PolygonLayerProps, ScatterplotLayerProps} from '..'; +import {BinaryFeatures} from '@loaders.gl/schema'; +import {SeparatedGeometries} from './geojson'; +declare type PathLayerProps = LayerProps & Record; +declare type SubLayersProps = { + points: Partial; + lines: Partial; + polygons: Partial; + polygonsOutline: Partial; +}; +declare type ExtendedBinaryFeatures = { + [P in keyof BinaryFeatures]: BinaryFeatures[P] & { + attributes?: Record; + }; +}; +export declare function createLayerPropsFromFeatures( + features: SeparatedGeometries, + featuresDiff: any +): SubLayersProps; +export declare function createLayerPropsFromBinary( + geojsonBinary: Required, + encodePickingColor: any +): SubLayersProps; +export {}; +// # sourceMappingURL=geojson-layer-props.d.ts.map diff --git a/modules/layers/typed/geojson-layer/geojson-layer-props.d.ts.map b/modules/layers/typed/geojson-layer/geojson-layer-props.d.ts.map new file mode 100644 index 00000000000..371e03480cb --- /dev/null +++ b/modules/layers/typed/geojson-layer/geojson-layer-props.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"geojson-layer-props.d.ts","sourceRoot":"","sources":["../../src/geojson-layer/geojson-layer-props.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,eAAe,EAAa,UAAU,EAAC,MAAM,eAAe,CAAC;AACrE,OAAO,EAAC,iBAAiB,EAAE,qBAAqB,EAAC,MAAM,IAAI,CAAC;AAE5D,OAAO,EAAC,cAAc,EAAC,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAC,mBAAmB,EAAC,MAAM,WAAW,CAAC;AAG9C,aAAK,cAAc,GAAG,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AAEvD,aAAK,cAAc,GAAG;IACpB,MAAM,EAAE,OAAO,CAAC,qBAAqB,CAAC,CAAC;IACvC,KAAK,EAAE,OAAO,CAAC,cAAc,CAAC,CAAC;IAC/B,QAAQ,EAAE,OAAO,CAAC,iBAAiB,CAAC,CAAC;IACrC,eAAe,EAAE,OAAO,CAAC,cAAc,CAAC,CAAC;CAC1C,CAAC;AAEF,aAAK,sBAAsB,GAAG;KAC3B,CAAC,IAAI,MAAM,cAAc,GAAG,cAAc,CAAC,CAAC,CAAC,GAAG;QAAC,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAA;KAAC;CAChG,CAAC;AAeF,wBAAgB,4BAA4B,CAC1C,QAAQ,EAAE,mBAAmB,EAC7B,YAAY,KAAA,GACX,cAAc,CAuBhB;AAED,wBAAgB,0BAA0B,CACxC,aAAa,EAAE,QAAQ,CAAC,sBAAsB,CAAC,EAC/C,kBAAkB,KAAA,GACjB,cAAc,CAgFhB"} \ No newline at end of file diff --git a/modules/layers/typed/geojson-layer/geojson-layer.d.ts b/modules/layers/typed/geojson-layer/geojson-layer.d.ts new file mode 100644 index 00000000000..7538822ac9a --- /dev/null +++ b/modules/layers/typed/geojson-layer/geojson-layer.d.ts @@ -0,0 +1,267 @@ +import { + Accessor, + Color, + CompositeLayer, + CompositeLayerProps, + Layer, + PickingInfo, + Unit, + Material, + UpdateParameters, + DefaultProps +} from '@deck.gl/core'; +import type {Feature} from 'geojson'; +/** All properties supported by GeoJsonLayer */ +export declare type GeoJsonLayerProps = _GeoJsonLayerProps & + CompositeLayerProps; +/** Properties added by GeoJsonLayer */ +export declare type _GeoJsonLayerProps = { + /** + * How to render Point and MultiPoint features in the data. + * + * Supported types are: + * * `'circle'` + * * `'icon'` + * * `'text'` + * + * @default 'circle' + */ + pointType?: string; +} & _GeoJsonLayerFillProps & + _GeoJsonLayerStrokeProps & + _GeoJsonLayer3DProps & + _GeoJsonLayerPointCircleProps & + _GeojsonLayerIconPointProps & + _GeojsonLayerTextPointProps; +/** GeoJsonLayer fill options. */ +declare type _GeoJsonLayerFillProps = { + /** + * Whether to draw a filled polygon (solid fill). + * + * Note that only the area between the outer polygon and any holes will be filled. + * + * @default true + */ + filled?: boolean; + /** + * Fill collor value or accessor. + * + * @default [0, 0, 0, 255] + */ + getFillColor?: Accessor; +}; +/** GeoJsonLayer stroke options. */ +declare type _GeoJsonLayerStrokeProps = { + /** + * Whether to draw an outline around the polygon (solid fill). + * + * Note that both the outer polygon as well the outlines of any holes will be drawn. + * + * @default true + */ + stroked?: boolean; + /** + * Line color value or accessor. + * + * @default [0, 0, 0, 255] + */ + getLineColor?: Accessor; + /** + * Line width value or accessor. + * + * @default [0, 0, 0, 255] + */ + getLineWidth?: Accessor; + /** + * The units of the line width, one of `meters`, `common`, and `pixels`. + * + * @default 'meters' + * @see Unit. + */ + lineWidthUnits?: Unit; + /** + * A multiplier that is applied to all line widths + * + * @default 1 + */ + lineWidthScale?: number; + /** + * The minimum line width in pixels. + * + * @default 0 + */ + lineWidthMinPixels?: number; + /** + * The maximum line width in pixels + * + * @default Number.MAX_SAFE_INTEGER + */ + lineWidthMaxPixels?: number; + /** + * Type of joint. If `true`, draw round joints. Otherwise draw miter joints. + * + * @default false + */ + lineJointRounded?: boolean; + /** + * The maximum extent of a joint in ratio to the stroke width. + * + * Only works if `lineJointRounded` is false. + * + * @default 4 + */ + lineMiterLimit?: number; + /** + * Type of line caps. + * + * If `true`, draw round caps. Otherwise draw square caps. + * + * @default false + */ + lineCapRounded?: boolean; + /** + * If `true`, extrude the line in screen space (width always faces the camera). + * If `false`, the width always faces up. + * + * @default false + */ + lineBillboard?: boolean; +}; +/** GeoJsonLayer 3D options. */ +declare type _GeoJsonLayer3DProps = { + /** + * Extrude Polygon and MultiPolygon features along the z-axis if set to true + * + * Based on the elevations provided by the `getElevation` accessor. + * + * @default false + */ + extruded?: boolean; + /** + * Whether to generate a line wireframe of the hexagon. + * + * @default false + */ + wireframe?: boolean; + /** + * (Experimental) This prop is only effective with `XYZ` data. + * When true, polygon tesselation will be performed on the plane with the largest area, instead of the xy plane. + * @default false + */ + _full3d?: boolean; + /** + * Elevation valur or accessor. + * + * Only used if `extruded: true`. + * + * @default 1000 + */ + getElevation?: Accessor; + /** + * Elevation multiplier. + * + * The final elevation is calculated by `elevationScale * getElevation(d)`. + * `elevationScale` is a handy property to scale all elevation without updating the data. + * + * @default 1 + */ + elevationScale?: boolean; + /** + * Material settings for lighting effect. Applies to extruded polgons. + * + * @default true + * @see https://deck.gl/docs/developer-guide/using-lighting + */ + material?: Material; +}; +/** GeoJsonLayer Properties forwarded to `ScatterPlotLayer` if `pointType` is `'circle'` */ +export declare type _GeoJsonLayerPointCircleProps = { + getPointRadius?: Accessor; + pointRadiusUnits?: Unit; + pointRadiusScale?: number; + pointRadiusMinPixels?: number; + pointRadiusMaxPixels?: number; + pointAntialiasing?: boolean; + pointBillboard?: boolean; + /** @deprecated use getPointRadius */ + getRadius?: Accessor; +}; +/** GeoJsonLayer properties forwarded to `IconLayer` if `pointType` is `'icon'` */ +declare type _GeojsonLayerIconPointProps = { + iconAtlas?: any; + iconMapping?: any; + getIcon?: Accessor; + getIconSize?: Accessor; + getIconColor?: Accessor; + getIconAngle?: Accessor; + getIconPixelOffset?: Accessor; + iconSizeUnits?: Unit; + iconSizeScale?: number; + iconSizeMinPixels?: number; + iconSizeMaxPixels?: number; + iconBillboard?: boolean; + iconAlphaCutoff?: number; +}; +/** GeoJsonLayer properties forwarded to `TextLayer` if `pointType` is `'text'` */ +declare type _GeojsonLayerTextPointProps = { + getText?: Accessor; + getTextColor?: Accessor; + getTextAngle?: Accessor; + getTextSize?: Accessor; + getTextAnchor?: Accessor; + getTextAlignmentBaseline?: Accessor; + getTextPixelOffset?: Accessor; + getTextBackgroundColor?: Accessor; + getTextBorderColor?: Accessor; + getTextBorderWidth?: Accessor; + textSizeUnits?: Unit; + textSizeScale?: number; + textSizeMinPixels?: number; + textSizeMaxPixels?: number; + textCharacterSet?: any; + textFontFamily?: string; + textFontWeight?: number; + textLineHeight?: number; + textMaxWidth?: number; + textWordBreak?: string; + textBackground?: boolean; + textBackgroundPadding?: number[]; + textOutlineColor?: Color; + textOutlineWidth?: number; + textBillboard?: boolean; + textFontSettings?: any; +}; +declare type GeoJsonPickingInfo = PickingInfo & { + featureType?: string | null; + info?: any; +}; +/** Render GeoJSON formatted data as polygons, lines and points (circles, icons and/or texts). */ +export default class GeoJsonLayer< + DataT extends Feature = Feature, + ExtraProps = {} +> extends CompositeLayer> & ExtraProps> { + static layerName: string; + static defaultProps: DefaultProps< + GeoJsonLayerProps< + Feature< + import('geojson').Geometry, + { + [name: string]: any; + } + > + > + >; + initializeState(): void; + updateState({props, changeFlags}: UpdateParameters): void; + private _updateStateBinary; + private _updateStateJSON; + getPickingInfo(params: any): GeoJsonPickingInfo; + _updateAutoHighlight(info: GeoJsonPickingInfo): void; + private _renderPolygonLayer; + private _renderLineLayers; + private _renderPointLayers; + renderLayers(): (Layer<{}> | (false | Layer<{}>)[])[]; + protected getSubLayerAccessor(accessor: Accessor): Accessor; +} +export {}; +// # sourceMappingURL=geojson-layer.d.ts.map diff --git a/modules/layers/typed/geojson-layer/geojson-layer.d.ts.map b/modules/layers/typed/geojson-layer/geojson-layer.d.ts.map new file mode 100644 index 00000000000..0ee2cdddfe3 --- /dev/null +++ b/modules/layers/typed/geojson-layer/geojson-layer.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"geojson-layer.d.ts","sourceRoot":"","sources":["../../src/geojson-layer/geojson-layer.ts"],"names":[],"mappings":"AAoBA,OAAO,EACL,QAAQ,EACR,KAAK,EACL,cAAc,EACd,mBAAmB,EACnB,KAAK,EACL,WAAW,EACX,IAAI,EACJ,QAAQ,EACR,gBAAgB,EAEhB,YAAY,EACb,MAAM,eAAe,CAAC;AAGvB,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,SAAS,CAAC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xB,cAAc,CAAC,MAAM,KAAA,GAAG,kBAAkB;IAU1C,oBAAoB,CAAC,IAAI,EAAE,kBAAkB,GAAG,IAAI;IAYpD,OAAO,CAAC,mBAAmB;IA+B3B,OAAO,CAAC,iBAAiB;IA2CzB,OAAO,CAAC,kBAAkB;IAoD1B,YAAY;IAiBZ,SAAS,CAAC,mBAAmB,CAAC,EAAE,EAAE,GAAG,EAAE,QAAQ,EAAE,QAAQ,CAAC,EAAE,EAAE,GAAG,CAAC,GAAG,QAAQ,CAAC,EAAE,EAAE,GAAG,CAAC;CAavF"} \ No newline at end of file diff --git a/modules/layers/typed/geojson-layer/geojson.d.ts b/modules/layers/typed/geojson-layer/geojson.d.ts new file mode 100644 index 00000000000..a5edefeb642 --- /dev/null +++ b/modules/layers/typed/geojson-layer/geojson.d.ts @@ -0,0 +1,38 @@ +import type {Feature, GeoJSON, GeoJsonGeometryTypes, LineString, Point, Polygon} from 'geojson'; +export declare type SeparatedGeometries = { + pointFeatures: { + geometry: Point; + }[]; + lineFeatures: { + geometry: LineString; + }[]; + polygonFeatures: { + geometry: Polygon; + }[]; + polygonOutlineFeatures: { + geometry: LineString; + }[]; +}; +/** + * "Normalizes" complete or partial GeoJSON data into iterable list of features + * Can accept GeoJSON geometry or "Feature", "FeatureCollection" in addition + * to plain arrays and iterables. + * Works by extracting the feature array or wrapping single objects in an array, + * so that subsequent code can simply iterate over features. + * + * @param {object} geojson - geojson data + * @param {Object|Array} data - geojson object (FeatureCollection, Feature or + * Geometry) or array of features + * @return {Array|"iteratable"} - iterable list of features + */ +export declare function getGeojsonFeatures(geojson: GeoJSON): Feature[]; +export declare function separateGeojsonFeatures( + features: Feature[], + wrapFeature: (row: T, sourceObject: any, sourceObjectIndex: number) => T, + dataRange?: { + startRow?: number; + endRow?: number; + } +): SeparatedGeometries; +export declare function validateGeometry(type: GeoJsonGeometryTypes, coordinates: any): boolean; +// # sourceMappingURL=geojson.d.ts.map diff --git a/modules/layers/typed/geojson-layer/geojson.d.ts.map b/modules/layers/typed/geojson-layer/geojson.d.ts.map new file mode 100644 index 00000000000..e7feb946eb7 --- /dev/null +++ b/modules/layers/typed/geojson-layer/geojson.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"geojson.d.ts","sourceRoot":"","sources":["../../src/geojson-layer/geojson.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EACV,OAAO,EACP,OAAO,EACP,oBAAoB,EACpB,UAAU,EAIV,KAAK,EACL,OAAO,EACR,MAAM,SAAS,CAAC;AAIjB,oBAAY,mBAAmB,GAAG;IAChC,aAAa,EAAE;QAAC,QAAQ,EAAE,KAAK,CAAA;KAAC,EAAE,CAAC;IACnC,YAAY,EAAE;QAAC,QAAQ,EAAE,UAAU,CAAA;KAAC,EAAE,CAAC;IACvC,eAAe,EAAE;QAAC,QAAQ,EAAE,OAAO,CAAA;KAAC,EAAE,CAAC;IACvC,sBAAsB,EAAE;QAAC,QAAQ,EAAE,UAAU,CAAA;KAAC,EAAE,CAAC;CAClD,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,EAAE,CAqB9D;AAGD,wBAAgB,uBAAuB,CACrC,QAAQ,EAAE,OAAO,EAAE,EACnB,WAAW,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,YAAY,EAAE,GAAG,EAAE,iBAAiB,EAAE,MAAM,KAAK,CAAC,EAC3E,SAAS,GAAE;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAM,GACnD,mBAAmB,CAqCrB;AAyID,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,oBAAoB,EAAE,WAAW,EAAE,GAAG,GAAG,OAAO,CAUtF"} \ No newline at end of file diff --git a/modules/layers/typed/geojson-layer/sub-layer-map.d.ts b/modules/layers/typed/geojson-layer/sub-layer-map.d.ts new file mode 100644 index 00000000000..fc2aee1666b --- /dev/null +++ b/modules/layers/typed/geojson-layer/sub-layer-map.d.ts @@ -0,0 +1,119 @@ +import {CompositeLayer, Layer} from '@deck.gl/core'; +import IconLayer from '../icon-layer/icon-layer'; +import ScatterplotLayer from '../scatterplot-layer/scatterplot-layer'; +import TextLayer from '../text-layer/text-layer'; +import PathLayer from '../path-layer/path-layer'; +import SolidPolygonLayer from '../solid-polygon-layer/solid-polygon-layer'; +export declare const POINT_LAYER: { + circle: { + type: typeof ScatterplotLayer; + props: { + filled: string; + stroked: string; + lineWidthMaxPixels: string; + lineWidthMinPixels: string; + lineWidthScale: string; + lineWidthUnits: string; + pointRadiusMaxPixels: string; + pointRadiusMinPixels: string; + pointRadiusScale: string; + pointRadiusUnits: string; + pointAntialiasing: string; + pointBillboard: string; + getFillColor: string; + getLineColor: string; + getLineWidth: string; + getPointRadius: string; + }; + }; + icon: { + type: typeof IconLayer; + props: { + iconAtlas: string; + iconMapping: string; + iconSizeMaxPixels: string; + iconSizeMinPixels: string; + iconSizeScale: string; + iconSizeUnits: string; + iconAlphaCutoff: string; + iconBillboard: string; + getIcon: string; + getIconAngle: string; + getIconColor: string; + getIconPixelOffset: string; + getIconSize: string; + }; + }; + text: { + type: typeof TextLayer; + props: { + textSizeMaxPixels: string; + textSizeMinPixels: string; + textSizeScale: string; + textSizeUnits: string; + textBackground: string; + textBackgroundPadding: string; + textFontFamily: string; + textFontWeight: string; + textLineHeight: string; + textMaxWidth: string; + textOutlineColor: string; + textOutlineWidth: string; + textWordBreak: string; + textCharacterSet: string; + textBillboard: string; + textFontSettings: string; + getText: string; + getTextAngle: string; + getTextColor: string; + getTextPixelOffset: string; + getTextSize: string; + getTextAnchor: string; + getTextAlignmentBaseline: string; + getTextBackgroundColor: string; + getTextBorderColor: string; + getTextBorderWidth: string; + }; + }; +}; +export declare const LINE_LAYER: { + type: typeof PathLayer; + props: { + lineWidthUnits: string; + lineWidthScale: string; + lineWidthMinPixels: string; + lineWidthMaxPixels: string; + lineJointRounded: string; + lineCapRounded: string; + lineMiterLimit: string; + lineBillboard: string; + getLineColor: string; + getLineWidth: string; + }; +}; +export declare const POLYGON_LAYER: { + type: typeof SolidPolygonLayer; + props: { + extruded: string; + filled: string; + wireframe: string; + elevationScale: string; + material: string; + _full3d: string; + getElevation: string; + getFillColor: string; + getLineColor: string; + }; +}; +export declare function getDefaultProps({ + type, + props +}: { + type: typeof Layer; + props: Record; +}): Record; +export declare function forwardProps( + layer: CompositeLayer, + mapping: Record +): Record; +// # sourceMappingURL=sub-layer-map.d.ts.map diff --git a/modules/layers/typed/geojson-layer/sub-layer-map.d.ts.map b/modules/layers/typed/geojson-layer/sub-layer-map.d.ts.map new file mode 100644 index 00000000000..ff00465ee2a --- /dev/null +++ b/modules/layers/typed/geojson-layer/sub-layer-map.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"sub-layer-map.d.ts","sourceRoot":"","sources":["../../src/geojson-layer/sub-layer-map.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAE,KAAK,EAAC,MAAM,eAAe,CAAC;AAEpD,OAAO,SAAS,MAAM,0BAA0B,CAAC;AACjD,OAAO,gBAAgB,MAAM,wCAAwC,CAAC;AACtE,OAAO,SAAS,MAAM,0BAA0B,CAAC;AACjD,OAAO,SAAS,MAAM,0BAA0B,CAAC;AACjD,OAAO,iBAAiB,MAAM,4CAA4C,CAAC;AAE3E,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6EvB,CAAC;AAEF,eAAO,MAAM,UAAU;;;;;;;;;;;;;;CAetB,CAAC;AAEF,eAAO,MAAM,aAAa;;;;;;;;;;;;;CAczB,CAAC;AAEF,wBAAgB,eAAe,CAAC,EAC9B,IAAI,EACJ,KAAK,EACN,EAAE;IACD,IAAI,EAAE,OAAO,KAAK,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC/B,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAMtB;AAED,wBAAgB,YAAY,CAC1B,KAAK,EAAE,cAAc,EACrB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC9B,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAuBrB"} \ No newline at end of file diff --git a/modules/layers/typed/icon-layer/icon-layer-fragment.glsl.d.ts b/modules/layers/typed/icon-layer/icon-layer-fragment.glsl.d.ts new file mode 100644 index 00000000000..f34ffa69558 --- /dev/null +++ b/modules/layers/typed/icon-layer/icon-layer-fragment.glsl.d.ts @@ -0,0 +1,3 @@ +declare const _default: '#define SHADER_NAME icon-layer-fragment-shader\n\nprecision highp float;\n\nuniform float opacity;\nuniform sampler2D iconsTexture;\nuniform float alphaCutoff;\n\nvarying float vColorMode;\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\nvarying vec2 uv;\n\nvoid main(void) {\n geometry.uv = uv;\n\n vec4 texColor = texture2D(iconsTexture, vTextureCoords);\n\n // if colorMode == 0, use pixel color from the texture\n // if colorMode == 1 or rendering picking buffer, use texture as transparency mask\n vec3 color = mix(texColor.rgb, vColor.rgb, vColorMode);\n // Take the global opacity and the alpha from vColor into account for the alpha component\n float a = texColor.a * opacity * vColor.a;\n\n if (a < alphaCutoff) {\n discard;\n }\n\n gl_FragColor = vec4(color, a);\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n'; +export default _default; +// # sourceMappingURL=icon-layer-fragment.glsl.d.ts.map diff --git a/modules/layers/typed/icon-layer/icon-layer-fragment.glsl.d.ts.map b/modules/layers/typed/icon-layer/icon-layer-fragment.glsl.d.ts.map new file mode 100644 index 00000000000..a00569a9cbd --- /dev/null +++ b/modules/layers/typed/icon-layer/icon-layer-fragment.glsl.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"icon-layer-fragment.glsl.d.ts","sourceRoot":"","sources":["../../src/icon-layer/icon-layer-fragment.glsl.ts"],"names":[],"mappings":";AAoBA,wBAgCE"} \ No newline at end of file diff --git a/modules/layers/typed/icon-layer/icon-layer-vertex.glsl.d.ts b/modules/layers/typed/icon-layer/icon-layer-vertex.glsl.d.ts new file mode 100644 index 00000000000..ee6deb0c8ef --- /dev/null +++ b/modules/layers/typed/icon-layer/icon-layer-vertex.glsl.d.ts @@ -0,0 +1,3 @@ +declare const _default: '#define SHADER_NAME icon-layer-vertex-shader\n\nattribute vec2 positions;\n\nattribute vec3 instancePositions;\nattribute vec3 instancePositions64Low;\nattribute float instanceSizes;\nattribute float instanceAngles;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\nattribute vec4 instanceIconFrames;\nattribute float instanceColorModes;\nattribute vec2 instanceOffsets;\nattribute vec2 instancePixelOffset;\n\nuniform float sizeScale;\nuniform vec2 iconsTextureDim;\nuniform float sizeMinPixels;\nuniform float sizeMaxPixels;\nuniform bool billboard;\nuniform int sizeUnits;\n\nvarying float vColorMode;\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\nvarying vec2 uv;\n\nvec2 rotate_by_angle(vec2 vertex, float angle) {\n float angle_radian = angle * PI / 180.0;\n float cos_angle = cos(angle_radian);\n float sin_angle = sin(angle_radian);\n mat2 rotationMatrix = mat2(cos_angle, -sin_angle, sin_angle, cos_angle);\n return rotationMatrix * vertex;\n}\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n geometry.uv = positions;\n geometry.pickingColor = instancePickingColors;\n uv = positions;\n\n vec2 iconSize = instanceIconFrames.zw;\n // convert size in meters to pixels, then scaled and clamp\n \n // project meters to pixels and clamp to limits \n float sizePixels = clamp(\n project_size_to_pixel(instanceSizes * sizeScale, sizeUnits), \n sizeMinPixels, sizeMaxPixels\n );\n\n // scale icon height to match instanceSize\n float instanceScale = iconSize.y == 0.0 ? 0.0 : sizePixels / iconSize.y;\n\n // scale and rotate vertex in "pixel" value and convert back to fraction in clipspace\n vec2 pixelOffset = positions / 2.0 * iconSize + instanceOffsets;\n pixelOffset = rotate_by_angle(pixelOffset, instanceAngles) * instanceScale;\n pixelOffset += instancePixelOffset;\n pixelOffset.y *= -1.0;\n\n if (billboard) {\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, vec3(0.0), geometry.position);\n vec3 offset = vec3(pixelOffset, 0.0);\n DECKGL_FILTER_SIZE(offset, geometry);\n gl_Position.xy += project_pixel_size_to_clipspace(offset.xy);\n\n } else {\n vec3 offset_common = vec3(project_pixel_size(pixelOffset), 0.0);\n DECKGL_FILTER_SIZE(offset_common, geometry);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, offset_common, geometry.position); \n }\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n vTextureCoords = mix(\n instanceIconFrames.xy,\n instanceIconFrames.xy + iconSize,\n (positions.xy + 1.0) / 2.0\n ) / iconsTextureDim;\n\n vColor = instanceColors;\n DECKGL_FILTER_COLOR(vColor, geometry);\n\n vColorMode = instanceColorModes;\n}\n'; +export default _default; +// # sourceMappingURL=icon-layer-vertex.glsl.d.ts.map diff --git a/modules/layers/typed/icon-layer/icon-layer-vertex.glsl.d.ts.map b/modules/layers/typed/icon-layer/icon-layer-vertex.glsl.d.ts.map new file mode 100644 index 00000000000..301b84ca6b8 --- /dev/null +++ b/modules/layers/typed/icon-layer/icon-layer-vertex.glsl.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"icon-layer-vertex.glsl.d.ts","sourceRoot":"","sources":["../../src/icon-layer/icon-layer-vertex.glsl.ts"],"names":[],"mappings":";AAoBA,wBAoFE"} \ No newline at end of file diff --git a/modules/layers/typed/icon-layer/icon-layer.d.ts b/modules/layers/typed/icon-layer/icon-layer.d.ts new file mode 100644 index 00000000000..95744340692 --- /dev/null +++ b/modules/layers/typed/icon-layer/icon-layer.d.ts @@ -0,0 +1,106 @@ +import {Layer} from '@deck.gl/core'; +import {Model} from '@luma.gl/webgl-legacy'; +import IconManager from './icon-manager'; +import type { + LayerProps, + Accessor, + AccessorFunction, + Position, + Color, + Unit, + UpdateParameters, + LayerContext, + DefaultProps +} from '@deck.gl/core'; +import {Texture2D} from '@luma.gl/webgl-legacy'; +import type {UnpackedIcon, IconMapping, LoadIconErrorContext} from './icon-manager'; +declare type _IconLayerProps = { + /** A prepacked image that contains all icons. */ + iconAtlas?: string | Texture2D; + /** Icon names mapped to icon definitions, or a URL to load such mapping from a JSON file. */ + iconMapping?: string | IconMapping; + /** Icon size multiplier. + * @default 1 + */ + sizeScale?: number; + /** + * The units of the icon size, one of `meters`, `common`, and `pixels`. + * + * @default 'pixels' + */ + sizeUnits?: Unit; + /** + * The minimum size in pixels. When using non-pixel `sizeUnits`, this prop can be used to prevent the icon from getting too small when zoomed out. + */ + sizeMinPixels?: number; + /** + * The maximum size in pixels. When using non-pixel `sizeUnits`, this prop can be used to prevent the icon from getting too big when zoomed in. + */ + sizeMaxPixels?: number; + /** If `true`, the icon always faces camera. Otherwise the icon faces up (z) + * @default true + */ + billboard?: boolean; + /** + * Discard pixels whose opacity is below this threshold. + * A discarded pixel would create a "hole" in the icon that is not considered part of the object. + * @default 0.05 + */ + alphaCutoff?: number; + /** Anchor position accessor. */ + getPosition?: Accessor; + /** Icon definition accessor. + * Should return the icon id if using pre-packed icons (`iconAtlas` + `iconMapping`). + * Return an object that defines the icon if using auto-packing. + */ + getIcon?: AccessorFunction | AccessorFunction; + /** Icon color accessor. + * @default [0, 0, 0, 255] + */ + getColor?: Accessor; + /** Icon size accessor. + * @default 1 + */ + getSize?: Accessor; + /** Icon rotation accessor, in degrees. + * @default 0 + */ + getAngle?: Accessor; + /** + * Icon offsest accessor, in pixels. + * @default [0, 0] + */ + getPixelOffset?: Accessor; + /** + * Callback called if the attempt to fetch an icon returned by `getIcon` fails. + */ + onIconError?: ((context: LoadIconErrorContext) => void) | null; + /** Customize the [texture parameters](https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/texParameter). */ + textureParameters?: Record | null; +}; +export declare type IconLayerProps = _IconLayerProps & LayerProps; +/** Render raster icons at given coordinates. */ +export default class IconLayer extends Layer< + ExtraPropsT & Required<_IconLayerProps> +> { + static defaultProps: DefaultProps>; + static layerName: string; + state: { + model?: Model; + iconManager: IconManager; + }; + getShaders(): any; + initializeState(): void; + updateState(params: UpdateParameters): void; + get isLoaded(): boolean; + finalizeState(context: LayerContext): void; + draw({uniforms}: {uniforms: any}): void; + protected _getModel(): Model; + private _onUpdate; + private _onError; + protected getInstanceOffset(icon: string): number[]; + protected getInstanceColorMode(icon: string): number; + protected getInstanceIconFrame(icon: string): number[]; +} +export {}; +// # sourceMappingURL=icon-layer.d.ts.map diff --git a/modules/layers/typed/icon-layer/icon-layer.d.ts.map b/modules/layers/typed/icon-layer/icon-layer.d.ts.map new file mode 100644 index 00000000000..bfff1ca356f --- /dev/null +++ b/modules/layers/typed/icon-layer/icon-layer.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"icon-layer.d.ts","sourceRoot":"","sources":["../../src/icon-layer/icon-layer.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,KAAK,EAAgC,MAAM,eAAe,CAAC;AAGnE,OAAO,EAAC,KAAK,EAAC,MAAM,uBAAuB,CAAC;AAI5C,OAAO,WAAW,MAAM,gBAAgB,CAAC;AAEzC,OAAO,KAAK,EACV,UAAU,EACV,QAAQ,EACR,gBAAgB,EAChB,QAAQ,EACR,KAAK,EACL,IAAI,EACJ,gBAAgB,EAChB,YAAY,EACZ,YAAY,EACb,MAAM,eAAe,CAAC;AACvB,OAAO,EAAC,SAAS,EAAC,MAAM,uBAAuB,CAAC;AAEhD,OAAO,KAAK,EAAC,YAAY,EAAE,WAAW,EAAE,oBAAoB,EAAC,MAAM,gBAAgB,CAAC;AAEpF,aAAK,eAAe,CAAC,KAAK,IAAI;IAC5B,iDAAiD;IACjD,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,6FAA6F;IAC7F,WAAW,CAAC,EAAE,MAAM,GAAG,WAAW,CAAC;IAEnC;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AAG,GAAG,EAAE,WAAW,GAAG,EAAE,CAAE,SAAQ,KAAK,CACzE,WAAW,GAAG,QAAQ,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC,CAC/C;IACC,MAAM,CAAC,YAAY,oCAAgB;IACnC,MAAM,CAAC,SAAS,SAAe;IAE/B,KAAK,EAAG;QACN,KAAK,CAAC,EAAE,KAAK,CAAC;QACd,WAAW,EAAE,WAAW,CAAC;KAC1B,CAAC;IAEF,UAAU;IAIV,eAAe;IAkEf,WAAW,CAAC,MAAM,EAAE,gBAAgB,CAAC,IAAI,CAAC;IA4C1C,IAAI,QAAQ,IAAI,OAAO,CAEtB;IAED,aAAa,CAAC,OAAO,EAAE,YAAY,GAAG,IAAI;IAM1C,IAAI,CAAC,EAAC,QAAQ,EAAC;;KAAA,GAAG,IAAI;IAsBtB,SAAS,CAAC,SAAS,IAAI,KAAK;IAuB5B,OAAO,CAAC,SAAS;IAIjB,OAAO,CAAC,QAAQ;IAShB,SAAS,CAAC,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE;IASnD,SAAS,CAAC,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAKpD,SAAS,CAAC,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE;CAIvD"} \ No newline at end of file diff --git a/modules/layers/typed/icon-layer/icon-manager.d.ts b/modules/layers/typed/icon-layer/icon-manager.d.ts new file mode 100644 index 00000000000..fe33ef2f34f --- /dev/null +++ b/modules/layers/typed/icon-layer/icon-manager.d.ts @@ -0,0 +1,146 @@ +import {Device} from '@luma.gl/api'; +import {Texture2D} from '@luma.gl/webgl-legacy'; +import type {AccessorFunction} from '@deck.gl/core'; +declare type IconDef = { + /** Width of the icon */ + width: number; + /** Height of the icon */ + height: number; + /** Horizontal position of icon anchor. Default: half width. */ + anchorX?: number; + /** Vertical position of icon anchor. Default: half height. */ + anchorY?: number; + /** + * Whether the icon is treated as a transparency mask. + * If `true`, color defined by `getColor` is applied. + * If `false`, pixel color from the icon image is applied. + * @default false + */ + mask?: boolean; +}; +export declare type UnpackedIcon = { + /** Url to fetch the icon */ + url: string; + /** Unique identifier of the icon. Icons of the same id are only fetched once. Fallback to `url` if not specified. */ + id?: string; +} & IconDef; +declare type PrepackedIcon = { + /** Left position of the icon on the atlas */ + x: number; + /** Top position of the icon on the atlas */ + y: number; +} & IconDef; +export declare type IconMapping = Record; +export declare type LoadIconErrorContext = { + error: Error; + /** The URL that was trying to fetch */ + url: string; + /** The original data object that requested this icon */ + source: any; + /** The index of the original data object that requested this icon */ + sourceIndex: number; + /** The load options used for the fetch */ + loadOptions: any; +}; +/** + * Generate coordinate mapping to retrieve icon left-top position from an icon atlas + */ +export declare function buildMapping({ + icons, + buffer, + mapping, + xOffset, + yOffset, + rowHeight, + canvasWidth +}: { + /** list of icon definitions */ + icons: UnpackedIcon[]; + /** add bleeding buffer to the right and bottom side of the image */ + buffer: number; + /** right position of last icon in old mapping */ + xOffset: number; + /** top position in last icon in old mapping */ + yOffset: number; + /** height of the last icon's row */ + rowHeight: number; + /** max width of canvas */ + canvasWidth: number; + mapping: IconMapping; +}): { + mapping: IconMapping; + rowHeight: number; + xOffset: number; + yOffset: number; + canvasWidth: number; + canvasHeight: number; +}; +export declare function getDiffIcons( + data: any, + getIcon: AccessorFunction | null, + cachedIcons: Record< + string, + PrepackedIcon & { + url?: string; + } + > +): Record< + string, + UnpackedIcon & { + source: any; + sourceIndex: number; + } +> | null; +export default class IconManager { + device: Device; + private onUpdate; + private onError; + private _loadOptions; + private _texture; + private _externalTexture; + private _mapping; + private _textureParameters; + /** count of pending requests to fetch icons */ + private _pendingCount; + private _autoPacking; + private _xOffset; + private _yOffset; + private _rowHeight; + private _buffer; + private _canvasWidth; + private _canvasHeight; + private _canvas; + constructor( + device: Device, + { + onUpdate, + onError + }: { + /** Callback when the texture updates */ + onUpdate: () => void; + /** Callback when an error is encountered */ + onError: (context: LoadIconErrorContext) => void; + } + ); + finalize(): void; + getTexture(): Texture2D | null; + getIconMapping(icon: string | UnpackedIcon): PrepackedIcon | null; + setProps({ + loadOptions, + autoPacking, + iconAtlas, + iconMapping, + textureParameters + }: { + loadOptions?: any; + autoPacking?: boolean; + iconAtlas?: Texture2D | null; + iconMapping?: IconMapping | null; + textureParameters?: Record | null; + }): void; + get isLoaded(): boolean; + packIcons(data: any, getIcon: AccessorFunction): void; + private _loadIcons; +} +export {}; +// # sourceMappingURL=icon-manager.d.ts.map diff --git a/modules/layers/typed/icon-layer/icon-manager.d.ts.map b/modules/layers/typed/icon-layer/icon-manager.d.ts.map new file mode 100644 index 00000000000..4267a22e99b --- /dev/null +++ b/modules/layers/typed/icon-layer/icon-manager.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"icon-manager.d.ts","sourceRoot":"","sources":["../../src/icon-layer/icon-manager.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,MAAM,EAAC,MAAM,cAAc,CAAC;AACpC,OAAO,EAAK,SAAS,EAAgB,MAAM,uBAAuB,CAAC;AAKnE,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,eAAe,CAAC;AAgBpD,aAAK,OAAO,GAAG;IACb,wBAAwB;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,yBAAyB;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,+DAA+D;IAC/D,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,8DAA8D;IAC9D,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;;OAKG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB,CAAC;AAEF,oBAAY,YAAY,GAAG;IACzB,4BAA4B;IAC5B,GAAG,EAAE,MAAM,CAAC;IACZ,qHAAqH;IACrH,EAAE,CAAC,EAAE,MAAM,CAAC;CACb,GAAG,OAAO,CAAC;AAEZ,aAAK,aAAa,GAAG;IACnB,6CAA6C;IAC7C,CAAC,EAAE,MAAM,CAAC;IACV,4CAA4C;IAC5C,CAAC,EAAE,MAAM,C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AC7B,WAAW,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;QACjC,iBAAiB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAAC;KACnD;IAwBD,IAAI,QAAQ,IAAI,OAAO,CAEtB;IAED,SAAS,CAAC,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,gBAAgB,CAAC,GAAG,EAAE,YAAY,CAAC,GAAG,IAAI;IAmDxE,OAAO,CAAC,UAAU;CA6CnB"} \ No newline at end of file diff --git a/modules/layers/typed/index.d.ts b/modules/layers/typed/index.d.ts new file mode 100644 index 00000000000..d3bbf36f332 --- /dev/null +++ b/modules/layers/typed/index.d.ts @@ -0,0 +1,31 @@ +export {default as ArcLayer} from './arc-layer/arc-layer'; +export {default as BitmapLayer} from './bitmap-layer/bitmap-layer'; +export {default as IconLayer} from './icon-layer/icon-layer'; +export {default as LineLayer} from './line-layer/line-layer'; +export {default as PointCloudLayer} from './point-cloud-layer/point-cloud-layer'; +export {default as ScatterplotLayer} from './scatterplot-layer/scatterplot-layer'; +export {default as ColumnLayer} from './column-layer/column-layer'; +export {default as GridCellLayer} from './column-layer/grid-cell-layer'; +export {default as PathLayer} from './path-layer/path-layer'; +export {default as PolygonLayer} from './polygon-layer/polygon-layer'; +export {default as GeoJsonLayer} from './geojson-layer/geojson-layer'; +export {default as TextLayer} from './text-layer/text-layer'; +export {default as SolidPolygonLayer} from './solid-polygon-layer/solid-polygon-layer'; +export {default as _MultiIconLayer} from './text-layer/multi-icon-layer/multi-icon-layer'; +export {default as _TextBackgroundLayer} from './text-layer/text-background-layer/text-background-layer'; +export type {ArcLayerProps} from './arc-layer/arc-layer'; +export type {BitmapLayerProps, BitmapBoundingBox} from './bitmap-layer/bitmap-layer'; +export type {ColumnLayerProps} from './column-layer/column-layer'; +export type {ScatterplotLayerProps} from './scatterplot-layer/scatterplot-layer'; +export type {IconLayerProps} from './icon-layer/icon-layer'; +export type {LineLayerProps} from './line-layer/line-layer'; +export type {PolygonLayerProps} from './polygon-layer/polygon-layer'; +export type {GeoJsonLayerProps} from './geojson-layer/geojson-layer'; +export type {GridCellLayerProps} from './column-layer/grid-cell-layer'; +export type {TextLayerProps} from './text-layer/text-layer'; +export type {MultiIconLayerProps} from './text-layer/multi-icon-layer/multi-icon-layer'; +export type {PointCloudLayerProps} from './point-cloud-layer/point-cloud-layer'; +export type {TextBackgroundLayerProps} from './text-layer/text-background-layer/text-background-layer'; +export type {PathLayerProps} from './path-layer/path-layer'; +export type {SolidPolygonLayerProps} from './solid-polygon-layer/solid-polygon-layer'; +// # sourceMappingURL=index.d.ts.map diff --git a/modules/layers/typed/index.d.ts.map b/modules/layers/typed/index.d.ts.map new file mode 100644 index 00000000000..13c0e731baf --- /dev/null +++ b/modules/layers/typed/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAC,OAAO,IAAI,QAAQ,EAAC,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAC,OAAO,IAAI,WAAW,EAAC,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAC,OAAO,IAAI,SAAS,EAAC,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAC,OAAO,IAAI,SAAS,EAAC,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAC,OAAO,IAAI,eAAe,EAAC,MAAM,uCAAuC,CAAC;AACjF,OAAO,EAAC,OAAO,IAAI,gBAAgB,EAAC,MAAM,uCAAuC,CAAC;AAClF,OAAO,EAAC,OAAO,IAAI,WAAW,EAAC,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAC,OAAO,IAAI,aAAa,EAAC,MAAM,gCAAgC,CAAC;AACxE,OAAO,EAAC,OAAO,IAAI,SAAS,EAAC,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAC,OAAO,IAAI,YAAY,EAAC,MAAM,+BAA+B,CAAC;AACtE,OAAO,EAAC,OAAO,IAAI,YAAY,EAAC,MAAM,+BAA+B,CAAC;AACtE,OAAO,EAAC,OAAO,IAAI,SAAS,EAAC,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAC,OAAO,IAAI,iBAAiB,EAAC,MAAM,2CAA2C,CAAC;AAGvF,OAAO,EAAC,OAAO,IAAI,eAAe,EAAC,MAAM,gDAAgD,CAAC;AAC1F,OAAO,EAAC,OAAO,IAAI,oBAAoB,EAAC,MAAM,0DAA0D,CAAC;AAGzG,YAAY,EAAC,aAAa,EAAC,MAAM,uBAAuB,CAAC;AACzD,YAAY,EAAC,gBAAgB,EAAE,iBAAiB,EAAC,MAAM,6BAA6B,CAAC;AACrF,YAAY,EAAC,gBAAgB,EAAC,MAAM,6BAA6B,CAAC;AAClE,YAAY,EAAC,qBAAqB,EAAC,MAAM,uCAAuC,CAAC;AACjF,YAAY,EAAC,cAAc,EAAC,MAAM,yBAAyB,CAAC;AAC5D,YAAY,EAAC,cAAc,EAAC,MAAM,yBAAyB,CAAC;AAC5D,YAAY,EAAC,iBAAiB,EAAC,MAAM,+BAA+B,CAAC;AACrE,YAAY,EAAC,iBAAiB,EAAC,MAAM,+BAA+B,CAAC;AACrE,YAAY,EAAC,kBAAkB,EAAC,MAAM,gCAAgC,CAAC;AACvE,YAAY,EAAC,cAAc,EAAC,MAAM,yBAAyB,CAAC;AAC5D,YAAY,EAAC,mBAAmB,EAAC,MAAM,gDAAgD,CAAC;AACxF,YAAY,EAAC,oBAAoB,EAAC,MAAM,uCAAuC,CAAC;AAChF,YAAY,EAAC,wBAAwB,EAAC,MAAM,0DAA0D,CAAC;AACvG,YAAY,EAAC,cAAc,EAAC,MAAM,yBAAyB,CAAC;AAC5D,YAAY,EAAC,sBAAsB,EAAC,MAAM,2CAA2C,CAAC"} \ No newline at end of file diff --git a/modules/layers/typed/line-layer/line-layer-fragment.glsl.d.ts b/modules/layers/typed/line-layer/line-layer-fragment.glsl.d.ts new file mode 100644 index 00000000000..78ded21456d --- /dev/null +++ b/modules/layers/typed/line-layer/line-layer-fragment.glsl.d.ts @@ -0,0 +1,3 @@ +declare const _default: '#define SHADER_NAME line-layer-fragment-shader\n\nprecision highp float;\n\nvarying vec4 vColor;\nvarying vec2 uv;\n\nvoid main(void) {\n geometry.uv = uv;\n\n gl_FragColor = vColor;\n\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n'; +export default _default; +// # sourceMappingURL=line-layer-fragment.glsl.d.ts.map diff --git a/modules/layers/typed/line-layer/line-layer-fragment.glsl.d.ts.map b/modules/layers/typed/line-layer/line-layer-fragment.glsl.d.ts.map new file mode 100644 index 00000000000..dbfd174f4f6 --- /dev/null +++ b/modules/layers/typed/line-layer/line-layer-fragment.glsl.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"line-layer-fragment.glsl.d.ts","sourceRoot":"","sources":["../../src/line-layer/line-layer-fragment.glsl.ts"],"names":[],"mappings":";AAoBA,wBAeE"} \ No newline at end of file diff --git a/modules/layers/typed/line-layer/line-layer-vertex.glsl.d.ts b/modules/layers/typed/line-layer/line-layer-vertex.glsl.d.ts new file mode 100644 index 00000000000..a7daf19de4d --- /dev/null +++ b/modules/layers/typed/line-layer/line-layer-vertex.glsl.d.ts @@ -0,0 +1,3 @@ +declare const _default: '#define SHADER_NAME line-layer-vertex-shader\n\nattribute vec3 positions;\nattribute vec3 instanceSourcePositions;\nattribute vec3 instanceTargetPositions;\nattribute vec3 instanceSourcePositions64Low;\nattribute vec3 instanceTargetPositions64Low;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\nattribute float instanceWidths;\n\nuniform float opacity;\nuniform float widthScale;\nuniform float widthMinPixels;\nuniform float widthMaxPixels;\nuniform float useShortestPath;\nuniform int widthUnits;\n\nvarying vec4 vColor;\nvarying vec2 uv;\n\n// offset vector by strokeWidth pixels\n// offset_direction is -1 (left) or 1 (right)\nvec2 getExtrusionOffset(vec2 line_clipspace, float offset_direction, float width) {\n // normalized direction of the line\n vec2 dir_screenspace = normalize(line_clipspace * project_uViewportSize);\n // rotate by 90 degrees\n dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);\n\n return dir_screenspace * offset_direction * width / 2.0;\n}\n\nvec3 splitLine(vec3 a, vec3 b, float x) {\n float t = (x - a.x) / (b.x - a.x);\n return vec3(x, mix(a.yz, b.yz, t));\n}\n\nvoid main(void) {\n geometry.worldPosition = instanceSourcePositions;\n geometry.worldPositionAlt = instanceTargetPositions;\n\n vec3 source_world = instanceSourcePositions;\n vec3 target_world = instanceTargetPositions;\n vec3 source_world_64low = instanceSourcePositions64Low;\n vec3 target_world_64low = instanceTargetPositions64Low;\n\n if (useShortestPath > 0.5 || useShortestPath < -0.5) {\n source_world.x = mod(source_world.x + 180., 360.0) - 180.;\n target_world.x = mod(target_world.x + 180., 360.0) - 180.;\n float deltaLng = target_world.x - source_world.x;\n\n if (deltaLng * useShortestPath > 180.) {\n source_world.x += 360. * useShortestPath;\n source_world = splitLine(source_world, target_world, 180. * useShortestPath);\n source_world_64low = vec3(0.0);\n } else if (deltaLng * useShortestPath < -180.) {\n target_world.x += 360. * useShortestPath;\n target_world = splitLine(source_world, target_world, 180. * useShortestPath);\n target_world_64low = vec3(0.0);\n } else if (useShortestPath < 0.) {\n // Line is not split, abort\n gl_Position = vec4(0.);\n return;\n }\n }\n\n // Position\n vec4 source_commonspace;\n vec4 target_commonspace;\n vec4 source = project_position_to_clipspace(source_world, source_world_64low, vec3(0.), source_commonspace);\n vec4 target = project_position_to_clipspace(target_world, target_world_64low, vec3(0.), target_commonspace);\n \n // linear interpolation of source & target to pick right coord\n float segmentIndex = positions.x;\n vec4 p = mix(source, target, segmentIndex);\n geometry.position = mix(source_commonspace, target_commonspace, segmentIndex);\n uv = positions.xy;\n geometry.uv = uv;\n geometry.pickingColor = instancePickingColors;\n\n // Multiply out width and clamp to limits\n float widthPixels = clamp(\n project_size_to_pixel(instanceWidths * widthScale, widthUnits),\n widthMinPixels, widthMaxPixels\n );\n\n // extrude\n vec3 offset = vec3(\n getExtrusionOffset(target.xy - source.xy, positions.y, widthPixels),\n 0.0);\n DECKGL_FILTER_SIZE(offset, geometry);\n gl_Position = p + vec4(project_pixel_size_to_clipspace(offset.xy), 0.0, 0.0);\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n // Color\n vColor = vec4(instanceColors.rgb, instanceColors.a * opacity);\n DECKGL_FILTER_COLOR(vColor, geometry);\n}\n'; +export default _default; +// # sourceMappingURL=line-layer-vertex.glsl.d.ts.map diff --git a/modules/layers/typed/line-layer/line-layer-vertex.glsl.d.ts.map b/modules/layers/typed/line-layer/line-layer-vertex.glsl.d.ts.map new file mode 100644 index 00000000000..9dda4d55945 --- /dev/null +++ b/modules/layers/typed/line-layer/line-layer-vertex.glsl.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"line-layer-vertex.glsl.d.ts","sourceRoot":"","sources":["../../src/line-layer/line-layer-vertex.glsl.ts"],"names":[],"mappings":";AAoBA,wBAmGE"} \ No newline at end of file diff --git a/modules/layers/typed/line-layer/line-layer.d.ts b/modules/layers/typed/line-layer/line-layer.d.ts new file mode 100644 index 00000000000..aa2a2fd8a7a --- /dev/null +++ b/modules/layers/typed/line-layer/line-layer.d.ts @@ -0,0 +1,73 @@ +import { + Layer, + LayerProps, + Unit, + Position, + Accessor, + Color, + UpdateParameters, + DefaultProps +} from '@deck.gl/core'; +import {Model} from '@luma.gl/webgl-legacy'; +/** All properties supported by LineLayer. */ +export declare type LineLayerProps = _LineLayerProps & LayerProps; +/** Properties added by LineLayer. */ +declare type _LineLayerProps = { + /** + * The units of the line width, one of `'meters'`, `'common'`, and `'pixels'`. + * @default 'pixels' + */ + widthUnits?: Unit; + /** + * The scaling multiplier for the width of each line. + * @default 1 + */ + widthScale?: number; + /** + * The minimum line width in pixels. + * @default 0 + */ + widthMinPixels?: number; + /** + * The maximum line width in pixels. + * @default Number.MAX_SAFE_INTEGER + */ + widthMaxPixels?: number; + /** + * Source position of each object. + * @default object => object.sourcePosition + */ + getSourcePosition?: Accessor; + /** + * Target position of each object. + * @default object => object.targetPosition + */ + getTargetPosition?: Accessor; + /** + * The rgba color is in the format of `[r, g, b, [a]]`. + * @default [0, 0, 0, 255] + */ + getColor?: Accessor; + /** + * Width of each object + * @default 1 + */ + getWidth?: Accessor; +}; +/** + * A layer that renders straight lines joining pairs of source and target coordinates. + */ +export default class LineLayer extends Layer< + ExtraProps & Required<_LineLayerProps> +> { + static layerName: string; + static defaultProps: DefaultProps>; + getShaders(): any; + get wrapLongitude(): boolean; + initializeState(): void; + updateState(params: UpdateParameters): void; + draw({uniforms}: {uniforms: any}): void; + protected _getModel(): Model; +} +export {}; +// # sourceMappingURL=line-layer.d.ts.map diff --git a/modules/layers/typed/line-layer/line-layer.d.ts.map b/modules/layers/typed/line-layer/line-layer.d.ts.map new file mode 100644 index 00000000000..e10480c8542 --- /dev/null +++ b/modules/layers/typed/line-layer/line-layer.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"line-layer.d.ts","sourceRoot":"","sources":["../../src/line-layer/line-layer.ts"],"names":[],"mappings":"AAoBA,OAAO,EACL,KAAK,EAIL,UAAU,EACV,IAAI,EACJ,QAAQ,EACR,QAAQ,EACR,KAAK,EACL,gBAAgB,EAChB,YAAY,EACb,MAAM,eAAe,CAAC;AAGvB,OAAO,EAAC,KAAK,EAAC,MAAM,uBAAuB,CAAC;AAmB5C,6CAA6C;AAC7C,oBAAY,cAAc,CAAC,KAAK,GAAG,GAAG,IAAI,eAAe,CAAC,KAAK,CAAC,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC;AAErF,qCAAqC;AACrC,aAAK,eAAe,CAAC,KAAK,IAAI;IAC5B;;;OAGG;IACH,UAAU,CAAC,EAAE,IAAI,CAAC;IAElB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;IAE9C;;;OAGG;IACH,iBAAiB,CAAC,EAAE,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;IAE9C;;;OAGG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IAElC;;;OAGG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;CACpC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,SAAS,CAAC,KAAK,GAAG,GAAG,EAAE,UAAU,GAAG,EAAE,CAAE,SAAQ,KAAK,CACxE,UAAU,GAAG,QAAQ,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC,CAC9C;IACC,MAAM,CAAC,SAAS,SAAe;IAC/B,MAAM,CAAC,YAAY,oCAAgB;IAEnC,UAAU;IAKV,IAAI,aAAa,IAAI,OAAO,CAE3B;IAED,eAAe;IAqCf,WAAW,CAAC,MAAM,EAAE,gBAAgB,CAAC,IAAI,CAAC,GAAG,IAAI;IAUjD,IAAI,CAAC,EAAC,QAAQ,EAAC;;KAAA,GAAG,IAAI;IAwBtB,SAAS,CAAC,SAAS,IAAI,KAAK;CAsB7B"} \ No newline at end of file diff --git a/modules/layers/typed/path-layer/path-layer-fragment.glsl.d.ts b/modules/layers/typed/path-layer/path-layer-fragment.glsl.d.ts new file mode 100644 index 00000000000..53557ead2be --- /dev/null +++ b/modules/layers/typed/path-layer/path-layer-fragment.glsl.d.ts @@ -0,0 +1,3 @@ +declare const _default: '#define SHADER_NAME path-layer-fragment-shader\n\nprecision highp float;\n\nuniform float miterLimit;\n\nvarying vec4 vColor;\nvarying vec2 vCornerOffset;\nvarying float vMiterLength;\n/*\n * vPathPosition represents the relative coordinates of the current fragment on the path segment.\n * vPathPosition.x - position along the width of the path, between [-1, 1]. 0 is the center line.\n * vPathPosition.y - position along the length of the path, between [0, L / width].\n */\nvarying vec2 vPathPosition;\nvarying float vPathLength;\nvarying float vJointType;\n\nvoid main(void) {\n geometry.uv = vPathPosition;\n\n if (vPathPosition.y < 0.0 || vPathPosition.y > vPathLength) {\n // if joint is rounded, test distance from the corner\n if (vJointType > 0.5 && length(vCornerOffset) > 1.0) {\n discard;\n }\n // trim miter\n if (vJointType < 0.5 && vMiterLength > miterLimit + 1.0) {\n discard;\n }\n }\n gl_FragColor = vColor;\n\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n'; +export default _default; +// # sourceMappingURL=path-layer-fragment.glsl.d.ts.map diff --git a/modules/layers/typed/path-layer/path-layer-fragment.glsl.d.ts.map b/modules/layers/typed/path-layer/path-layer-fragment.glsl.d.ts.map new file mode 100644 index 00000000000..c68fcd2521a --- /dev/null +++ b/modules/layers/typed/path-layer/path-layer-fragment.glsl.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"path-layer-fragment.glsl.d.ts","sourceRoot":"","sources":["../../src/path-layer/path-layer-fragment.glsl.ts"],"names":[],"mappings":";AAoBA,wBAoCE"} \ No newline at end of file diff --git a/modules/layers/typed/path-layer/path-layer-vertex.glsl.d.ts b/modules/layers/typed/path-layer/path-layer-vertex.glsl.d.ts new file mode 100644 index 00000000000..4a5c952c810 --- /dev/null +++ b/modules/layers/typed/path-layer/path-layer-vertex.glsl.d.ts @@ -0,0 +1,3 @@ +declare const _default: '#define SHADER_NAME path-layer-vertex-shader\n\nattribute vec2 positions;\n\nattribute float instanceTypes;\nattribute vec3 instanceStartPositions;\nattribute vec3 instanceEndPositions;\nattribute vec3 instanceLeftPositions;\nattribute vec3 instanceRightPositions;\nattribute vec3 instanceLeftPositions64Low;\nattribute vec3 instanceStartPositions64Low;\nattribute vec3 instanceEndPositions64Low;\nattribute vec3 instanceRightPositions64Low;\nattribute float instanceStrokeWidths;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\n\nuniform float widthScale;\nuniform float widthMinPixels;\nuniform float widthMaxPixels;\nuniform float jointType;\nuniform float capType;\nuniform float miterLimit;\nuniform bool billboard;\nuniform int widthUnits;\n\nuniform float opacity;\n\nvarying vec4 vColor;\nvarying vec2 vCornerOffset;\nvarying float vMiterLength;\nvarying vec2 vPathPosition;\nvarying float vPathLength;\nvarying float vJointType;\n\nconst float EPSILON = 0.001;\nconst vec3 ZERO_OFFSET = vec3(0.0);\n\nfloat flipIfTrue(bool flag) {\n return -(float(flag) * 2. - 1.);\n}\n\n// calculate line join positions\nvec3 lineJoin(\n vec3 prevPoint, vec3 currPoint, vec3 nextPoint,\n vec2 width\n) {\n bool isEnd = positions.x > 0.0;\n // side of the segment - -1: left, 0: center, 1: right\n float sideOfPath = positions.y;\n float isJoint = float(sideOfPath == 0.0);\n\n vec3 deltaA3 = (currPoint - prevPoint);\n vec3 deltaB3 = (nextPoint - currPoint);\n\n mat3 rotationMatrix;\n bool needsRotation = !billboard && project_needs_rotation(currPoint, rotationMatrix);\n if (needsRotation) {\n deltaA3 = deltaA3 * rotationMatrix;\n deltaB3 = deltaB3 * rotationMatrix;\n }\n vec2 deltaA = deltaA3.xy / width;\n vec2 deltaB = deltaB3.xy / width;\n\n float lenA = length(deltaA);\n float lenB = length(deltaB);\n\n vec2 dirA = lenA > 0. ? normalize(deltaA) : vec2(0.0, 0.0);\n vec2 dirB = lenB > 0. ? normalize(deltaB) : vec2(0.0, 0.0);\n\n vec2 perpA = vec2(-dirA.y, dirA.x);\n vec2 perpB = vec2(-dirB.y, dirB.x);\n\n // tangent of the corner\n vec2 tangent = dirA + dirB;\n tangent = length(tangent) > 0. ? normalize(tangent) : perpA;\n // direction of the corner\n vec2 miterVec = vec2(-tangent.y, tangent.x);\n // direction of the segment\n vec2 dir = isEnd ? dirA : dirB;\n // direction of the extrusion\n vec2 perp = isEnd ? perpA : perpB;\n // length of the segment\n float L = isEnd ? lenA : lenB;\n\n // A = angle of the corner\n float sinHalfA = abs(dot(miterVec, perp));\n float cosHalfA = abs(dot(dirA, miterVec));\n\n // -1: right, 1: left\n float turnDirection = flipIfTrue(dirA.x * dirB.y >= dirA.y * dirB.x);\n\n // relative position to the corner:\n // -1: inside (smaller side of the angle)\n // 0: center\n // 1: outside (bigger side of the angle)\n float cornerPosition = sideOfPath * turnDirection;\n\n float miterSize = 1.0 / max(sinHalfA, EPSILON);\n // trim if inside corner extends further than the line segment\n miterSize = mix(\n min(miterSize, max(lenA, lenB) / max(cosHalfA, EPSILON)),\n miterSize,\n step(0.0, cornerPosition)\n );\n\n vec2 offsetVec = mix(miterVec * miterSize, perp, step(0.5, cornerPosition))\n * (sideOfPath + isJoint * turnDirection);\n\n // special treatment for start cap and end cap\n bool isStartCap = lenA == 0.0 || (!isEnd && (instanceTypes == 1.0 || instanceTypes == 3.0));\n bool isEndCap = lenB == 0.0 || (isEnd && (instanceTypes == 2.0 || instanceTypes == 3.0));\n bool isCap = isStartCap || isEndCap;\n\n // extend out a triangle to envelope the round cap\n if (isCap) {\n offsetVec = mix(perp * sideOfPath, dir * capType * 4.0 * flipIfTrue(isStartCap), isJoint);\n vJointType = capType;\n } else {\n vJointType = jointType;\n }\n\n // Generate variables for fragment shader\n vPathLength = L;\n vCornerOffset = offsetVec;\n vMiterLength = dot(vCornerOffset, miterVec * turnDirection);\n vMiterLength = isCap ? isJoint : vMiterLength;\n\n vec2 offsetFromStartOfPath = vCornerOffset + deltaA * float(isEnd);\n vPathPosition = vec2(\n dot(offsetFromStartOfPath, perp),\n dot(offsetFromStartOfPath, dir)\n );\n geometry.uv = vPathPosition;\n\n float isValid = step(instanceTypes, 3.5);\n vec3 offset = vec3(offsetVec * width * isValid, 0.0);\n\n if (needsRotation) {\n offset = rotationMatrix * offset;\n }\n return currPoint + offset;\n}\n\n// In clipspace extrusion, if a line extends behind the camera, clip it to avoid visual artifacts\nvoid clipLine(inout vec4 position, vec4 refPosition) {\n if (position.w < EPSILON) {\n float r = (EPSILON - refPosition.w) / (position.w - refPosition.w);\n position = refPosition + (position - refPosition) * r;\n }\n}\n\nvoid main() {\n geometry.pickingColor = instancePickingColors;\n\n vColor = vec4(instanceColors.rgb, instanceColors.a * opacity);\n\n float isEnd = positions.x;\n\n vec3 prevPosition = mix(instanceLeftPositions, instanceStartPositions, isEnd);\n vec3 prevPosition64Low = mix(instanceLeftPositions64Low, instanceStartPositions64Low, isEnd);\n\n vec3 currPosition = mix(instanceStartPositions, instanceEndPositions, isEnd);\n vec3 currPosition64Low = mix(instanceStartPositions64Low, instanceEndPositions64Low, isEnd);\n\n vec3 nextPosition = mix(instanceEndPositions, instanceRightPositions, isEnd);\n vec3 nextPosition64Low = mix(instanceEndPositions64Low, instanceRightPositions64Low, isEnd);\n\n geometry.worldPosition = currPosition;\n vec2 widthPixels = vec2(clamp(\n project_size_to_pixel(instanceStrokeWidths * widthScale, widthUnits),\n widthMinPixels, widthMaxPixels) / 2.0);\n vec3 width;\n\n if (billboard) {\n // Extrude in clipspace\n vec4 prevPositionScreen = project_position_to_clipspace(prevPosition, prevPosition64Low, ZERO_OFFSET);\n vec4 currPositionScreen = project_position_to_clipspace(currPosition, currPosition64Low, ZERO_OFFSET, geometry.position);\n vec4 nextPositionScreen = project_position_to_clipspace(nextPosition, nextPosition64Low, ZERO_OFFSET);\n\n clipLine(prevPositionScreen, currPositionScreen);\n clipLine(nextPositionScreen, currPositionScreen);\n clipLine(currPositionScreen, mix(nextPositionScreen, prevPositionScreen, isEnd));\n\n width = vec3(widthPixels, 0.0);\n DECKGL_FILTER_SIZE(width, geometry);\n\n vec3 pos = lineJoin(\n prevPositionScreen.xyz / prevPositionScreen.w,\n currPositionScreen.xyz / currPositionScreen.w,\n nextPositionScreen.xyz / nextPositionScreen.w,\n project_pixel_size_to_clipspace(width.xy)\n );\n\n gl_Position = vec4(pos * currPositionScreen.w, currPositionScreen.w);\n } else {\n // Extrude in commonspace\n prevPosition = project_position(prevPosition, prevPosition64Low);\n currPosition = project_position(currPosition, currPosition64Low);\n nextPosition = project_position(nextPosition, nextPosition64Low);\n\n width = vec3(project_pixel_size(widthPixels), 0.0);\n DECKGL_FILTER_SIZE(width, geometry);\n\n vec4 pos = vec4(\n lineJoin(prevPosition, currPosition, nextPosition, width.xy),\n 1.0);\n geometry.position = pos;\n gl_Position = project_common_position_to_clipspace(pos);\n }\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n DECKGL_FILTER_COLOR(vColor, geometry);\n}\n'; +export default _default; +// # sourceMappingURL=path-layer-vertex.glsl.d.ts.map diff --git a/modules/layers/typed/path-layer/path-layer-vertex.glsl.d.ts.map b/modules/layers/typed/path-layer/path-layer-vertex.glsl.d.ts.map new file mode 100644 index 00000000000..06ff3546f02 --- /dev/null +++ b/modules/layers/typed/path-layer/path-layer-vertex.glsl.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"path-layer-vertex.glsl.d.ts","sourceRoot":"","sources":["../../src/path-layer/path-layer-vertex.glsl.ts"],"names":[],"mappings":";AAoBA,wBAsNE"} \ No newline at end of file diff --git a/modules/layers/typed/path-layer/path-layer.d.ts b/modules/layers/typed/path-layer/path-layer.d.ts new file mode 100644 index 00000000000..40120a646ae --- /dev/null +++ b/modules/layers/typed/path-layer/path-layer.d.ts @@ -0,0 +1,106 @@ +import {Layer} from '@deck.gl/core'; +import {Model} from '@luma.gl/webgl-legacy'; +import PathTesselator from './path-tesselator'; +import type { + LayerProps, + Color, + Accessor, + AccessorFunction, + Unit, + UpdateParameters, + GetPickingInfoParams, + PickingInfo, + DefaultProps +} from '@deck.gl/core'; +import type {PathGeometry} from './path'; +declare type _PathLayerProps = { + /** The units of the line width, one of `'meters'`, `'common'`, and `'pixels'` + * @default 'meters' + */ + widthUnits?: Unit; + /** + * Path width multiplier. + * @default 1 + */ + widthScale?: number; + /** + * The minimum path width in pixels. This prop can be used to prevent the path from getting too thin when zoomed out. + * @default 0 + */ + widthMinPixels?: number; + /** + * The maximum path width in pixels. This prop can be used to prevent the path from getting too thick when zoomed in. + * @default Number.MAX_SAFE_INTEGER + */ + widthMaxPixels?: number; + /** + * Type of joint. If `true`, draw round joints. Otherwise draw miter joints. + * @default false + */ + jointRounded?: boolean; + /** + * Type of caps. If `true`, draw round caps. Otherwise draw square caps. + * @default false + */ + capRounded?: boolean; + /** + * The maximum extent of a joint in ratio to the stroke width. Only works if `jointRounded` is `false`. + * @default 4 + */ + miterLimit?: number; + /** + * If `true`, extrude the path in screen space (width always faces the camera). + * If `false`, the width always faces up (z). + * @default false + */ + billboard?: boolean; + /** + * (Experimental) If `'loop'` or `'open'`, will skip normalizing the coordinates returned by `getPath` and instead assume all paths are to be loops or open paths. + * When normalization is disabled, paths must be specified in the format of flat array. Open paths must contain at least 2 vertices and closed paths must contain at least 3 vertices. + * @default null + */ + _pathType?: null | 'loop' | 'open'; + /** + * Path geometry accessor. + */ + getPath?: AccessorFunction; + /** + * Path color accessor. + * @default [0, 0, 0, 255] + */ + getColor?: Accessor; + /** + * Path width accessor. + * @default 1 + */ + getWidth?: Accessor; + /** + * @deprecated Use `jointRounded` and `capRounded` instead + */ + rounded?: boolean; +}; +export declare type PathLayerProps = _PathLayerProps & LayerProps; +/** Render lists of coordinate points as extruded polylines with mitering. */ +export default class PathLayer extends Layer< + ExtraPropsT & Required<_PathLayerProps> +> { + static defaultProps: DefaultProps>; + static layerName: string; + state: { + model?: Model; + pathTesselator: PathTesselator; + }; + getShaders(): any; + get wrapLongitude(): boolean; + initializeState(): void; + updateState(params: UpdateParameters): void; + getPickingInfo(params: GetPickingInfoParams): PickingInfo; + /** Override base Layer method */ + disablePickingIndex(objectIndex: number): void; + draw({uniforms}: {uniforms: any}): void; + protected _getModel(): Model; + protected calculatePositions(attribute: any): void; + protected calculateSegmentTypes(attribute: any): void; +} +export {}; +// # sourceMappingURL=path-layer.d.ts.map diff --git a/modules/layers/typed/path-layer/path-layer.d.ts.map b/modules/layers/typed/path-layer/path-layer.d.ts.map new file mode 100644 index 00000000000..9f953c08c9f --- /dev/null +++ b/modules/layers/typed/path-layer/path-layer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,CAAC;IAC9C;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,oBAAY,cAAc,CAAC,KAAK,GAAG,GAAG,IAAI,eAAe,CAAC,KAAK,CAAC,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC;AA6BrF,6EAA6E;AAC7E,MAAM,CAAC,OAAO,OAAO,SAAS,CAAC,KAAK,GAAG,GAAG,EAAE,WAAW,GAAG,EAAE,CAAE,SAAQ,KAAK,CACzE,WAAW,GAAG,QAAQ,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC,CAC/C;IACC,MAAM,CAAC,YAAY,oCAAgB;IACnC,MAAM,CAAC,SAAS,SAAe;IAE/B,KAAK,EAAG;QACN,KAAK,CAAC,EAAE,KAAK,CAAC;QACd,cAAc,EAAE,cAAc,CAAC;KAChC,CAAC;IAEF,UAAU;IAIV,IAAI,aAAa,IAAI,OAAO,CAE3B;IAED,eAAe;IAoEf,WAAW,CAAC,MAAM,EAAE,gBAAgB,CAAC,IAAI,CAAC;IA8C1C,cAAc,CAAC,MAAM,EAAE,oBAAoB,GAAG,WAAW;IAazD,iCAAiC;IACjC,mBAAmB,CAAC,WAAW,EAAE,MAAM;IAgBvC,IAAI,CAAC,EAAC,QAAQ,EAAC;;KAAA;IA2Bf,SAAS,CAAC,SAAS,IAAI,KAAK;IA2D5B,SAAS,CAAC,kBAAkB,CAAC,SAAS,KAAA;IAOtC,SAAS,CAAC,qBAAqB,CAAC,SAAS,KAAA;CAM1C"} \ No newline at end of file diff --git a/modules/layers/typed/path-layer/path-tesselator.d.ts b/modules/layers/typed/path-layer/path-tesselator.d.ts new file mode 100644 index 00000000000..7d717eda9d9 --- /dev/null +++ b/modules/layers/typed/path-layer/path-tesselator.d.ts @@ -0,0 +1,37 @@ +import {Tesselator} from '@deck.gl/core'; +import type {TypedArray} from '@math.gl/core'; +import type {PathGeometry, NormalizedPathGeometry} from './path'; +export default class PathTesselator extends Tesselator< + PathGeometry, + NormalizedPathGeometry, + { + fp64?: boolean; + resolution?: number; + wrapLongitude?: boolean; + loop?: boolean; + } +> { + constructor(opts: any); + /** Get packed attribute by name */ + get(attributeName: string): TypedArray | null; + protected getGeometryFromBuffer( + buffer: any + ): import('@deck.gl/core').AccessorFunction; + protected normalizeGeometry(path: PathGeometry): number[][] | PathGeometry; + protected getGeometrySize(path: NormalizedPathGeometry): number; + protected updateGeometryAttributes( + path: NormalizedPathGeometry | null, + context: { + vertexStart: number; + geometrySize: number; + } + ): void; + private _updateSegmentTypes; + private _updatePositions; + /** Returns the number of points in the path */ + private getPathLength; + /** Returns a point on the path at the specified index */ + private getPointOnPath; + private isClosed; +} +// # sourceMappingURL=path-tesselator.d.ts.map diff --git a/modules/layers/typed/path-layer/path-tesselator.d.ts.map b/modules/layers/typed/path-layer/path-tesselator.d.ts.map new file mode 100644 index 00000000000..f0cf6a7c106 --- /dev/null +++ b/modules/layers/typed/path-layer/path-tesselator.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"path-tesselator.d.ts","sourceRoot":"","sources":["../../src/path-layer/path-tesselator.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,UAAU,EAAC,MAAM,eAAe,CAAC;AAGzC,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,eAAe,CAAC;AAC9C,OAAO,KAAK,EAAC,YAAY,EAAoB,sBAAsB,EAAC,MAAM,QAAQ,CAAC;AAQnF,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,UAAU,CACpD,YAAY,EACZ,sBAAsB,EACtB;IACE,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB,CACF;gBACa,IAAI,KAAA;IAiBhB,mCAAmC;IACnC,GAAG,CAAC,aAAa,EAAE,MAAM,GAAG,UAAU,GAAG,IAAI;IAK7C,SAAS,CAAC,qBAAqB,CAAC,MAAM,KAAA;IAStC,SAAS,CAAC,iBAAiB,CAAC,IAAI,EAAE,YAAY,GAAG,MAAM,EAAE,EAAE,GAAG,YAAY;IAQ1E,SAAS,CAAC,eAAe,CAAC,IAAI,EAAE,sBAAsB,GAAG,MAAM;IAqB/D,SAAS,CAAC,wBAAwB,CAChC,IAAI,EAAE,sBAAsB,GAAG,IAAI,EACnC,OAAO,EAAE;QACP,WAAW,EAAE,MAAM,CAAC;QACpB,YAAY,EAAE,MAAM,CAAC;KACtB,GACA,IAAI;IAmBP,OAAO,CAAC,mBAAmB;IAwB3B,OAAO,CAAC,gBAAgB;IAyBxB,+CAA+C;IAC/C,OAAO,CAAC,aAAa;IAIrB,yDAAyD;IACzD,OAAO,CAAC,cAAc;IActB,OAAO,CAAC,QAAQ;CAYjB"} \ No newline at end of file diff --git a/modules/layers/typed/path-layer/path.d.ts b/modules/layers/typed/path-layer/path.d.ts new file mode 100644 index 00000000000..90eda5712df --- /dev/null +++ b/modules/layers/typed/path-layer/path.d.ts @@ -0,0 +1,18 @@ +import type {NumericArray} from '@math.gl/core'; +import type {Position} from '@deck.gl/core'; +export declare type NestedPathGeometry = Position[]; +export declare type FlatPathGeometry = NumericArray; +export declare type PathGeometry = NestedPathGeometry | FlatPathGeometry; +export declare type NormalizedPathGeometry = FlatPathGeometry[] | FlatPathGeometry; +/** + * Flattens a nested path object + * Cut the feature if needed (globe projection, wrap longitude, etc.) + * Returns a flat array of path positions, or a list of flat arrays representing multiple paths + */ +export declare function normalizePath( + path: PathGeometry, + size: number, + gridResolution?: number, + wrapLongitude?: boolean +): number[][] | NumericArray; +// # sourceMappingURL=path.d.ts.map diff --git a/modules/layers/typed/path-layer/path.d.ts.map b/modules/layers/typed/path-layer/path.d.ts.map new file mode 100644 index 00000000000..20aa779518f --- /dev/null +++ b/modules/layers/typed/path-layer/path.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"path.d.ts","sourceRoot":"","sources":["../../src/path-layer/path.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,eAAe,CAAC;AAChD,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,eAAe,CAAC;AAE5C,oBAAY,kBAAkB,GAAG,QAAQ,EAAE,CAAC;AAC5C,oBAAY,gBAAgB,GAAG,YAAY,CAAC;AAC5C,oBAAY,YAAY,GAAG,kBAAkB,GAAG,gBAAgB,CAAC;AACjE,oBAAY,sBAAsB,GAAG,gBAAgB,EAAE,GAAG,gBAAgB,CAAC;AAE3E;;;;GAIG;AACH,wBAAgB,aAAa,CAC3B,IAAI,EAAE,YAAY,EAClB,IAAI,EAAE,MAAM,EACZ,cAAc,CAAC,EAAE,MAAM,EACvB,aAAa,CAAC,EAAE,OAAO,GACtB,MAAM,EAAE,EAAE,GAAG,YAAY,CAoB3B"} \ No newline at end of file diff --git a/modules/layers/typed/point-cloud-layer/point-cloud-layer-fragment.glsl.d.ts b/modules/layers/typed/point-cloud-layer/point-cloud-layer-fragment.glsl.d.ts new file mode 100644 index 00000000000..3dc8ab23c9c --- /dev/null +++ b/modules/layers/typed/point-cloud-layer/point-cloud-layer-fragment.glsl.d.ts @@ -0,0 +1,3 @@ +declare const _default: '#define SHADER_NAME point-cloud-layer-fragment-shader\n\nprecision highp float;\n\nvarying vec4 vColor;\nvarying vec2 unitPosition;\n\nvoid main(void) {\n geometry.uv = unitPosition;\n\n float distToCenter = length(unitPosition);\n\n if (distToCenter > 1.0) {\n discard;\n }\n\n gl_FragColor = vColor;\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n'; +export default _default; +// # sourceMappingURL=point-cloud-layer-fragment.glsl.d.ts.map diff --git a/modules/layers/typed/point-cloud-layer/point-cloud-layer-fragment.glsl.d.ts.map b/modules/layers/typed/point-cloud-layer/point-cloud-layer-fragment.glsl.d.ts.map new file mode 100644 index 00000000000..f8611967715 --- /dev/null +++ b/modules/layers/typed/point-cloud-layer/point-cloud-layer-fragment.glsl.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"point-cloud-layer-fragment.glsl.d.ts","sourceRoot":"","sources":["../../src/point-cloud-layer/point-cloud-layer-fragment.glsl.ts"],"names":[],"mappings":";AAoBA,wBAoBE"} \ No newline at end of file diff --git a/modules/layers/typed/point-cloud-layer/point-cloud-layer-vertex.glsl.d.ts b/modules/layers/typed/point-cloud-layer/point-cloud-layer-vertex.glsl.d.ts new file mode 100644 index 00000000000..689a8976286 --- /dev/null +++ b/modules/layers/typed/point-cloud-layer/point-cloud-layer-vertex.glsl.d.ts @@ -0,0 +1,3 @@ +declare const _default: '#define SHADER_NAME point-cloud-layer-vertex-shader\n\nattribute vec3 positions;\nattribute vec3 instanceNormals;\nattribute vec4 instanceColors;\nattribute vec3 instancePositions;\nattribute vec3 instancePositions64Low;\nattribute vec3 instancePickingColors;\n\nuniform float opacity;\nuniform float radiusPixels;\nuniform int sizeUnits;\n\nvarying vec4 vColor;\nvarying vec2 unitPosition;\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n geometry.normal = project_normal(instanceNormals);\n\n // position on the containing square in [-1, 1] space\n unitPosition = positions.xy;\n geometry.uv = unitPosition;\n geometry.pickingColor = instancePickingColors;\n\n // Find the center of the point and add the current vertex\n vec3 offset = vec3(positions.xy * project_size_to_pixel(radiusPixels, sizeUnits), 0.0);\n DECKGL_FILTER_SIZE(offset, geometry);\n\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, vec3(0.), geometry.position);\n gl_Position.xy += project_pixel_size_to_clipspace(offset.xy);\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n // Apply lighting\n vec3 lightColor = lighting_getLightColor(instanceColors.rgb, project_uCameraPosition, geometry.position.xyz, geometry.normal);\n\n // Apply opacity to instance color, or return instance picking color\n vColor = vec4(lightColor, instanceColors.a * opacity);\n DECKGL_FILTER_COLOR(vColor, geometry);\n}\n'; +export default _default; +// # sourceMappingURL=point-cloud-layer-vertex.glsl.d.ts.map diff --git a/modules/layers/typed/point-cloud-layer/point-cloud-layer-vertex.glsl.d.ts.map b/modules/layers/typed/point-cloud-layer/point-cloud-layer-vertex.glsl.d.ts.map new file mode 100644 index 00000000000..ecd826b72c7 --- /dev/null +++ b/modules/layers/typed/point-cloud-layer/point-cloud-layer-vertex.glsl.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"point-cloud-layer-vertex.glsl.d.ts","sourceRoot":"","sources":["../../src/point-cloud-layer/point-cloud-layer-vertex.glsl.ts"],"names":[],"mappings":";AAoBA,wBAyCE"} \ No newline at end of file diff --git a/modules/layers/typed/point-cloud-layer/point-cloud-layer.d.ts b/modules/layers/typed/point-cloud-layer/point-cloud-layer.d.ts new file mode 100644 index 00000000000..ac8b0eb1e5b --- /dev/null +++ b/modules/layers/typed/point-cloud-layer/point-cloud-layer.d.ts @@ -0,0 +1,69 @@ +import { + Layer, + LayerProps, + UpdateParameters, + Unit, + AccessorFunction, + Position, + Accessor, + Color, + Material, + DefaultProps +} from '@deck.gl/core'; +import {Model} from '@luma.gl/webgl-legacy'; +/** All properties supported by PointCloudLayer. */ +export declare type PointCloudLayerProps = _PointCloudLayerProps & + LayerProps; +/** Properties added by PointCloudLayer. */ +declare type _PointCloudLayerProps = { + /** + * The units of the point size, one of `'meters'`, `'common'`, and `'pixels'`. + * @default 'pixels' + */ + sizeUnits?: Unit; + /** + * Global radius of all points, in units specified by `sizeUnits` + * @default 10 + */ + pointSize?: number; + /** + * @deprecated Use `pointSize` instead + */ + radiusPixels?: number; + /** + * Material settings for lighting effect. + * + * @default true + * @see https://deck.gl/docs/developer-guide/using-lighting + */ + material?: Material; + /** + * Method called to retrieve the position of each object. + * @default object => object.position + */ + getPosition?: AccessorFunction; + /** + * The normal of each object, in `[nx, ny, nz]`. + * @default [0, 0, 1] + */ + getNormal?: Accessor; + /** + * The rgba color is in the format of `[r, g, b, [a]]` + * @default [0, 0, 0, 255] + */ + getColor?: Accessor; +}; +/** Render a point cloud with 3D positions, normals and colors. */ +export default class PointCloudLayer extends Layer< + ExtraPropsT & Required<_PointCloudLayerProps> +> { + static layerName: string; + static defaultProps: DefaultProps>; + getShaders(): any; + initializeState(): void; + updateState(params: UpdateParameters): void; + draw({uniforms}: {uniforms: any}): void; + protected _getModel(): Model; +} +export {}; +// # sourceMappingURL=point-cloud-layer.d.ts.map diff --git a/modules/layers/typed/point-cloud-layer/point-cloud-layer.d.ts.map b/modules/layers/typed/point-cloud-layer/point-cloud-layer.d.ts.map new file mode 100644 index 00000000000..15ec72e2a78 --- /dev/null +++ b/modules/layers/typed/point-cloud-layer/point-cloud-layer.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"point-cloud-layer.d.ts","sourceRoot":"","sources":["../../src/point-cloud-layer/point-cloud-layer.ts"],"names":[],"mappings":"AAoBA,OAAO,EACL,KAAK,EAKL,UAAU,EACV,gBAAgB,EAChB,IAAI,EACJ,gBAAgB,EAChB,QAAQ,EACR,QAAQ,EACR,KAAK,EACL,QAAQ,EACR,YAAY,EACb,MAAM,eAAe,CAAC;AAGvB,OAAO,EAAC,KAAK,EAAC,MAAM,uBAAuB,CAAC;AA0C5C,mDAAmD;AACnD,oBAAY,oBAAoB,CAAC,KAAK,GAAG,GAAG,IAAI,qBAAqB,CAAC,KAAK,CAAC,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC;AAEjG,2CAA2C;AAC3C,aAAK,qBAAqB,CAAC,KAAK,IAAI;IAClC;;;OAGG;IACH,SAAS,CAAC,EAAE,IAAI,CAAC;IAEjB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAC;IAEpB;;;OAGG;IACH,WAAW,CAAC,EAAE,gBAAgB,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;IAEhD;;;OAGG;IACH,SAAS,CAAC,EAAE,QAAQ,CAAC,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAEtD;;;OAGG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;CACnC,CAAC;AAEF,kEAAkE;AAClE,MAAM,CAAC,OAAO,OAAO,eAAe,CAAC,KAAK,GAAG,GAAG,EAAE,WAAW,GAAG,EAAE,CAAE,SAAQ,KAAK,CAC/E,WAAW,GAAG,QAAQ,CAAC,qBAAqB,CAAC,KAAK,CAAC,CAAC,CACrD;IACC,MAAM,CAAC,SAAS,SAAqB;IACrC,MAAM,CAAC,YAAY,0CAAgB;IAEnC,UAAU;IAIV,eAAe;IA0Bf,WAAW,CAAC,MAAM,EAAE,gBAAgB,CAAC,IAAI,CAAC,GAAG,IAAI;IAajD,IAAI,CAAC,EAAC,QAAQ,EAAC;;KAAA;IAYf,SAAS,CAAC,SAAS,IAAI,KAAK;CAoB7B"} \ No newline at end of file diff --git a/modules/layers/typed/polygon-layer/polygon-layer.d.ts b/modules/layers/typed/polygon-layer/polygon-layer.d.ts new file mode 100644 index 00000000000..32a49705340 --- /dev/null +++ b/modules/layers/typed/polygon-layer/polygon-layer.d.ts @@ -0,0 +1,179 @@ +import { + Accessor, + AccessorFunction, + Color, + CompositeLayer, + CompositeLayerProps, + Layer, + LayersList, + Unit, + Material, + UpdateParameters, + DefaultProps +} from '@deck.gl/core'; +/** + * All properties supported by `PolygonLayer`. + */ +export declare type PolygonLayerProps = _PolygonLayerProps & + CompositeLayerProps; +/** + * Properties added by `PolygonLayer`. + */ +declare type _PolygonLayerProps = { + /** + * Whether to draw an outline around the polygon (solid fill). + * + * Note that both the outer polygon as well the outlines of any holes will be drawn. + * + * @default true + */ + stroked?: boolean; + /** + * Whether to draw a filled polygon (solid fill). + * + * Note that only the area between the outer polygon and any holes will be filled. + * + * @default true + */ + filled?: boolean; + /** + * Whether to extrude the polygons. + * + * Based on the elevations provided by the `getElevation` accessor. + * + * If set to `false`, all polygons will be flat, this generates less geometry and is faster + * than simply returning 0 from getElevation. + * + * @default false + */ + extruded?: boolean; + /** + * Elevation multiplier. + * + * The final elevation is calculated by `elevationScale * getElevation(d)`. + * `elevationScale` is a handy property to scale all elevation without updating the data. + * + * @default 1 + */ + elevationScale?: number; + /** + * Whether to generate a line wireframe of the hexagon. + * + * The outline will have "horizontal" lines closing the top and bottom polygons and a vertical + * line (a "strut") for each vertex on the polygon. + * + * @default false + */ + wireframe?: boolean; + /** + * The units of the line width, one of `meters`, `common`, and `pixels`. + * + * @default 'meters' + * @see Unit. + */ + lineWidthUnits?: Unit; + /** + * The line width multiplier that multiplied to all outlines of `Polygon` and `MultiPolygon` + * features if the stroked attribute is true. + * + * @default 1 + */ + lineWidthScale?: number; + /** + * The minimum line width in pixels. + * + * @default 0 + */ + lineWidthMinPixels?: number; + /** + * The maximum line width in pixels + * + * @default Number.MAX_SAFE_INTEGER + */ + lineWidthMaxPixels?: number; + /** + * Type of joint. If `true`, draw round joints. Otherwise draw miter joints. + * + * @default false + */ + lineJointRounded?: boolean; + /** + * The maximum extent of a joint in ratio to the stroke width. + * + * Only works if `lineJointRounded` is false. + * + * @default 4 + */ + lineMiterLimit?: number; + lineDashJustified?: boolean; + /** Called on each object in the data stream to retrieve its corresponding polygon. */ + getPolygon?: AccessorFunction; + /** + * Fill collor value or accessor. + * + * @default [0, 0, 0, 255] + */ + getFillColor?: Accessor; + /** + * Line color value or accessor. + * + * @default [0, 0, 0, 255] + */ + getLineColor?: Accessor; + /** + * Line width value or accessor. + * + * @default [0, 0, 0, 255] + */ + getLineWidth?: Accessor; + /** + * Elevation valur or accessor. + * + * Only used if `extruded: true`. + * + * @default 1000 + */ + getElevation?: Accessor; + /** + * This property has been moved to `PathStyleExtension`. + * + * @deprecated + */ + getLineDashArray?: Accessor | null; + /** + * If `false`, will skip normalizing the coordinates returned by `getPolygon`. + * + * **Note**: This prop is experimental + * + * @default true + */ + _normalize?: boolean; + /** + * Specifies the winding order of rings in the polygon data. + * + * **Note**: This prop is experimental + * + * @default 'CW' + */ + _windingOrder?: 'CW' | 'CCW'; + /** + * Material settings for lighting effect. Applies if `extruded: true`. + * + * @default true + * @see https://deck.gl/docs/developer-guide/using-lighting + */ + material?: Material; +}; +/** A composite layer that renders filled, stroked and/or extruded polygons. */ +export default class PolygonLayer extends CompositeLayer< + Required<_PolygonLayerProps> & ExtraProps +> { + static layerName: string; + static defaultProps: DefaultProps>; + initializeState(): void; + updateState({changeFlags}: UpdateParameters): void; + private _getPaths; + renderLayers(): Layer | null | LayersList; +} +export {}; +// # sourceMappingURL=polygon-layer.d.ts.map diff --git a/modules/layers/typed/polygon-layer/polygon-layer.d.ts.map b/modules/layers/typed/polygon-layer/polygon-layer.d.ts.map new file mode 100644 index 00000000000..4cb56c1639f --- /dev/null +++ b/modules/layers/typed/polygon-layer/polygon-layer.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"polygon-layer.d.ts","sourceRoot":"","sources":["../../src/polygon-layer/polygon-layer.ts"],"names":[],"mappings":"AAoBA,OAAO,EACL,QAAQ,EACR,gBAAgB,EAChB,KAAK,EACL,cAAc,EACd,mBAAmB,EAEnB,KAAK,EACL,UAAU,EAEV,IAAI,EACJ,QAAQ,EACR,gBAAgB,EAChB,YAAY,EACb,MAAM,eAAe,CAAC;AAMvB;;GAEG;AACH,oBAAY,iBAAiB,CAAC,KAAK,GAAG,GAAG,IAAI,kBAAkB,CAAC,KAAK,CAAC,GAAG,mBAAmB,CAAC,KAAK,CAAC,CAAC;AAEpG;;GAEG;AACH,aAAK,kBAAkB,CAAC,KAAK,GAAG,GAAG,IAAI;IACrC;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB;;;;;;;;;OASG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;;;;;OAOG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;;;;;;OAOG;IACH,S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AAkB,CAAC,KAAK,CAAC,CAAC,GAAG,UAAU,CACjD;IACC,MAAM,CAAC,SAAS,SAAkB;IAClC,MAAM,CAAC,YAAY,uCAAgB;IAEnC,eAAe,IAAI,IAAI;IAUvB,WAAW,CAAC,EAAC,WAAW,EAAC,EAAE,gBAAgB,CAAC,IAAI,CAAC;IAyBjD,OAAO,CAAC,SAAS;IAgCjB,YAAY,IAAI,KAAK,GAAG,IAAI,GAAG,UAAU;CAyI1C"} \ No newline at end of file diff --git a/modules/layers/typed/scatterplot-layer/scatterplot-layer-fragment.glsl.d.ts b/modules/layers/typed/scatterplot-layer/scatterplot-layer-fragment.glsl.d.ts new file mode 100644 index 00000000000..3328b5e2b7a --- /dev/null +++ b/modules/layers/typed/scatterplot-layer/scatterplot-layer-fragment.glsl.d.ts @@ -0,0 +1,3 @@ +declare const _default: '#define SHADER_NAME scatterplot-layer-fragment-shader\n\nprecision highp float;\n\nuniform bool filled;\nuniform float stroked;\nuniform bool antialiasing;\n\nvarying vec4 vFillColor;\nvarying vec4 vLineColor;\nvarying vec2 unitPosition;\nvarying float innerUnitRadius;\nvarying float outerRadiusPixels;\n\nvoid main(void) {\n geometry.uv = unitPosition;\n\n float distToCenter = length(unitPosition) * outerRadiusPixels;\n float inCircle = antialiasing ? \n smoothedge(distToCenter, outerRadiusPixels) : \n step(distToCenter, outerRadiusPixels);\n\n if (inCircle == 0.0) {\n discard;\n }\n\n if (stroked > 0.5) {\n float isLine = antialiasing ? \n smoothedge(innerUnitRadius * outerRadiusPixels, distToCenter) :\n step(innerUnitRadius * outerRadiusPixels, distToCenter);\n\n if (filled) {\n gl_FragColor = mix(vFillColor, vLineColor, isLine);\n } else {\n if (isLine == 0.0) {\n discard;\n }\n gl_FragColor = vec4(vLineColor.rgb, vLineColor.a * isLine);\n }\n } else if (filled) {\n gl_FragColor = vFillColor;\n } else {\n discard;\n }\n\n gl_FragColor.a *= inCircle;\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n'; +export default _default; +// # sourceMappingURL=scatterplot-layer-fragment.glsl.d.ts.map diff --git a/modules/layers/typed/scatterplot-layer/scatterplot-layer-fragment.glsl.d.ts.map b/modules/layers/typed/scatterplot-layer/scatterplot-layer-fragment.glsl.d.ts.map new file mode 100644 index 00000000000..1895d231547 --- /dev/null +++ b/modules/layers/typed/scatterplot-layer/scatterplot-layer-fragment.glsl.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"scatterplot-layer-fragment.glsl.d.ts","sourceRoot":"","sources":["../../src/scatterplot-layer/scatterplot-layer-fragment.glsl.ts"],"names":[],"mappings":";AAoBA,wBAiDE"} \ No newline at end of file diff --git a/modules/layers/typed/scatterplot-layer/scatterplot-layer-vertex.glsl.d.ts b/modules/layers/typed/scatterplot-layer/scatterplot-layer-vertex.glsl.d.ts new file mode 100644 index 00000000000..ba359d74646 --- /dev/null +++ b/modules/layers/typed/scatterplot-layer/scatterplot-layer-vertex.glsl.d.ts @@ -0,0 +1,3 @@ +declare const _default: '#define SHADER_NAME scatterplot-layer-vertex-shader\n\nattribute vec3 positions;\n\nattribute vec3 instancePositions;\nattribute vec3 instancePositions64Low;\nattribute float instanceRadius;\nattribute float instanceLineWidths;\nattribute vec4 instanceFillColors;\nattribute vec4 instanceLineColors;\nattribute vec3 instancePickingColors;\n\nuniform float opacity;\nuniform float radiusScale;\nuniform float radiusMinPixels;\nuniform float radiusMaxPixels;\nuniform float lineWidthScale;\nuniform float lineWidthMinPixels;\nuniform float lineWidthMaxPixels;\nuniform float stroked;\nuniform bool filled;\nuniform bool antialiasing;\nuniform bool billboard;\nuniform int radiusUnits;\nuniform int lineWidthUnits;\n\nvarying vec4 vFillColor;\nvarying vec4 vLineColor;\nvarying vec2 unitPosition;\nvarying float innerUnitRadius;\nvarying float outerRadiusPixels;\n\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n\n // Multiply out radius and clamp to limits\n outerRadiusPixels = clamp(\n project_size_to_pixel(radiusScale * instanceRadius, radiusUnits),\n radiusMinPixels, radiusMaxPixels\n );\n \n // Multiply out line width and clamp to limits\n float lineWidthPixels = clamp(\n project_size_to_pixel(lineWidthScale * instanceLineWidths, lineWidthUnits),\n lineWidthMinPixels, lineWidthMaxPixels\n );\n\n // outer radius needs to offset by half stroke width\n outerRadiusPixels += stroked * lineWidthPixels / 2.0;\n\n // Expand geometry to accomodate edge smoothing\n float edgePadding = antialiasing ? (outerRadiusPixels + SMOOTH_EDGE_RADIUS) / outerRadiusPixels : 1.0;\n\n // position on the containing square in [-1, 1] space\n unitPosition = edgePadding * positions.xy;\n geometry.uv = unitPosition;\n geometry.pickingColor = instancePickingColors;\n\n innerUnitRadius = 1.0 - stroked * lineWidthPixels / outerRadiusPixels;\n \n if (billboard) {\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, vec3(0.0), geometry.position);\n vec3 offset = edgePadding * positions * outerRadiusPixels;\n DECKGL_FILTER_SIZE(offset, geometry);\n gl_Position.xy += project_pixel_size_to_clipspace(offset.xy);\n } else {\n vec3 offset = edgePadding * positions * project_pixel_size(outerRadiusPixels);\n DECKGL_FILTER_SIZE(offset, geometry);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, offset, geometry.position);\n }\n\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n // Apply opacity to instance color, or return instance picking color\n vFillColor = vec4(instanceFillColors.rgb, instanceFillColors.a * opacity);\n DECKGL_FILTER_COLOR(vFillColor, geometry);\n vLineColor = vec4(instanceLineColors.rgb, instanceLineColors.a * opacity);\n DECKGL_FILTER_COLOR(vLineColor, geometry);\n}\n'; +export default _default; +// # sourceMappingURL=scatterplot-layer-vertex.glsl.d.ts.map diff --git a/modules/layers/typed/scatterplot-layer/scatterplot-layer-vertex.glsl.d.ts.map b/modules/layers/typed/scatterplot-layer/scatterplot-layer-vertex.glsl.d.ts.map new file mode 100644 index 00000000000..a50a1ea669f --- /dev/null +++ b/modules/layers/typed/scatterplot-layer/scatterplot-layer-vertex.glsl.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"scatterplot-layer-vertex.glsl.d.ts","sourceRoot":"","sources":["../../src/scatterplot-layer/scatterplot-layer-vertex.glsl.ts"],"names":[],"mappings":";AAoBA,wBAiFE"} \ No newline at end of file diff --git a/modules/layers/typed/scatterplot-layer/scatterplot-layer.d.ts b/modules/layers/typed/scatterplot-layer/scatterplot-layer.d.ts new file mode 100644 index 00000000000..ef2c77e9367 --- /dev/null +++ b/modules/layers/typed/scatterplot-layer/scatterplot-layer.d.ts @@ -0,0 +1,127 @@ +import {Layer} from '@deck.gl/core'; +import {Model} from '@luma.gl/webgl-legacy'; +import type { + LayerProps, + UpdateParameters, + Accessor, + Unit, + Position, + Color, + DefaultProps +} from '@deck.gl/core'; +/** All props supported by the ScatterplotLayer */ +export declare type ScatterplotLayerProps = _ScatterplotLayerProps & + LayerProps; +/** Props added by the ScatterplotLayer */ +declare type _ScatterplotLayerProps = { + /** + * The units of the radius, one of `'meters'`, `'common'`, and `'pixels'`. + * @default 'meters' + */ + radiusUnits?: Unit; + /** + * Radius multiplier. + * @default 1 + */ + radiusScale?: number; + /** + * The minimum radius in pixels. This prop can be used to prevent the circle from getting too small when zoomed out. + * @default 0 + */ + radiusMinPixels?: number; + /** + * The maximum radius in pixels. This prop can be used to prevent the circle from getting too big when zoomed in. + * @default Number.MAX_SAFE_INTEGER + */ + radiusMaxPixels?: number; + /** + * The units of the stroke width, one of `'meters'`, `'common'`, and `'pixels'`. + * @default 'meters' + */ + lineWidthUnits?: Unit; + /** + * Stroke width multiplier. + * @default 1 + */ + lineWidthScale?: number; + /** + * The minimum stroke width in pixels. This prop can be used to prevent the line from getting too thin when zoomed out. + * @default 0 + */ + lineWidthMinPixels?: number; + /** + * The maximum stroke width in pixels. This prop can be used to prevent the circle from getting too thick when zoomed in. + * @default Number.MAX_SAFE_INTEGER + */ + lineWidthMaxPixels?: number; + /** + * Draw the outline of points. + * @default false + */ + stroked?: boolean; + /** + * Draw the filled area of points. + * @default true + */ + filled?: boolean; + /** + * If `true`, rendered circles always face the camera. If `false` circles face up (i.e. are parallel with the ground plane). + * @default false + */ + billboard?: boolean; + /** + * If `true`, circles are rendered with smoothed edges. If `false`, circles are rendered with rough edges. Antialiasing can cause artifacts on edges of overlapping circles. + * @default true + */ + antialiasing?: boolean; + /** + * Center position accessor. + */ + getPosition?: Accessor; + /** + * Radius accessor. + * @default 1 + */ + getRadius?: Accessor; + /** + * Fill color accessor. + * @default [0, 0, 0, 255] + */ + getFillColor?: Accessor; + /** + * Stroke color accessor. + * @default [0, 0, 0, 255] + */ + getLineColor?: Accessor; + /** + * Stroke width accessor. + * @default 1 + */ + getLineWidth?: Accessor; + /** + * @deprecated Use `getLineWidth` instead + */ + strokeWidth?: number; + /** + * @deprecated Use `stroked` instead + */ + outline?: boolean; + /** + * @deprecated Use `getFillColor` and `getLineColor` instead + */ + getColor?: Accessor; +}; +/** Render circles at given coordinates. */ +export default class ScatterplotLayer extends Layer< + ExtraPropsT & Required<_ScatterplotLayerProps> +> { + static defaultProps: DefaultProps>; + static layerName: string; + getShaders(): any; + initializeState(): void; + updateState(params: UpdateParameters): void; + draw({uniforms}: {uniforms: any}): void; + protected _getModel(): Model; +} +export {}; +// # sourceMappingURL=scatterplot-layer.d.ts.map diff --git a/modules/layers/typed/scatterplot-layer/scatterplot-layer.d.ts.map b/modules/layers/typed/scatterplot-layer/scatterplot-layer.d.ts.map new file mode 100644 index 00000000000..15e3599e610 --- /dev/null +++ b/modules/layers/typed/scatterplot-layer/scatterplot-layer.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"scatterplot-layer.d.ts","sourceRoot":"","sources":["../../src/scatterplot-layer/scatterplot-layer.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAC,KAAK,EAA2B,MAAM,eAAe,CAAC;AAE9D,OAAO,EAAK,KAAK,EAAC,MAAM,uBAAuB,CAAC;AAKhD,OAAO,KAAK,EACV,UAAU,EACV,gBAAgB,EAChB,QAAQ,EACR,IAAI,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AM,CAAC,CAAC;IACvC;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;CACnC,CAAC;AA8BF,2CAA2C;AAC3C,MAAM,CAAC,OAAO,OAAO,gBAAgB,CAAC,KAAK,GAAG,GAAG,EAAE,WAAW,GAAG,EAAE,CAAE,SAAQ,KAAK,CAChF,WAAW,GAAG,QAAQ,CAAC,sBAAsB,CAAC,KAAK,CAAC,CAAC,CACtD;IACC,MAAM,CAAC,YAAY,2CAAgB;IACnC,MAAM,CAAC,SAAS,EAAE,MAAM,CAAsB;IAE9C,UAAU;IAIV,eAAe;IAwCf,WAAW,CAAC,MAAM,EAAE,gBAAgB,CAAC,IAAI,CAAC;IAU1C,IAAI,CAAC,EAAC,QAAQ,EAAC;;KAAA;IAmCf,SAAS,CAAC,SAAS;CAiBpB"} \ No newline at end of file diff --git a/modules/layers/typed/solid-polygon-layer/polygon-tesselator.d.ts b/modules/layers/typed/solid-polygon-layer/polygon-tesselator.d.ts new file mode 100644 index 00000000000..9b561f4192e --- /dev/null +++ b/modules/layers/typed/solid-polygon-layer/polygon-tesselator.d.ts @@ -0,0 +1,53 @@ +import * as Polygon from './polygon'; +import {Tesselator} from '@deck.gl/core'; +import type { + PolygonGeometry, + NormalizedPolygonGeometry, + FlatComplexPolygonGeometry +} from './polygon'; +import type {TypedArray} from '@math.gl/core'; +declare type GeometryUpdateContext = { + vertexStart: number; + indexStart: number; + geometrySize: number; + geometryIndex: number; +}; +declare type CutPolygon = FlatComplexPolygonGeometry & { + edgeTypes: number[]; +}; +export default class PolygonTesselator extends Tesselator< + PolygonGeometry, + NormalizedPolygonGeometry | CutPolygon[], + { + fp64?: boolean; + IndexType?: Uint32ArrayConstructor | Uint16ArrayConstructor; + resolution?: number; + wrapLongitude?: boolean; + preproject?: (xy: number[]) => number[]; + full3d?: boolean; + } +> { + constructor(opts: any); + /** Get attribute by name */ + get(attributeName: string): TypedArray | null; + /** Override base Tesselator method */ + updateGeometry(opts: any): void; + /** Implement base Tesselator interface */ + protected normalizeGeometry(polygon: PolygonGeometry): NormalizedPolygonGeometry | CutPolygon[]; + /** Implement base Tesselator interface */ + protected getGeometrySize(polygon: NormalizedPolygonGeometry | CutPolygon[]): number; + /** Override base Tesselator method */ + protected getGeometryFromBuffer( + buffer: any + ): import('@deck.gl/core').AccessorFunction; + /** Implement base Tesselator interface */ + protected updateGeometryAttributes( + polygon: NormalizedPolygonGeometry | CutPolygon[] | null, + context: GeometryUpdateContext + ): void; + private _updateIndices; + private _updatePositions; + private _updateVertexValid; +} +export {}; +// # sourceMappingURL=polygon-tesselator.d.ts.map diff --git a/modules/layers/typed/solid-polygon-layer/polygon-tesselator.d.ts.map b/modules/layers/typed/solid-polygon-layer/polygon-tesselator.d.ts.map new file mode 100644 index 00000000000..5f3075edf7d --- /dev/null +++ b/modules/layers/typed/solid-polygon-layer/polygon-tesselator.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"polygon-tesselator.d.ts","sourceRoot":"","sources":["../../src/solid-polygon-layer/polygon-tesselator.ts"],"names":[],"mappings":"AAyBA,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AACrC,OAAO,EAAC,UAAU,EAAC,MAAM,eAAe,CAAC;AAGzC,OAAO,KAAK,EACV,eAAe,EACf,yBAAyB,EACzB,0BAA0B,EAC3B,MAAM,WAAW,CAAC;AACnB,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,eAAe,CAAC;AAE9C,aAAK,qBAAqB,GAAG;IAC3B,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,aAAK,UAAU,GAAG,0BAA0B,GAAG;IAC7C,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB,CAAC;AAIF,MAAM,CAAC,OAAO,OAAO,iBAAkB,SAAQ,UAAU,CACvD,eAAe,EACf,yBAAyB,GAAG,UAAU,EAAE,EACxC;IACE,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,SAAS,CAAC,EAAE,sBAAsB,GAAG,sBAAsB,CAAC;IAC5D,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,MAAM,EAAE,CAAC;IACxC,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,CACF;gBACa,IAAI,KAAA;IAYhB,4BAA4B;IAC5B,GAAG,CAAC,aAAa,EAAE,MAAM,GAAG,UAAU,GAAG,IAAI;IAS7C,sCAAsC;IACtC,cAAc,CAAC,IAAI,KAAA;IAYnB,0CAA0C;IAC1C,SAAS,CAAC,iBAAiB,CAAC,OAAO,EAAE,eAAe,GAAG,yBAAyB,GAAG,UAAU,EAAE;IA+B/F,0CAA0C;IAC1C,SAAS,CAAC,eAAe,CAAC,OAAO,EAAE,yBAAyB,GAAG,UAAU,EAAE,GAAG,MAAM;IAWpF,sCAAsC;IACtC,SAAS,CAAC,qBAAqB,CAAC,MAAM,KAAA;IAQtC,0CAA0C;IAC1C,SAAS,CAAC,wBAAwB,CAChC,OAAO,EAAE,yBAAyB,GAAG,UAAU,EAAE,GAAG,IAAI,EACxD,OAAO,EAAE,qBAAqB;IAmBhC,OAAO,CAAC,cAAc;IAmCtB,OAAO,CAAC,gBAAgB;IAwBxB,OAAO,CAAC,kBAAkB;CA4B3B"} \ No newline at end of file diff --git a/modules/layers/typed/solid-polygon-layer/polygon.d.ts b/modules/layers/typed/solid-polygon-layer/polygon.d.ts new file mode 100644 index 00000000000..da26fbc2ad6 --- /dev/null +++ b/modules/layers/typed/solid-polygon-layer/polygon.d.ts @@ -0,0 +1,44 @@ +import type {Position} from '@deck.gl/core'; +import type {NumericArray} from '@math.gl/core'; +/** Simple Polygon: an array of points */ +export declare type NestedSimplePolygonGeometry = Position[]; +/** Complex Polygon: an array of array of points (array of rings) + * with the first ring representing the outer hull and other rings representing holes + */ +export declare type NestedComplexPolygonGeometry = Position[][]; +/** An array of numbers (flattened "simple polygon") */ +export declare type FlatSimplePolygonGeometry = NumericArray; +/** Flattened "complex polygon" */ +export declare type FlatComplexPolygonGeometry = { + positions: NumericArray; + holeIndices: NumericArray; +}; +export declare type PolygonGeometry = + | NestedSimplePolygonGeometry + | NestedComplexPolygonGeometry + | FlatSimplePolygonGeometry + | FlatComplexPolygonGeometry; +export declare type NormalizedPolygonGeometry = + | FlatSimplePolygonGeometry + | FlatComplexPolygonGeometry; +/** Get the positions from a normalized polygon */ +export declare function getPositions(polygon: NormalizedPolygonGeometry): NumericArray; +/** Get the hole indices from a normalized polygon */ +export declare function getHoleIndices(polygon: NormalizedPolygonGeometry): NumericArray | null; +/** + * Normalize any polygon representation into the "complex flat" format + */ +export declare function normalize( + polygon: PolygonGeometry, + positionSize: number +): NormalizedPolygonGeometry; +/** + * Get vertex indices for drawing polygon mesh (triangulation) + */ +export declare function getSurfaceIndices( + polygon: NormalizedPolygonGeometry, + positionSize: number, + preproject?: (xy: number[]) => number[], + full3d?: boolean +): number[]; +// # sourceMappingURL=polygon.d.ts.map diff --git a/modules/layers/typed/solid-polygon-layer/polygon.d.ts.map b/modules/layers/typed/solid-polygon-layer/polygon.d.ts.map new file mode 100644 index 00000000000..86ec866a225 --- /dev/null +++ b/modules/layers/typed/solid-polygon-layer/polygon.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"polygon.d.ts","sourceRoot":"","sources":["../../src/solid-polygon-layer/polygon.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,eAAe,CAAC;AAC5C,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,eAAe,CAAC;AAmBhD,yCAAyC;AACzC,oBAAY,2BAA2B,GAAG,QAAQ,EAAE,CAAC;AACrD;;GAEG;AACH,oBAAY,4BAA4B,GAAG,QAAQ,EAAE,EAAE,CAAC;AACxD,uDAAuD;AACvD,oBAAY,yBAAyB,GAAG,YAAY,CAAC;AACrD,kCAAkC;AAClC,oBAAY,0BAA0B,GAAG;IAAC,SAAS,EAAE,YAAY,CAAC;IAAC,WAAW,EAAE,YAAY,CAAA;CAAC,CAAC;AAE9F,oBAAY,eAAe,GACvB,2BAA2B,GAC3B,4BAA4B,GAC5B,yBAAyB,GACzB,0BAA0B,CAAC;AAE/B,oBAAY,yBAAyB,GAAG,yBAAyB,GAAG,0BAA0B,CAAC;AAY/F,kDAAkD;AAClD,wBAAgB,YAAY,CAAC,OAAO,EAAE,yBAAyB,GAAG,YAAY,CAE7E;AAED,qDAAqD;AACrD,wBAAgB,cAAc,CAAC,OAAO,EAAE,yBAAyB,GAAG,YAAY,GAAG,IAAI,CAEtF;AAyID;;GAEG;AAEH,wBAAgB,SAAS,CACvB,OAAO,EAAE,eAAe,EACxB,YAAY,EAAE,MAAM,GACnB,yBAAyB,CA6D3B;AAgCD;;GAEG;AAEH,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,yBAAyB,EAClC,YAAY,EAAE,MAAM,EACpB,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,MAAM,EAAE,EACvC,MAAM,CAAC,EAAE,OAAO,GACf,MAAM,EAAE,CAmEV"} \ No newline at end of file diff --git a/modules/layers/typed/solid-polygon-layer/solid-polygon-layer-fragment.glsl.d.ts b/modules/layers/typed/solid-polygon-layer/solid-polygon-layer-fragment.glsl.d.ts new file mode 100644 index 00000000000..5e11bb8bca3 --- /dev/null +++ b/modules/layers/typed/solid-polygon-layer/solid-polygon-layer-fragment.glsl.d.ts @@ -0,0 +1,3 @@ +declare const _default: '#define SHADER_NAME solid-polygon-layer-fragment-shader\n\nprecision highp float;\n\nvarying vec4 vColor;\n\nvoid main(void) {\n gl_FragColor = vColor;\n\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n'; +export default _default; +// # sourceMappingURL=solid-polygon-layer-fragment.glsl.d.ts.map diff --git a/modules/layers/typed/solid-polygon-layer/solid-polygon-layer-fragment.glsl.d.ts.map b/modules/layers/typed/solid-polygon-layer/solid-polygon-layer-fragment.glsl.d.ts.map new file mode 100644 index 00000000000..4e07b20f7b6 --- /dev/null +++ b/modules/layers/typed/solid-polygon-layer/solid-polygon-layer-fragment.glsl.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"solid-polygon-layer-fragment.glsl.d.ts","sourceRoot":"","sources":["../../src/solid-polygon-layer/solid-polygon-layer-fragment.glsl.ts"],"names":[],"mappings":";AAoBA,wBAYE"} \ No newline at end of file diff --git a/modules/layers/typed/solid-polygon-layer/solid-polygon-layer-vertex-main.glsl.d.ts b/modules/layers/typed/solid-polygon-layer/solid-polygon-layer-vertex-main.glsl.d.ts new file mode 100644 index 00000000000..5cf411c0afc --- /dev/null +++ b/modules/layers/typed/solid-polygon-layer/solid-polygon-layer-vertex-main.glsl.d.ts @@ -0,0 +1,3 @@ +declare const _default: '\nattribute vec2 vertexPositions;\nattribute float vertexValid;\n\nuniform bool extruded;\nuniform bool isWireframe;\nuniform float elevationScale;\nuniform float opacity;\n\nvarying vec4 vColor;\n\nstruct PolygonProps {\n vec4 fillColors;\n vec4 lineColors;\n vec3 positions;\n vec3 nextPositions;\n vec3 pickingColors;\n vec3 positions64Low;\n vec3 nextPositions64Low;\n float elevations;\n};\n\nvec3 project_offset_normal(vec3 vector) {\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT ||\n project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSETS) {\n // normals generated by the polygon tesselator are in lnglat offsets instead of meters\n return normalize(vector * project_uCommonUnitsPerWorldUnit);\n }\n return project_normal(vector);\n}\n\nvoid calculatePosition(PolygonProps props) {\n#ifdef IS_SIDE_VERTEX\n if(vertexValid < 0.5){\n gl_Position = vec4(0.);\n return;\n }\n#endif\n\n vec3 pos;\n vec3 pos64Low;\n vec3 normal;\n vec4 colors = isWireframe ? props.lineColors : props.fillColors;\n\n geometry.worldPosition = props.positions;\n geometry.worldPositionAlt = props.nextPositions;\n geometry.pickingColor = props.pickingColors;\n\n#ifdef IS_SIDE_VERTEX\n pos = mix(props.positions, props.nextPositions, vertexPositions.x);\n pos64Low = mix(props.positions64Low, props.nextPositions64Low, vertexPositions.x);\n#else\n pos = props.positions;\n pos64Low = props.positions64Low;\n#endif\n\n if (extruded) {\n pos.z += props.elevations * vertexPositions.y * elevationScale;\n }\n gl_Position = project_position_to_clipspace(pos, pos64Low, vec3(0.), geometry.position);\n\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n if (extruded) {\n #ifdef IS_SIDE_VERTEX\n normal = vec3(\n props.positions.y - props.nextPositions.y + (props.positions64Low.y - props.nextPositions64Low.y),\n props.nextPositions.x - props.positions.x + (props.nextPositions64Low.x - props.positions64Low.x),\n 0.0);\n normal = project_offset_normal(normal);\n #else\n normal = project_normal(vec3(0.0, 0.0, 1.0));\n #endif\n geometry.normal = normal;\n vec3 lightColor = lighting_getLightColor(colors.rgb, project_uCameraPosition, geometry.position.xyz, normal);\n vColor = vec4(lightColor, colors.a * opacity);\n } else {\n vColor = vec4(colors.rgb, colors.a * opacity);\n }\n DECKGL_FILTER_COLOR(vColor, geometry);\n}\n'; +export default _default; +// # sourceMappingURL=solid-polygon-layer-vertex-main.glsl.d.ts.map diff --git a/modules/layers/typed/solid-polygon-layer/solid-polygon-layer-vertex-main.glsl.d.ts.map b/modules/layers/typed/solid-polygon-layer/solid-polygon-layer-vertex-main.glsl.d.ts.map new file mode 100644 index 00000000000..e9cae80d526 --- /dev/null +++ b/modules/layers/typed/solid-polygon-layer/solid-polygon-layer-vertex-main.glsl.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"solid-polygon-layer-vertex-main.glsl.d.ts","sourceRoot":"","sources":["../../src/solid-polygon-layer/solid-polygon-layer-vertex-main.glsl.ts"],"names":[],"mappings":";AAoBA,wBAkFE"} \ No newline at end of file diff --git a/modules/layers/typed/solid-polygon-layer/solid-polygon-layer-vertex-side.glsl.d.ts b/modules/layers/typed/solid-polygon-layer/solid-polygon-layer-vertex-side.glsl.d.ts new file mode 100644 index 00000000000..cfdd28bbdd1 --- /dev/null +++ b/modules/layers/typed/solid-polygon-layer/solid-polygon-layer-vertex-side.glsl.d.ts @@ -0,0 +1,3 @@ +declare const _default: string; +export default _default; +// # sourceMappingURL=solid-polygon-layer-vertex-side.glsl.d.ts.map diff --git a/modules/layers/typed/solid-polygon-layer/solid-polygon-layer-vertex-side.glsl.d.ts.map b/modules/layers/typed/solid-polygon-layer/solid-polygon-layer-vertex-side.glsl.d.ts.map new file mode 100644 index 00000000000..26c4ba2da2b --- /dev/null +++ b/modules/layers/typed/solid-polygon-layer/solid-polygon-layer-vertex-side.glsl.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"solid-polygon-layer-vertex-side.glsl.d.ts","sourceRoot":"","sources":["../../src/solid-polygon-layer/solid-polygon-layer-vertex-side.glsl.ts"],"names":[],"mappings":";AAsBA,wBAqCE"} \ No newline at end of file diff --git a/modules/layers/typed/solid-polygon-layer/solid-polygon-layer-vertex-top.glsl.d.ts b/modules/layers/typed/solid-polygon-layer/solid-polygon-layer-vertex-top.glsl.d.ts new file mode 100644 index 00000000000..448132035ba --- /dev/null +++ b/modules/layers/typed/solid-polygon-layer/solid-polygon-layer-vertex-top.glsl.d.ts @@ -0,0 +1,3 @@ +declare const _default: string; +export default _default; +// # sourceMappingURL=solid-polygon-layer-vertex-top.glsl.d.ts.map diff --git a/modules/layers/typed/solid-polygon-layer/solid-polygon-layer-vertex-top.glsl.d.ts.map b/modules/layers/typed/solid-polygon-layer/solid-polygon-layer-vertex-top.glsl.d.ts.map new file mode 100644 index 00000000000..f42fd064129 --- /dev/null +++ b/modules/layers/typed/solid-polygon-layer/solid-polygon-layer-vertex-top.glsl.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"solid-polygon-layer-vertex-top.glsl.d.ts","sourceRoot":"","sources":["../../src/solid-polygon-layer/solid-polygon-layer-vertex-top.glsl.ts"],"names":[],"mappings":";AAsBA,wBAwBE"} \ No newline at end of file diff --git a/modules/layers/typed/solid-polygon-layer/solid-polygon-layer.d.ts b/modules/layers/typed/solid-polygon-layer/solid-polygon-layer.d.ts new file mode 100644 index 00000000000..b1df5f2d517 --- /dev/null +++ b/modules/layers/typed/solid-polygon-layer/solid-polygon-layer.d.ts @@ -0,0 +1,104 @@ +import {Layer} from '@deck.gl/core'; +import {Model} from '@luma.gl/webgl-legacy'; +import PolygonTesselator from './polygon-tesselator'; +import type { + LayerProps, + Color, + Material, + Accessor, + AccessorFunction, + UpdateParameters, + GetPickingInfoParams, + PickingInfo, + DefaultProps +} from '@deck.gl/core'; +import type {PolygonGeometry} from './polygon'; +declare type _SolidPolygonLayerProps = { + /** Whether to fill the polygons + * @default true + */ + filled?: boolean; + /** Whether to extrude the polygons + * @default false + */ + extruded?: boolean; + /** Whether to generate a line wireframe of the polygon. + * @default false + */ + wireframe?: boolean; + /** + * (Experimental) If `false`, will skip normalizing the coordinates returned by `getPolygon`. + * @default true + */ + _normalize?: boolean; + /** + * (Experimental) This prop is only effective with `_normalize: false`. + * It specifies the winding order of rings in the polygon data, one of 'CW' (clockwise) and 'CCW' (counter-clockwise) + */ + _windingOrder?: 'CW' | 'CCW'; + /** + * (Experimental) This prop is only effective with `XYZ` data. + * When true, polygon tesselation will be performed on the plane with the largest area, instead of the xy plane. + * @default false + */ + _full3d?: boolean; + /** Elevation multiplier. + * @default 1 + */ + elevationScale?: number; + /** Polygon geometry accessor. */ + getPolygon?: AccessorFunction; + /** Extrusion height accessor. + * @default 1000 + */ + getElevation?: Accessor; + /** Fill color accessor. + * @default [0, 0, 0, 255] + */ + getFillColor?: Accessor; + /** Stroke color accessor. + * @default [0, 0, 0, 255] + */ + getLineColor?: Accessor; + /** + * Material settings for lighting effect. Applies if `extruded: true` + * + * @default true + * @see https://deck.gl/docs/developer-guide/using-lighting + */ + material?: Material; +}; +/** Render filled and/or extruded polygons. */ +export declare type SolidPolygonLayerProps = _SolidPolygonLayerProps & + LayerProps; +export default class SolidPolygonLayer extends Layer< + ExtraPropsT & Required<_SolidPolygonLayerProps> +> { + static defaultProps: DefaultProps>; + static layerName: string; + state: { + topModel?: Model; + sideModel?: Model; + models?: Model[]; + numInstances: number; + polygonTesselator: PolygonTesselator; + }; + getShaders(type: any): any; + get wrapLongitude(): boolean; + initializeState(): void; + getPickingInfo(params: GetPickingInfoParams): PickingInfo; + disablePickingIndex(objectIndex: number): void; + draw({uniforms}: {uniforms: any}): void; + updateState(updateParams: UpdateParameters): void; + protected updateGeometry({props, oldProps, changeFlags}: UpdateParameters): void; + protected _getModels(): { + models: Model[]; + topModel: any; + sideModel: any; + }; + protected calculateIndices(attribute: any): void; + protected calculatePositions(attribute: any): void; + protected calculateVertexValid(attribute: any): void; +} +export {}; +// # sourceMappingURL=solid-polygon-layer.d.ts.map diff --git a/modules/layers/typed/solid-polygon-layer/solid-polygon-layer.d.ts.map b/modules/layers/typed/solid-polygon-layer/solid-polygon-layer.d.ts.map new file mode 100644 index 00000000000..4db571d9b9e --- /dev/null +++ b/modules/layers/typed/solid-polygon-layer/solid-polygon-layer.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"solid-polygon-layer.d.ts","sourceRoot":"","sources":["../../src/solid-polygon-layer/solid-polygon-layer.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAC,KAAK,EAAyD,MAAM,eAAe,CAAC;AAG5F,OAAO,EAAC,KAAK,EAAwB,MAAM,uBAAuB,CAAC;AAGnE,OAAO,iBAAiB,MAAM,sBAAsB,CAAC;AAMrD,OAAO,KAAK,EACV,UAAU,EACV,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,gBAAgB,EAChB,gBAAgB,EAChB,oBAAoB,EACpB,WAAW,EACX,YAAY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B;IAEvC,KAAK,EAAG;QACN,QAAQ,CAAC,EAAE,KAAK,CAAC;QACjB,SAAS,CAAC,EAAE,KAAK,CAAC;QAClB,MAAM,CAAC,EAAE,KAAK,EAAE,CAAC;QACjB,YAAY,EAAE,MAAM,CAAC;QACrB,iBAAiB,EAAE,iBAAiB,CAAC;KACtC,CAAC;IAEF,UAAU,CAAC,IAAI,KAAA;IAWf,IAAI,aAAa,IAAI,OAAO,CAE3B;IAED,eAAe;IA0If,cAAc,CAAC,MAAM,EAAE,oBAAoB,GAAG,WAAW;IAazD,mBAAmB,CAAC,WAAW,EAAE,MAAM;IAgBvC,IAAI,CAAC,EAAC,QAAQ,EAAC;;KAAA;IA8Bf,WAAW,CAAC,YAAY,EAAE,gBAAgB,CAAC,IAAI,CAAC;IAqBhD,SAAS,CAAC,cAAc,CAAC,EAAC,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAC,EAAE,gBAAgB,CAAC,IAAI,CAAC;IAuC/E,SAAS,CAAC,UAAU;;;;;IA8DpB,SAAS,CAAC,gBAAgB,CAAC,SAAS,KAAA;IAMpC,SAAS,CAAC,kBAAkB,CAAC,SAAS,KAAA;IAMtC,SAAS,CAAC,oBAAoB,CAAC,SAAS,KAAA;CAGzC"} \ No newline at end of file diff --git a/modules/layers/typed/text-layer/font-atlas-manager.d.ts b/modules/layers/typed/text-layer/font-atlas-manager.d.ts new file mode 100644 index 00000000000..0c46965b8cc --- /dev/null +++ b/modules/layers/typed/text-layer/font-atlas-manager.d.ts @@ -0,0 +1,75 @@ +import {CharacterMapping} from './utils'; +export declare type FontSettings = { + /** CSS font family + * @default 'Monaco, monospace' + */ + fontFamily?: string; + /** CSS font weight + * @default 'normal' + */ + fontWeight?: string | number; + /** Specifies a list of characters to include in the font. + * @default (ASCII characters 32-128) + */ + characterSet?: Set | string[] | string; + /** Font size in pixels. This option is only applied for generating `fontAtlas`, it does not impact the size of displayed text labels. Larger `fontSize` will give you a sharper look when rendering text labels with very large font sizes. But larger `fontSize` requires more time and space to generate the `fontAtlas`. + * @default 64 + */ + fontSize?: number; + /** Whitespace buffer around each side of the character. In general, bigger `fontSize` requires bigger `buffer`. Increase `buffer` will add more space between each character when layout `characterSet` in `fontAtlas`. This option could be tuned to provide sufficient space for drawing each character and avoiding overlapping of neighboring characters. + * @default 4 + */ + buffer?: number; + /** Flag to enable / disable `sdf`. [`sdf` (Signed Distance Fields)](http://cs.brown.edu/people/pfelzens/papers/dt-final.pdf) will provide a sharper look when rendering with very large or small font sizes. `TextLayer` integrates with [`TinySDF`](https://github.com/mapbox/tiny-sdf) which implements the `sdf` algorithm. + * @default false + */ + sdf?: boolean; + /** How much of the radius (relative) is used for the inside part the glyph. Bigger `cutoff` makes character thinner. Smaller `cutoff` makes character look thicker. Only applies when `sdf: true`. + * @default 0.25 + */ + cutoff?: number; + /** How many pixels around the glyph shape to use for encoding distance. Bigger radius yields higher quality outcome. Only applies when `sdf: true`. + * @default 12 + */ + radius?: number; + /** How much smoothing to apply to the text edges. Only applies when `sdf: true`. + * @default 0.1 + */ + smoothing?: number; +}; +export declare const DEFAULT_FONT_SETTINGS: Required; +declare type FontAtlas = { + /** x position of last character in mapping */ + xOffset: number; + /** y position of last character in mapping */ + yOffset: number; + /** bounding box of each character in the texture */ + mapping: CharacterMapping; + /** packed texture */ + data: HTMLCanvasElement; + /** texture width */ + width: number; + /** texture height */ + height: number; +}; +/** + * Sets the Font Atlas LRU Cache Limit + * @param {number} limit LRU Cache limit + */ +export declare function setFontAtlasCacheLimit(limit: number): void; +export default class FontAtlasManager { + /** Font settings */ + props: Required; + /** Cache key of the current font atlas */ + private _key?; + /** The current font atlas */ + private _atlas?; + get atlas(): Readonly | undefined; + get mapping(): CharacterMapping | undefined; + get scale(): number; + setProps(props?: FontSettings): void; + private _generateFontAtlas; + private _getKey; +} +export {}; +// # sourceMappingURL=font-atlas-manager.d.ts.map diff --git a/modules/layers/typed/text-layer/font-atlas-manager.d.ts.map b/modules/layers/typed/text-layer/font-atlas-manager.d.ts.map new file mode 100644 index 00000000000..976dd075f7d --- /dev/null +++ b/modules/layers/typed/text-layer/font-atlas-manager.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"font-atlas-manager.d.ts","sourceRoot":"","sources":["../../src/text-layer/font-atlas-manager.ts"],"names":[],"mappings":"AAKA,OAAO,EAAe,gBAAgB,EAAC,MAAM,SAAS,CAAC;AAavD,oBAAY,YAAY,GAAG;IACzB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC7B;;OAEG;IACH,YAAY,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,GAAG,MAAM,EAAE,GAAG,MAAM,CAAC;IAC/C;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,GAAG,CAAC,EAAE,OAAO,CAAC;IACd;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,YAAY,CAUxD,CAAC;AAUF,aAAK,SAAS,GAAG;IACf,8CAA8C;IAC9C,OAAO,EAAE,MAAM,CAAC;IAChB,8CAA8C;IAC9C,OAAO,EAAE,MAAM,CAAC;IAChB,oDAAoD;IACpD,OAAO,EAAE,gBAAgB,CAAC;IAC1B,qBAAqB;IACrB,IAAI,EAAE,iBAAiB,CAAC;IACxB,oBAAoB;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,qBAAqB;IACrB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAgDF;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAI1D;AAED,MAAM,CAAC,OAAO,OAAO,gBAAgB;IACnC,oBAAoB;IACpB,KAAK,EAAE,QAAQ,CAAC,YAAY,CAAC,CAA8B;IAE3D,0CAA0C;IAC1C,OAAO,CAAC,IAAI,CAAC,CAAS;IACtB,6BAA6B;IAC7B,OAAO,CAAC,MAAM,CAAC,CAAY;IAE3B,IAAI,KAAK,IAAI,QAAQ,CAAC,SAAS,CAAC,GAAG,SAAS,CAE3C;IAOD,IAAI,OAAO,IAAI,gBAAgB,GAAG,SAAS,CAE1C;IAED,IAAI,KAAK,IAAI,MAAM,CAGlB;IAED,QAAQ,CAAC,KAAK,GAAE,YAAiB;IA4BjC,OAAO,CAAC,kBAAkB;IAsE1B,OAAO,CAAC,OAAO;CAOhB"} \ No newline at end of file diff --git a/modules/layers/typed/text-layer/lru-cache.d.ts b/modules/layers/typed/text-layer/lru-cache.d.ts new file mode 100644 index 00000000000..cb66058dbb5 --- /dev/null +++ b/modules/layers/typed/text-layer/lru-cache.d.ts @@ -0,0 +1,19 @@ +/** + * LRU Cache class with limit + * + * Update order for each get/set operation + * Delete oldest when reach given limit + */ +export default class LRUCache { + private limit; + private _cache; + /** access/update order, first item is oldest, last item is newest */ + private _order; + constructor(limit?: number); + get(key: string): ValueT; + set(key: string, value: ValueT): void; + delete(key: string): void; + private _deleteOrder; + private _appendOrder; +} +// # sourceMappingURL=lru-cache.d.ts.map diff --git a/modules/layers/typed/text-layer/lru-cache.d.ts.map b/modules/layers/typed/text-layer/lru-cache.d.ts.map new file mode 100644 index 00000000000..516ce7a47ee --- /dev/null +++ b/modules/layers/typed/text-layer/lru-cache.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"lru-cache.d.ts","sourceRoot":"","sources":["../../src/text-layer/lru-cache.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,OAAO,OAAO,QAAQ,CAAC,MAAM;IAClC,OAAO,CAAC,KAAK,CAAS;IACtB,OAAO,CAAC,MAAM,CAA8B;IAC5C,qEAAqE;IACrE,OAAO,CAAC,MAAM,CAAgB;gBAElB,KAAK,GAAE,MAAU;IAI7B,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM;IAUxB,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;IAkBrC,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAQzB,OAAO,CAAC,YAAY;IAOpB,OAAO,CAAC,YAAY;CAGrB"} \ No newline at end of file diff --git a/modules/layers/typed/text-layer/multi-icon-layer/multi-icon-layer-fragment.glsl.d.ts b/modules/layers/typed/text-layer/multi-icon-layer/multi-icon-layer-fragment.glsl.d.ts new file mode 100644 index 00000000000..ab3a8de1073 --- /dev/null +++ b/modules/layers/typed/text-layer/multi-icon-layer/multi-icon-layer-fragment.glsl.d.ts @@ -0,0 +1,3 @@ +declare const _default: '#define SHADER_NAME multi-icon-layer-fragment-shader\n\nprecision highp float;\n\nuniform float opacity;\nuniform sampler2D iconsTexture;\nuniform float gamma;\nuniform bool sdf;\nuniform float alphaCutoff;\nuniform float buffer;\nuniform float outlineBuffer;\nuniform vec4 outlineColor;\n\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\nvarying vec2 uv;\n\nvoid main(void) {\n geometry.uv = uv;\n\n if (!picking_uActive) {\n float alpha = texture2D(iconsTexture, vTextureCoords).a;\n vec4 color = vColor;\n\n // if enable sdf (signed distance fields)\n if (sdf) {\n float distance = alpha;\n alpha = smoothstep(buffer - gamma, buffer + gamma, distance);\n\n if (outlineBuffer > 0.0) {\n float inFill = alpha;\n float inBorder = smoothstep(outlineBuffer - gamma, outlineBuffer + gamma, distance);\n color = mix(outlineColor, vColor, inFill);\n alpha = inBorder;\n }\n }\n\n // Take the global opacity and the alpha from color into account for the alpha component\n float a = alpha * color.a;\n \n if (a < alphaCutoff) {\n discard;\n }\n\n gl_FragColor = vec4(color.rgb, a * opacity);\n }\n\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n'; +export default _default; +// # sourceMappingURL=multi-icon-layer-fragment.glsl.d.ts.map diff --git a/modules/layers/typed/text-layer/multi-icon-layer/multi-icon-layer-fragment.glsl.d.ts.map b/modules/layers/typed/text-layer/multi-icon-layer/multi-icon-layer-fragment.glsl.d.ts.map new file mode 100644 index 00000000000..feb05ad2c7a --- /dev/null +++ b/modules/layers/typed/text-layer/multi-icon-layer/multi-icon-layer-fragment.glsl.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"multi-icon-layer-fragment.glsl.d.ts","sourceRoot":"","sources":["../../../src/text-layer/multi-icon-layer/multi-icon-layer-fragment.glsl.ts"],"names":[],"mappings":";AAoBA,wBAkDE"} \ No newline at end of file diff --git a/modules/layers/typed/text-layer/multi-icon-layer/multi-icon-layer.d.ts b/modules/layers/typed/text-layer/multi-icon-layer/multi-icon-layer.d.ts new file mode 100644 index 00000000000..25da2829dd2 --- /dev/null +++ b/modules/layers/typed/text-layer/multi-icon-layer/multi-icon-layer.d.ts @@ -0,0 +1,31 @@ +import IconLayer from '../../icon-layer/icon-layer'; +import type {IconLayerProps} from '../../icon-layer/icon-layer'; +import type {Accessor, Color, UpdateParameters, DefaultProps} from '@deck.gl/core'; +declare type _MultiIconLayerProps = { + getIconOffsets?: Accessor; + sdf?: boolean; + smoothing?: number; + outlineWidth?: number; + outlineColor?: Color; +}; +export declare type MultiIconLayerProps = _MultiIconLayerProps & + IconLayerProps; +export default class MultiIconLayer extends IconLayer< + DataT, + ExtraPropsT & Required<_MultiIconLayerProps> +> { + static defaultProps: DefaultProps>; + static layerName: string; + state: IconLayer['state'] & { + outlineColor: Color; + }; + getShaders(): any; + initializeState(): void; + updateState(params: UpdateParameters): void; + draw(params: any): void; + protected getInstanceOffset(icons: string): number[]; + getInstanceColorMode(icons: string): number; + getInstanceIconFrame(icons: string): number[]; +} +export {}; +// # sourceMappingURL=multi-icon-layer.d.ts.map diff --git a/modules/layers/typed/text-layer/multi-icon-layer/multi-icon-layer.d.ts.map b/modules/layers/typed/text-layer/multi-icon-layer/multi-icon-layer.d.ts.map new file mode 100644 index 00000000000..5daad4bb80f --- /dev/null +++ b/modules/layers/typed/text-layer/multi-icon-layer/multi-icon-layer.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"multi-icon-layer.d.ts","sourceRoot":"","sources":["../../../src/text-layer/multi-icon-layer/multi-icon-layer.ts"],"names":[],"mappings":"AAsBA,OAAO,SAAS,MAAM,6BAA6B,CAAC;AAIpD,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAAC,QAAQ,EAAE,KAAK,EAAE,gBAAgB,EAAE,YAAY,EAAC,MAAM,eAAe,CAAC;AAMnF,aAAK,oBAAoB,CAAC,KAAK,IAAI;IACjC,cAAc,CAAC,EAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC;IAC3C,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,KAAK,CAAC;CACtB,CAAC;AAEF,oBAAY,mBAAmB,CAAC,KAAK,GAAG,GAAG,IAAI,oBAAoB,CAAC,KAAK,CAAC,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC;AAUnG,MAAM,CAAC,OAAO,OAAO,cAAc,CAAC,KAAK,EAAE,WAAW,GAAG,EAAE,CAAE,SAAQ,SAAS,CAC5E,KAAK,EACL,WAAW,GAAG,QAAQ,CAAC,oBAAoB,CAAC,KAAK,CAAC,CAAC,CACpD;IACC,MAAM,CAAC,YAAY,yCAAgB;IACnC,MAAM,CAAC,SAAS,SAAoB;IAEpC,KAAK,EAAG,SAAS,CAAC,OAAO,CAAC,GAAG;QAC3B,YAAY,EAAE,KAAK,CAAC;KACrB,CAAC;IAEF,UAAU;IAIV,eAAe;IAiBf,WAAW,CAAC,MAAM,EAAE,gBAAgB,CAAC,IAAI,CAAC;IAkB1C,IAAI,CAAC,MAAM,KAAA;IA+BX,SAAS,CAAC,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE;IAIpD,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAI3C,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE;CAK9C"} \ No newline at end of file diff --git a/modules/layers/typed/text-layer/text-background-layer/text-background-layer-fragment.glsl.d.ts b/modules/layers/typed/text-layer/text-background-layer/text-background-layer-fragment.glsl.d.ts new file mode 100644 index 00000000000..8f7ffc75d31 --- /dev/null +++ b/modules/layers/typed/text-layer/text-background-layer/text-background-layer-fragment.glsl.d.ts @@ -0,0 +1,3 @@ +declare const _default: '#define SHADER_NAME text-background-layer-fragment-shader\n\nprecision highp float;\n\nuniform bool stroked;\n\nvarying vec4 vFillColor;\nvarying vec4 vLineColor;\nvarying float vLineWidth;\nvarying vec2 uv;\nvarying vec2 dimensions;\n\nvoid main(void) {\n geometry.uv = uv;\n\n vec2 pixelPosition = uv * dimensions;\n if (stroked) {\n float distToEdge = min(\n min(pixelPosition.x, dimensions.x - pixelPosition.x),\n min(pixelPosition.y, dimensions.y - pixelPosition.y)\n );\n float isBorder = smoothedge(distToEdge, vLineWidth);\n gl_FragColor = mix(vFillColor, vLineColor, isBorder);\n } else {\n gl_FragColor = vFillColor;\n }\n\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n'; +export default _default; +// # sourceMappingURL=text-background-layer-fragment.glsl.d.ts.map diff --git a/modules/layers/typed/text-layer/text-background-layer/text-background-layer-fragment.glsl.d.ts.map b/modules/layers/typed/text-layer/text-background-layer/text-background-layer-fragment.glsl.d.ts.map new file mode 100644 index 00000000000..d3298ce5361 --- /dev/null +++ b/modules/layers/typed/text-layer/text-background-layer/text-background-layer-fragment.glsl.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"text-background-layer-fragment.glsl.d.ts","sourceRoot":"","sources":["../../../src/text-layer/text-background-layer/text-background-layer-fragment.glsl.ts"],"names":[],"mappings":";AAAA,wBA8BE"} \ No newline at end of file diff --git a/modules/layers/typed/text-layer/text-background-layer/text-background-layer-vertex.glsl.d.ts b/modules/layers/typed/text-layer/text-background-layer/text-background-layer-vertex.glsl.d.ts new file mode 100644 index 00000000000..d3b75e737cc --- /dev/null +++ b/modules/layers/typed/text-layer/text-background-layer/text-background-layer-vertex.glsl.d.ts @@ -0,0 +1,3 @@ +declare const _default: '#define SHADER_NAME text-background-layer-vertex-shader\n\nattribute vec2 positions;\n\nattribute vec3 instancePositions;\nattribute vec3 instancePositions64Low;\nattribute vec4 instanceRects;\nattribute float instanceSizes;\nattribute float instanceAngles;\nattribute vec2 instancePixelOffsets;\nattribute float instanceLineWidths;\nattribute vec4 instanceFillColors;\nattribute vec4 instanceLineColors;\nattribute vec3 instancePickingColors;\n\nuniform bool billboard;\nuniform float opacity;\nuniform float sizeScale;\nuniform float sizeMinPixels;\nuniform float sizeMaxPixels;\nuniform vec4 padding;\nuniform int sizeUnits;\n\nvarying vec4 vFillColor;\nvarying vec4 vLineColor;\nvarying float vLineWidth;\nvarying vec2 uv;\nvarying vec2 dimensions;\n\nvec2 rotate_by_angle(vec2 vertex, float angle) {\n float angle_radian = radians(angle);\n float cos_angle = cos(angle_radian);\n float sin_angle = sin(angle_radian);\n mat2 rotationMatrix = mat2(cos_angle, -sin_angle, sin_angle, cos_angle);\n return rotationMatrix * vertex;\n}\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n geometry.uv = positions;\n geometry.pickingColor = instancePickingColors;\n uv = positions;\n vLineWidth = instanceLineWidths;\n\n // convert size in meters to pixels, then scaled and clamp\n\n // project meters to pixels and clamp to limits\n float sizePixels = clamp(\n project_size_to_pixel(instanceSizes * sizeScale, sizeUnits),\n sizeMinPixels, sizeMaxPixels\n );\n\n dimensions = instanceRects.zw * sizePixels + padding.xy + padding.zw;\n\n vec2 pixelOffset = (positions * instanceRects.zw + instanceRects.xy) * sizePixels + mix(-padding.xy, padding.zw, positions);\n pixelOffset = rotate_by_angle(pixelOffset, instanceAngles);\n pixelOffset += instancePixelOffsets;\n pixelOffset.y *= -1.0;\n\n if (billboard) {\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, vec3(0.0), geometry.position);\n vec3 offset = vec3(pixelOffset, 0.0);\n DECKGL_FILTER_SIZE(offset, geometry);\n gl_Position.xy += project_pixel_size_to_clipspace(offset.xy);\n } else {\n vec3 offset_common = vec3(project_pixel_size(pixelOffset), 0.0);\n DECKGL_FILTER_SIZE(offset_common, geometry);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, offset_common, geometry.position);\n }\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n // Apply opacity to instance color, or return instance picking color\n vFillColor = vec4(instanceFillColors.rgb, instanceFillColors.a * opacity);\n DECKGL_FILTER_COLOR(vFillColor, geometry);\n vLineColor = vec4(instanceLineColors.rgb, instanceLineColors.a * opacity);\n DECKGL_FILTER_COLOR(vLineColor, geometry);\n}\n'; +export default _default; +// # sourceMappingURL=text-background-layer-vertex.glsl.d.ts.map diff --git a/modules/layers/typed/text-layer/text-background-layer/text-background-layer-vertex.glsl.d.ts.map b/modules/layers/typed/text-layer/text-background-layer/text-background-layer-vertex.glsl.d.ts.map new file mode 100644 index 00000000000..f7f71059dce --- /dev/null +++ b/modules/layers/typed/text-layer/text-background-layer/text-background-layer-vertex.glsl.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"text-background-layer-vertex.glsl.d.ts","sourceRoot":"","sources":["../../../src/text-layer/text-background-layer/text-background-layer-vertex.glsl.ts"],"names":[],"mappings":";AAAA,wBA8EE"} \ No newline at end of file diff --git a/modules/layers/typed/text-layer/text-background-layer/text-background-layer.d.ts b/modules/layers/typed/text-layer/text-background-layer/text-background-layer.d.ts new file mode 100644 index 00000000000..c214bddf045 --- /dev/null +++ b/modules/layers/typed/text-layer/text-background-layer/text-background-layer.d.ts @@ -0,0 +1,45 @@ +import {Layer} from '@deck.gl/core'; +import {Model} from '@luma.gl/webgl-legacy'; +import type { + LayerProps, + Accessor, + Unit, + Position, + Color, + UpdateParameters, + DefaultProps +} from '@deck.gl/core'; +declare type _TextBackgroundLayerProps = { + billboard?: boolean; + sizeScale?: number; + sizeUnits?: Unit; + sizeMinPixels?: number; + sizeMaxPixels?: number; + padding?: [number, number] | [number, number, number, number]; + getPosition?: Accessor; + getSize?: Accessor; + getAngle?: Accessor; + getPixelOffset?: Accessor; + getBoundingRect?: Accessor; + getFillColor?: Accessor; + getLineColor?: Accessor; + getLineWidth?: Accessor; +}; +export declare type TextBackgroundLayerProps = _TextBackgroundLayerProps & + LayerProps; +export default class TextBackgroundLayer extends Layer< + ExtraPropsT & Required<_TextBackgroundLayerProps> +> { + static defaultProps: DefaultProps>; + static layerName: string; + state: { + model: Model; + }; + getShaders(): any; + initializeState(): void; + updateState(params: UpdateParameters): void; + draw({uniforms}: {uniforms: any}): void; + protected _getModel(): Model; +} +export {}; +// # sourceMappingURL=text-background-layer.d.ts.map diff --git a/modules/layers/typed/text-layer/text-background-layer/text-background-layer.d.ts.map b/modules/layers/typed/text-layer/text-background-layer/text-background-layer.d.ts.map new file mode 100644 index 00000000000..1fc4f34ee54 --- /dev/null +++ b/modules/layers/typed/text-layer/text-background-layer/text-background-layer.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"text-background-layer.d.ts","sourceRoot":"","sources":["../../../src/text-layer/text-background-layer/text-background-layer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,EAA2B,MAAM,eAAe,CAAC;AAE9D,OAAO,EAAK,KAAK,EAAC,MAAM,uBAAuB,CAAC;AAKhD,OAAO,KAAK,EACV,UAAU,EACV,QAAQ,EACR,IAAI,EACJ,QAAQ,EACR,KAAK,EACL,gBAAgB,EAChB,YAAY,EACb,MAAM,eAAe,CAAC;AAEvB,aAAK,yBAAyB,CAAC,KAAK,IAAI;IACtC,SAAS,CAAC,EA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IACnC,MAAM,CAAC,SAAS,SAAyB;IAEzC,KAAK,EAAG;QACN,KAAK,EAAE,KAAK,CAAC;KACd,CAAC;IAEF,UAAU;IAIV,eAAe;IAsDf,WAAW,CAAC,MAAM,EAAE,gBAAgB,CAAC,IAAI,CAAC;IAU1C,IAAI,CAAC,EAAC,QAAQ,EAAC;;KAAA;IAuBf,SAAS,CAAC,SAAS,IAAI,KAAK;CAiB7B"} \ No newline at end of file diff --git a/modules/layers/typed/text-layer/text-layer.d.ts b/modules/layers/typed/text-layer/text-layer.d.ts new file mode 100644 index 00000000000..01ee06dd620 --- /dev/null +++ b/modules/layers/typed/text-layer/text-layer.d.ts @@ -0,0 +1,177 @@ +import {CompositeLayer} from '@deck.gl/core'; +import MultiIconLayer from './multi-icon-layer/multi-icon-layer'; +import FontAtlasManager from './font-atlas-manager'; +import TextBackgroundLayer from './text-background-layer/text-background-layer'; +import type {FontSettings} from './font-atlas-manager'; +import type { + LayerProps, + Accessor, + AccessorFunction, + Unit, + Position, + Color, + UpdateParameters, + GetPickingInfoParams, + PickingInfo, + DefaultProps +} from '@deck.gl/core'; +declare type _TextLayerProps = { + /** If `true`, the text always faces camera. Otherwise the text faces up (z). + * @default true + */ + billboard?: boolean; + /** + * Text size multiplier. + * @default 1 + */ + sizeScale?: number; + /** + * The units of the size, one of `'meters'`, `'common'`, and `'pixels'`. + * @default 'pixels' + */ + sizeUnits?: Unit; + /** + * The minimum size in pixels. When using non-pixel `sizeUnits`, this prop can be used to prevent the icon from getting too small when zoomed out. + * @default 0 + */ + sizeMinPixels?: number; + /** + * The maximum size in pixels. When using non-pixel `sizeUnits`, this prop can be used to prevent the icon from getting too big when zoomed in. + * @default Number.MAX_SAFE_INTEGER + */ + sizeMaxPixels?: number; + /** Whether to render background for the text blocks. + * @default false + */ + background?: boolean; + /** Background color accessor. + * @default [255, 255, 255, 255] + */ + getBackgroundColor?: Accessor; + /** Border color accessor. + * @default [0, 0, 0, 255] + */ + getBorderColor?: Accessor; + /** Border width accessor. + * @default 0 + */ + getBorderWidth?: Accessor; + /** + * The padding of the background.. + * If an array of 2 is supplied, it is interpreted as `[padding_x, padding_y]` in pixels. + * If an array of 4 is supplied, it is interpreted as `[padding_left, padding_top, padding_right, padding_bottom]` in pixels. + * @default [0, 0, 0, 0] + */ + backgroundPadding?: [number, number] | [number, number, number, number]; + /** + * Specifies a list of characters to include in the font. If set to 'auto', will be automatically generated from the data set. + * @default (ASCII characters 32-128) + */ + characterSet?: FontSettings['characterSet'] | 'auto'; + /** CSS font family + * @default 'Monaco, monospace' + */ + fontFamily?: FontSettings['fontFamily']; + /** CSS font weight + * @default 'normal' + */ + fontWeight?: FontSettings['fontWeight']; + /** A unitless number that will be multiplied with the current font size to set the line height. + * @default 'normal' + */ + lineHeight?: number; + /** + * Width of outline around the text, relative to the font size. Only effective if `fontSettings.sdf` is `true`. + * @default 0 + */ + outlineWidth?: number; + /** + * Color of outline around the text, in `[r, g, b, [a]]`. Each channel is a number between 0-255 and `a` is 255 if not supplied. + * @default [0, 0, 0, 255] + */ + outlineColor?: Color; + /** + * Advance options for fine tuning the appearance and performance of the generated shared `fontAtlas`. + */ + fontSettings?: FontSettings; + /** + * Available options are `break-all` and `break-word`. A valid `maxWidth` has to be provided to use `wordBreak`. + * @default 'break-word' + */ + wordBreak?: 'break-word' | 'break-all'; + /** + * `maxWidth` is used together with `break-word` for wrapping text. The value of `maxWidth` specifies the width limit to break the text into multiple lines. + * @default -1 + */ + maxWidth?: number; + /** + * Label text accessor + */ + getText?: AccessorFunction; + /** + * Anchor position accessor + */ + getPosition?: Accessor; + /** + * Label color accessor + * @default [0, 0, 0, 255] + */ + getColor?: Accessor; + /** + * Label size accessor + * @default 32 + */ + getSize?: Accessor; + /** + * Label rotation accessor, in degrees + * @default 0 + */ + getAngle?: Accessor; + /** + * Horizontal alignment accessor + * @default 'middle' + */ + getTextAnchor?: Accessor; + /** + * Vertical alignment accessor + * @default 'center' + */ + getAlignmentBaseline?: Accessor; + /** + * Label offset from the anchor position, [x, y] in pixels + * @default [0, 0] + */ + getPixelOffset?: Accessor; + /** + * @deprecated Use `background` and `getBackgroundColor` instead + */ + backgroundColor?: Color; +}; +export declare type TextLayerProps = _TextLayerProps & LayerProps; +/** Render text labels at given coordinates. */ +export default class TextLayer extends CompositeLayer< + ExtraPropsT & Required<_TextLayerProps> +> { + static defaultProps: DefaultProps>; + static layerName: string; + state: { + styleVersion: number; + fontAtlasManager: FontAtlasManager; + characterSet?: Set; + startIndices?: number[]; + numInstances?: number; + getText?: AccessorFunction; + }; + initializeState(): void; + updateState(params: UpdateParameters): void; + getPickingInfo({info}: GetPickingInfoParams): PickingInfo; + /** Returns true if font has changed */ + private _updateFontAtlas; + private _updateText; + private getBoundingRect; + private getIconOffsets; + renderLayers(): (TextBackgroundLayer | MultiIconLayer)[]; + static set fontAtlasCacheLimit(limit: number); +} +export {}; +// # sourceMappingURL=text-layer.d.ts.map diff --git a/modules/layers/typed/text-layer/text-layer.d.ts.map b/modules/layers/typed/text-layer/text-layer.d.ts.map new file mode 100644 index 00000000000..691ffb3ec9f --- /dev/null +++ b/modules/layers/typed/text-layer/text-layer.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"text-layer.d.ts","sourceRoot":"","sources":["../../src/text-layer/text-layer.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAC,cAAc,EAAiB,MAAM,eAAe,CAAC;AAC7D,OAAO,cAAc,MAAM,qCAAqC,CAAC;AACjE,OAAO,gBAGN,MAAM,sBAAsB,CAAC;AAG9B,OAAO,mBAAmB,MAAM,+CAA+C,CAAC;AAEhF,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,sBAAsB,CAAC;AACvD,OAAO,KAAK,EACV,UAAU,EACV,QAAQ,EACR,gBAAgB,EAChB,IAAI,EACJ,QAAQ,EACR,KAAK,EACL,gBAAgB,EAChB,oBAAoB,EACpB,WAAW,EACX,YAAY,EACb,MAAM,eAAe,CAAC;AAkBvB,aAAK,eAAe,CAAC,KAAK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,CAAC,MAAM,CAAC,CAAC;QAC3B,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;QACxB,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,OAAO,CAAC,EAAE,gBAAgB,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;KAC3C,CAAC;IAEF,eAAe;IAQf,WAAW,CAAC,MAAM,EAAE,gBAAgB,CAAC,IAAI,CAAC;IA0B1C,cAAc,CAAC,EAAC,IAAI,EAAC,EAAE,oBAAoB,GAAG,WAAW;IAOzD,uCAAuC;IACvC,OAAO,CAAC,gBAAgB;IA6BxB,OAAO,CAAC,WAAW;IA+CnB,OAAO,CAAC,eAAe,CAwBrB;IAGF,OAAO,CAAC,cAAc,CAmCpB;IAEF,YAAY;IA+JZ,MAAM,KAAK,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAE3C;CACF"} \ No newline at end of file diff --git a/modules/layers/typed/text-layer/utils.d.ts b/modules/layers/typed/text-layer/utils.d.ts new file mode 100644 index 00000000000..030951c8ba3 --- /dev/null +++ b/modules/layers/typed/text-layer/utils.d.ts @@ -0,0 +1,105 @@ +import type {NumericArray} from '@math.gl/core'; +export declare type Character = { + x: number; + y: number; + width: number; + height: number; + layoutWidth: number; + layoutHeight: number; + layoutOffsetY?: number; +}; +export declare type CharacterMapping = Record; +export declare function nextPowOfTwo(number: number): number; +/** + * Generate character mapping table or update from an existing mapping table + */ +export declare function buildMapping({ + characterSet, + getFontWidth, + fontHeight, + buffer, + maxCanvasWidth, + mapping, + xOffset, + yOffset +}: { + /** list of characters */ + characterSet: Set; + /** function to get width of each character */ + getFontWidth: (char: string) => number; + /** height of font */ + fontHeight: number; + /** bleeding buffer surround each character */ + buffer: number; + /** max width of font atlas */ + maxCanvasWidth: number; + /** cached mapping table */ + mapping?: CharacterMapping; + /** x position of last character in the existing mapping table */ + xOffset?: number; + /** y position of last character in the existing mapping table */ + yOffset?: number; +}): { + /** new mapping table */ + mapping: CharacterMapping; + /** x position of last character in the new mapping table */ + xOffset: number; + /** y position of last character in the new mapping table */ + yOffset: number; + /** height of the font atlas canvas, power of 2 */ + canvasHeight: number; +}; +/** + * Wrap the given text so that each line does not exceed the given max width. + * Returns a list of indices where line breaks should be inserted. + */ +export declare function autoWrapping( + text: string[], + wordBreak: 'break-all' | 'break-word', + maxWidth: number, + iconMapping: CharacterMapping, + startIndex: number, + endIndex: number +): number[]; +/** + * Transform a text paragraph to an array of characters, each character contains + */ +export declare function transformParagraph( + paragraph: string, + /** CSS line-height */ + lineHeight: number, + /** CSS word-break option */ + wordBreak: 'break-word' | 'break-all', + /** CSS max-width */ + maxWidth: number, + /** character mapping table for retrieving a character from font atlas */ + iconMapping: CharacterMapping +): { + /** x position of each character */ + x: number[]; + /** y position of each character */ + y: number[]; + /** the current row width of each character */ + rowWidth: number[]; + /** the width and height of the paragraph */ + size: [number, number]; +}; +export declare function getTextFromBuffer({ + value, + length, + stride, + offset, + startIndices, + characterSet +}: { + value: Uint8Array | Uint8ClampedArray | Uint16Array | Uint32Array; + length: number; + stride?: number; + offset?: number; + startIndices: NumericArray; + characterSet?: Set; +}): { + texts: string[]; + characterCount: number; +}; +// # sourceMappingURL=utils.d.ts.map diff --git a/modules/layers/typed/text-layer/utils.d.ts.map b/modules/layers/typed/text-layer/utils.d.ts.map new file mode 100644 index 00000000000..25407f78bb0 --- /dev/null +++ b/modules/layers/typed/text-layer/utils.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/text-layer/utils.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,eAAe,CAAC;AAKhD,oBAAY,SAAS,GAAG;IACtB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,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ACjB,sBAAsB;AACtB,UAAU,EAAE,MAAM;AAClB,4BAA4B;AAC5B,SAAS,EAAE,YAAY,GAAG,WAAW;AACrC,oBAAoB;AACpB,QAAQ,EAAE,MAAM;AAChB,yEAAyE;AACzE,WAAW,EAAE,gBAAgB,GAC5B;IACD,mCAAmC;IACnC,CAAC,EAAE,MAAM,EAAE,CAAC;IACZ,mCAAmC;IACnC,CAAC,EAAE,MAAM,EAAE,CAAC;IACZ,8CAA8C;IAC9C,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,4CAA4C;IAC5C,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACxB,CA2DA;AAED,wBAAgB,iBAAiB,CAAC,EAChC,KAAK,EACL,MAAM,EACN,MAAM,EACN,MAAM,EACN,YAAY,EACZ,YAAY,EACb,EAAE;IACD,KAAK,EAAE,UAAU,GAAG,iBAAiB,GAAG,WAAW,GAAG,WAAW,CAAC;IAClE,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,YAAY,CAAC;IAC3B,YAAY,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;CAC5B,GAAG;IACF,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,cAAc,EAAE,MAAM,CAAC;CACxB,CA0CA"} \ No newline at end of file diff --git a/modules/layers/typed/utils.d.ts b/modules/layers/typed/utils.d.ts new file mode 100644 index 00000000000..7bdc413795e --- /dev/null +++ b/modules/layers/typed/utils.d.ts @@ -0,0 +1,18 @@ +export declare function replaceInRange({ + data, + getIndex, + dataRange, + replace +}: { + data: any[]; + getIndex: (d: any) => number; + dataRange: { + startRow?: number; + endRow?: number; + }; + replace: any[]; +}): { + startRow: Number; + endRow: number; +}; +// # sourceMappingURL=utils.d.ts.map diff --git a/modules/layers/typed/utils.d.ts.map b/modules/layers/typed/utils.d.ts.map new file mode 100644 index 00000000000..571ee78b026 --- /dev/null +++ b/modules/layers/typed/utils.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAIA,wBAAgB,cAAc,CAAC,EAC7B,IAAI,EACJ,QAAQ,EACR,SAAS,EACT,OAAO,EACR,EAAE;IACD,IAAI,EAAE,GAAG,EAAE,CAAC;IACZ,QAAQ,EAAE,CAAC,CAAC,EAAE,GAAG,KAAK,MAAM,CAAC;IAC7B,SAAS,EAAE;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAC,CAAC;IAChD,OAAO,EAAE,GAAG,EAAE,CAAC;CAChB,GAAG;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAC,CAoCrC"} \ No newline at end of file diff --git a/modules/main/typed/index.d.ts b/modules/main/typed/index.d.ts new file mode 100644 index 00000000000..bab4fb3d895 --- /dev/null +++ b/modules/main/typed/index.d.ts @@ -0,0 +1,146 @@ +export { + COORDINATE_SYSTEM, + OPERATION, + UNIT, + Deck, + Layer, + CompositeLayer, + View, + MapView, + FirstPersonView, + OrbitView, + OrthographicView, + _GlobeView, + Viewport, + WebMercatorViewport, + _GlobeViewport, + OrbitViewport, + OrthographicViewport, + FirstPersonViewport, + Controller, + MapController, + OrbitController, + FirstPersonController, + OrthographicController, + _GlobeController, + AttributeManager, + picking, + project, + project32, + gouraudLighting, + phongLighting, + shadow, + LayerManager, + DeckRenderer, + log, + assert, + TRANSITION_EVENTS, + TransitionInterpolator, + LinearInterpolator, + FlyToInterpolator, + LightingEffect, + PostProcessEffect, + AmbientLight, + PointLight, + DirectionalLight, + LayerExtension, + Tesselator, + fp64LowPart, + createIterable +} from '@deck.gl/core'; +export { + ArcLayer, + BitmapLayer, + IconLayer, + LineLayer, + PointCloudLayer, + ScatterplotLayer, + GridCellLayer, + ColumnLayer, + PathLayer, + PolygonLayer, + SolidPolygonLayer, + GeoJsonLayer, + TextLayer +} from '@deck.gl/layers'; +export { + ScreenGridLayer, + CPUGridLayer, + HexagonLayer, + ContourLayer, + GridLayer, + GPUGridLayer, + AGGREGATION_OPERATION, + HeatmapLayer +} from '@deck.gl/aggregation-layers'; +export { + GreatCircleLayer, + S2Layer, + QuadkeyLayer, + H3ClusterLayer, + H3HexagonLayer, + TileLayer, + _Tileset2D, + TripsLayer, + Tile3DLayer, + TerrainLayer, + MVTLayer, + GeohashLayer +} from '@deck.gl/geo-layers'; +export {SimpleMeshLayer, ScenegraphLayer} from '@deck.gl/mesh-layers'; +export {default, DeckGL} from '@deck.gl/react'; +export type { + MapViewState, + FirstPersonViewState, + OrbitViewState, + OrthographicViewState, + GlobeViewState, + CoordinateSystem, + ChangeFlags, + LayersList, + LayerContext, + UpdateParameters, + DeckProps, + LayerProps, + CompositeLayerProps, + Accessor, + AccessorFunction, + LayerData, + Unit, + Position, + Color, + Texture, + PickingInfo, + GetPickingInfoParams, + BinaryAttribute, + Effect +} from '@deck.gl/core'; +export type { + ArcLayerProps, + BitmapLayerProps, + ColumnLayerProps, + ScatterplotLayerProps, + IconLayerProps, + LineLayerProps, + PolygonLayerProps, + GeoJsonLayerProps, + GridCellLayerProps, + TextLayerProps, + MultiIconLayerProps, + PointCloudLayerProps, + TextBackgroundLayerProps, + PathLayerProps, + SolidPolygonLayerProps +} from '@deck.gl/layers'; +export type { + ContourLayerProps, + CPUGridLayerProps, + GridLayerProps, + GPUGridLayerProps, + HeatmapLayerProps, + HexagonLayerProps, + ScreenGridLayerProps +} from '@deck.gl/aggregation-layers'; +export type {MVTLayerProps, QuadkeyLayerProps, TileLayerProps} from '@deck.gl/geo-layers'; +export type {DeckGLProps, DeckGLRef, DeckGLContextValue} from '@deck.gl/react'; +// # sourceMappingURL=index.d.ts.map diff --git a/modules/main/typed/index.d.ts.map b/modules/main/typed/index.d.ts.map new file mode 100644 index 00000000000..11b6be586d5 --- /dev/null +++ b/modules/main/typed/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAyBA,OAAO,EAEL,iBAAiB,EACjB,SAAS,EACT,IAAI,EAEJ,IAAI,EAEJ,KAAK,EACL,cAAc,EAEd,IAAI,EACJ,OAAO,EACP,eAAe,EACf,SAAS,EACT,gBAAgB,EAChB,UAAU,EAEV,QAAQ,EACR,mBAAmB,EACnB,cAAc,EACd,aAAa,EACb,oBAAoB,EACpB,mBAAmB,EAEnB,UAAU,EACV,aAAa,EACb,eAAe,EACf,qBAAqB,EACrB,sBAAsB,EACtB,gBAAgB,EAEhB,gBAAgB,EAEhB,OAAO,EACP,OAAO,EACP,SAAS,EACT,eAAe,EACf,aAAa,EACb,MAAM,EAEN,YAAY,EACZ,YAAY,EAEZ,GAAG,EACH,MAAM,EAEN,iBAAiB,EACjB,sBAAsB,EACtB,kBAAkB,EAClB,iBAAiB,EAEjB,cAAc,EACd,iBAAiB,EAEjB,YAAY,EACZ,UAAU,EACV,gBAAgB,EAEhB,cAAc,EAEd,UAAU,EACV,WAAW,EACX,cAAc,EACf,MAAM,eAAe,CAAC;AAMvB,OAAO,EACL,QAAQ,EACR,WAAW,EACX,SAAS,EACT,SAAS,EACT,eAAe,EACf,gBAAgB,EAChB,aAAa,EACb,WAAW,EACX,SAAS,EACT,YAAY,EACZ,iBAAiB,EACjB,YAAY,EACZ,SAAS,EACV,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACL,eAAe,EACf,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,SAAS,EACT,YAAY,EACZ,qBAAqB,EACrB,YAAY,EACb,MAAM,6BAA6B,CAAC;AAErC,OAAO,EACL,gBAAgB,EAChB,OAAO,EACP,YAAY,EACZ,cAAc,EACd,cAAc,EACd,SAAS,EACT,UAAU,EACV,UAAU,EACV,WAAW,EACX,YAAY,EACZ,QAAQ,EACR,YAAY,EACb,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAC,eAAe,EAAE,eAAe,EAAC,MAAM,sBAAsB,CAAC;AAMtE,OAAO,EAAC,OAAO,EAAE,MAAM,EAAC,MAAM,gBAAgB,CAAC;AAI/C,YAAY,EACV,YAAY,EACZ,oBAAoB,EACpB,cAAc,EACd,qBAAqB,EACrB,cAAc,EACd,gBAAgB,EAChB,WAAW,EACX,UAAU,EACV,YAAY,EACZ,gBAAgB,EAChB,SAAS,EACT,UAAU,EACV,mBAAmB,EACnB,QAAQ,EACR,gBAAgB,EAChB,SAAS,EACT,IAAI,EACJ,QAAQ,EACR,KAAK,EACL,OAAO,EACP,WAAW,EACX,oBAAoB,EACpB,eAAe,EACf,MAAM,EACP,MAAM,eAAe,CAAC;AAEvB,YAAY,EACV,aAAa,EACb,gBAAgB,EAChB,gBAAgB,EAChB,qBAAqB,EACrB,cAAc,EACd,cAAc,EACd,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,cAAc,EACd,mBAAmB,EACnB,oBAAoB,EACpB,wBAAwB,EACxB,cAAc,EACd,sBAAsB,EACvB,MAAM,iBAAiB,CAAC;AAEzB,YAAY,EACV,iBAAiB,EACjB,iBAAiB,EACjB,cAAc,EACd,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,EACjB,oBAAoB,EACrB,MAAM,6BAA6B,CAAC;AAErC,YAAY,EAAC,aAAa,EAAE,iBAAiB,EAAE,cAAc,EAAC,MAAM,qBAAqB,CAAC;AAE1F,YAAY,EAAC,WAAW,EAAE,SAAS,EAAE,kBAAkB,EAAC,MAAM,gBAAgB,CAAC"} \ No newline at end of file diff --git a/modules/mapbox/typed/deck-utils.d.ts b/modules/mapbox/typed/deck-utils.d.ts new file mode 100644 index 00000000000..420ee9ef48c --- /dev/null +++ b/modules/mapbox/typed/deck-utils.d.ts @@ -0,0 +1,29 @@ +import {Deck} from '@deck.gl/core'; +import type {MapViewState} from '@deck.gl/core'; +import type MapboxLayer from './mapbox-layer'; +import type {Map} from 'mapbox-gl'; +export declare function getDeckInstance({ + map, + gl, + deck +}: { + map: Map & { + __deck?: Deck | null; + }; + gl: WebGLRenderingContext; + deck?: Deck; +}): Deck; +export declare function addLayer(deck: Deck, layer: MapboxLayer): void; +export declare function removeLayer(deck: Deck, layer: MapboxLayer): void; +export declare function updateLayer(deck: Deck, layer: MapboxLayer): void; +export declare function drawLayer(deck: Deck, map: Map, layer: MapboxLayer): void; +export declare function getViewState(map: Map): MapViewState & { + repeat: boolean; + padding: { + left: number; + right: number; + top: number; + bottom: number; + }; +}; +// # sourceMappingURL=deck-utils.d.ts.map diff --git a/modules/mapbox/typed/deck-utils.d.ts.map b/modules/mapbox/typed/deck-utils.d.ts.map new file mode 100644 index 00000000000..36f8ecc7ccd --- /dev/null +++ b/modules/mapbox/typed/deck-utils.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"deck-utils.d.ts","sourceRoot":"","sources":["../src/deck-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAoD,MAAM,eAAe,CAAC;AACtF,OAAO,KAAK,EAAY,YAAY,EAAQ,MAAM,eAAe,CAAC;AAClE,OAAO,KAAK,WAAW,MAAM,gBAAgB,CAAC;AAC9C,OAAO,KAAK,EAAC,GAAG,EAAC,MAAM,WAAW,CAAC;AAenC,wBAAgB,eAAe,CAAC,EAC9B,GAAG,EACH,EAAE,EACF,IAAI,EACL,EAAE;IACD,GAAG,EAAE,GAAG,GAAG;QAAC,MAAM,CAAC,EAAE,IAAI,GAAG,IAAI,CAAA;KAAC,CAAC;IAClC,EAAE,EAAE,qBAAqB,CAAC;IAC1B,IAAI,CAAC,EAAE,IAAI,CAAC;CACb,GAAG,IAAI,CAoEP;AAED,wBAAgB,QAAQ,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,WAAW,CAAC,GAAG,CAAC,GAAG,IAAI,CAGlE;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,WAAW,CAAC,GAAG,CAAC,GAAG,IAAI,CAGrE;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,WAAW,CAAC,GAAG,CAAC,GAAG,IAAI,CAErE;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,WAAW,CAAC,GAAG,CAAC,GAAG,IAAI,CAqB7E;AAED,wBAAgB,YAAY,CAAC,GAAG,EAAE,GAAG,GAAG,YAAY,GAAG;IACrD,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE;QACP,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;QACd,GAAG,EAAE,MAAM,CAAC;QACZ,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;CACH,CA6BA"} \ No newline at end of file diff --git a/modules/mapbox/typed/index.d.ts b/modules/mapbox/typed/index.d.ts new file mode 100644 index 00000000000..f743b9c4090 --- /dev/null +++ b/modules/mapbox/typed/index.d.ts @@ -0,0 +1,4 @@ +export {default as MapboxLayer} from './mapbox-layer'; +export {default as MapboxOverlay} from './mapbox-overlay'; +export type {MapboxOverlayProps} from './mapbox-overlay'; +// # sourceMappingURL=index.d.ts.map diff --git a/modules/mapbox/typed/index.d.ts.map b/modules/mapbox/typed/index.d.ts.map new file mode 100644 index 00000000000..0ae900ec809 --- /dev/null +++ b/modules/mapbox/typed/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,IAAI,WAAW,EAAC,MAAM,gBAAgB,CAAC;AACtD,OAAO,EAAC,OAAO,IAAI,aAAa,EAAC,MAAM,kBAAkB,CAAC;AAE1D,YAAY,EAAC,kBAAkB,EAAC,MAAM,kBAAkB,CAAC"} \ No newline at end of file diff --git a/modules/mapbox/typed/mapbox-layer.d.ts b/modules/mapbox/typed/mapbox-layer.d.ts new file mode 100644 index 00000000000..904bebd41cc --- /dev/null +++ b/modules/mapbox/typed/mapbox-layer.d.ts @@ -0,0 +1,21 @@ +import type {Map, CustomLayerInterface} from 'mapbox-gl'; +import type {Deck, Layer} from '@deck.gl/core'; +export declare type MapboxLayerProps = Partial & { + id: string; + renderingMode?: '2d' | '3d'; + deck?: Deck; +}; +export default class MapboxLayer implements CustomLayerInterface { + id: string; + type: 'custom'; + renderingMode: '2d' | '3d'; + map: Map | null; + deck: Deck | null; + props: MapboxLayerProps; + constructor(props: MapboxLayerProps); + onAdd(map: Map, gl: WebGLRenderingContext): void; + onRemove(): void; + setProps(props: MapboxLayerProps): void; + render(): void; +} +// # sourceMappingURL=mapbox-layer.d.ts.map diff --git a/modules/mapbox/typed/mapbox-layer.d.ts.map b/modules/mapbox/typed/mapbox-layer.d.ts.map new file mode 100644 index 00000000000..dc766fd6e03 --- /dev/null +++ b/modules/mapbox/typed/mapbox-layer.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"mapbox-layer.d.ts","sourceRoot":"","sources":["../src/mapbox-layer.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,GAAG,EAAE,oBAAoB,EAAC,MAAM,WAAW,CAAC;AACzD,OAAO,KAAK,EAAC,IAAI,EAAE,KAAK,EAAC,MAAM,eAAe,CAAC;AAE/C,oBAAY,gBAAgB,CAAC,MAAM,SAAS,KAAK,IAAI,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,GAAG;IAC9E,EAAE,EAAE,MAAM,CAAC;IACX,aAAa,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IAC5B,IAAI,CAAC,EAAE,IAAI,CAAC;CACb,CAAC;AAEF,MAAM,CAAC,OAAO,OAAO,WAAW,CAAC,MAAM,SAAS,KAAK,CAAE,YAAW,oBAAoB;IACpF,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,QAAQ,CAAC;IACf,aAAa,EAAE,IAAI,GAAG,IAAI,CAAC;IAC3B,GAAG,EAAE,GAAG,GAAG,IAAI,CAAC;IAChB,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC;IAClB,KAAK,EAAE,gBAAgB,CAAC,MAAM,CAAC,CAAC;gBAGpB,KAAK,EAAE,gBAAgB,CAAC,MAAM,CAAC;IAe3C,KAAK,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,qBAAqB,GAAG,IAAI;IAMhD,QAAQ,IAAI,IAAI;IAMhB,QAAQ,CAAC,KAAK,EAAE,gBAAgB,CAAC,MAAM,CAAC;IASxC,MAAM;CAGP"} \ No newline at end of file diff --git a/modules/mapbox/typed/mapbox-overlay.d.ts b/modules/mapbox/typed/mapbox-overlay.d.ts new file mode 100644 index 00000000000..67e034b88de --- /dev/null +++ b/modules/mapbox/typed/mapbox-overlay.d.ts @@ -0,0 +1,57 @@ +import {Deck} from '@deck.gl/core'; +import type {Map, IControl} from 'mapbox-gl'; +import type {DeckProps} from '@deck.gl/core'; +export declare type MapboxOverlayProps = Omit< + DeckProps, + | 'width' + | 'height' + | 'gl' + | 'parent' + | 'canvas' + | '_customRender' + | 'viewState' + | 'initialViewState' + | 'controller' +>; +/** + * Implements Mapbox [IControl](https://docs.mapbox.com/mapbox-gl-js/api/markers/#icontrol) interface + * Renders deck.gl layers over the base map and automatically synchronizes with the map's camera + */ +export default class MapboxOverlay implements IControl { + private _props; + private _deck?; + private _map?; + private _container?; + private _interleaved; + constructor( + props: MapboxOverlayProps & { + interleaved?: boolean; + } + ); + /** Update (partial) props of the underlying Deck instance. */ + setProps(props: MapboxOverlayProps): void; + /** Called when the control is added to a map */ + onAdd(map: Map): HTMLDivElement; + private _onAddOverlaid; + private _onAddInterleaved; + /** Called when the control is removed from a map */ + onRemove(): void; + private _onRemoveOverlaid; + private _onRemoveInterleaved; + getDefaultPosition(): string; + /** Forwards the Deck.pickObject method */ + pickObject(params: Parameters[0]): ReturnType; + /** Forwards the Deck.pickMultipleObjects method */ + pickMultipleObjects( + params: Parameters[0] + ): ReturnType; + /** Forwards the Deck.pickObjects method */ + pickObjects(params: Parameters[0]): ReturnType; + /** Remove from map and releases all resources */ + finalize(): void; + private _handleStyleChange; + private _updateContainerSize; + private _updateViewState; + private _handleMouseEvent; +} +// # sourceMappingURL=mapbox-overlay.d.ts.map diff --git a/modules/mapbox/typed/mapbox-overlay.d.ts.map b/modules/mapbox/typed/mapbox-overlay.d.ts.map new file mode 100644 index 00000000000..5d0e9ce734f --- /dev/null +++ b/modules/mapbox/typed/mapbox-overlay.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"mapbox-overlay.d.ts","sourceRoot":"","sources":["../src/mapbox-overlay.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAS,MAAM,eAAe,CAAC;AAG3C,OAAO,KAAK,EAAC,GAAG,EAAE,QAAQ,EAAgB,MAAM,WAAW,CAAC;AAE5D,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,eAAe,CAAC;AAI7C,oBAAY,kBAAkB,GAAG,IAAI,CACnC,SAAS,EACP,OAAO,GACP,QAAQ,GACR,IAAI,GACJ,QAAQ,GACR,QAAQ,GACR,eAAe,GACf,WAAW,GACX,kBAAkB,GAClB,YAAY,CACf,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,aAAc,YAAW,QAAQ;IACpD,OAAO,CAAC,MAAM,CAAqB;IACnC,OAAO,CAAC,KAAK,CAAC,CAAO;IACrB,OAAO,CAAC,IAAI,CAAC,CAAM;IACnB,OAAO,CAAC,UAAU,CAAC,CAAiB;IACpC,OAAO,CAAC,YAAY,CAAU;gBAG5B,KAAK,EAAE,kBAAkB,GAAG;QAC1B,WAAW,CAAC,EAAE,OAAO,CAAC;KACvB;IAOH,8DAA8D;IAC9D,QAAQ,CAAC,KAAK,EAAE,kBAAkB,GAAG,IAAI;IAYzC,gDAAgD;IAChD,KAAK,CAAC,GAAG,EAAE,GAAG,GAAG,cAAc;IAK/B,OAAO,CAAC,cAAc;IA4BtB,OAAO,CAAC,iBAAiB;IAazB,oDAAoD;IACpD,QAAQ,IAAI,IAAI;IAiBhB,OAAO,CAAC,iBAAiB;IASzB,OAAO,CAAC,oBAAoB;IAK5B,kBAAkB;IAIlB,0CAA0C;IAC1C,UAAU,CAAC,MAAM,EAAE,UAAU,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IAKrF,mDAAmD;IACnD,mBAAmB,CACjB,MAAM,EAAE,UAAU,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC,CAAC,GACjD,UAAU,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC;IAK1C,2CAA2C;IAC3C,WAAW,CAAC,MAAM,EAAE,UAAU,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;IAKxF,iDAAiD;IACjD,QAAQ;IAMR,OAAO,CAAC,kBAAkB,CAExB;IAEF,OAAO,CAAC,oBAAoB,CAQ1B;IAEF,OAAO,CAAC,gBAAgB,CAQtB;IAEF,OAAO,CAAC,iBAAiB,CA4CvB;CACH"} \ No newline at end of file diff --git a/modules/mapbox/typed/resolve-layers.d.ts b/modules/mapbox/typed/resolve-layers.d.ts new file mode 100644 index 00000000000..5317b3e55be --- /dev/null +++ b/modules/mapbox/typed/resolve-layers.d.ts @@ -0,0 +1,10 @@ +import type {Deck, LayersList} from '@deck.gl/core'; +import type {Map} from 'mapbox-gl'; +/** Insert Deck layers into the mapbox Map according to the user-defined order */ +export declare function resolveLayers( + map?: Map, + deck?: Deck, + oldLayers?: LayersList, + newLayers?: LayersList +): void; +// # sourceMappingURL=resolve-layers.d.ts.map diff --git a/modules/mapbox/typed/resolve-layers.d.ts.map b/modules/mapbox/typed/resolve-layers.d.ts.map new file mode 100644 index 00000000000..174598f51c1 --- /dev/null +++ b/modules/mapbox/typed/resolve-layers.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"resolve-layers.d.ts","sourceRoot":"","sources":["../src/resolve-layers.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,IAAI,EAAE,UAAU,EAAQ,MAAM,eAAe,CAAC;AAC3D,OAAO,KAAK,EAAC,GAAG,EAAC,MAAM,WAAW,CAAC;AAInC,iFAAiF;AAEjF,wBAAgB,aAAa,CAC3B,GAAG,CAAC,EAAE,GAAG,EACT,IAAI,CAAC,EAAE,IAAI,EACX,SAAS,CAAC,EAAE,UAAU,EACtB,SAAS,CAAC,EAAE,UAAU,QA+EvB"} \ No newline at end of file diff --git a/modules/mesh-layers/typed/index.d.ts b/modules/mesh-layers/typed/index.d.ts new file mode 100644 index 00000000000..df2abcf23a2 --- /dev/null +++ b/modules/mesh-layers/typed/index.d.ts @@ -0,0 +1,5 @@ +export {default as SimpleMeshLayer} from './simple-mesh-layer/simple-mesh-layer'; +export {default as ScenegraphLayer} from './scenegraph-layer/scenegraph-layer'; +export type {ScenegraphLayerProps} from './scenegraph-layer/scenegraph-layer'; +export type {SimpleMeshLayerProps} from './simple-mesh-layer/simple-mesh-layer'; +// # sourceMappingURL=index.d.ts.map diff --git a/modules/mesh-layers/typed/index.d.ts.map b/modules/mesh-layers/typed/index.d.ts.map new file mode 100644 index 00000000000..5e122448a3b --- /dev/null +++ b/modules/mesh-layers/typed/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAqBA,OAAO,EAAC,OAAO,IAAI,eAAe,EAAC,MAAM,uCAAuC,CAAC;AACjF,OAAO,EAAC,OAAO,IAAI,eAAe,EAAC,MAAM,qCAAqC,CAAC;AAE/E,YAAY,EAAC,oBAAoB,EAAC,MAAM,qCAAqC,CAAC;AAC9E,YAAY,EAAC,oBAAoB,EAAC,MAAM,uCAAuC,CAAC"} \ No newline at end of file diff --git a/modules/mesh-layers/typed/scenegraph-layer/gltf-utils.d.ts b/modules/mesh-layers/typed/scenegraph-layer/gltf-utils.d.ts new file mode 100644 index 00000000000..4c5578c39a2 --- /dev/null +++ b/modules/mesh-layers/typed/scenegraph-layer/gltf-utils.d.ts @@ -0,0 +1,3 @@ +import type {GroupNode} from '@luma.gl/experimental'; +export declare function waitForGLTFAssets(gltfObjects: {scenes: GroupNode[]}): Promise; +// # sourceMappingURL=gltf-utils.d.ts.map diff --git a/modules/mesh-layers/typed/scenegraph-layer/gltf-utils.d.ts.map b/modules/mesh-layers/typed/scenegraph-layer/gltf-utils.d.ts.map new file mode 100644 index 00000000000..39ac2c39b40 --- /dev/null +++ b/modules/mesh-layers/typed/scenegraph-layer/gltf-utils.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"gltf-utils.d.ts","sourceRoot":"","sources":["../../src/scenegraph-layer/gltf-utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,SAAS,EAAY,MAAM,uBAAuB,CAAC;AAEhE,wBAAsB,iBAAiB,CAAC,WAAW,EAAE;IAAC,MAAM,EAAE,SAAS,EAAE,CAAA;CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAczF"} \ No newline at end of file diff --git a/modules/mesh-layers/typed/scenegraph-layer/scenegraph-layer-fragment.glsl.d.ts b/modules/mesh-layers/typed/scenegraph-layer/scenegraph-layer-fragment.glsl.d.ts new file mode 100644 index 00000000000..89823b5b0a8 --- /dev/null +++ b/modules/mesh-layers/typed/scenegraph-layer/scenegraph-layer-fragment.glsl.d.ts @@ -0,0 +1,3 @@ +declare const _default: '#version 300 es\n\n// Uniforms\nuniform float opacity;\n\n// Varying\nin vec4 vColor;\n\nout vec4 fragmentColor;\n\n// MODULE_PBR contains all the varying definitions needed\n#ifndef MODULE_PBR\n #if defined(HAS_UV) && defined(HAS_BASECOLORMAP)\n in vec2 vTEXCOORD_0;\n uniform sampler2D u_BaseColorSampler;\n #endif\n#endif\n\nvoid main(void) {\n #ifdef MODULE_PBR\n fragmentColor = vColor * pbr_filterColor(vec4(0));\n geometry.uv = pbr_vUV;\n #else\n #if defined(HAS_UV) && defined(HAS_BASECOLORMAP)\n fragmentColor = vColor * texture2D(u_BaseColorSampler, vTEXCOORD_0);\n geometry.uv = vTEXCOORD_0;\n #else\n fragmentColor = vColor;\n #endif\n #endif\n\n fragmentColor.a *= opacity;\n DECKGL_FILTER_COLOR(fragmentColor, geometry);\n}\n'; +export default _default; +// # sourceMappingURL=scenegraph-layer-fragment.glsl.d.ts.map diff --git a/modules/mesh-layers/typed/scenegraph-layer/scenegraph-layer-fragment.glsl.d.ts.map b/modules/mesh-layers/typed/scenegraph-layer/scenegraph-layer-fragment.glsl.d.ts.map new file mode 100644 index 00000000000..29acf51b38d --- /dev/null +++ b/modules/mesh-layers/typed/scenegraph-layer/scenegraph-layer-fragment.glsl.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"scenegraph-layer-fragment.glsl.d.ts","sourceRoot":"","sources":["../../src/scenegraph-layer/scenegraph-layer-fragment.glsl.ts"],"names":[],"mappings":";AAAA,wBAmCE"} \ No newline at end of file diff --git a/modules/mesh-layers/typed/scenegraph-layer/scenegraph-layer-vertex.glsl.d.ts b/modules/mesh-layers/typed/scenegraph-layer/scenegraph-layer-vertex.glsl.d.ts new file mode 100644 index 00000000000..2db8998fe17 --- /dev/null +++ b/modules/mesh-layers/typed/scenegraph-layer/scenegraph-layer-vertex.glsl.d.ts @@ -0,0 +1,3 @@ +declare const _default: '#version 300 es\n\n// Instance attributes\nin vec3 instancePositions;\nin vec3 instancePositions64Low;\nin vec4 instanceColors;\nin vec3 instancePickingColors;\nin mat3 instanceModelMatrix;\nin vec3 instanceTranslation;\n\n// Uniforms\nuniform float sizeScale;\nuniform float sizeMinPixels;\nuniform float sizeMaxPixels;\nuniform mat4 sceneModelMatrix;\nuniform bool composeModelMatrix;\n\n// Attributes\nin vec4 POSITION;\n\n#ifdef HAS_UV\n in vec2 TEXCOORD_0;\n#endif\n\n#ifdef MODULE_PBR\n #ifdef HAS_NORMALS\n in vec4 NORMAL;\n #endif\n#endif\n\n// Varying\nout vec4 vColor;\n\n// MODULE_PBR contains all the varying definitions needed\n#ifndef MODULE_PBR\n #ifdef HAS_UV\n out vec2 vTEXCOORD_0;\n #endif\n#endif\n\n// Main\nvoid main(void) {\n #if defined(HAS_UV) && !defined(MODULE_PBR)\n vTEXCOORD_0 = TEXCOORD_0;\n geometry.uv = vTEXCOORD_0;\n #endif\n\n geometry.worldPosition = instancePositions;\n geometry.pickingColor = instancePickingColors;\n\n vec3 normal = vec3(0.0, 0.0, 1.0);\n #ifdef MODULE_PBR\n #ifdef HAS_NORMALS\n normal = instanceModelMatrix * (sceneModelMatrix * vec4(NORMAL.xyz, 0.0)).xyz;\n #endif\n #endif\n\n float originalSize = project_size_to_pixel(sizeScale);\n float clampedSize = clamp(originalSize, sizeMinPixels, sizeMaxPixels);\n\n vec3 pos = (instanceModelMatrix * (sceneModelMatrix * POSITION).xyz) * sizeScale * (clampedSize / originalSize) + instanceTranslation;\n if(composeModelMatrix) {\n DECKGL_FILTER_SIZE(pos, geometry);\n // using instancePositions as world coordinates\n // when using globe mode, this branch does not re-orient the model to align with the surface of the earth\n // call project_normal before setting position to avoid rotation\n geometry.normal = project_normal(normal);\n gl_Position = project_position_to_clipspace(pos + instancePositions, instancePositions64Low, vec3(0.0), geometry.position);\n }\n else {\n pos = project_size(pos);\n DECKGL_FILTER_SIZE(pos, geometry);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, pos, geometry.position);\n geometry.normal = project_normal(normal);\n }\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n #ifdef MODULE_PBR\n // set PBR data\n pbr_vPosition = geometry.position.xyz;\n #ifdef HAS_NORMALS\n pbr_vNormal = geometry.normal;\n #endif\n\n #ifdef HAS_UV\n pbr_vUV = TEXCOORD_0;\n #else\n pbr_vUV = vec2(0., 0.);\n #endif\n geometry.uv = pbr_vUV;\n #endif\n\n vColor = instanceColors;\n DECKGL_FILTER_COLOR(vColor, geometry);\n}\n'; +export default _default; +// # sourceMappingURL=scenegraph-layer-vertex.glsl.d.ts.map diff --git a/modules/mesh-layers/typed/scenegraph-layer/scenegraph-layer-vertex.glsl.d.ts.map b/modules/mesh-layers/typed/scenegraph-layer/scenegraph-layer-vertex.glsl.d.ts.map new file mode 100644 index 00000000000..119e32f4704 --- /dev/null +++ b/modules/mesh-layers/typed/scenegraph-layer/scenegraph-layer-vertex.glsl.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"scenegraph-layer-vertex.glsl.d.ts","sourceRoot":"","sources":["../../src/scenegraph-layer/scenegraph-layer-vertex.glsl.ts"],"names":[],"mappings":";AAAA,wBAgGE"} \ No newline at end of file diff --git a/modules/mesh-layers/typed/scenegraph-layer/scenegraph-layer.d.ts b/modules/mesh-layers/typed/scenegraph-layer/scenegraph-layer.d.ts new file mode 100644 index 00000000000..6a8178e1b4c --- /dev/null +++ b/modules/mesh-layers/typed/scenegraph-layer/scenegraph-layer.d.ts @@ -0,0 +1,143 @@ +import type {Device} from '@luma.gl/api'; +import {Layer} from '@deck.gl/core'; +import {GroupNode, GLTFAnimator, GLTFEnvironment} from '@luma.gl/experimental'; +import type { + UpdateParameters, + LayerContext, + LayerProps, + Position, + Color, + Accessor, + DefaultProps +} from '@deck.gl/core'; +export declare type ScenegraphLayerProps = _ScenegraphLayerProps & + LayerProps; +declare type _ScenegraphLayerProps = { + /** + * A url for a glTF model or scenegraph loaded via a [scenegraph loader](https://loaders.gl/docs/specifications/category-scenegraph) + */ + scenegraph: any; + /** + * Create a luma.gl GroupNode from the resolved scenegraph prop + */ + getScene?: ( + scenegraph: any, + context: { + device?: Device; + layer: ScenegraphLayer; + } + ) => GroupNode; + /** + * Create a luma.gl GLTFAnimator from the resolved scenegraph prop + */ + getAnimator?: ( + scenegraph: any, + context: { + device?: Device; + layer: ScenegraphLayer; + } + ) => GLTFAnimator; + /** + * (Experimental) animation configurations. Requires `_animate` on deck object. + */ + _animations?: { + [name: number | string | '*']: { + /** If the animation is playing */ + playing?: boolean; + /** Start time of the animation, default `0` */ + startTime?: number; + /** Speed multiplier of the animation, default `1` */ + speed?: number; + }; + } | null; + /** + * (Experimental) lighting mode + * @default 'flat' + */ + _lighting?: 'flat' | 'pbr'; + /** + * (Experimental) lighting environment. Requires `_lighting` to be `'pbr'`. + */ + _imageBasedLightingEnvironment?: + | null + | GLTFEnvironment + | ((context: {gl: WebGLRenderingContext; layer: ScenegraphLayer}) => GLTFEnvironment); + /** Anchor position accessor. */ + getPosition?: Accessor; + /** Color value or accessor. + * @default [255, 255, 255, 255] + */ + getColor?: Accessor; + /** + * Orientation in [pitch, yaw, roll] in degrees. + * @see https://en.wikipedia.org/wiki/Euler_angles + * @default [0, 0, 0] + */ + getOrientation?: Accessor; + /** + * Scaling factor of the model along each axis. + * @default [1, 1, 1] + */ + getScale?: Accessor; + /** + * Translation from the anchor point, [x, y, z] in meters. + * @default [0, 0, 0] + */ + getTranslation?: Accessor; + /** + * TransformMatrix. If specified, `getOrientation`, `getScale` and `getTranslation` are ignored. + */ + getTransformMatrix?: Accessor; + /** + * Multiplier to scale each geometry by. + * @default 1 + */ + sizeScale?: number; + /** + * The minimum size in pixels for one unit of the scene. + * @default 0 + */ + sizeMinPixels?: number; + /** + * The maximum size in pixels for one unit of the scene. + * @default Number.MAX_SAFE_INTEGER + */ + sizeMaxPixels?: number; +}; +/** Render a number of instances of a complete glTF scenegraph. */ +export default class ScenegraphLayer extends Layer< + ExtraPropsT & Required<_ScenegraphLayerProps> +> { + static defaultProps: DefaultProps>; + static layerName: string; + state: { + scenegraph: GroupNode; + animator: GLTFAnimator; + attributesAvailable?: boolean; + }; + getShaders(): { + vs: string; + fs: string; + modules: import('@deck.gl/core')._ShaderModule[]; + }; + initializeState(): void; + updateState(params: UpdateParameters): void; + finalizeState(context: LayerContext): void; + private _updateScenegraph; + private _applyAllAttributes; + private _applyAnimationsProp; + private _deleteScenegraph; + private _getModelOptions; + updateAttributes(changedAttributes: any): void; + draw({ + moduleParameters, + parameters, + context + }: { + moduleParameters?: any; + parameters?: {}; + context: any; + }): void; +} +export {}; +// # sourceMappingURL=scenegraph-layer.d.ts.map diff --git a/modules/mesh-layers/typed/scenegraph-layer/scenegraph-layer.d.ts.map b/modules/mesh-layers/typed/scenegraph-layer/scenegraph-layer.d.ts.map new file mode 100644 index 00000000000..2332a4c925f --- /dev/null +++ b/modules/mesh-layers/typed/scenegraph-layer/scenegraph-layer.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"scenegraph-layer.d.ts","sourceRoot":"","sources":["../../src/scenegraph-layer/scenegraph-layer.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,cAAc,CAAC;AACzC,OAAO,EAAC,KAAK,EAA0B,MAAM,eAAe,CAAC;AAG7D,OAAO,EAEL,SAAS,EACT,YAAY,EACZ,eAAe,EAEhB,MAAM,uBAAuB,CAAC;AAU/B,OAAO,KAAK,EACV,gBAAgB,EAChB,YAAY,EACZ,UAAU,EACV,QAAQ,EACR,KAAK,EACL,QAAQ,EACR,YAAY,EACb,MAAM,eAAe,CAAC;AAIvB,oBAAY,oBAAoB,CAAC,KAAK,GAAG,GAAG,IAAI,qBAAqB,CAAC,KAAK,CAAC,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC;AAEjG,aAAK,qBAAqB,CAAC,KAAK,IAAI;IAElC;;OAEG;IACH,UAAU,EAAE,GAAG,CAAC;IAChB;;OAEG;IACH,QAAQ,CAAC,EAAE,CACT,UAAU,EAAE,GAAG,EACf,OAAO,EAAE;QAAC,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,eAAe,CAAC,KAAK,CAAC,CAAA;KAAC,KACtD,SAAS,CAAC;IACf;;OAEG;IACH,WAAW,CAAC,EAAE,CACZ,UAAU,EAAE,GAAG,EACf,OAAO,EAAE;QAAC,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,E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AAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC;AAsCF,kEAAkE;AAClE,MAAM,CAAC,OAAO,OAAO,eAAe,CAAC,KAAK,GAAG,GAAG,EAAE,WAAW,GAAG,EAAE,CAAE,SAAQ,KAAK,CAC/E,WAAW,GAAG,QAAQ,CAAC,qBAAqB,CAAC,KAAK,CAAC,CAAC,CACrD;IACC,MAAM,CAAC,YAAY,0CAAgB;IACnC,MAAM,CAAC,SAAS,SAAqB;IAErC,KAAK,EAAG;QACN,UAAU,EAAE,SAAS,CAAC;QACtB,QAAQ,EAAE,YAAY,CAAC;QACvB,mBAAmB,CAAC,EAAE,OAAO,CAAC;KAC/B,CAAC;IAEF,UAAU;;;;;IAUV,eAAe;IAuBf,WAAW,CAAC,MAAM,EAAE,gBAAgB,CAAC,IAAI,CAAC;IAW1C,aAAa,CAAC,OAAO,EAAE,YAAY;IAKnC,OAAO,CAAC,iBAAiB;IAqCzB,OAAO,CAAC,mBAAmB;IAU3B,OAAO,CAAC,oBAAoB;IA2C5B,OAAO,CAAC,iBAAiB;IAOzB,OAAO,CAAC,gBAAgB;IA0BxB,gBAAgB,CAAC,iBAAiB,KAAA;IASlC,IAAI,CAAC,EAAC,gBAAuB,EAAE,UAAe,EAAE,OAAO,EAAC;;;;KAAA;CA8BzD"} \ No newline at end of file diff --git a/modules/mesh-layers/typed/simple-mesh-layer/simple-mesh-layer-fragment.glsl.d.ts b/modules/mesh-layers/typed/simple-mesh-layer/simple-mesh-layer-fragment.glsl.d.ts new file mode 100644 index 00000000000..bcea8462ee9 --- /dev/null +++ b/modules/mesh-layers/typed/simple-mesh-layer/simple-mesh-layer-fragment.glsl.d.ts @@ -0,0 +1,3 @@ +declare const _default: '#version 300 es\n#define SHADER_NAME simple-mesh-layer-fs\n\nprecision highp float;\n\nuniform bool hasTexture;\nuniform sampler2D sampler;\nuniform bool flatShading;\nuniform float opacity;\n\nin vec2 vTexCoord;\nin vec3 cameraPosition;\nin vec3 normals_commonspace;\nin vec4 position_commonspace;\nin vec4 vColor;\n\nout vec4 fragColor;\n\nvoid main(void) {\n geometry.uv = vTexCoord;\n\n vec3 normal;\n if (flatShading) {\n\n// NOTE(Tarek): This is necessary because\n// headless.gl reports the extension as\n// available but does not support it in\n// the shader.\n#ifdef DERIVATIVES_AVAILABLE\n normal = normalize(cross(dFdx(position_commonspace.xyz), dFdy(position_commonspace.xyz)));\n#else\n normal = vec3(0.0, 0.0, 1.0);\n#endif\n } else {\n normal = normals_commonspace;\n }\n\n vec4 color = hasTexture ? texture(sampler, vTexCoord) : vColor;\n vec3 lightColor = lighting_getLightColor(color.rgb, cameraPosition, position_commonspace.xyz, normal);\n fragColor = vec4(lightColor, color.a * opacity);\n\n DECKGL_FILTER_COLOR(fragColor, geometry);\n}\n'; +export default _default; +// # sourceMappingURL=simple-mesh-layer-fragment.glsl.d.ts.map diff --git a/modules/mesh-layers/typed/simple-mesh-layer/simple-mesh-layer-fragment.glsl.d.ts.map b/modules/mesh-layers/typed/simple-mesh-layer/simple-mesh-layer-fragment.glsl.d.ts.map new file mode 100644 index 00000000000..149637c50e3 --- /dev/null +++ b/modules/mesh-layers/typed/simple-mesh-layer/simple-mesh-layer-fragment.glsl.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"simple-mesh-layer-fragment.glsl.d.ts","sourceRoot":"","sources":["../../src/simple-mesh-layer/simple-mesh-layer-fragment.glsl.ts"],"names":[],"mappings":";AAAA,wBA2CE"} \ No newline at end of file diff --git a/modules/mesh-layers/typed/simple-mesh-layer/simple-mesh-layer-vertex.glsl.d.ts b/modules/mesh-layers/typed/simple-mesh-layer/simple-mesh-layer-vertex.glsl.d.ts new file mode 100644 index 00000000000..f89530eca30 --- /dev/null +++ b/modules/mesh-layers/typed/simple-mesh-layer/simple-mesh-layer-vertex.glsl.d.ts @@ -0,0 +1,3 @@ +declare const _default: '#version 300 es\n#define SHADER_NAME simple-mesh-layer-vs\n\n// Scale the model\nuniform float sizeScale;\nuniform bool composeModelMatrix;\n\n// Primitive attributes\nin vec3 positions;\nin vec3 normals;\nin vec3 colors;\nin vec2 texCoords;\n\n// Instance attributes\nin vec3 instancePositions;\nin vec3 instancePositions64Low;\nin vec4 instanceColors;\nin vec3 instancePickingColors;\nin mat3 instanceModelMatrix;\nin vec3 instanceTranslation;\n\n// Outputs to fragment shader\nout vec2 vTexCoord;\nout vec3 cameraPosition;\nout vec3 normals_commonspace;\nout vec4 position_commonspace;\nout vec4 vColor;\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n geometry.uv = texCoords;\n geometry.pickingColor = instancePickingColors;\n\n vTexCoord = texCoords;\n cameraPosition = project_uCameraPosition;\n vColor = vec4(colors * instanceColors.rgb, instanceColors.a);\n\n vec3 pos = (instanceModelMatrix * positions) * sizeScale + instanceTranslation;\n\n if (composeModelMatrix) {\n DECKGL_FILTER_SIZE(pos, geometry);\n // using instancePositions as world coordinates\n // when using globe mode, this branch does not re-orient the model to align with the surface of the earth\n // call project_normal before setting position to avoid rotation\n normals_commonspace = project_normal(instanceModelMatrix * normals);\n gl_Position = project_position_to_clipspace(pos + instancePositions, instancePositions64Low, vec3(0.0), position_commonspace);\n geometry.position = position_commonspace;\n }\n else {\n pos = project_size(pos);\n DECKGL_FILTER_SIZE(pos, geometry);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, pos, position_commonspace);\n geometry.position = position_commonspace;\n normals_commonspace = project_normal(instanceModelMatrix * normals);\n }\n\n geometry.normal = normals_commonspace;\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n DECKGL_FILTER_COLOR(vColor, geometry);\n}\n'; +export default _default; +// # sourceMappingURL=simple-mesh-layer-vertex.glsl.d.ts.map diff --git a/modules/mesh-layers/typed/simple-mesh-layer/simple-mesh-layer-vertex.glsl.d.ts.map b/modules/mesh-layers/typed/simple-mesh-layer/simple-mesh-layer-vertex.glsl.d.ts.map new file mode 100644 index 00000000000..c2be944b7f3 --- /dev/null +++ b/modules/mesh-layers/typed/simple-mesh-layer/simple-mesh-layer-vertex.glsl.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"simple-mesh-layer-vertex.glsl.d.ts","sourceRoot":"","sources":["../../src/simple-mesh-layer/simple-mesh-layer-vertex.glsl.ts"],"names":[],"mappings":";AAAA,wBA6DE"} \ No newline at end of file diff --git a/modules/mesh-layers/typed/simple-mesh-layer/simple-mesh-layer.d.ts b/modules/mesh-layers/typed/simple-mesh-layer/simple-mesh-layer.d.ts new file mode 100644 index 00000000000..13e699fa13c --- /dev/null +++ b/modules/mesh-layers/typed/simple-mesh-layer/simple-mesh-layer.d.ts @@ -0,0 +1,105 @@ +import {Layer, DefaultProps, LayerContext, Material} from '@deck.gl/core'; +import {Model, Texture2D} from '@luma.gl/webgl-legacy'; +import type {LayerProps, UpdateParameters, Accessor, Position, Color} from '@deck.gl/core'; +import type {MeshAttribute, MeshAttributes} from '@loaders.gl/schema'; +import type {Geometry as GeometryType} from '@luma.gl/engine'; +import {GLTFMaterialParser} from '@luma.gl/experimental'; +declare type Mesh = + | GeometryType + | { + attributes: MeshAttributes; + indices?: MeshAttribute; + } + | MeshAttributes; +declare type _SimpleMeshLayerProps = { + mesh: string | Mesh | Promise | null; + texture?: string | Texture2D | Promise; + /** Customize the [texture parameters](https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/texParameter). */ + textureParameters?: Record | null; + /** Anchor position accessor. */ + getPosition?: Accessor; + /** Color value or accessor. + * If `mesh` does not contain vertex colors, use this color to render each object. + * If `mesh` contains vertex colors, then the two colors are mixed together. + * Use `[255, 255, 255]` to use the original mesh colors. + * If `texture` is assigned, then both colors will be ignored. + * @default [0, 0, 0, 255] + */ + getColor?: Accessor; + /** + * Orientation in [pitch, yaw, roll] in degrees. + * @see https://en.wikipedia.org/wiki/Euler_angles + * @default [0, 0, 0] + */ + getOrientation?: Accessor; + /** + * Scaling factor of the model along each axis. + * @default [1, 1, 1] + */ + getScale?: Accessor; + /** + * Translation from the anchor point, [x, y, z] in meters. + * @default [0, 0, 0] + */ + getTranslation?: Accessor; + /** + * TransformMatrix. If specified, `getOrientation`, `getScale` and `getTranslation` are ignored. + */ + getTransformMatrix?: Accessor; + /** + * Multiplier to scale each geometry by. + * @default 1 + */ + sizeScale?: number; + /** + * @deprecated Whether to color pixels using vertex colors supplied in the mesh (the `COLOR_0` or `colors` attribute). + * If set to `false` vertex colors will be ignored. + * This prop will be removed and set to always true in the next major release. + * @default false + */ + _useMeshColors?: boolean; + /** + * (Experimental) If rendering only one instance of the mesh, set this to false to treat mesh positions + * as deltas of the world coordinates of the anchor. + * E.g. in LNGLAT coordinates, mesh positions are interpreted as meter offsets by default. + * setting _instanced to false interpreted mesh positions as lnglat deltas. + * @default true + */ + _instanced?: true; + /** + * Whether to render the mesh in wireframe mode. + * @default false + */ + wireframe?: false; + /** + * Material props for lighting effect. + * + * @default true + * @see https://deck.gl/docs/developer-guide/using-lighting#constructing-a-material-instance + */ + material?: Material; +}; +export declare type SimpleMeshLayerProps = _SimpleMeshLayerProps & + LayerProps; +/** Render a number of instances of an arbitrary 3D geometry. */ +export default class SimpleMeshLayer extends Layer< + ExtraPropsT & Required<_SimpleMeshLayerProps> +> { + static defaultProps: DefaultProps>; + static layerName: string; + state: { + materialParser?: GLTFMaterialParser; + model?: Model; + emptyTexture: Texture2D; + hasNormals?: boolean; + }; + getShaders(): any; + initializeState(): void; + updateState(params: UpdateParameters): void; + finalizeState(context: LayerContext): void; + draw({uniforms}: {uniforms: any}): void; + protected getModel(mesh: Mesh): Model; + private setTexture; +} +export {}; +// # sourceMappingURL=simple-mesh-layer.d.ts.map diff --git a/modules/mesh-layers/typed/simple-mesh-layer/simple-mesh-layer.d.ts.map b/modules/mesh-layers/typed/simple-mesh-layer/simple-mesh-layer.d.ts.map new file mode 100644 index 00000000000..dd04eecf2b6 --- /dev/null +++ b/modules/mesh-layers/typed/simple-mesh-layer/simple-mesh-layer.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"simple-mesh-layer.d.ts","sourceRoot":"","sources":["../../src/simple-mesh-layer/simple-mesh-layer.ts"],"names":[],"mappings":"AAwBA,OAAO,EACL,KAAK,EAIL,YAAY,EAEZ,YAAY,EACZ,QAAQ,EACT,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAK,KAAK,EAAY,SAAS,EAAuB,MAAM,uBAAuB,CAAC;AAO3F,OAAO,KAAK,EAAC,UAAU,EAAE,gBAAgB,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAC,MAAM,eAAe,CAAC;AAC3F,OAAO,KAAK,EAAC,aAAa,EAAE,cAAc,EAAC,MAAM,oBAAoB,CAAC;AACtE,OAAO,KAAK,EAAC,QAAQ,IAAI,YAAY,EAAC,MAAM,iBAAiB,CAAC;AAC9D,OAAO,EAAC,kBAAkB,EAAC,MAAM,uBAAuB,CAAC;AAsCzD,aAAK,IAAI,GACL,YAAY,GACZ;IACE,UAAU,EAAE,cAAc,CAAC;IAC3B,OAAO,CAAC,EAAE,aAAa,CAAC;CACzB,GACD,cAAc,CAAC;AAEnB,aAAK,qBAAqB,CAAC,KAAK,IAAI;IAClC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IAC3C,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;IAClD,+HAA+H;IAC/H,iBAAiB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAAC;IAElD,gCAAgC;IAChC,WAAW,CAAC,EAAE,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;IACxC;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IAClC;;;;OAIG;IACH,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AEF,UAAU;IAkBV,eAAe;IAiCf,WAAW,CAAC,MAAM,EAAE,gBAAgB,CAAC,IAAI,CAAC;IA2B1C,aAAa,CAAC,OAAO,EAAE,YAAY;IAMnC,IAAI,CAAC,EAAC,QAAQ,EAAC;;KAAA;IAkBf,SAAS,CAAC,QAAQ,CAAC,IAAI,EAAE,IAAI,GAAG,KAAK;IAkBrC,OAAO,CAAC,UAAU;CAYnB"} \ No newline at end of file diff --git a/modules/mesh-layers/typed/utils/matrix.d.ts b/modules/mesh-layers/typed/utils/matrix.d.ts new file mode 100644 index 00000000000..fc185715406 --- /dev/null +++ b/modules/mesh-layers/typed/utils/matrix.d.ts @@ -0,0 +1,34 @@ +export declare const MATRIX_ATTRIBUTES: { + size: number; + accessor: string[]; + shaderAttributes: { + readonly instanceModelMatrix__LOCATION_0: { + readonly size: 3; + readonly elementOffset: 0; + }; + readonly instanceModelMatrix__LOCATION_1: { + readonly size: 3; + readonly elementOffset: 3; + }; + readonly instanceModelMatrix__LOCATION_2: { + readonly size: 3; + readonly elementOffset: 6; + }; + readonly instanceTranslation: { + readonly size: 3; + readonly elementOffset: 9; + }; + }; + update( + attribute: any, + { + startRow, + endRow + }: { + startRow: any; + endRow: any; + } + ): void; +}; +export declare function shouldComposeModelMatrix(viewport: any, coordinateSystem: any): boolean; +// # sourceMappingURL=matrix.d.ts.map diff --git a/modules/mesh-layers/typed/utils/matrix.d.ts.map b/modules/mesh-layers/typed/utils/matrix.d.ts.map new file mode 100644 index 00000000000..5db3280f2b1 --- /dev/null +++ b/modules/mesh-layers/typed/utils/matrix.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"matrix.d.ts","sourceRoot":"","sources":["../../src/utils/matrix.ts"],"names":[],"mappings":"AAoDA,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;CAkG7B,CAAC;AAMF,wBAAgB,wBAAwB,CAAC,QAAQ,KAAA,EAAE,gBAAgB,KAAA,WAMlE"} \ No newline at end of file diff --git a/modules/react/typed/deckgl.d.ts b/modules/react/typed/deckgl.d.ts new file mode 100644 index 00000000000..06a2e56b31b --- /dev/null +++ b/modules/react/typed/deckgl.d.ts @@ -0,0 +1,32 @@ +import * as React from 'react'; +import {Deck} from '@deck.gl/core'; +import type {DeckGLContextValue} from './utils/position-children-under-views'; +import type {DeckProps} from '@deck.gl/core'; +/** DeckGL React component props */ +export declare type DeckGLProps = Omit< + DeckProps, + 'width' | 'height' | 'gl' | 'parent' | 'canvas' | '_customRender' +> & { + Deck?: typeof Deck; + width?: string | number; + height?: string | number; + children?: React.ReactNode; + ContextProvider?: React.Context['Provider']; +}; +export declare type DeckGLRef = { + deck?: Deck; + pickObject: Deck['pickObject']; + pickObjects: Deck['pickObjects']; + pickMultipleObjects: Deck['pickMultipleObjects']; +}; +declare const DeckGL: React.ForwardRefExoticComponent< + Omit & { + Deck?: typeof Deck; + width?: string | number; + height?: string | number; + children?: React.ReactNode; + ContextProvider?: React.Context['Provider']; + } & React.RefAttributes +>; +export default DeckGL; +// # sourceMappingURL=deckgl.d.ts.map diff --git a/modules/react/typed/deckgl.d.ts.map b/modules/react/typed/deckgl.d.ts.map new file mode 100644 index 00000000000..da9969c4063 --- /dev/null +++ b/modules/react/typed/deckgl.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"deckgl.d.ts","sourceRoot":"","sources":["../src/deckgl.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAU/B,OAAO,EAAC,IAAI,EAAC,MAAM,eAAe,CAAC;AAOnC,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,uCAAuC,CAAC;AAC9E,OAAO,KAAK,EAAC,SAAS,EAAW,MAAM,eAAe,CAAC;AAevD,mCAAmC;AACnC,oBAAY,WAAW,GAAG,IAAI,CAC5B,SAAS,EACT,OAAO,GAAG,QAAQ,GAAG,IAAI,GAAG,QAAQ,GAAG,QAAQ,GAAG,eAAe,CAClE,GAAG;IACF,IAAI,CAAC,EAAE,OAAO,IAAI,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,eAAe,CAAC,EAAE,KAAK,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC,UAAU,CAAC,CAAC;CACjE,CAAC;AAEF,oBAAY,SAAS,GAAG;IACtB,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,UAAU,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;IAC/B,WAAW,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;IACjC,mBAAmB,EAAE,IAAI,CAAC,qBAAqB,CAAC,CAAC;CAClD,CAAC;AAqDF,QAAA,MAAM,MAAM;WAjEH,WAAW;YACV,MAAM,GAAG,MAAM;aACd,MAAM,GAAG,MAAM;eACb,MAAM,SAAS;sBACR,MAAM,OAAO,CAAC,kBAAkB,CAAC,CAAC,UAAU,CAAC;mCAuN/D,CAAC;AAIH,eAAe,MAAM,CAAC"} \ No newline at end of file diff --git a/modules/react/typed/index.d.ts b/modules/react/typed/index.d.ts new file mode 100644 index 00000000000..e7402da712e --- /dev/null +++ b/modules/react/typed/index.d.ts @@ -0,0 +1,5 @@ +export {default as DeckGL} from './deckgl'; +export {default} from './deckgl'; +export type {DeckGLContextValue} from './utils/position-children-under-views'; +export type {DeckGLRef, DeckGLProps} from './deckgl'; +// # sourceMappingURL=index.d.ts.map diff --git a/modules/react/typed/index.d.ts.map b/modules/react/typed/index.d.ts.map new file mode 100644 index 00000000000..84a3d80e4fc --- /dev/null +++ b/modules/react/typed/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAC,OAAO,IAAI,MAAM,EAAC,MAAM,UAAU,CAAC;AAC3C,OAAO,EAAC,OAAO,EAAC,MAAM,UAAU,CAAC;AAGjC,YAAY,EAAC,kBAAkB,EAAC,MAAM,uCAAuC,CAAC;AAC9E,YAAY,EAAC,SAAS,EAAE,WAAW,EAAC,MAAM,UAAU,CAAC"} \ No newline at end of file diff --git a/modules/react/typed/utils/evaluate-children.d.ts b/modules/react/typed/utils/evaluate-children.d.ts new file mode 100644 index 00000000000..1e893260a91 --- /dev/null +++ b/modules/react/typed/utils/evaluate-children.d.ts @@ -0,0 +1,7 @@ +import * as React from 'react'; +export default function evaluateChildren( + children: React.ReactNode, + childProps: any +): React.ReactNode; +export declare function isComponent(child: React.ReactNode): child is React.ReactElement; +// # sourceMappingURL=evaluate-children.d.ts.map diff --git a/modules/react/typed/utils/evaluate-children.d.ts.map b/modules/react/typed/utils/evaluate-children.d.ts.map new file mode 100644 index 00000000000..47518b1df69 --- /dev/null +++ b/modules/react/typed/utils/evaluate-children.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"evaluate-children.d.ts","sourceRoot":"","sources":["../../src/utils/evaluate-children.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,MAAM,CAAC,OAAO,UAAU,gBAAgB,CACtC,QAAQ,EAAE,KAAK,CAAC,SAAS,EACzB,UAAU,EAAE,GAAG,GACd,KAAK,CAAC,SAAS,CAqBjB;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,KAAK,CAAC,SAAS,GAAG,KAAK,IAAI,KAAK,CAAC,YAAY,CAE/E"} \ No newline at end of file diff --git a/modules/react/typed/utils/extract-jsx-layers.d.ts b/modules/react/typed/utils/extract-jsx-layers.d.ts new file mode 100644 index 00000000000..dbb440c6d1b --- /dev/null +++ b/modules/react/typed/utils/extract-jsx-layers.d.ts @@ -0,0 +1,17 @@ +import * as React from 'react'; +import {View} from '@deck.gl/core'; +import type {LayersList} from '@deck.gl/core'; +export default function extractJSXLayers({ + children, + layers, + views +}: { + children?: React.ReactNode; + layers?: LayersList; + views?: View | View[] | null; +}): { + children: React.ReactNode[]; + layers: LayersList; + views: View | View[] | null; +}; +// # sourceMappingURL=extract-jsx-layers.d.ts.map diff --git a/modules/react/typed/utils/extract-jsx-layers.d.ts.map b/modules/react/typed/utils/extract-jsx-layers.d.ts.map new file mode 100644 index 00000000000..137cfcb28d3 --- /dev/null +++ b/modules/react/typed/utils/extract-jsx-layers.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"extract-jsx-layers.d.ts","sourceRoot":"","sources":["../../src/utils/extract-jsx-layers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAQ,IAAI,EAAC,MAAM,eAAe,CAAC;AAE1C,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,eAAe,CAAC;AAyB9C,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,EACvC,QAAQ,EACR,MAAW,EACX,KAAY,EACb,EAAE;IACD,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,KAAK,CAAC,EAAE,IAAI,GAAG,IAAI,EAAE,GAAG,IAAI,CAAC;CAC9B,GAAG;IACF,QAAQ,EAAE,KAAK,CAAC,SAAS,EAAE,CAAC;IAC5B,MAAM,EAAE,UAAU,CAAC;IACnB,KAAK,EAAE,IAAI,GAAG,IAAI,EAAE,GAAG,IAAI,CAAC;CAC7B,CA6CA"} \ No newline at end of file diff --git a/modules/react/typed/utils/extract-styles.d.ts b/modules/react/typed/utils/extract-styles.d.ts new file mode 100644 index 00000000000..736763343be --- /dev/null +++ b/modules/react/typed/utils/extract-styles.d.ts @@ -0,0 +1,14 @@ +import * as React from 'react'; +export default function extractStyles({ + width, + height, + style +}: { + width?: string | number; + height?: string | number; + style?: Partial | null; +}): { + containerStyle: React.CSSProperties; + canvasStyle: React.CSSProperties; +}; +// # sourceMappingURL=extract-styles.d.ts.map diff --git a/modules/react/typed/utils/extract-styles.d.ts.map b/modules/react/typed/utils/extract-styles.d.ts.map new file mode 100644 index 00000000000..0d90f5debb3 --- /dev/null +++ b/modules/react/typed/utils/extract-styles.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"extract-styles.d.ts","sourceRoot":"","sources":["../../src/utils/extract-styles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,EACpC,KAAK,EACL,MAAM,EACN,KAAK,EACN,EAAE;IACD,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,KAAK,CAAC,EAAE,OAAO,CAAC,mBAAmB,CAAC,GAAG,IAAI,CAAC;CAC7C,GAAG;IACF,cAAc,EAAE,KAAK,CAAC,aAAa,CAAC;IACpC,WAAW,EAAE,KAAK,CAAC,aAAa,CAAC;CAClC,CA8BA"} \ No newline at end of file diff --git a/modules/react/typed/utils/inherits-from.d.ts b/modules/react/typed/utils/inherits-from.d.ts new file mode 100644 index 00000000000..525ec2598e8 --- /dev/null +++ b/modules/react/typed/utils/inherits-from.d.ts @@ -0,0 +1,2 @@ +export declare function inheritsFrom(Type: any, ParentType: T): Type is T; +// # sourceMappingURL=inherits-from.d.ts.map diff --git a/modules/react/typed/utils/inherits-from.d.ts.map b/modules/react/typed/utils/inherits-from.d.ts.map new file mode 100644 index 00000000000..9f7367fb32a --- /dev/null +++ b/modules/react/typed/utils/inherits-from.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"inherits-from.d.ts","sourceRoot":"","sources":["../../src/utils/inherits-from.ts"],"names":[],"mappings":"AACA,wBAAgB,YAAY,CAAC,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,UAAU,EAAE,CAAC,GAAG,IAAI,IAAI,CAAC,CAQnE"} \ No newline at end of file diff --git a/modules/react/typed/utils/position-children-under-views.d.ts b/modules/react/typed/utils/position-children-under-views.d.ts new file mode 100644 index 00000000000..27db8fc81c1 --- /dev/null +++ b/modules/react/typed/utils/position-children-under-views.d.ts @@ -0,0 +1,19 @@ +import * as React from 'react'; +import type {Deck, DeckProps, Viewport} from '@deck.gl/core'; +import type {EventManager} from 'mjolnir.js'; +export declare type DeckGLContextValue = { + viewport: Viewport; + container: HTMLElement; + eventManager: EventManager; + onViewStateChange: DeckProps['onViewStateChange']; +}; +export default function positionChildrenUnderViews({ + children, + deck, + ContextProvider +}: { + children: React.ReactNode[]; + deck?: Deck; + ContextProvider?: React.Context['Provider']; +}): React.ReactNode[]; +// # sourceMappingURL=position-children-under-views.d.ts.map diff --git a/modules/react/typed/utils/position-children-under-views.d.ts.map b/modules/react/typed/utils/position-children-under-views.d.ts.map new file mode 100644 index 00000000000..36ea3fe405e --- /dev/null +++ b/modules/react/typed/utils/position-children-under-views.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"position-children-under-views.d.ts","sourceRoot":"","sources":["../../src/utils/position-children-under-views.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,OAAO,KAAK,EAAC,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAC,MAAM,eAAe,CAAC;AAC7D,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,YAAY,CAAC;AAE7C,oBAAY,kBAAkB,GAAG;IAC/B,QAAQ,EAAE,QAAQ,CAAC;IACnB,SAAS,EAAE,WAAW,CAAC;IACvB,YAAY,EAAE,YAAY,CAAC;IAC3B,iBAAiB,EAAE,SAAS,CAAC,mBAAmB,CAAC,CAAC;CACnD,CAAC;AAIF,MAAM,CAAC,OAAO,UAAU,0BAA0B,CAAC,EACjD,QAAQ,EACR,IAAI,EACJ,eAAe,EAChB,EAAE;IACD,QAAQ,EAAE,KAAK,CAAC,SAAS,EAAE,CAAC;IAC5B,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,eAAe,CAAC,EAAE,KAAK,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC,UAAU,CAAC,CAAC;CACjE,GAAG,KAAK,CAAC,SAAS,EAAE,CA0FpB"} \ No newline at end of file diff --git a/modules/react/typed/utils/use-isomorphic-layout-effect.d.ts b/modules/react/typed/utils/use-isomorphic-layout-effect.d.ts new file mode 100644 index 00000000000..72a88926384 --- /dev/null +++ b/modules/react/typed/utils/use-isomorphic-layout-effect.d.ts @@ -0,0 +1,4 @@ +import {useLayoutEffect} from 'react'; +declare const useIsomorphicLayoutEffect: typeof useLayoutEffect; +export default useIsomorphicLayoutEffect; +// # sourceMappingURL=use-isomorphic-layout-effect.d.ts.map diff --git a/modules/react/typed/utils/use-isomorphic-layout-effect.d.ts.map b/modules/react/typed/utils/use-isomorphic-layout-effect.d.ts.map new file mode 100644 index 00000000000..f3536557268 --- /dev/null +++ b/modules/react/typed/utils/use-isomorphic-layout-effect.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"use-isomorphic-layout-effect.d.ts","sourceRoot":"","sources":["../../src/utils/use-isomorphic-layout-effect.ts"],"names":[],"mappings":"AAEA,OAAO,EAAY,eAAe,EAAC,MAAM,OAAO,CAAC;AAEjD,QAAA,MAAM,yBAAyB,wBAA8D,CAAC;AAE9F,eAAe,yBAAyB,CAAC"} \ No newline at end of file diff --git a/test/apps/mapbox-integration/mapbox-layers-react/mapbox-layers-react.jsx b/test/apps/mapbox-integration/mapbox-layers-react/mapbox-layers-react.jsx index 3ba1c3b18f3..945efcf5b4e 100644 --- a/test/apps/mapbox-integration/mapbox-layers-react/mapbox-layers-react.jsx +++ b/test/apps/mapbox-integration/mapbox-layers-react/mapbox-layers-react.jsx @@ -87,7 +87,7 @@ function App() { initialViewState={INITIAL_VIEW_STATE} controller={true} onWebGLInitialized={setGLContext} - deviceProps={{type: 'webgl', stencil: true}} + deviceProps={{type: 'webgl', webgl: {stencil: true}}} layerFilter={layerFilter} > {glContext && ( diff --git a/test/apps/mapbox-integration/mapbox-overlay-react/mapbox-overlay-react.jsx b/test/apps/mapbox-integration/mapbox-overlay-react/mapbox-overlay-react.jsx index e5a2d0b2af9..6e1006ae152 100644 --- a/test/apps/mapbox-integration/mapbox-overlay-react/mapbox-overlay-react.jsx +++ b/test/apps/mapbox-integration/mapbox-overlay-react/mapbox-overlay-react.jsx @@ -97,7 +97,7 @@ function App() { interleaved layers={layers} views={[mapboxView, widgetView]} - deviceProps={{type: 'webgl', stencil: true}} + deviceProps={{type: 'webgl', webgl: {stencil: true}}} layerFilter={layerFilter} />