@developmentseed/deck.gl-raster 0.7.0-beta.1 → 0.8.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/fp64.d.ts +18 -0
- package/dist/fp64.d.ts.map +1 -0
- package/dist/fp64.js +28 -0
- package/dist/fp64.js.map +1 -0
- package/dist/globe-grid-mesh.d.ts +30 -0
- package/dist/globe-grid-mesh.d.ts.map +1 -0
- package/dist/globe-grid-mesh.js +67 -0
- package/dist/globe-grid-mesh.js.map +1 -0
- package/dist/gpu-modules/cutline-bbox.d.ts +26 -40
- package/dist/gpu-modules/cutline-bbox.d.ts.map +1 -1
- package/dist/gpu-modules/cutline-bbox.js +24 -53
- package/dist/gpu-modules/cutline-bbox.js.map +1 -1
- package/dist/gpu-modules/index.d.ts +1 -1
- package/dist/gpu-modules/index.d.ts.map +1 -1
- package/dist/gpu-modules/index.js +1 -1
- package/dist/gpu-modules/index.js.map +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/dist/layer-utils.d.ts +2 -2
- package/dist/layer-utils.d.ts.map +1 -1
- package/dist/layer-utils.js.map +1 -1
- package/dist/mesh-layer/mesh-layer-fragment.glsl.d.ts +1 -1
- package/dist/mesh-layer/mesh-layer-fragment.glsl.js +1 -1
- package/dist/mesh-layer/mesh-layer-vertex.glsl.d.ts +3 -0
- package/dist/mesh-layer/mesh-layer-vertex.glsl.d.ts.map +1 -0
- package/dist/mesh-layer/mesh-layer-vertex.glsl.js +90 -0
- package/dist/mesh-layer/mesh-layer-vertex.glsl.js.map +1 -0
- package/dist/mesh-layer/mesh-layer.d.ts +31 -5
- package/dist/mesh-layer/mesh-layer.d.ts.map +1 -1
- package/dist/mesh-layer/mesh-layer.js +67 -3
- package/dist/mesh-layer/mesh-layer.js.map +1 -1
- package/dist/multi-raster-tileset/index.d.ts +2 -2
- package/dist/multi-raster-tileset/index.d.ts.map +1 -1
- package/dist/multi-raster-tileset/index.js +1 -1
- package/dist/multi-raster-tileset/index.js.map +1 -1
- package/dist/multi-raster-tileset/multi-tileset-descriptor.d.ts +21 -21
- package/dist/multi-raster-tileset/multi-tileset-descriptor.d.ts.map +1 -1
- package/dist/multi-raster-tileset/multi-tileset-descriptor.js +11 -11
- package/dist/multi-raster-tileset/multi-tileset-descriptor.js.map +1 -1
- package/dist/multi-raster-tileset/secondary-tile-resolver.d.ts +4 -4
- package/dist/multi-raster-tileset/secondary-tile-resolver.d.ts.map +1 -1
- package/dist/multi-raster-tileset/secondary-tile-resolver.js +2 -2
- package/dist/multi-raster-tileset/secondary-tile-resolver.js.map +1 -1
- package/dist/raster-layer.d.ts +39 -4
- package/dist/raster-layer.d.ts.map +1 -1
- package/dist/raster-layer.js +51 -35
- package/dist/raster-layer.js.map +1 -1
- package/dist/raster-tile-layer/raster-tile-layer.d.ts +6 -6
- package/dist/raster-tile-layer/raster-tile-layer.d.ts.map +1 -1
- package/dist/raster-tile-layer/raster-tile-layer.js +40 -31
- package/dist/raster-tile-layer/raster-tile-layer.js.map +1 -1
- package/dist/raster-tileset/affine-tileset-level.d.ts +4 -4
- package/dist/raster-tileset/affine-tileset-level.d.ts.map +1 -1
- package/dist/raster-tileset/affine-tileset-level.js +2 -2
- package/dist/raster-tileset/affine-tileset.d.ts +3 -3
- package/dist/raster-tileset/affine-tileset.d.ts.map +1 -1
- package/dist/raster-tileset/affine-tileset.js +1 -1
- package/dist/raster-tileset/bounding-volume-cache.d.ts +11 -4
- package/dist/raster-tileset/bounding-volume-cache.d.ts.map +1 -1
- package/dist/raster-tileset/bounding-volume-cache.js +13 -4
- package/dist/raster-tileset/bounding-volume-cache.js.map +1 -1
- package/dist/raster-tileset/index.d.ts +3 -2
- package/dist/raster-tileset/index.d.ts.map +1 -1
- package/dist/raster-tileset/index.js +1 -0
- package/dist/raster-tileset/index.js.map +1 -1
- package/dist/raster-tileset/raster-tile-traversal.d.ts +68 -13
- package/dist/raster-tileset/raster-tile-traversal.d.ts.map +1 -1
- package/dist/raster-tileset/raster-tile-traversal.js +240 -35
- package/dist/raster-tileset/raster-tile-traversal.js.map +1 -1
- package/dist/raster-tileset/raster-tileset-2d.d.ts +64 -6
- package/dist/raster-tileset/raster-tileset-2d.d.ts.map +1 -1
- package/dist/raster-tileset/raster-tileset-2d.js +75 -2
- package/dist/raster-tileset/raster-tileset-2d.js.map +1 -1
- package/dist/raster-tileset/sort-by-distance.d.ts +41 -0
- package/dist/raster-tileset/sort-by-distance.d.ts.map +1 -0
- package/dist/raster-tileset/sort-by-distance.js +72 -0
- package/dist/raster-tileset/sort-by-distance.js.map +1 -0
- package/dist/raster-tileset/tile-matrix-set.d.ts +4 -4
- package/dist/raster-tileset/tile-matrix-set.d.ts.map +1 -1
- package/dist/raster-tileset/tile-matrix-set.js +1 -1
- package/dist/raster-tileset/tile-matrix-set.js.map +1 -1
- package/dist/raster-tileset/tileset-interface.d.ts +3 -3
- package/dist/raster-tileset/tileset-interface.d.ts.map +1 -1
- package/dist/raster-tileset/web-mercator-clamp.d.ts +29 -0
- package/dist/raster-tileset/web-mercator-clamp.d.ts.map +1 -0
- package/dist/raster-tileset/web-mercator-clamp.js +54 -0
- package/dist/raster-tileset/web-mercator-clamp.js.map +1 -0
- package/package.json +7 -7
- package/dist/raster-tile-layer/constants.d.ts +0 -11
- package/dist/raster-tile-layer/constants.d.ts.map +0 -1
- package/dist/raster-tile-layer/constants.js +0 -11
- package/dist/raster-tile-layer/constants.js.map +0 -1
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
// Vertex shader for MeshTextureLayer. Override of upstream's
|
|
2
|
+
// simple-mesh-layer-vertex.glsl.ts (deck.gl 9.3 @
|
|
3
|
+
// 09af8de8d18a9cb9a31d064cae8f9e7239df7f53):
|
|
4
|
+
// https://github.com/visgl/deck.gl/blob/09af8de8d18a9cb9a31d064cae8f9e7239df7f53/modules/mesh-layers/src/simple-mesh-layer/simple-mesh-layer-vertex.glsl.ts
|
|
5
|
+
//
|
|
6
|
+
// Differences from upstream:
|
|
7
|
+
// 1. Adds `in vec3 positions64Low;` — per-vertex low part of the
|
|
8
|
+
// fp64-split mesh position. Supplied by MeshTextureLayer via
|
|
9
|
+
// attributeManager.add (non-instanced).
|
|
10
|
+
// 2. Passes `positions64Low + instancePositions64Low` to
|
|
11
|
+
// project_position_to_clipspace, so the shader's fp64 path recovers the
|
|
12
|
+
// mesh-vertex precision lost by the float32 attribute pipeline.
|
|
13
|
+
// 3. Collapses upstream's `composeModelMatrix` branch to a single
|
|
14
|
+
// direct-projection path. MeshTextureLayer always draws ONE
|
|
15
|
+
// non-instanced, identity-transform mesh anchored at the origin
|
|
16
|
+
// (instancePositions = [0,0,0], identity instanceModelMatrix, sizeScale =
|
|
17
|
+
// 1), so the instanced / meters-offset (upstream's `else`) branch never
|
|
18
|
+
// applied. Projecting `pos` directly is correct for BOTH cartesian
|
|
19
|
+
// (common-space mesh, Web Mercator) and lnglat (degrees, GlobeView):
|
|
20
|
+
// project_position_to_clipspace handles each coordinate system. This is
|
|
21
|
+
// what makes GlobeView render correctly — upstream's `else` branch ran
|
|
22
|
+
// project_size(pos) on lng/lat degrees, which is meaningless. See
|
|
23
|
+
// dev-docs/specs/2026-05-21-globe-view-design.md.
|
|
24
|
+
//
|
|
25
|
+
// The fp64 correction is only valid when the per-instance transforms are
|
|
26
|
+
// identity. MeshTextureLayer enforces that by fixing those props and omitting
|
|
27
|
+
// them from its public prop type (see MeshTextureLayer's class doc). See
|
|
28
|
+
// dev-docs/specs/2026-05-19-high-zoom-precision-design.md and
|
|
29
|
+
// dev-docs/coordinate-systems.md.
|
|
30
|
+
export default /* glsl */ `#version 300 es
|
|
31
|
+
#define SHADER_NAME mesh-texture-layer-vs
|
|
32
|
+
|
|
33
|
+
// Primitive attributes
|
|
34
|
+
in vec3 positions;
|
|
35
|
+
in vec3 positions64Low;
|
|
36
|
+
in vec3 normals;
|
|
37
|
+
in vec3 colors;
|
|
38
|
+
in vec2 texCoords;
|
|
39
|
+
|
|
40
|
+
// Instance attributes
|
|
41
|
+
in vec3 instancePositions;
|
|
42
|
+
in vec3 instancePositions64Low;
|
|
43
|
+
in vec4 instanceColors;
|
|
44
|
+
in vec3 instancePickingColors;
|
|
45
|
+
in vec3 instanceModelMatrixCol0;
|
|
46
|
+
in vec3 instanceModelMatrixCol1;
|
|
47
|
+
in vec3 instanceModelMatrixCol2;
|
|
48
|
+
in vec3 instanceTranslation;
|
|
49
|
+
|
|
50
|
+
// Outputs to fragment shader
|
|
51
|
+
out vec2 vTexCoord;
|
|
52
|
+
out vec3 cameraPosition;
|
|
53
|
+
out vec3 normals_commonspace;
|
|
54
|
+
out vec4 position_commonspace;
|
|
55
|
+
out vec4 vColor;
|
|
56
|
+
|
|
57
|
+
void main(void) {
|
|
58
|
+
geometry.worldPosition = instancePositions;
|
|
59
|
+
geometry.uv = texCoords;
|
|
60
|
+
geometry.pickingColor = instancePickingColors;
|
|
61
|
+
|
|
62
|
+
vTexCoord = texCoords;
|
|
63
|
+
cameraPosition = project.cameraPosition;
|
|
64
|
+
vColor = vec4(colors * instanceColors.rgb, instanceColors.a);
|
|
65
|
+
|
|
66
|
+
mat3 instanceModelMatrix = mat3(instanceModelMatrixCol0, instanceModelMatrixCol1, instanceModelMatrixCol2);
|
|
67
|
+
vec3 pos = (instanceModelMatrix * positions) * simpleMesh.sizeScale + instanceTranslation;
|
|
68
|
+
|
|
69
|
+
DECKGL_FILTER_SIZE(pos, geometry);
|
|
70
|
+
// Call project_normal before project_position so the normal isn't affected by
|
|
71
|
+
// a position offset (unused for unlit raster, kept for parity with upstream).
|
|
72
|
+
normals_commonspace = project_normal(instanceModelMatrix * normals);
|
|
73
|
+
geometry.worldPosition += pos;
|
|
74
|
+
|
|
75
|
+
// No composeModelMatrix branch: that flag only matters when placing an
|
|
76
|
+
// instanced model offset from an anchor. MeshTextureLayer always draws one
|
|
77
|
+
// mesh at instancePositions = [0,0,0] with identity transforms, so we project
|
|
78
|
+
// the mesh vertex directly (with its fp64 low part). This is correct for both
|
|
79
|
+
// cartesian (common-space, Web Mercator) and lnglat (degrees, GlobeView) —
|
|
80
|
+
// project_position_to_clipspace handles each coordinate system.
|
|
81
|
+
gl_Position = project_position_to_clipspace(pos + instancePositions, positions64Low + instancePositions64Low, vec3(0.0), position_commonspace);
|
|
82
|
+
geometry.position = position_commonspace;
|
|
83
|
+
|
|
84
|
+
geometry.normal = normals_commonspace;
|
|
85
|
+
DECKGL_FILTER_GL_POSITION(gl_Position, geometry);
|
|
86
|
+
|
|
87
|
+
DECKGL_FILTER_COLOR(vColor, geometry);
|
|
88
|
+
}
|
|
89
|
+
`;
|
|
90
|
+
//# sourceMappingURL=mesh-layer-vertex.glsl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mesh-layer-vertex.glsl.js","sourceRoot":"","sources":["../../src/mesh-layer/mesh-layer-vertex.glsl.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAC7D,kDAAkD;AAClD,6CAA6C;AAC7C,4JAA4J;AAC5J,EAAE;AACF,6BAA6B;AAC7B,mEAAmE;AACnE,kEAAkE;AAClE,6CAA6C;AAC7C,2DAA2D;AAC3D,6EAA6E;AAC7E,qEAAqE;AACrE,oEAAoE;AACpE,iEAAiE;AACjE,qEAAqE;AACrE,+EAA+E;AAC/E,6EAA6E;AAC7E,wEAAwE;AACxE,0EAA0E;AAC1E,6EAA6E;AAC7E,4EAA4E;AAC5E,uEAAuE;AACvE,uDAAuD;AACvD,EAAE;AACF,yEAAyE;AACzE,8EAA8E;AAC9E,yEAAyE;AACzE,8DAA8D;AAC9D,kCAAkC;AAElC,eAAe,UAAU,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2DzB,CAAC"}
|
|
@@ -1,7 +1,17 @@
|
|
|
1
|
-
import type { DefaultProps, TextureSource } from "@deck.gl/core";
|
|
1
|
+
import type { DefaultProps, TextureSource, UpdateParameters } from "@deck.gl/core";
|
|
2
2
|
import type { SimpleMeshLayerProps } from "@deck.gl/mesh-layers";
|
|
3
3
|
import { SimpleMeshLayer } from "@deck.gl/mesh-layers";
|
|
4
4
|
import type { RasterModule } from "../gpu-modules/types.js";
|
|
5
|
+
/**
|
|
6
|
+
* `SimpleMeshLayer` props that `MeshTextureLayer` deliberately does not
|
|
7
|
+
* support. They configure per-instance 3D-model placement, which is
|
|
8
|
+
* meaningless for our single-mesh-at-the-origin use case — and a non-identity
|
|
9
|
+
* value would silently break the fp64 mesh-vertex precision correction (the
|
|
10
|
+
* `positions64Low` low part is the residual of `positions`, not of a
|
|
11
|
+
* transformed `pos`). They are fixed internally (see `defaultProps`) and
|
|
12
|
+
* omitted from the public prop type so they can't be set.
|
|
13
|
+
*/
|
|
14
|
+
type ExcludedSimpleMeshProps = "_instanced" | "getPosition" | "getOrientation" | "getScale" | "getTranslation" | "getTransformMatrix" | "sizeScale";
|
|
5
15
|
type _MeshTextureLayerProps = {
|
|
6
16
|
image: TextureSource;
|
|
7
17
|
renderPipeline?: RasterModule[];
|
|
@@ -9,21 +19,37 @@ type _MeshTextureLayerProps = {
|
|
|
9
19
|
renderPipeline: RasterModule[];
|
|
10
20
|
image?: TextureSource;
|
|
11
21
|
};
|
|
12
|
-
export type MeshTextureLayerProps = SimpleMeshLayerProps & _MeshTextureLayerProps;
|
|
22
|
+
export type MeshTextureLayerProps = Omit<SimpleMeshLayerProps, ExcludedSimpleMeshProps> & _MeshTextureLayerProps;
|
|
13
23
|
declare const defaultProps: DefaultProps<SimpleMeshLayerProps & {
|
|
14
24
|
image: TextureSource | null;
|
|
15
25
|
renderPipeline: RasterModule[];
|
|
16
26
|
}>;
|
|
17
27
|
/**
|
|
18
|
-
* A
|
|
28
|
+
* A specialized raster-rendering layer, spiritually based on deck.gl's
|
|
29
|
+
* `SimpleMeshLayer` but with a narrower purpose: it draws **one** texture-mapped
|
|
30
|
+
* mesh anchored at the coordinate origin, not instanced 3D models.
|
|
19
31
|
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
32
|
+
* Differences from `SimpleMeshLayer`:
|
|
33
|
+
* - Allows dynamic shader injection (a render pipeline of `RasterModule`s) and
|
|
34
|
+
* overrides the vertex/fragment shaders.
|
|
35
|
+
* - Provides fp64 mesh-vertex precision via a `positions64Low` attribute paired
|
|
36
|
+
* with the geometry's `positions` (supplied by the caller through
|
|
37
|
+
* `data.attributes.positions64Low`).
|
|
38
|
+
* - The per-instance placement props (`_instanced`, `getPosition`,
|
|
39
|
+
* `getOrientation`, `getScale`, `getTranslation`, `getTransformMatrix`,
|
|
40
|
+
* `sizeScale`) are intentionally unsupported and fixed at identity — see
|
|
41
|
+
* {@link ExcludedSimpleMeshProps}. This is what keeps the fp64 correction
|
|
42
|
+
* valid (the low part is the residual of `positions`, not of a transformed
|
|
43
|
+
* vertex).
|
|
22
44
|
*/
|
|
23
45
|
export declare class MeshTextureLayer extends SimpleMeshLayer<null, MeshTextureLayerProps> {
|
|
24
46
|
static layerName: string;
|
|
25
47
|
static defaultProps: typeof defaultProps;
|
|
48
|
+
initializeState(): void;
|
|
26
49
|
_resolveRenderPipeline(): RasterModule[];
|
|
50
|
+
updateState(params: UpdateParameters<this>): void;
|
|
51
|
+
/** Returns true if the render pipeline has changed between the old and new props. */
|
|
52
|
+
private hasRenderPipelineChanged;
|
|
27
53
|
getShaders(): any;
|
|
28
54
|
draw(opts: any): void;
|
|
29
55
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mesh-layer.d.ts","sourceRoot":"","sources":["../../src/mesh-layer/mesh-layer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"mesh-layer.d.ts","sourceRoot":"","sources":["../../src/mesh-layer/mesh-layer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,aAAa,EACb,gBAAgB,EACjB,MAAM,eAAe,CA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/mesh-layers";
|
|
2
2
|
import { CreateTexture } from "../gpu-modules/create-texture.js";
|
|
3
3
|
import fs from "./mesh-layer-fragment.glsl.js";
|
|
4
|
+
import vs from "./mesh-layer-vertex.glsl.js";
|
|
4
5
|
const defaultProps = {
|
|
5
6
|
...SimpleMeshLayer.defaultProps,
|
|
6
7
|
// Note: putting `image` in defaultProps causes Maplibre to fail to render
|
|
7
8
|
// labels in interleaved mode 🤷♂️
|
|
8
9
|
// image: { type: "image", value: null, async: true },
|
|
9
10
|
renderPipeline: { type: "array", value: [], compare: true },
|
|
11
|
+
// Render exactly one non-instanced mesh anchored at the coordinate origin.
|
|
12
|
+
_instanced: false,
|
|
13
|
+
getPosition: { type: "accessor", value: [0, 0, 0] },
|
|
10
14
|
// Disable lighting by default (avoids darkening raster)
|
|
11
15
|
material: {
|
|
12
16
|
ambient: 1.0,
|
|
@@ -16,14 +20,43 @@ const defaultProps = {
|
|
|
16
20
|
},
|
|
17
21
|
};
|
|
18
22
|
/**
|
|
19
|
-
* A
|
|
23
|
+
* A specialized raster-rendering layer, spiritually based on deck.gl's
|
|
24
|
+
* `SimpleMeshLayer` but with a narrower purpose: it draws **one** texture-mapped
|
|
25
|
+
* mesh anchored at the coordinate origin, not instanced 3D models.
|
|
20
26
|
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
27
|
+
* Differences from `SimpleMeshLayer`:
|
|
28
|
+
* - Allows dynamic shader injection (a render pipeline of `RasterModule`s) and
|
|
29
|
+
* overrides the vertex/fragment shaders.
|
|
30
|
+
* - Provides fp64 mesh-vertex precision via a `positions64Low` attribute paired
|
|
31
|
+
* with the geometry's `positions` (supplied by the caller through
|
|
32
|
+
* `data.attributes.positions64Low`).
|
|
33
|
+
* - The per-instance placement props (`_instanced`, `getPosition`,
|
|
34
|
+
* `getOrientation`, `getScale`, `getTranslation`, `getTransformMatrix`,
|
|
35
|
+
* `sizeScale`) are intentionally unsupported and fixed at identity — see
|
|
36
|
+
* {@link ExcludedSimpleMeshProps}. This is what keeps the fp64 correction
|
|
37
|
+
* valid (the low part is the residual of `positions`, not of a transformed
|
|
38
|
+
* vertex).
|
|
23
39
|
*/
|
|
24
40
|
export class MeshTextureLayer extends SimpleMeshLayer {
|
|
25
41
|
static layerName = "mesh-texture-layer";
|
|
26
42
|
static defaultProps = defaultProps;
|
|
43
|
+
initializeState() {
|
|
44
|
+
super.initializeState();
|
|
45
|
+
const attributeManager = this.getAttributeManager();
|
|
46
|
+
if (attributeManager) {
|
|
47
|
+
// Register the per-vertex low part of the fp64 position split, supplied
|
|
48
|
+
// via `data.attributes.positions64Low`
|
|
49
|
+
attributeManager.add({
|
|
50
|
+
positions64Low: {
|
|
51
|
+
size: 3,
|
|
52
|
+
type: "float32",
|
|
53
|
+
// Tell the AttributeManager not to allocate a buffer for this
|
|
54
|
+
// attribute; we'll supply it externally
|
|
55
|
+
noAlloc: true,
|
|
56
|
+
},
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
}
|
|
27
60
|
_resolveRenderPipeline() {
|
|
28
61
|
const { image, renderPipeline } = this.props;
|
|
29
62
|
const imageModule = image
|
|
@@ -31,6 +64,34 @@ export class MeshTextureLayer extends SimpleMeshLayer {
|
|
|
31
64
|
: [];
|
|
32
65
|
return [...imageModule, ...(renderPipeline ?? [])];
|
|
33
66
|
}
|
|
67
|
+
updateState(params) {
|
|
68
|
+
// Ensure the SimpleMeshLayer rebuilds the model when the renderPipeline has
|
|
69
|
+
// changed.
|
|
70
|
+
if (this.hasRenderPipelineChanged(params)) {
|
|
71
|
+
// Setting extensionsChanged to true causes recompiling the shader
|
|
72
|
+
// https://github.com/visgl/deck.gl/blob/70adde2f1fcdf5e99195df81512e6d01ee7a5edc/modules/mesh-layers/src/simple-mesh-layer/simple-mesh-layer.ts#L284-L297
|
|
73
|
+
params.changeFlags.extensionsChanged = true;
|
|
74
|
+
}
|
|
75
|
+
super.updateState(params);
|
|
76
|
+
}
|
|
77
|
+
/** Returns true if the render pipeline has changed between the old and new props. */
|
|
78
|
+
hasRenderPipelineChanged(params) {
|
|
79
|
+
const { oldProps, props: newProps } = params;
|
|
80
|
+
if (Boolean(oldProps.image) !== Boolean(newProps.image)) {
|
|
81
|
+
return true;
|
|
82
|
+
}
|
|
83
|
+
const oldPipeline = oldProps.renderPipeline ?? [];
|
|
84
|
+
const newPipeline = newProps.renderPipeline ?? [];
|
|
85
|
+
if (oldPipeline.length !== newPipeline.length) {
|
|
86
|
+
return true;
|
|
87
|
+
}
|
|
88
|
+
for (let i = 0; i < oldPipeline.length; i++) {
|
|
89
|
+
if (oldPipeline[i]?.module.name !== newPipeline[i]?.module.name) {
|
|
90
|
+
return true;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
return false;
|
|
94
|
+
}
|
|
34
95
|
getShaders() {
|
|
35
96
|
const upstreamShaders = super.getShaders();
|
|
36
97
|
const modules = upstreamShaders.modules;
|
|
@@ -39,6 +100,9 @@ export class MeshTextureLayer extends SimpleMeshLayer {
|
|
|
39
100
|
}
|
|
40
101
|
return {
|
|
41
102
|
...upstreamShaders,
|
|
103
|
+
// Override upstream's vertex shader with our copy that uses fp64
|
|
104
|
+
// emulation
|
|
105
|
+
vs,
|
|
42
106
|
// Override upstream's fragment shader with our copy with modified
|
|
43
107
|
// injection points
|
|
44
108
|
fs,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mesh-layer.js","sourceRoot":"","sources":["../../src/mesh-layer/mesh-layer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"mesh-layer.js","sourceRoot":"","sources":["../../src/mesh-layer/mesh-layer.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAGvD,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AAEjE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAC/C,OAAO,EAAE,MAAM,6BAA6B,CAAC;AA8B7C,MAAM,YAAY,GAKd;IACF,GAA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AM,eAAe,GAAG,KAAK,CAAC,UAAU,EAAE,CAAC;QAE3C,MAAM,OAAO,GAAmB,eAAe,CAAC,OAAO,CAAC;QACxD,KAAK,MAAM,CAAC,IAAI,IAAI,CAAC,sBAAsB,EAAE,EAAE,CAAC;YAC9C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;QACzB,CAAC;QAED,OAAO;YACL,GAAG,eAAe;YAClB,iEAAiE;YACjE,YAAY;YACZ,EAAE;YACF,kEAAkE;YAClE,mBAAmB;YACnB,EAAE;YACF,OAAO;SACR,CAAC;IACJ,CAAC;IAEQ,IAAI,CAAC,IAAS;QACrB,MAAM,WAAW,GAAsD,EAAE,CAAC;QAC1E,KAAK,MAAM,CAAC,IAAI,IAAI,CAAC,sBAAsB,EAAE,EAAE,CAAC;YAC9C,uCAAuC;YACvC,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC;QAC7C,CAAC;QAED,KAAK,MAAM,CAAC,IAAI,KAAK,CAAC,SAAS,EAAE,EAAE,CAAC;YAClC,CAAC,CAAC,YAAY,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;QACvC,CAAC;QAED,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACnB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export type {
|
|
2
|
-
export {
|
|
1
|
+
export type { MultiRasterTilesetDescriptor, SecondaryLevelStrategy, } from "./multi-tileset-descriptor.js";
|
|
2
|
+
export { createMultiRasterTilesetDescriptor, selectSecondaryLevel, tilesetLevelsEqual, } from "./multi-tileset-descriptor.js";
|
|
3
3
|
export type { SecondaryTileIndex, SecondaryTileResolution, UvTransform, } from "./secondary-tile-resolver.js";
|
|
4
4
|
export { resolveSecondaryTiles } from "./secondary-tile-resolver.js";
|
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/multi-raster-tileset/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/multi-raster-tileset/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,4BAA4B,EAC5B,sBAAsB,GACvB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,kCAAkC,EAClC,oBAAoB,EACpB,kBAAkB,GACnB,MAAM,+BAA+B,CAAC;AACvC,YAAY,EACV,kBAAkB,EAClB,uBAAuB,EACvB,WAAW,GACZ,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { createMultiRasterTilesetDescriptor, selectSecondaryLevel, tilesetLevelsEqual, } from "./multi-tileset-descriptor.js";
|
|
2
2
|
export { resolveSecondaryTiles } from "./secondary-tile-resolver.js";
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/multi-raster-tileset/index.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/multi-raster-tileset/index.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,kCAAkC,EAClC,oBAAoB,EACpB,kBAAkB,GACnB,MAAM,+BAA+B,CAAC;AAMvC,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC"}
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { RasterTilesetDescriptor, RasterTilesetLevel } from "../raster-tileset/tileset-interface.js";
|
|
2
2
|
import type { Bounds, ProjectionFunction } from "../raster-tileset/types.js";
|
|
3
3
|
/**
|
|
4
|
-
* Groups N {@link
|
|
4
|
+
* Groups N {@link RasterTilesetDescriptor}s representing the same geographic extent
|
|
5
5
|
* at different native resolutions.
|
|
6
6
|
*
|
|
7
7
|
* The {@link primary} tileset (finest resolution) drives tile traversal;
|
|
8
8
|
* {@link secondaries} are consulted at fetch time to resolve covering tiles
|
|
9
9
|
* and compute UV transforms.
|
|
10
10
|
*
|
|
11
|
-
* @see {@link
|
|
11
|
+
* @see {@link createMultiRasterTilesetDescriptor} to construct from a named map of tilesets
|
|
12
12
|
*/
|
|
13
|
-
export interface
|
|
13
|
+
export interface MultiRasterTilesetDescriptor {
|
|
14
14
|
/** Highest-resolution tileset — drives tile traversal. */
|
|
15
|
-
primary:
|
|
16
|
-
/** The key under which the primary was provided to {@link
|
|
15
|
+
primary: RasterTilesetDescriptor;
|
|
16
|
+
/** The key under which the primary was provided to {@link createMultiRasterTilesetDescriptor}. */
|
|
17
17
|
primaryKey: string;
|
|
18
18
|
/** Lower-resolution tilesets, keyed by user-defined name. */
|
|
19
|
-
secondaries: Map<string,
|
|
20
|
-
/** Shared CRS bounds (from primary's {@link
|
|
19
|
+
secondaries: Map<string, RasterTilesetDescriptor>;
|
|
20
|
+
/** Shared CRS bounds (from primary's {@link RasterTilesetDescriptor.projectedBounds}). */
|
|
21
21
|
bounds: Bounds;
|
|
22
22
|
/** Shared projection: source CRS -> EPSG:3857. */
|
|
23
23
|
projectTo3857: ProjectionFunction;
|
|
@@ -25,16 +25,16 @@ export interface MultiTilesetDescriptor {
|
|
|
25
25
|
projectTo4326: ProjectionFunction;
|
|
26
26
|
}
|
|
27
27
|
/**
|
|
28
|
-
* Create a {@link
|
|
28
|
+
* Create a {@link MultiRasterTilesetDescriptor} from a map of named tilesets.
|
|
29
29
|
*
|
|
30
30
|
* Automatically selects the tileset with the finest
|
|
31
|
-
* {@link
|
|
31
|
+
* {@link RasterTilesetLevel.metersPerPixel} at its highest-resolution level as the
|
|
32
32
|
* primary. All others become secondaries.
|
|
33
33
|
*
|
|
34
34
|
* @param tilesets - Named tilesets, e.g. `new Map([["B04", band10m], ["B11", band20m]])`
|
|
35
35
|
* @throws If `tilesets` is empty
|
|
36
36
|
*/
|
|
37
|
-
export declare function
|
|
37
|
+
export declare function createMultiRasterTilesetDescriptor(tilesets: Map<string, RasterTilesetDescriptor>): MultiRasterTilesetDescriptor;
|
|
38
38
|
/**
|
|
39
39
|
* Strategy for selecting a secondary tileset level.
|
|
40
40
|
*
|
|
@@ -48,28 +48,28 @@ export declare function createMultiTilesetDescriptor(tilesets: Map<string, Tiles
|
|
|
48
48
|
*/
|
|
49
49
|
export type SecondaryLevelStrategy = "closest" | "closest-finer";
|
|
50
50
|
/**
|
|
51
|
-
* Select the best {@link
|
|
52
|
-
* primary {@link
|
|
51
|
+
* Select the best {@link RasterTilesetLevel} from a secondary tileset for a given
|
|
52
|
+
* primary {@link RasterTilesetLevel.metersPerPixel}.
|
|
53
53
|
*
|
|
54
54
|
* @param levels - Ordered coarsest-first (index 0 = coarsest), matching
|
|
55
|
-
* {@link
|
|
55
|
+
* {@link RasterTilesetDescriptor.levels} convention
|
|
56
56
|
* @param primaryMetersPerPixel - The `metersPerPixel` of the current primary
|
|
57
57
|
* tile's zoom level
|
|
58
58
|
* @param strategy - Selection strategy. Defaults to `"closest-finer"`.
|
|
59
|
-
* @returns The selected {@link
|
|
59
|
+
* @returns The selected {@link RasterTilesetLevel}
|
|
60
60
|
*
|
|
61
61
|
* @see {@link SecondaryLevelStrategy} for available strategies
|
|
62
62
|
*/
|
|
63
|
-
export declare function selectSecondaryLevel(levels:
|
|
63
|
+
export declare function selectSecondaryLevel(levels: RasterTilesetLevel[], primaryMetersPerPixel: number, strategy?: SecondaryLevelStrategy): RasterTilesetLevel;
|
|
64
64
|
/**
|
|
65
|
-
* Check if two {@link
|
|
65
|
+
* Check if two {@link RasterTilesetLevel}s have the same grid parameters.
|
|
66
66
|
*
|
|
67
67
|
* Used to detect when sources share a tile grid and can skip UV transform
|
|
68
68
|
* computation (e.g., all 10m Sentinel-2 bands share the same grid).
|
|
69
69
|
*
|
|
70
|
-
* Compares {@link
|
|
71
|
-
* {@link
|
|
72
|
-
* {@link
|
|
70
|
+
* Compares {@link RasterTilesetLevel.matrixWidth}, {@link RasterTilesetLevel.matrixHeight},
|
|
71
|
+
* {@link RasterTilesetLevel.tileWidth}, {@link RasterTilesetLevel.tileHeight}, and
|
|
72
|
+
* {@link RasterTilesetLevel.metersPerPixel}.
|
|
73
73
|
*/
|
|
74
|
-
export declare function tilesetLevelsEqual(a:
|
|
74
|
+
export declare function tilesetLevelsEqual(a: RasterTilesetLevel, b: RasterTilesetLevel): boolean;
|
|
75
75
|
//# sourceMappingURL=multi-tileset-descriptor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"multi-tileset-descriptor.d.ts","sourceRoot":"","sources":["../../src/multi-raster-tileset/multi-tileset-descriptor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,
|
|
1
|
+
{"version":3,"file":"multi-tileset-descriptor.d.ts","sourceRoot":"","sources":["../../src/multi-raster-tileset/multi-tileset-descriptor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,uBAAuB,EACvB,kBAAkB,EACnB,MAAM,wCAAwC,CAAC;AAChD,OAAO,KAAK,EAAE,MAAM,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAE7E;;;;;;;;;GASG;AACH,MAAM,WAAW,4BAA4B;IAC3C,0DAA0D;IAC1D,OAAO,EAAE,uBAAuB,CAAC;IACjC,kGAAkG;IAClG,UAAU,EAAE,MAAM,CAAC;IACnB,6DAA6D;IAC7D,WAAW,EAAE,GAAG,CAAC,MAAM,EAAE,uBAAuB,CAAC,CAAC;IAClD,0FAA0F;IAC1F,MAAM,EAAE,MAAM,CAAC;IACf,kDAAkD;IAClD,aAAa,EAAE,kBAAkB,CAAC;IAClC,kDAAkD;IAClD,aAAa,EAAE,kBAAkB,CAAC;CACnC;AAED;;;;;;;;;GASG;AACH,wBAAgB,kCAAkC,CAChD,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,uBAAuB,CAAC,GAC7C,4BAA4B,CA4B9B;AAED;;;;;;;;;;GAUG;AACH,MAAM,MAAM,sBAAsB,GAAG,SAAS,GAAG,eAAe,CAAC;AAEjE;;;;;;;;;;;;GAYG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,kBAAkB,EAAE,EAC5B,qBAAqB,EAAE,MAAM,EAC7B,QAAQ,GAAE,sBAAwC,GACjD,kBAAkB,CA2BpB;AAED;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAChC,CAAC,EAAE,kBAAkB,EACrB,CAAC,EAAE,kBAAkB,GACpB,OAAO,CAQT"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Create a {@link
|
|
2
|
+
* Create a {@link MultiRasterTilesetDescriptor} from a map of named tilesets.
|
|
3
3
|
*
|
|
4
4
|
* Automatically selects the tileset with the finest
|
|
5
|
-
* {@link
|
|
5
|
+
* {@link RasterTilesetLevel.metersPerPixel} at its highest-resolution level as the
|
|
6
6
|
* primary. All others become secondaries.
|
|
7
7
|
*
|
|
8
8
|
* @param tilesets - Named tilesets, e.g. `new Map([["B04", band10m], ["B11", band20m]])`
|
|
9
9
|
* @throws If `tilesets` is empty
|
|
10
10
|
*/
|
|
11
|
-
export function
|
|
11
|
+
export function createMultiRasterTilesetDescriptor(tilesets) {
|
|
12
12
|
if (tilesets.size === 0) {
|
|
13
13
|
throw new Error("At least one tileset is required");
|
|
14
14
|
}
|
|
@@ -38,15 +38,15 @@ export function createMultiTilesetDescriptor(tilesets) {
|
|
|
38
38
|
};
|
|
39
39
|
}
|
|
40
40
|
/**
|
|
41
|
-
* Select the best {@link
|
|
42
|
-
* primary {@link
|
|
41
|
+
* Select the best {@link RasterTilesetLevel} from a secondary tileset for a given
|
|
42
|
+
* primary {@link RasterTilesetLevel.metersPerPixel}.
|
|
43
43
|
*
|
|
44
44
|
* @param levels - Ordered coarsest-first (index 0 = coarsest), matching
|
|
45
|
-
* {@link
|
|
45
|
+
* {@link RasterTilesetDescriptor.levels} convention
|
|
46
46
|
* @param primaryMetersPerPixel - The `metersPerPixel` of the current primary
|
|
47
47
|
* tile's zoom level
|
|
48
48
|
* @param strategy - Selection strategy. Defaults to `"closest-finer"`.
|
|
49
|
-
* @returns The selected {@link
|
|
49
|
+
* @returns The selected {@link RasterTilesetLevel}
|
|
50
50
|
*
|
|
51
51
|
* @see {@link SecondaryLevelStrategy} for available strategies
|
|
52
52
|
*/
|
|
@@ -78,14 +78,14 @@ export function selectSecondaryLevel(levels, primaryMetersPerPixel, strategy = "
|
|
|
78
78
|
return best;
|
|
79
79
|
}
|
|
80
80
|
/**
|
|
81
|
-
* Check if two {@link
|
|
81
|
+
* Check if two {@link RasterTilesetLevel}s have the same grid parameters.
|
|
82
82
|
*
|
|
83
83
|
* Used to detect when sources share a tile grid and can skip UV transform
|
|
84
84
|
* computation (e.g., all 10m Sentinel-2 bands share the same grid).
|
|
85
85
|
*
|
|
86
|
-
* Compares {@link
|
|
87
|
-
* {@link
|
|
88
|
-
* {@link
|
|
86
|
+
* Compares {@link RasterTilesetLevel.matrixWidth}, {@link RasterTilesetLevel.matrixHeight},
|
|
87
|
+
* {@link RasterTilesetLevel.tileWidth}, {@link RasterTilesetLevel.tileHeight}, and
|
|
88
|
+
* {@link RasterTilesetLevel.metersPerPixel}.
|
|
89
89
|
*/
|
|
90
90
|
export function tilesetLevelsEqual(a, b) {
|
|
91
91
|
return (a.matrixWidth === b.matrixWidth &&
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"multi-tileset-descriptor.js","sourceRoot":"","sources":["../../src/multi-raster-tileset/multi-tileset-descriptor.ts"],"names":[],"mappings":"AA+BA;;;;;;;;;GASG;AACH,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"multi-tileset-descriptor.js","sourceRoot":"","sources":["../../src/multi-raster-tileset/multi-tileset-descriptor.ts"],"names":[],"mappings":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AAC,CAAC,SAAS;QAC3B,CAAC,CAAC,UAAU,KAAK,CAAC,CAAC,UAAU;QAC7B,CAAC,CAAC,cAAc,KAAK,CAAC,CAAC,cAAc,CACtC,CAAC;AACJ,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { RasterTilesetLevel } from "../raster-tileset/tileset-interface.js";
|
|
2
2
|
/**
|
|
3
3
|
* UV transform mapping primary tile UV space to the correct sub-region of a
|
|
4
4
|
* band texture.
|
|
@@ -114,10 +114,10 @@ export interface SecondaryTileResolution {
|
|
|
114
114
|
* upward (north), so `offsetY` is computed as
|
|
115
115
|
* `(stitchedMaxY - primaryMaxY) / stitchedCrsHeight` to account for the flip.
|
|
116
116
|
*
|
|
117
|
-
* @param primaryLevel - The {@link
|
|
117
|
+
* @param primaryLevel - The {@link RasterTilesetLevel} describing the primary tileset.
|
|
118
118
|
* @param primaryCol - Column index of the primary tile.
|
|
119
119
|
* @param primaryRow - Row index of the primary tile.
|
|
120
|
-
* @param secondaryLevel - The {@link
|
|
120
|
+
* @param secondaryLevel - The {@link RasterTilesetLevel} describing the secondary tileset.
|
|
121
121
|
* @param secondaryZ - The zoom level index of `secondaryLevel` within its
|
|
122
122
|
* {@link TilesetDescriptor.levels} array. Stored in the returned
|
|
123
123
|
* {@link SecondaryTileResolution.z} so the consumer knows which COG overview
|
|
@@ -125,5 +125,5 @@ export interface SecondaryTileResolution {
|
|
|
125
125
|
* @returns A {@link SecondaryTileResolution} with tile indices, UV transform,
|
|
126
126
|
* stitched dimensions, and the min col/row of the covered range.
|
|
127
127
|
*/
|
|
128
|
-
export declare function resolveSecondaryTiles(primaryLevel:
|
|
128
|
+
export declare function resolveSecondaryTiles(primaryLevel: RasterTilesetLevel, primaryCol: number, primaryRow: number, secondaryLevel: RasterTilesetLevel, secondaryZ: number): SecondaryTileResolution;
|
|
129
129
|
//# sourceMappingURL=secondary-tile-resolver.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"secondary-tile-resolver.d.ts","sourceRoot":"","sources":["../../src/multi-raster-tileset/secondary-tile-resolver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"secondary-tile-resolver.d.ts","sourceRoot":"","sources":["../../src/multi-raster-tileset/secondary-tile-resolver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAEjF;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,WAAW,GAAG,SAAS;IACjC,OAAO,EAAE,MAAM;IACf,OAAO,EAAE,MAAM;IACf,MAAM,EAAE,MAAM;IACd,MAAM,EAAE,MAAM;CACf,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,WAAW,kBAAkB;IACjC,0CAA0C;IAC1C,CAAC,EAAE,MAAM,CAAC;IACV,uCAAuC;IACvC,CAAC,EAAE,MAAM,CAAC;CACX;AAED;;;;GAIG;AACH,MAAM,WAAW,uBAAuB;IACtC;;;;;;OAMG;IACH,WAAW,EAAE,kBAAkB,EAAE,CAAC;IAElC;;;;;;;;;;;;OAYG;IACH,WAAW,EAAE,WAAW,CAAC;IAEzB;;;;;;OAMG;IACH,aAAa,EAAE,MAAM,CAAC;IAEtB;;;;;;OAMG;IACH,cAAc,EAAE,MAAM,CAAC;IAEvB;;;;;;OAMG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;;;;;OAMG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;;;;OAKG;IACH,CAAC,EAAE,MAAM,CAAC;CACX;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,qBAAqB,CACnC,YAAY,EAAE,kBAAkB,EAChC,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,EAClB,cAAc,EAAE,kBAAkB,EAClC,UAAU,EAAE,MAAM,GACjB,uBAAuB,CAqGzB"}
|
|
@@ -12,10 +12,10 @@
|
|
|
12
12
|
* upward (north), so `offsetY` is computed as
|
|
13
13
|
* `(stitchedMaxY - primaryMaxY) / stitchedCrsHeight` to account for the flip.
|
|
14
14
|
*
|
|
15
|
-
* @param primaryLevel - The {@link
|
|
15
|
+
* @param primaryLevel - The {@link RasterTilesetLevel} describing the primary tileset.
|
|
16
16
|
* @param primaryCol - Column index of the primary tile.
|
|
17
17
|
* @param primaryRow - Row index of the primary tile.
|
|
18
|
-
* @param secondaryLevel - The {@link
|
|
18
|
+
* @param secondaryLevel - The {@link RasterTilesetLevel} describing the secondary tileset.
|
|
19
19
|
* @param secondaryZ - The zoom level index of `secondaryLevel` within its
|
|
20
20
|
* {@link TilesetDescriptor.levels} array. Stored in the returned
|
|
21
21
|
* {@link SecondaryTileResolution.z} so the consumer knows which COG overview
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"secondary-tile-resolver.js","sourceRoot":"","sources":["../../src/multi-raster-tileset/secondary-tile-resolver.ts"],"names":[],"mappings":"AAgHA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,UAAU,qBAAqB,CACnC,
|
|
1
|
+
{"version":3,"file":"secondary-tile-resolver.js","sourceRoot":"","sources":["../../src/multi-raster-tileset/secondary-tile-resolver.ts"],"names":[],"mappings":"AAgHA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,UAAU,qBAAqB,CACnC,YAAgC,EAChC,UAAkB,EAClB,UAAkB,EAClB,cAAkC,EAClC,UAAkB;IAElB,iDAAiD;IACjD,MAAM,OAAO,GAAG,YAAY,CAAC,oBAAoB,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;IAC1E,MAAM,WAAW,GAAG,IAAI,CAAC,GAAG,CAC1B,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,EAClB,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,EACrB,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,EACnB,OAAO,CAAC,WAAW,CAAC,CAAC,CA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IAClD,MAAM,gBAAgB,GAAG,WAAW,GAAG,WAAW,CAAC;IACnD,MAAM,MAAM,GAAG,gBAAgB,GAAG,CAAC,CAAC,CAAC,CAAC,eAAe,GAAG,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7E,MAAM,MAAM,GACV,iBAAiB,GAAG,CAAC,CAAC,CAAC,CAAC,gBAAgB,GAAG,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAC;IACnE,MAAM,OAAO,GACX,gBAAgB,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,GAAG,YAAY,CAAC,GAAG,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7E,MAAM,OAAO,GACX,iBAAiB,GAAG,CAAC;QACnB,CAAC,CAAC,CAAC,YAAY,GAAG,WAAW,CAAC,GAAG,iBAAiB;QAClD,CAAC,CAAC,CAAC,CAAC;IAER,oCAAoC;IACpC,MAAM,OAAO,GAAG,KAAK,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC;IAChD,MAAM,OAAO,GAAG,KAAK,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC;IAChD,MAAM,aAAa,GAAG,OAAO,GAAG,cAAc,CAAC,SAAS,CAAC;IACzD,MAAM,cAAc,GAAG,OAAO,GAAG,cAAc,CAAC,UAAU,CAAC;IAE3D,OAAO;QACL,WAAW;QACX,WAAW,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC;QAC/C,aAAa;QACb,cAAc;QACd,MAAM,EAAE,KAAK,CAAC,MAAM;QACpB,MAAM,EAAE,KAAK,CAAC,MAAM;QACpB,CAAC,EAAE,UAAU;KACd,CAAC;AACJ,CAAC"}
|
package/dist/raster-layer.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { CompositeLayerProps, DefaultProps, Layer, TextureSource, UpdateParameters } from "@deck.gl/core";
|
|
2
2
|
import { CompositeLayer } from "@deck.gl/core";
|
|
3
|
-
import type { ReprojectionFns } from "@developmentseed/raster-reproject";
|
|
3
|
+
import type { InitialTriangulation, ReprojectionFns } from "@developmentseed/raster-reproject";
|
|
4
4
|
import { RasterReprojector } from "@developmentseed/raster-reproject";
|
|
5
5
|
import type { RasterModule } from "./gpu-modules/types.js";
|
|
6
6
|
/**
|
|
@@ -33,6 +33,13 @@ export interface RasterLayerProps extends CompositeLayerProps {
|
|
|
33
33
|
* Reprojection functions for converting between pixel, input CRS, and output CRS coordinates
|
|
34
34
|
*/
|
|
35
35
|
reprojectionFns: ReprojectionFns;
|
|
36
|
+
/**
|
|
37
|
+
* Optional seed triangulation for the reprojector — e.g. to clamp the mesh to
|
|
38
|
+
* a UV sub-region (such as the valid Web Mercator latitude band). Defaults to
|
|
39
|
+
* the full image. Must be reference-stable across renders to avoid
|
|
40
|
+
* regenerating the mesh every frame.
|
|
41
|
+
*/
|
|
42
|
+
initialTriangulation?: InitialTriangulation;
|
|
36
43
|
/**
|
|
37
44
|
* The image to display. Accepts any luma.gl `TextureSource` (e.g. a URL,
|
|
38
45
|
* `HTMLImageElement`, `ImageData`, etc.). deck.gl manages the texture
|
|
@@ -76,11 +83,39 @@ export declare class RasterLayer extends CompositeLayer<RasterLayerProps> {
|
|
|
76
83
|
static defaultProps: DefaultProps<RasterLayerProps>;
|
|
77
84
|
state: {
|
|
78
85
|
reprojector?: RasterReprojector;
|
|
86
|
+
/**
|
|
87
|
+
* Mesh in the exact shape SimpleMeshLayer expects.
|
|
88
|
+
*
|
|
89
|
+
* It's important for this to be passed to MeshTextureLayer as a stable
|
|
90
|
+
* reference so `props.mesh` equality holds across renders. This avoids
|
|
91
|
+
* unnecessarily recreating the model.
|
|
92
|
+
*/
|
|
79
93
|
mesh?: {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
94
|
+
indices: {
|
|
95
|
+
value: Uint32Array;
|
|
96
|
+
size: number;
|
|
97
|
+
};
|
|
98
|
+
attributes: {
|
|
99
|
+
POSITION: {
|
|
100
|
+
value: Float32Array;
|
|
101
|
+
size: number;
|
|
102
|
+
};
|
|
103
|
+
TEXCOORD_0: {
|
|
104
|
+
value: Float32Array;
|
|
105
|
+
size: number;
|
|
106
|
+
};
|
|
107
|
+
};
|
|
83
108
|
};
|
|
109
|
+
/**
|
|
110
|
+
* Low-part of positions for fp64 emulation in the shaders.
|
|
111
|
+
* `mesh.attributes.POSITION` carries the high part.
|
|
112
|
+
*
|
|
113
|
+
* This needs to be passed separately from `mesh` because SimpleMeshLayer's
|
|
114
|
+
* `normalizeGeometryAttributes` whitelists only positions/colors/normals/
|
|
115
|
+
* texCoords on the mesh attributes object — anything else is silently
|
|
116
|
+
* dropped.
|
|
117
|
+
*/
|
|
118
|
+
positions64Low?: Float32Array;
|
|
84
119
|
};
|
|
85
120
|
initializeState(): void;
|
|
86
121
|
updateState(params: UpdateParameters<this>): void;
|