@deck.gl/geo-layers 8.8.0-alpha.4 → 8.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/dist.dev.js +32610 -62978
- package/dist/es5/geo-cell-layer/GeoCellLayer.js.map +1 -1
- package/dist/es5/index.js +8 -0
- package/dist/es5/index.js.map +1 -1
- package/dist/es5/mvt-layer/coordinate-transform.js.map +1 -1
- package/dist/es5/mvt-layer/find-index-binary.js +7 -5
- package/dist/es5/mvt-layer/find-index-binary.js.map +1 -1
- package/dist/es5/mvt-layer/mvt-layer.js +35 -25
- package/dist/es5/mvt-layer/mvt-layer.js.map +1 -1
- package/dist/es5/quadkey-layer/quadkey-layer.js.map +1 -1
- package/dist/es5/tile-layer/tile-2d-header.js.map +1 -1
- package/dist/es5/tile-layer/tile-layer.js +0 -4
- package/dist/es5/tile-layer/tile-layer.js.map +1 -1
- package/dist/es5/tile-layer/tileset-2d.js +1 -6
- package/dist/es5/tile-layer/tileset-2d.js.map +1 -1
- package/dist/es5/tile-layer/utils.js +5 -0
- package/dist/es5/tile-layer/utils.js.map +1 -1
- package/dist/es5/trips-layer/trips-layer.js +6 -6
- package/dist/es5/trips-layer/trips-layer.js.map +1 -1
- package/dist/esm/geo-cell-layer/GeoCellLayer.js.map +1 -1
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/mvt-layer/coordinate-transform.js.map +1 -1
- package/dist/esm/mvt-layer/find-index-binary.js +1 -1
- package/dist/esm/mvt-layer/find-index-binary.js.map +1 -1
- package/dist/esm/mvt-layer/mvt-layer.js +40 -33
- package/dist/esm/mvt-layer/mvt-layer.js.map +1 -1
- package/dist/esm/quadkey-layer/quadkey-layer.js.map +1 -1
- package/dist/esm/tile-layer/tile-2d-header.js.map +1 -1
- package/dist/esm/tile-layer/tile-layer.js +1 -5
- package/dist/esm/tile-layer/tile-layer.js.map +1 -1
- package/dist/esm/tile-layer/tileset-2d.js +1 -5
- package/dist/esm/tile-layer/tileset-2d.js.map +1 -1
- package/dist/esm/tile-layer/utils.js +3 -0
- package/dist/esm/tile-layer/utils.js.map +1 -1
- package/dist/esm/trips-layer/trips-layer.js +7 -4
- package/dist/esm/trips-layer/trips-layer.js.map +1 -1
- package/dist.min.js +2 -2
- package/package.json +15 -12
- package/src/geo-cell-layer/GeoCellLayer.ts +3 -2
- package/src/index.ts +4 -1
- package/src/mvt-layer/{coordinate-transform.js → coordinate-transform.ts} +10 -8
- package/src/mvt-layer/{find-index-binary.js → find-index-binary.ts} +41 -10
- package/src/mvt-layer/{mvt-layer.js → mvt-layer.ts} +143 -58
- package/src/quadkey-layer/quadkey-layer.ts +7 -6
- package/src/tile-layer/tile-2d-header.ts +15 -14
- package/src/tile-layer/tile-layer.ts +29 -30
- package/src/tile-layer/tileset-2d.ts +14 -14
- package/src/tile-layer/types.ts +5 -1
- package/src/tile-layer/utils.ts +10 -1
- package/src/trips-layer/{trips-layer.js → trips-layer.ts} +39 -8
- package/typed/geo-cell-layer/GeoCellLayer.d.ts +47 -0
- package/typed/geo-cell-layer/GeoCellLayer.d.ts.map +1 -0
- package/typed/geo-cell-layer/GeoCellLayer.js +49 -0
- package/typed/great-circle-layer/great-circle-layer.d.ts +16 -0
- package/typed/great-circle-layer/great-circle-layer.d.ts.map +1 -0
- package/typed/great-circle-layer/great-circle-layer.js +29 -0
- package/typed/h3-layers/h3-cluster-layer.d.ts +16 -0
- package/typed/h3-layers/h3-cluster-layer.d.ts.map +1 -0
- package/typed/h3-layers/h3-cluster-layer.js +33 -0
- package/typed/h3-layers/h3-hexagon-layer.d.ts +107 -0
- package/typed/h3-layers/h3-hexagon-layer.d.ts.map +1 -0
- package/typed/h3-layers/h3-hexagon-layer.js +251 -0
- package/typed/index.d.ts +19 -0
- package/typed/index.d.ts.map +1 -0
- package/typed/index.js +33 -0
- package/typed/mesh-layer/mesh-layer-fragment.glsl.d.ts +3 -0
- package/typed/mesh-layer/mesh-layer-fragment.glsl.d.ts.map +1 -0
- package/typed/mesh-layer/mesh-layer-fragment.glsl.js +55 -0
- package/typed/mesh-layer/mesh-layer-vertex.glsl.d.ts +3 -0
- package/typed/mesh-layer/mesh-layer-vertex.glsl.d.ts.map +1 -0
- package/typed/mesh-layer/mesh-layer-vertex.glsl.js +80 -0
- package/typed/mesh-layer/mesh-layer.d.ts +27 -0
- package/typed/mesh-layer/mesh-layer.d.ts.map +1 -0
- package/typed/mesh-layer/mesh-layer.js +110 -0
- package/typed/mvt-layer/coordinate-transform.d.ts +4 -0
- package/typed/mvt-layer/coordinate-transform.d.ts.map +1 -0
- package/typed/mvt-layer/coordinate-transform.js +41 -0
- package/typed/mvt-layer/find-index-binary.d.ts +12 -0
- package/typed/mvt-layer/find-index-binary.d.ts.map +1 -0
- package/typed/mvt-layer/find-index-binary.js +96 -0
- package/typed/mvt-layer/mvt-layer.d.ts +102 -0
- package/typed/mvt-layer/mvt-layer.d.ts.map +1 -0
- package/typed/mvt-layer/mvt-layer.js +297 -0
- package/typed/package.json +6 -0
- package/typed/quadkey-layer/quadkey-layer.d.ts +20 -0
- package/typed/quadkey-layer/quadkey-layer.d.ts.map +1 -0
- package/typed/quadkey-layer/quadkey-layer.js +18 -0
- package/typed/quadkey-layer/quadkey-utils.d.ts +3 -0
- package/typed/quadkey-layer/quadkey-utils.d.ts.map +1 -0
- package/typed/quadkey-layer/quadkey-utils.js +26 -0
- package/typed/s2-layer/s2-geometry.d.ts +11 -0
- package/typed/s2-layer/s2-geometry.d.ts.map +1 -0
- package/typed/s2-layer/s2-geometry.js +123 -0
- package/typed/s2-layer/s2-layer.d.ts +16 -0
- package/typed/s2-layer/s2-layer.d.ts.map +1 -0
- package/typed/s2-layer/s2-layer.js +37 -0
- package/typed/s2-layer/s2-utils.d.ts +10 -0
- package/typed/s2-layer/s2-utils.d.ts.map +1 -0
- package/typed/s2-layer/s2-utils.js +88 -0
- package/typed/terrain-layer/terrain-layer.d.ts +28 -0
- package/typed/terrain-layer/terrain-layer.d.ts.map +1 -0
- package/typed/terrain-layer/terrain-layer.js +226 -0
- package/typed/tile-3d-layer/tile-3d-layer.d.ts +70 -0
- package/typed/tile-3d-layer/tile-3d-layer.d.ts.map +1 -0
- package/typed/tile-3d-layer/tile-3d-layer.js +294 -0
- package/typed/tile-layer/tile-2d-header.d.ts +40 -0
- package/typed/tile-layer/tile-2d-header.d.ts.map +1 -0
- package/typed/tile-layer/tile-2d-header.js +113 -0
- package/typed/tile-layer/tile-2d-traversal.d.ts +4 -0
- package/typed/tile-layer/tile-2d-traversal.d.ts.map +1 -0
- package/typed/tile-layer/tile-2d-traversal.js +181 -0
- package/typed/tile-layer/tile-layer.d.ts +118 -0
- package/typed/tile-layer/tile-layer.d.ts.map +1 -0
- package/typed/tile-layer/tile-layer.js +192 -0
- package/typed/tile-layer/tileset-2d.d.ts +87 -0
- package/typed/tile-layer/tileset-2d.d.ts.map +1 -0
- package/typed/tile-layer/tileset-2d.js +399 -0
- package/typed/tile-layer/types.d.ts +29 -0
- package/typed/tile-layer/types.d.ts.map +1 -0
- package/typed/tile-layer/types.js +1 -0
- package/typed/tile-layer/utils.d.ts +37 -0
- package/typed/tile-layer/utils.d.ts.map +1 -0
- package/typed/tile-layer/utils.js +197 -0
- package/typed/trips-layer/trips-layer.d.ts +36 -0
- package/typed/trips-layer/trips-layer.d.ts.map +1 -0
- package/typed/trips-layer/trips-layer.js +92 -0
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
export function normalizeLongitudes(vertices: any, refLng: any): void;
|
|
2
|
+
export function scalePolygon(hexId: any, vertices: any, factor: any): void;
|
|
3
|
+
/**
|
|
4
|
+
* A subclass of HexagonLayer that uses H3 hexagonIds in data objects
|
|
5
|
+
* rather than centroid lat/longs. The shape of each hexagon is determined
|
|
6
|
+
* based on a single "center" hexagon, which can be selected by passing in
|
|
7
|
+
* a center lat/lon pair. If not provided, the map center will be used.
|
|
8
|
+
*
|
|
9
|
+
* Also sets the `hexagonId` field in the onHover/onClick callback's info
|
|
10
|
+
* objects. Since this is calculated using math, hexagonId will be present
|
|
11
|
+
* even when no corresponding hexagon is in the data set. You can check
|
|
12
|
+
* index !== -1 to see if picking matches an actual object.
|
|
13
|
+
*/
|
|
14
|
+
declare class H3HexagonLayer extends CompositeLayer<any> {
|
|
15
|
+
constructor(...propObjects: Partial<any>[]);
|
|
16
|
+
_calculateH3DataProps(props: any): {
|
|
17
|
+
resolution: number;
|
|
18
|
+
edgeLengthKM: number;
|
|
19
|
+
hasMultipleRes: boolean;
|
|
20
|
+
hasPentagon: boolean;
|
|
21
|
+
};
|
|
22
|
+
_shouldUseHighPrecision(): any;
|
|
23
|
+
_updateVertices(viewport: any): void;
|
|
24
|
+
_getForwardProps(): {
|
|
25
|
+
elevationScale: any;
|
|
26
|
+
extruded: any;
|
|
27
|
+
coverage: any;
|
|
28
|
+
wireframe: any;
|
|
29
|
+
stroked: any;
|
|
30
|
+
filled: any;
|
|
31
|
+
lineWidthUnits: any;
|
|
32
|
+
lineWidthScale: any;
|
|
33
|
+
lineWidthMinPixels: any;
|
|
34
|
+
lineWidthMaxPixels: any;
|
|
35
|
+
material: any;
|
|
36
|
+
getElevation: any;
|
|
37
|
+
getFillColor: any;
|
|
38
|
+
getLineColor: any;
|
|
39
|
+
getLineWidth: any;
|
|
40
|
+
transitions: any;
|
|
41
|
+
updateTriggers: {
|
|
42
|
+
getFillColor: any;
|
|
43
|
+
getElevation: any;
|
|
44
|
+
getLineColor: any;
|
|
45
|
+
getLineWidth: any;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
_renderPolygonLayer(): PolygonLayer<any, {}>;
|
|
49
|
+
_renderColumnLayer(): ColumnLayer<any, {}>;
|
|
50
|
+
}
|
|
51
|
+
declare namespace H3HexagonLayer {
|
|
52
|
+
export { defaultProps };
|
|
53
|
+
export const layerName: string;
|
|
54
|
+
}
|
|
55
|
+
export default H3HexagonLayer;
|
|
56
|
+
import { CompositeLayer } from '@deck.gl/core/typed';
|
|
57
|
+
import { PolygonLayer } from '@deck.gl/layers/typed';
|
|
58
|
+
import { ColumnLayer } from '@deck.gl/layers/typed';
|
|
59
|
+
declare const defaultProps: {
|
|
60
|
+
highPrecision: string;
|
|
61
|
+
coverage: {
|
|
62
|
+
type: string;
|
|
63
|
+
min: number;
|
|
64
|
+
max: number;
|
|
65
|
+
value: number;
|
|
66
|
+
};
|
|
67
|
+
centerHexagon: null;
|
|
68
|
+
getHexagon: {
|
|
69
|
+
type: string;
|
|
70
|
+
value: (x: any) => any;
|
|
71
|
+
};
|
|
72
|
+
extruded: boolean;
|
|
73
|
+
stroked: boolean;
|
|
74
|
+
filled: boolean;
|
|
75
|
+
elevationScale: number;
|
|
76
|
+
wireframe: boolean;
|
|
77
|
+
_normalize: boolean;
|
|
78
|
+
_windingOrder: string;
|
|
79
|
+
lineWidthUnits: string;
|
|
80
|
+
lineWidthScale: number;
|
|
81
|
+
lineWidthMinPixels: number;
|
|
82
|
+
lineWidthMaxPixels: number;
|
|
83
|
+
lineJointRounded: boolean;
|
|
84
|
+
lineMiterLimit: number;
|
|
85
|
+
getPolygon: {
|
|
86
|
+
type: string;
|
|
87
|
+
value: (f: any) => any;
|
|
88
|
+
};
|
|
89
|
+
getFillColor: {
|
|
90
|
+
type: string;
|
|
91
|
+
value: number[];
|
|
92
|
+
};
|
|
93
|
+
getLineColor: {
|
|
94
|
+
type: string;
|
|
95
|
+
value: number[];
|
|
96
|
+
};
|
|
97
|
+
getLineWidth: {
|
|
98
|
+
type: string;
|
|
99
|
+
value: number;
|
|
100
|
+
};
|
|
101
|
+
getElevation: {
|
|
102
|
+
type: string;
|
|
103
|
+
value: number;
|
|
104
|
+
};
|
|
105
|
+
material: boolean;
|
|
106
|
+
};
|
|
107
|
+
//# sourceMappingURL=h3-hexagon-layer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"h3-hexagon-layer.d.ts","sourceRoot":"","sources":["../../src/h3-layers/h3-hexagon-layer.js"],"names":[],"mappings":"AAoBA,sEAUC;AAGD,2EAcC;AAwDD;;;;;;;;;;GAUG;AACH;IAjGoB,4CAEmB;IAmHrC;;;;;MA8BC;IAED,+BAUC;IAED,qCAqCC;IAMD;;;;;;;;;;;;;;;;;;;;;;;MA6CC;IAED,6CAyBC;IAED,2CAsBC;CACF;;;;;;;;;AAnOD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAOE"}
|
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
import { h3ToGeoBoundary, h3GetResolution, h3ToGeo, geoToH3, h3IsPentagon, h3Distance, edgeLength, UNITS } from 'h3-js';
|
|
2
|
+
import { lerp } from '@math.gl/core';
|
|
3
|
+
import { CompositeLayer, createIterable } from '@deck.gl/core';
|
|
4
|
+
import { ColumnLayer, PolygonLayer } from '@deck.gl/layers';
|
|
5
|
+
// There is a cost to updating the instanced geometries when using highPrecision: false
|
|
6
|
+
// This constant defines the distance between two hexagons that leads to "significant
|
|
7
|
+
// distortion." Smaller value makes the column layer more sensitive to viewport change.
|
|
8
|
+
const UPDATE_THRESHOLD_KM = 10;
|
|
9
|
+
// normalize longitudes w.r.t center (refLng), when not provided first vertex
|
|
10
|
+
export function normalizeLongitudes(vertices, refLng) {
|
|
11
|
+
refLng = refLng === undefined ? vertices[0][0] : refLng;
|
|
12
|
+
for (const pt of vertices) {
|
|
13
|
+
const deltaLng = pt[0] - refLng;
|
|
14
|
+
if (deltaLng > 180) {
|
|
15
|
+
pt[0] -= 360;
|
|
16
|
+
}
|
|
17
|
+
else if (deltaLng < -180) {
|
|
18
|
+
pt[0] += 360;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
// scale polygon vertices w.r.t center (hexId)
|
|
23
|
+
export function scalePolygon(hexId, vertices, factor) {
|
|
24
|
+
const [lat, lng] = h3ToGeo(hexId);
|
|
25
|
+
const actualCount = vertices.length;
|
|
26
|
+
// normalize with respect to center
|
|
27
|
+
normalizeLongitudes(vertices, lng);
|
|
28
|
+
// `h3ToGeoBoundary` returns same array object for first and last vertex (closed polygon),
|
|
29
|
+
// if so skip scaling the last vertex
|
|
30
|
+
const vertexCount = vertices[0] === vertices[actualCount - 1] ? actualCount - 1 : actualCount;
|
|
31
|
+
for (let i = 0; i < vertexCount; i++) {
|
|
32
|
+
vertices[i][0] = lerp(lng, vertices[i][0], factor);
|
|
33
|
+
vertices[i][1] = lerp(lat, vertices[i][1], factor);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
function getHexagonCentroid(getHexagon, object, objectInfo) {
|
|
37
|
+
const hexagonId = getHexagon(object, objectInfo);
|
|
38
|
+
const [lat, lng] = h3ToGeo(hexagonId);
|
|
39
|
+
return [lng, lat];
|
|
40
|
+
}
|
|
41
|
+
function h3ToPolygon(hexId, coverage = 1, flatten) {
|
|
42
|
+
const vertices = h3ToGeoBoundary(hexId, true);
|
|
43
|
+
if (coverage !== 1) {
|
|
44
|
+
// scale and normalize vertices w.r.t to center
|
|
45
|
+
scalePolygon(hexId, vertices, coverage);
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
// normalize w.r.t to start vertex
|
|
49
|
+
normalizeLongitudes(vertices);
|
|
50
|
+
}
|
|
51
|
+
if (flatten) {
|
|
52
|
+
const positions = new Float64Array(vertices.length * 2);
|
|
53
|
+
let i = 0;
|
|
54
|
+
for (const pt of vertices) {
|
|
55
|
+
positions[i++] = pt[0];
|
|
56
|
+
positions[i++] = pt[1];
|
|
57
|
+
}
|
|
58
|
+
return positions;
|
|
59
|
+
}
|
|
60
|
+
return vertices;
|
|
61
|
+
}
|
|
62
|
+
function mergeTriggers(getHexagon, coverage) {
|
|
63
|
+
let trigger;
|
|
64
|
+
if (getHexagon === undefined || getHexagon === null) {
|
|
65
|
+
trigger = coverage;
|
|
66
|
+
}
|
|
67
|
+
else if (typeof getHexagon === 'object') {
|
|
68
|
+
trigger = { ...getHexagon, coverage };
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
trigger = { getHexagon, coverage };
|
|
72
|
+
}
|
|
73
|
+
return trigger;
|
|
74
|
+
}
|
|
75
|
+
const defaultProps = {
|
|
76
|
+
...PolygonLayer.defaultProps,
|
|
77
|
+
highPrecision: 'auto',
|
|
78
|
+
coverage: { type: 'number', min: 0, max: 1, value: 1 },
|
|
79
|
+
centerHexagon: null,
|
|
80
|
+
getHexagon: { type: 'accessor', value: x => x.hexagon },
|
|
81
|
+
extruded: true
|
|
82
|
+
};
|
|
83
|
+
// not supported
|
|
84
|
+
delete defaultProps.getLineDashArray;
|
|
85
|
+
/**
|
|
86
|
+
* A subclass of HexagonLayer that uses H3 hexagonIds in data objects
|
|
87
|
+
* rather than centroid lat/longs. The shape of each hexagon is determined
|
|
88
|
+
* based on a single "center" hexagon, which can be selected by passing in
|
|
89
|
+
* a center lat/lon pair. If not provided, the map center will be used.
|
|
90
|
+
*
|
|
91
|
+
* Also sets the `hexagonId` field in the onHover/onClick callback's info
|
|
92
|
+
* objects. Since this is calculated using math, hexagonId will be present
|
|
93
|
+
* even when no corresponding hexagon is in the data set. You can check
|
|
94
|
+
* index !== -1 to see if picking matches an actual object.
|
|
95
|
+
*/
|
|
96
|
+
export default class H3HexagonLayer extends CompositeLayer {
|
|
97
|
+
shouldUpdateState({ changeFlags }) {
|
|
98
|
+
return this._shouldUseHighPrecision()
|
|
99
|
+
? changeFlags.propsOrDataChanged
|
|
100
|
+
: changeFlags.somethingChanged;
|
|
101
|
+
}
|
|
102
|
+
updateState({ props, oldProps, changeFlags }) {
|
|
103
|
+
if (props.highPrecision !== true &&
|
|
104
|
+
(changeFlags.dataChanged ||
|
|
105
|
+
(changeFlags.updateTriggers && changeFlags.updateTriggers.getHexagon))) {
|
|
106
|
+
const dataProps = this._calculateH3DataProps(props);
|
|
107
|
+
this.setState(dataProps);
|
|
108
|
+
}
|
|
109
|
+
this._updateVertices(this.context.viewport);
|
|
110
|
+
}
|
|
111
|
+
_calculateH3DataProps(props) {
|
|
112
|
+
let resolution = -1;
|
|
113
|
+
let hasPentagon = false;
|
|
114
|
+
let hasMultipleRes = false;
|
|
115
|
+
const { iterable, objectInfo } = createIterable(props.data);
|
|
116
|
+
for (const object of iterable) {
|
|
117
|
+
objectInfo.index++;
|
|
118
|
+
const hexId = props.getHexagon(object, objectInfo);
|
|
119
|
+
// Take the resolution of the first hex
|
|
120
|
+
const hexResolution = h3GetResolution(hexId);
|
|
121
|
+
if (resolution < 0) {
|
|
122
|
+
resolution = hexResolution;
|
|
123
|
+
if (!props.highPrecision)
|
|
124
|
+
break;
|
|
125
|
+
}
|
|
126
|
+
else if (resolution !== hexResolution) {
|
|
127
|
+
hasMultipleRes = true;
|
|
128
|
+
break;
|
|
129
|
+
}
|
|
130
|
+
if (h3IsPentagon(hexId)) {
|
|
131
|
+
hasPentagon = true;
|
|
132
|
+
break;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
return {
|
|
136
|
+
resolution,
|
|
137
|
+
edgeLengthKM: resolution >= 0 ? edgeLength(resolution, UNITS.km) : 0,
|
|
138
|
+
hasMultipleRes,
|
|
139
|
+
hasPentagon
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
_shouldUseHighPrecision() {
|
|
143
|
+
if (this.props.highPrecision === 'auto') {
|
|
144
|
+
const { resolution, hasPentagon, hasMultipleRes } = this.state;
|
|
145
|
+
const { viewport } = this.context;
|
|
146
|
+
return (viewport.resolution || hasMultipleRes || hasPentagon || (resolution >= 0 && resolution <= 5));
|
|
147
|
+
}
|
|
148
|
+
return this.props.highPrecision;
|
|
149
|
+
}
|
|
150
|
+
_updateVertices(viewport) {
|
|
151
|
+
if (this._shouldUseHighPrecision()) {
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
const { resolution, edgeLengthKM, centerHex } = this.state;
|
|
155
|
+
if (resolution < 0) {
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
const hex = this.props.centerHexagon || geoToH3(viewport.latitude, viewport.longitude, resolution);
|
|
159
|
+
if (centerHex === hex) {
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
if (centerHex) {
|
|
163
|
+
const distance = h3Distance(centerHex, hex);
|
|
164
|
+
// h3Distance returns a negative number if the distance could not be computed
|
|
165
|
+
// due to the two indexes very far apart or on opposite sides of a pentagon.
|
|
166
|
+
if (distance >= 0 && distance * edgeLengthKM < UPDATE_THRESHOLD_KM) {
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
const { unitsPerMeter } = viewport.distanceScales;
|
|
171
|
+
let vertices = h3ToPolygon(hex);
|
|
172
|
+
const [centerLat, centerLng] = h3ToGeo(hex);
|
|
173
|
+
const [centerX, centerY] = viewport.projectFlat([centerLng, centerLat]);
|
|
174
|
+
vertices = vertices.map(p => {
|
|
175
|
+
const worldPosition = viewport.projectFlat(p);
|
|
176
|
+
return [
|
|
177
|
+
(worldPosition[0] - centerX) / unitsPerMeter[0],
|
|
178
|
+
(worldPosition[1] - centerY) / unitsPerMeter[1]
|
|
179
|
+
];
|
|
180
|
+
});
|
|
181
|
+
this.setState({ centerHex: hex, vertices });
|
|
182
|
+
}
|
|
183
|
+
renderLayers() {
|
|
184
|
+
return this._shouldUseHighPrecision() ? this._renderPolygonLayer() : this._renderColumnLayer();
|
|
185
|
+
}
|
|
186
|
+
_getForwardProps() {
|
|
187
|
+
const { elevationScale, material, coverage, extruded, wireframe, stroked, filled, lineWidthUnits, lineWidthScale, lineWidthMinPixels, lineWidthMaxPixels, getFillColor, getElevation, getLineColor, getLineWidth, transitions, updateTriggers } = this.props;
|
|
188
|
+
return {
|
|
189
|
+
elevationScale,
|
|
190
|
+
extruded,
|
|
191
|
+
coverage,
|
|
192
|
+
wireframe,
|
|
193
|
+
stroked,
|
|
194
|
+
filled,
|
|
195
|
+
lineWidthUnits,
|
|
196
|
+
lineWidthScale,
|
|
197
|
+
lineWidthMinPixels,
|
|
198
|
+
lineWidthMaxPixels,
|
|
199
|
+
material,
|
|
200
|
+
getElevation,
|
|
201
|
+
getFillColor,
|
|
202
|
+
getLineColor,
|
|
203
|
+
getLineWidth,
|
|
204
|
+
transitions,
|
|
205
|
+
updateTriggers: {
|
|
206
|
+
getFillColor: updateTriggers.getFillColor,
|
|
207
|
+
getElevation: updateTriggers.getElevation,
|
|
208
|
+
getLineColor: updateTriggers.getLineColor,
|
|
209
|
+
getLineWidth: updateTriggers.getLineWidth
|
|
210
|
+
}
|
|
211
|
+
};
|
|
212
|
+
}
|
|
213
|
+
_renderPolygonLayer() {
|
|
214
|
+
const { data, getHexagon, updateTriggers, coverage } = this.props;
|
|
215
|
+
const SubLayerClass = this.getSubLayerClass('hexagon-cell-hifi', PolygonLayer);
|
|
216
|
+
const forwardProps = this._getForwardProps();
|
|
217
|
+
forwardProps.updateTriggers.getPolygon = mergeTriggers(updateTriggers.getHexagon, coverage);
|
|
218
|
+
return new SubLayerClass(forwardProps, this.getSubLayerProps({
|
|
219
|
+
id: 'hexagon-cell-hifi',
|
|
220
|
+
updateTriggers: forwardProps.updateTriggers
|
|
221
|
+
}), {
|
|
222
|
+
data,
|
|
223
|
+
_normalize: false,
|
|
224
|
+
_windingOrder: 'CCW',
|
|
225
|
+
positionFormat: 'XY',
|
|
226
|
+
getPolygon: (object, objectInfo) => {
|
|
227
|
+
const hexagonId = getHexagon(object, objectInfo);
|
|
228
|
+
return h3ToPolygon(hexagonId, coverage, true);
|
|
229
|
+
}
|
|
230
|
+
});
|
|
231
|
+
}
|
|
232
|
+
_renderColumnLayer() {
|
|
233
|
+
const { data, getHexagon, updateTriggers } = this.props;
|
|
234
|
+
const SubLayerClass = this.getSubLayerClass('hexagon-cell', ColumnLayer);
|
|
235
|
+
const forwardProps = this._getForwardProps();
|
|
236
|
+
forwardProps.updateTriggers.getPosition = updateTriggers.getHexagon;
|
|
237
|
+
return new SubLayerClass(forwardProps, this.getSubLayerProps({
|
|
238
|
+
id: 'hexagon-cell',
|
|
239
|
+
flatShading: true,
|
|
240
|
+
updateTriggers: forwardProps.updateTriggers
|
|
241
|
+
}), {
|
|
242
|
+
data,
|
|
243
|
+
diskResolution: 6,
|
|
244
|
+
radius: 1,
|
|
245
|
+
vertices: this.state.vertices,
|
|
246
|
+
getPosition: getHexagonCentroid.bind(null, getHexagon)
|
|
247
|
+
});
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
H3HexagonLayer.defaultProps = defaultProps;
|
|
251
|
+
H3HexagonLayer.layerName = 'H3HexagonLayer';
|
package/typed/index.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export { default as GreatCircleLayer } from './great-circle-layer/great-circle-layer';
|
|
2
|
+
export { default as S2Layer } from './s2-layer/s2-layer';
|
|
3
|
+
export { default as QuadkeyLayer } from './quadkey-layer/quadkey-layer';
|
|
4
|
+
export { default as TileLayer } from './tile-layer/tile-layer';
|
|
5
|
+
export { default as TripsLayer } from './trips-layer/trips-layer';
|
|
6
|
+
export { default as H3ClusterLayer } from './h3-layers/h3-cluster-layer';
|
|
7
|
+
export { default as H3HexagonLayer } from './h3-layers/h3-hexagon-layer';
|
|
8
|
+
export { default as Tile3DLayer } from './tile-3d-layer/tile-3d-layer';
|
|
9
|
+
export { default as TerrainLayer } from './terrain-layer/terrain-layer';
|
|
10
|
+
export { default as MVTLayer } from './mvt-layer/mvt-layer';
|
|
11
|
+
export { getURLFromTemplate as _getURLFromTemplate } from './tile-layer/utils';
|
|
12
|
+
export { default as _Tileset2D } from './tile-layer/tileset-2d';
|
|
13
|
+
export { default as _Tile2DHeader } from './tile-layer/tile-2d-header';
|
|
14
|
+
export type { TileLayerProps } from './tile-layer/tile-layer';
|
|
15
|
+
export type { GeoBoundingBox } from './tile-layer/types';
|
|
16
|
+
export type { QuadkeyLayerProps } from './quadkey-layer/quadkey-layer';
|
|
17
|
+
export type { TileLoadProps as _TileLoadProps } from './tile-layer/types';
|
|
18
|
+
export type { MVTLayerProps } from './mvt-layer/mvt-layer';
|
|
19
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAqBA,OAAO,EAAC,OAAO,IAAI,gBAAgB,EAAC,MAAM,yCAAyC,CAAC;AACpF,OAAO,EAAC,OAAO,IAAI,OAAO,EAAC,MAAM,qBAAqB,CAAC;AACvD,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,UAAU,EAAC,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAC,OAAO,IAAI,cAAc,EAAC,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAC,OAAO,IAAI,cAAc,EAAC,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAC,OAAO,IAAI,WAAW,EAAC,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAC,OAAO,IAAI,YAAY,EAAC,MAAM,+BAA+B,CAAC;AACtE,OAAO,EAAC,OAAO,IAAI,QAAQ,EAAC,MAAM,uBAAuB,CAAC;AAE1D,OAAO,EAAC,kBAAkB,IAAI,mBAAmB,EAAC,MAAM,oBAAoB,CAAC;AAC7E,OAAO,EAAC,OAAO,IAAI,UAAU,EAAC,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAC,OAAO,IAAI,aAAa,EAAC,MAAM,6BAA6B,CAAC;AAGrE,YAAY,EAAC,cAAc,EAAC,MAAM,yBAAyB,CAAC;AAC5D,YAAY,EAAC,cAAc,EAAC,MAAM,oBAAoB,CAAC;AACvD,YAAY,EAAC,iBAAiB,EAAC,MAAM,+BAA+B,CAAC;AACrE,YAAY,EAAC,aAAa,IAAI,cAAc,EAAC,MAAM,oBAAoB,CAAC;AACxE,YAAY,EAAC,aAAa,EAAC,MAAM,uBAAuB,CAAC"}
|
package/typed/index.js
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// Copyright (c) 2015 - 2017 Uber Technologies, Inc.
|
|
2
|
+
//
|
|
3
|
+
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
4
|
+
// of this software and associated documentation files (the "Software"), to deal
|
|
5
|
+
// in the Software without restriction, including without limitation the rights
|
|
6
|
+
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
7
|
+
// copies of the Software, and to permit persons to whom the Software is
|
|
8
|
+
// furnished to do so, subject to the following conditions:
|
|
9
|
+
//
|
|
10
|
+
// The above copyright notice and this permission notice shall be included in
|
|
11
|
+
// all copies or substantial portions of the Software.
|
|
12
|
+
//
|
|
13
|
+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
14
|
+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
15
|
+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
16
|
+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
17
|
+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
18
|
+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
19
|
+
// THE SOFTWARE.
|
|
20
|
+
/* eslint-disable max-len */
|
|
21
|
+
export { default as GreatCircleLayer } from './great-circle-layer/great-circle-layer';
|
|
22
|
+
export { default as S2Layer } from './s2-layer/s2-layer';
|
|
23
|
+
export { default as QuadkeyLayer } from './quadkey-layer/quadkey-layer';
|
|
24
|
+
export { default as TileLayer } from './tile-layer/tile-layer';
|
|
25
|
+
export { default as TripsLayer } from './trips-layer/trips-layer';
|
|
26
|
+
export { default as H3ClusterLayer } from './h3-layers/h3-cluster-layer';
|
|
27
|
+
export { default as H3HexagonLayer } from './h3-layers/h3-hexagon-layer';
|
|
28
|
+
export { default as Tile3DLayer } from './tile-3d-layer/tile-3d-layer';
|
|
29
|
+
export { default as TerrainLayer } from './terrain-layer/terrain-layer';
|
|
30
|
+
export { default as MVTLayer } from './mvt-layer/mvt-layer';
|
|
31
|
+
export { getURLFromTemplate as _getURLFromTemplate } from './tile-layer/utils';
|
|
32
|
+
export { default as _Tileset2D } from './tile-layer/tileset-2d';
|
|
33
|
+
export { default as _Tile2DHeader } from './tile-layer/tile-2d-header';
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
declare var _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";
|
|
2
|
+
export default _default;
|
|
3
|
+
//# sourceMappingURL=mesh-layer-fragment.glsl.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mesh-layer-fragment.glsl.d.ts","sourceRoot":"","sources":["../../src/mesh-layer/mesh-layer-fragment.glsl.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
export default `#version 300 es
|
|
2
|
+
#define SHADER_NAME simple-mesh-layer-fs
|
|
3
|
+
|
|
4
|
+
precision highp float;
|
|
5
|
+
|
|
6
|
+
uniform bool hasTexture;
|
|
7
|
+
uniform sampler2D sampler;
|
|
8
|
+
uniform bool flatShading;
|
|
9
|
+
uniform float opacity;
|
|
10
|
+
|
|
11
|
+
in vec2 vTexCoord;
|
|
12
|
+
in vec3 cameraPosition;
|
|
13
|
+
in vec3 normals_commonspace;
|
|
14
|
+
in vec4 position_commonspace;
|
|
15
|
+
in vec4 vColor;
|
|
16
|
+
|
|
17
|
+
out vec4 fragColor;
|
|
18
|
+
|
|
19
|
+
void main(void) {
|
|
20
|
+
|
|
21
|
+
#ifdef MODULE_PBR
|
|
22
|
+
|
|
23
|
+
fragColor = vColor * pbr_filterColor(vec4(0));
|
|
24
|
+
geometry.uv = pbr_vUV;
|
|
25
|
+
fragColor.a *= opacity;
|
|
26
|
+
|
|
27
|
+
#else
|
|
28
|
+
|
|
29
|
+
geometry.uv = vTexCoord;
|
|
30
|
+
|
|
31
|
+
vec3 normal;
|
|
32
|
+
if (flatShading) {
|
|
33
|
+
|
|
34
|
+
// NOTE(Tarek): This is necessary because
|
|
35
|
+
// headless.gl reports the extension as
|
|
36
|
+
// available but does not support it in
|
|
37
|
+
// the shader.
|
|
38
|
+
#ifdef DERIVATIVES_AVAILABLE
|
|
39
|
+
normal = normalize(cross(dFdx(position_commonspace.xyz), dFdy(position_commonspace.xyz)));
|
|
40
|
+
#else
|
|
41
|
+
normal = vec3(0.0, 0.0, 1.0);
|
|
42
|
+
#endif
|
|
43
|
+
} else {
|
|
44
|
+
normal = normals_commonspace;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
vec4 color = hasTexture ? texture(sampler, vTexCoord) : vColor;
|
|
48
|
+
vec3 lightColor = lighting_getLightColor(color.rgb, cameraPosition, position_commonspace.xyz, normal);
|
|
49
|
+
fragColor = vec4(lightColor, color.a * opacity);
|
|
50
|
+
|
|
51
|
+
#endif
|
|
52
|
+
|
|
53
|
+
DECKGL_FILTER_COLOR(fragColor, geometry);
|
|
54
|
+
}
|
|
55
|
+
`;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
declare var _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 u_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 (u_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";
|
|
2
|
+
export default _default;
|
|
3
|
+
//# sourceMappingURL=mesh-layer-vertex.glsl.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mesh-layer-vertex.glsl.d.ts","sourceRoot":"","sources":["../../src/mesh-layer/mesh-layer-vertex.glsl.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
export default `#version 300 es
|
|
2
|
+
#define SHADER_NAME simple-mesh-layer-vs
|
|
3
|
+
|
|
4
|
+
// Scale the model
|
|
5
|
+
uniform float sizeScale;
|
|
6
|
+
uniform bool composeModelMatrix;
|
|
7
|
+
uniform bool u_pickFeatureIds;
|
|
8
|
+
|
|
9
|
+
// Primitive attributes
|
|
10
|
+
in vec3 positions;
|
|
11
|
+
in vec3 normals;
|
|
12
|
+
in vec3 colors;
|
|
13
|
+
in vec2 texCoords;
|
|
14
|
+
in vec4 uvRegions;
|
|
15
|
+
in vec3 featureIdsPickingColors;
|
|
16
|
+
|
|
17
|
+
// Instance attributes
|
|
18
|
+
in vec4 instanceColors;
|
|
19
|
+
in vec3 instancePickingColors;
|
|
20
|
+
in mat3 instanceModelMatrix;
|
|
21
|
+
|
|
22
|
+
// Outputs to fragment shader
|
|
23
|
+
out vec2 vTexCoord;
|
|
24
|
+
out vec3 cameraPosition;
|
|
25
|
+
out vec3 normals_commonspace;
|
|
26
|
+
out vec4 position_commonspace;
|
|
27
|
+
out vec4 vColor;
|
|
28
|
+
|
|
29
|
+
vec2 applyUVRegion(vec2 uv) {
|
|
30
|
+
#ifdef HAS_UV_REGIONS
|
|
31
|
+
// https://github.com/Esri/i3s-spec/blob/master/docs/1.7/geometryUVRegion.cmn.md
|
|
32
|
+
return fract(uv) * (uvRegions.zw - uvRegions.xy) + uvRegions.xy;
|
|
33
|
+
#else
|
|
34
|
+
return uv;
|
|
35
|
+
#endif
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
void main(void) {
|
|
39
|
+
vec2 uv = applyUVRegion(texCoords);
|
|
40
|
+
geometry.uv = uv;
|
|
41
|
+
|
|
42
|
+
if (u_pickFeatureIds) {
|
|
43
|
+
geometry.pickingColor = featureIdsPickingColors;
|
|
44
|
+
} else {
|
|
45
|
+
geometry.pickingColor = instancePickingColors;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
vTexCoord = uv;
|
|
49
|
+
cameraPosition = project_uCameraPosition;
|
|
50
|
+
vColor = vec4(colors * instanceColors.rgb, instanceColors.a);
|
|
51
|
+
|
|
52
|
+
vec3 pos = (instanceModelMatrix * positions) * sizeScale;
|
|
53
|
+
vec3 projectedPosition = project_position(positions);
|
|
54
|
+
position_commonspace = vec4(projectedPosition, 1.0);
|
|
55
|
+
gl_Position = project_common_position_to_clipspace(position_commonspace);
|
|
56
|
+
|
|
57
|
+
geometry.position = position_commonspace;
|
|
58
|
+
normals_commonspace = project_normal(instanceModelMatrix * normals);
|
|
59
|
+
geometry.normal = normals_commonspace;
|
|
60
|
+
|
|
61
|
+
DECKGL_FILTER_GL_POSITION(gl_Position, geometry);
|
|
62
|
+
|
|
63
|
+
#ifdef MODULE_PBR
|
|
64
|
+
// set PBR data
|
|
65
|
+
pbr_vPosition = geometry.position.xyz;
|
|
66
|
+
#ifdef HAS_NORMALS
|
|
67
|
+
pbr_vNormal = geometry.normal;
|
|
68
|
+
#endif
|
|
69
|
+
|
|
70
|
+
#ifdef HAS_UV
|
|
71
|
+
pbr_vUV = uv;
|
|
72
|
+
#else
|
|
73
|
+
pbr_vUV = vec2(0., 0.);
|
|
74
|
+
#endif
|
|
75
|
+
geometry.uv = pbr_vUV;
|
|
76
|
+
#endif
|
|
77
|
+
|
|
78
|
+
DECKGL_FILTER_COLOR(vColor, geometry);
|
|
79
|
+
}
|
|
80
|
+
`;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
declare class _MeshLayer extends SimpleMeshLayer<any, any> {
|
|
2
|
+
constructor(...propObjects: Partial<any>[]);
|
|
3
|
+
updatePbrMaterialUniforms(pbrMaterial: any): void;
|
|
4
|
+
parseMaterial(pbrMaterial: any, mesh: any): GLTFMaterialParser;
|
|
5
|
+
calculateFeatureIdsPickingColors(attribute: any): void;
|
|
6
|
+
}
|
|
7
|
+
declare namespace _MeshLayer {
|
|
8
|
+
export const layerName: string;
|
|
9
|
+
export { defaultProps };
|
|
10
|
+
}
|
|
11
|
+
export default _MeshLayer;
|
|
12
|
+
import { SimpleMeshLayer } from '@deck.gl/mesh-layers/typed';
|
|
13
|
+
import { GLTFMaterialParser } from "@luma.gl/experimental";
|
|
14
|
+
declare namespace defaultProps {
|
|
15
|
+
namespace pbrMaterial {
|
|
16
|
+
const type: string;
|
|
17
|
+
const value: null;
|
|
18
|
+
}
|
|
19
|
+
namespace featureIds {
|
|
20
|
+
const type_1: string;
|
|
21
|
+
export { type_1 as type };
|
|
22
|
+
const value_1: null;
|
|
23
|
+
export { value_1 as value };
|
|
24
|
+
export const optional: boolean;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=mesh-layer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mesh-layer.d.ts","sourceRoot":"","sources":["../../src/mesh-layer/mesh-layer.js"],"names":[],"mappings":"AAqBA;IALyC,4CACb;IAsE1B,kDAOC;IAED,+DAaC;IAED,uDAcC;CACF"}
|