@deck.gl-community/experimental 9.0.3
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/LICENSE +20 -0
- package/README.md +5 -0
- package/dist/data-driven-tile-3d-layer/data-driven-tile-3d-layer.d.ts +65 -0
- package/dist/data-driven-tile-3d-layer/data-driven-tile-3d-layer.d.ts.map +1 -0
- package/dist/data-driven-tile-3d-layer/data-driven-tile-3d-layer.js +188 -0
- package/dist/data-driven-tile-3d-layer/utils/colorize-tile.d.ts +11 -0
- package/dist/data-driven-tile-3d-layer/utils/colorize-tile.d.ts.map +1 -0
- package/dist/data-driven-tile-3d-layer/utils/colorize-tile.js +37 -0
- package/dist/data-driven-tile-3d-layer/utils/filter-tile.d.ts +13 -0
- package/dist/data-driven-tile-3d-layer/utils/filter-tile.d.ts.map +1 -0
- package/dist/data-driven-tile-3d-layer/utils/filter-tile.js +120 -0
- package/dist/index.cjs +338 -0
- package/dist/index.cjs.map +7 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6 -0
- package/package.json +48 -0
- package/src/data-driven-tile-3d-layer/data-driven-tile-3d-layer.ts +260 -0
- package/src/data-driven-tile-3d-layer/utils/colorize-tile.ts +53 -0
- package/src/data-driven-tile-3d-layer/utils/filter-tile.ts +177 -0
- package/src/index.ts +8 -0
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,338 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var __publicField = (obj, key, value) => {
|
|
20
|
+
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
21
|
+
return value;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
// dist/index.js
|
|
25
|
+
var dist_exports = {};
|
|
26
|
+
__export(dist_exports, {
|
|
27
|
+
DataDrivenTile3DLayer: () => DataDrivenTile3DLayer,
|
|
28
|
+
colorizeTile: () => colorizeTile,
|
|
29
|
+
filterTile: () => filterTile
|
|
30
|
+
});
|
|
31
|
+
module.exports = __toCommonJS(dist_exports);
|
|
32
|
+
|
|
33
|
+
// dist/data-driven-tile-3d-layer/data-driven-tile-3d-layer.js
|
|
34
|
+
var import_geo_layers = require("@deck.gl/geo-layers");
|
|
35
|
+
var import_tiles = require("@loaders.gl/tiles");
|
|
36
|
+
var import_core = require("@loaders.gl/core");
|
|
37
|
+
var defaultProps = {
|
|
38
|
+
colorsByAttribute: null,
|
|
39
|
+
filtersByAttribute: null
|
|
40
|
+
};
|
|
41
|
+
var DataDrivenTile3DLayer = class extends import_geo_layers.Tile3DLayer {
|
|
42
|
+
state = void 0;
|
|
43
|
+
initializeState() {
|
|
44
|
+
super.initializeState();
|
|
45
|
+
this.setState({
|
|
46
|
+
colorsByAttribute: this.props.colorsByAttribute,
|
|
47
|
+
filtersByAttribute: this.props.filtersByAttribute,
|
|
48
|
+
loadingCounter: 0
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
updateState(params) {
|
|
52
|
+
const { props, oldProps, changeFlags } = params;
|
|
53
|
+
if (props.data && props.data !== oldProps.data) {
|
|
54
|
+
this._loadTileset(props.data);
|
|
55
|
+
} else if (props.colorsByAttribute !== oldProps.colorsByAttribute) {
|
|
56
|
+
this.setState({
|
|
57
|
+
colorsByAttribute: props.colorsByAttribute
|
|
58
|
+
});
|
|
59
|
+
this._colorizeTileset();
|
|
60
|
+
} else if (props.filtersByAttribute !== oldProps.filtersByAttribute) {
|
|
61
|
+
this.setState({
|
|
62
|
+
filtersByAttribute: props.filtersByAttribute
|
|
63
|
+
});
|
|
64
|
+
this._filterTileset();
|
|
65
|
+
} else if (changeFlags.viewportChanged) {
|
|
66
|
+
const { activeViewports } = this.state;
|
|
67
|
+
const viewportsNumber = Object.keys(activeViewports).length;
|
|
68
|
+
if (viewportsNumber) {
|
|
69
|
+
if (!this.state.loadingCounter) {
|
|
70
|
+
super._updateTileset(activeViewports);
|
|
71
|
+
}
|
|
72
|
+
this.state.lastUpdatedViewports = activeViewports;
|
|
73
|
+
this.state.activeViewports = {};
|
|
74
|
+
}
|
|
75
|
+
} else {
|
|
76
|
+
super.updateState(params);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
async _loadTileset(tilesetUrl) {
|
|
80
|
+
const { loadOptions = {} } = this.props;
|
|
81
|
+
let loader = this.props.loader || this.props.loaders;
|
|
82
|
+
if (Array.isArray(loader)) {
|
|
83
|
+
loader = loader[0];
|
|
84
|
+
}
|
|
85
|
+
const options = { loadOptions: { ...loadOptions } };
|
|
86
|
+
if (loader.preload) {
|
|
87
|
+
const preloadOptions = await loader.preload(tilesetUrl, loadOptions);
|
|
88
|
+
if (preloadOptions.headers) {
|
|
89
|
+
options.loadOptions.fetch = {
|
|
90
|
+
...options.loadOptions.fetch,
|
|
91
|
+
headers: preloadOptions.headers
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
Object.assign(options, preloadOptions);
|
|
95
|
+
}
|
|
96
|
+
const tilesetJson = await (0, import_core.load)(tilesetUrl, loader, options.loadOptions);
|
|
97
|
+
const tileset3d = new import_tiles.Tileset3D(tilesetJson, {
|
|
98
|
+
onTileLoad: this._onTileLoad.bind(this),
|
|
99
|
+
// @ts-expect-error call of private method of the base class
|
|
100
|
+
onTileUnload: super._onTileUnload.bind(this),
|
|
101
|
+
onTileError: this.props.onTileError,
|
|
102
|
+
// New code ------------------
|
|
103
|
+
onTraversalComplete: this._onTraversalComplete.bind(this),
|
|
104
|
+
// ---------------------------
|
|
105
|
+
...options
|
|
106
|
+
});
|
|
107
|
+
this.setState({
|
|
108
|
+
tileset3d,
|
|
109
|
+
layerMap: {}
|
|
110
|
+
});
|
|
111
|
+
super._updateTileset(this.state.activeViewports);
|
|
112
|
+
this.props.onTilesetLoad(tileset3d);
|
|
113
|
+
}
|
|
114
|
+
_onTileLoad(tileHeader) {
|
|
115
|
+
const { lastUpdatedViewports } = this.state;
|
|
116
|
+
this._colorizeTiles([tileHeader]);
|
|
117
|
+
this._filterTiles([tileHeader]);
|
|
118
|
+
this.props.onTileLoad(tileHeader);
|
|
119
|
+
if (!this.state.colorsByAttribute && !this.state.filtersByAttribute) {
|
|
120
|
+
super._updateTileset(lastUpdatedViewports);
|
|
121
|
+
this.setNeedsUpdate();
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
_onTraversalComplete(selectedTiles) {
|
|
125
|
+
this._colorizeTiles(selectedTiles);
|
|
126
|
+
this._filterTiles(selectedTiles);
|
|
127
|
+
return this.props.onTraversalComplete ? this.props.onTraversalComplete(selectedTiles) : selectedTiles;
|
|
128
|
+
}
|
|
129
|
+
_colorizeTiles(tiles) {
|
|
130
|
+
var _a;
|
|
131
|
+
if (this.props.customizeColors && ((_a = tiles[0]) == null ? void 0 : _a.type) === import_tiles.TILE_TYPE.MESH) {
|
|
132
|
+
const { layerMap, colorsByAttribute } = this.state;
|
|
133
|
+
const promises = [];
|
|
134
|
+
for (const tile of tiles) {
|
|
135
|
+
promises.push(this.props.customizeColors(tile, colorsByAttribute));
|
|
136
|
+
}
|
|
137
|
+
this.setState({
|
|
138
|
+
loadingCounter: this.state.loadingCounter + 1
|
|
139
|
+
});
|
|
140
|
+
Promise.allSettled(promises).then((result) => {
|
|
141
|
+
this.setState({
|
|
142
|
+
loadingCounter: this.state.loadingCounter - 1
|
|
143
|
+
});
|
|
144
|
+
let isTileChanged = false;
|
|
145
|
+
for (const item of result) {
|
|
146
|
+
if (item.status === "fulfilled" && item.value.isColored) {
|
|
147
|
+
isTileChanged = true;
|
|
148
|
+
delete layerMap[item.value.id];
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
if (isTileChanged && !this.state.loadingCounter) {
|
|
152
|
+
super._updateTileset(this.state.activeViewports);
|
|
153
|
+
this.setNeedsUpdate();
|
|
154
|
+
}
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
_colorizeTileset() {
|
|
159
|
+
const { tileset3d } = this.state;
|
|
160
|
+
if (tileset3d) {
|
|
161
|
+
this._colorizeTiles(tileset3d.selectedTiles);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
_filterTiles(tiles) {
|
|
165
|
+
var _a;
|
|
166
|
+
if (this.props.filterTile && ((_a = tiles[0]) == null ? void 0 : _a.type) === import_tiles.TILE_TYPE.MESH) {
|
|
167
|
+
const { layerMap, filtersByAttribute } = this.state;
|
|
168
|
+
const promises = [];
|
|
169
|
+
for (const tile of tiles) {
|
|
170
|
+
promises.push(this.props.filterTile(tile, filtersByAttribute));
|
|
171
|
+
}
|
|
172
|
+
this.setState({
|
|
173
|
+
loadingCounter: this.state.loadingCounter + 1
|
|
174
|
+
});
|
|
175
|
+
Promise.allSettled(promises).then((result) => {
|
|
176
|
+
this.setState({
|
|
177
|
+
loadingCounter: this.state.loadingCounter - 1
|
|
178
|
+
});
|
|
179
|
+
let isTileChanged = false;
|
|
180
|
+
for (const item of result) {
|
|
181
|
+
if (item.status === "fulfilled" && item.value.isFiltered) {
|
|
182
|
+
isTileChanged = true;
|
|
183
|
+
delete layerMap[item.value.id];
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
if (isTileChanged && !this.state.loadingCounter) {
|
|
187
|
+
super._updateTileset(this.state.activeViewports);
|
|
188
|
+
this.setNeedsUpdate();
|
|
189
|
+
}
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
_filterTileset() {
|
|
194
|
+
const { tileset3d } = this.state;
|
|
195
|
+
if (tileset3d) {
|
|
196
|
+
this._filterTiles(tileset3d.selectedTiles);
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
};
|
|
200
|
+
__publicField(DataDrivenTile3DLayer, "layerName", "DataDrivenTile3DLayer");
|
|
201
|
+
__publicField(DataDrivenTile3DLayer, "defaultProps", defaultProps);
|
|
202
|
+
|
|
203
|
+
// dist/data-driven-tile-3d-layer/utils/colorize-tile.js
|
|
204
|
+
var import_i3s = require("@loaders.gl/i3s");
|
|
205
|
+
var colorizeTile = async (tile, colorsByAttribute) => {
|
|
206
|
+
const result = { isColored: false, id: tile.id };
|
|
207
|
+
if (tile.content.customColors !== colorsByAttribute) {
|
|
208
|
+
if (tile.content && colorsByAttribute) {
|
|
209
|
+
if (!tile.content.originalColorsAttributes) {
|
|
210
|
+
tile.content.originalColorsAttributes = {
|
|
211
|
+
...tile.content.attributes.colors,
|
|
212
|
+
value: new Uint8Array(tile.content.attributes.colors.value)
|
|
213
|
+
};
|
|
214
|
+
} else if (colorsByAttribute.mode === "multiply") {
|
|
215
|
+
tile.content.attributes.colors.value.set(tile.content.originalColorsAttributes.value);
|
|
216
|
+
}
|
|
217
|
+
tile.content.customColors = colorsByAttribute;
|
|
218
|
+
const newColors = await (0, import_i3s.customizeColors)(tile.content.attributes.colors, tile.content.featureIds, tile.header.attributeUrls, tile.tileset.tileset.fields, tile.tileset.tileset.attributeStorageInfo, colorsByAttribute, tile.tileset.loadOptions.i3s.token);
|
|
219
|
+
if (tile.content.customColors === colorsByAttribute) {
|
|
220
|
+
tile.content.attributes.colors = newColors;
|
|
221
|
+
result.isColored = true;
|
|
222
|
+
}
|
|
223
|
+
} else if (tile.content && tile.content.originalColorsAttributes) {
|
|
224
|
+
tile.content.attributes.colors.value = tile.content.originalColorsAttributes.value;
|
|
225
|
+
tile.content.customColors = null;
|
|
226
|
+
result.isColored = true;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
return result;
|
|
230
|
+
};
|
|
231
|
+
|
|
232
|
+
// dist/data-driven-tile-3d-layer/utils/filter-tile.js
|
|
233
|
+
var import_i3s2 = require("@loaders.gl/i3s");
|
|
234
|
+
var import_core2 = require("@loaders.gl/core");
|
|
235
|
+
var filterTile = async (tile, filtersByAttribute) => {
|
|
236
|
+
var _a, _b, _c, _d;
|
|
237
|
+
const result = { isFiltered: false, id: tile.id };
|
|
238
|
+
if (((_a = tile.content.userData) == null ? void 0 : _a.customFilters) !== filtersByAttribute) {
|
|
239
|
+
if (tile.content && filtersByAttribute) {
|
|
240
|
+
if (((_b = tile.content.userData) == null ? void 0 : _b.originalIndices) === void 0) {
|
|
241
|
+
tile.content.userData = {};
|
|
242
|
+
tile.content.userData.originalIndices = tile.content.indices;
|
|
243
|
+
}
|
|
244
|
+
tile.content.indices = (_c = tile.content.userData) == null ? void 0 : _c.originalIndices;
|
|
245
|
+
tile.content.userData.customFilters = filtersByAttribute;
|
|
246
|
+
const { indices } = await filterTileIndices(tile, filtersByAttribute, tile.tileset.loadOptions.i3s.token);
|
|
247
|
+
if (indices && tile.content.userData.customFilters === filtersByAttribute) {
|
|
248
|
+
tile.content.indices = indices;
|
|
249
|
+
result.isFiltered = true;
|
|
250
|
+
}
|
|
251
|
+
} else if (tile.content && ((_d = tile.content.userData) == null ? void 0 : _d.originalIndices) !== void 0) {
|
|
252
|
+
tile.content.indices = tile.content.userData.originalIndices;
|
|
253
|
+
tile.content.userData.customFilters = null;
|
|
254
|
+
result.isFiltered = true;
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
return result;
|
|
258
|
+
};
|
|
259
|
+
async function filterTileIndices(tile, filtersByAttribute, token) {
|
|
260
|
+
var _a;
|
|
261
|
+
if (!filtersByAttribute.attributeName.length) {
|
|
262
|
+
return { success: false };
|
|
263
|
+
}
|
|
264
|
+
const filterAttributeField = tile.tileset.tileset.fields.find(({ name }) => name === (filtersByAttribute == null ? void 0 : filtersByAttribute.attributeName));
|
|
265
|
+
if (!filterAttributeField || !["esriFieldTypeDouble", "esriFieldTypeInteger", "esriFieldTypeSmallInteger"].includes(filterAttributeField.type)) {
|
|
266
|
+
return { success: false };
|
|
267
|
+
}
|
|
268
|
+
const tileFilterAttributeData = await loadFeatureAttributeData(filterAttributeField.name, tile.header.attributeUrls, tile.tileset.tileset.attributeStorageInfo, token);
|
|
269
|
+
if (!tileFilterAttributeData) {
|
|
270
|
+
return { success: false };
|
|
271
|
+
}
|
|
272
|
+
const objectIdField = tile.tileset.tileset.fields.find(({ type }) => type === "esriFieldTypeOID");
|
|
273
|
+
if (!objectIdField) {
|
|
274
|
+
return { success: false };
|
|
275
|
+
}
|
|
276
|
+
const objectIdAttributeData = await loadFeatureAttributeData(objectIdField.name, tile.header.attributeUrls, tile.tileset.tileset.attributeStorageInfo, token);
|
|
277
|
+
if (!objectIdAttributeData) {
|
|
278
|
+
return { success: false };
|
|
279
|
+
}
|
|
280
|
+
const attributeValuesMap = {};
|
|
281
|
+
(_a = objectIdAttributeData[objectIdField.name]) == null ? void 0 : _a.forEach((elem, index) => {
|
|
282
|
+
attributeValuesMap[elem] = tileFilterAttributeData[filterAttributeField.name][index];
|
|
283
|
+
});
|
|
284
|
+
if (!tile.content.indices) {
|
|
285
|
+
const triangles2 = [];
|
|
286
|
+
for (let i = 0; i < tile.content.featureIds.length; i += 3) {
|
|
287
|
+
if (attributeValuesMap[tile.content.featureIds[i]] === filtersByAttribute.value) {
|
|
288
|
+
triangles2.push(i);
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
const indices2 = new Uint32Array(3 * triangles2.length);
|
|
292
|
+
triangles2.forEach((vertex, index) => {
|
|
293
|
+
indices2[index * 3] = vertex;
|
|
294
|
+
indices2[index * 3 + 1] = vertex + 1;
|
|
295
|
+
indices2[index * 3 + 2] = vertex + 2;
|
|
296
|
+
});
|
|
297
|
+
return { success: true, indices: indices2 };
|
|
298
|
+
}
|
|
299
|
+
const triangles = [];
|
|
300
|
+
for (let i = 0; i < tile.content.indices.length; i += 3) {
|
|
301
|
+
if (attributeValuesMap[tile.content.featureIds[tile.content.indices[i]]] === filtersByAttribute.value) {
|
|
302
|
+
triangles.push(i);
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
const indices = new Uint32Array(3 * triangles.length);
|
|
306
|
+
triangles.forEach((vertex, index) => {
|
|
307
|
+
indices[index * 3] = tile.content.indices[vertex];
|
|
308
|
+
indices[index * 3 + 1] = tile.content.indices[vertex + 1];
|
|
309
|
+
indices[index * 3 + 2] = tile.content.indices[vertex + 2];
|
|
310
|
+
});
|
|
311
|
+
return { success: true, indices };
|
|
312
|
+
}
|
|
313
|
+
async function loadFeatureAttributeData(attributeName, attributeUrls, attributesStorageInfo, token) {
|
|
314
|
+
const attributeIndex = attributesStorageInfo.findIndex(({ name }) => attributeName === name);
|
|
315
|
+
if (attributeIndex === -1) {
|
|
316
|
+
return null;
|
|
317
|
+
}
|
|
318
|
+
const objectIdAttributeUrl = getUrlWithToken(attributeUrls[attributeIndex], token);
|
|
319
|
+
const attributeType = getAttributeValueType(attributesStorageInfo[attributeIndex]);
|
|
320
|
+
const objectIdAttributeData = await (0, import_core2.load)(objectIdAttributeUrl, import_i3s2.I3SAttributeLoader, {
|
|
321
|
+
attributeName,
|
|
322
|
+
attributeType
|
|
323
|
+
});
|
|
324
|
+
return objectIdAttributeData;
|
|
325
|
+
}
|
|
326
|
+
function getUrlWithToken(url, token = null) {
|
|
327
|
+
return token ? `${url}?token=${token}` : url;
|
|
328
|
+
}
|
|
329
|
+
function getAttributeValueType(attribute) {
|
|
330
|
+
var _a;
|
|
331
|
+
if (attribute.hasOwnProperty("objectIds")) {
|
|
332
|
+
return "Oid32";
|
|
333
|
+
} else if (attribute.hasOwnProperty("attributeValues")) {
|
|
334
|
+
return (_a = attribute.attributeValues) == null ? void 0 : _a.valueType;
|
|
335
|
+
}
|
|
336
|
+
return "";
|
|
337
|
+
}
|
|
338
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["index.js", "data-driven-tile-3d-layer/data-driven-tile-3d-layer.js", "data-driven-tile-3d-layer/utils/colorize-tile.js", "data-driven-tile-3d-layer/utils/filter-tile.js"],
|
|
4
|
+
"sourcesContent": ["// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nexport { DataDrivenTile3DLayer } from \"./data-driven-tile-3d-layer/data-driven-tile-3d-layer.js\";\nexport { colorizeTile } from \"./data-driven-tile-3d-layer/utils/colorize-tile.js\";\nexport { filterTile } from \"./data-driven-tile-3d-layer/utils/filter-tile.js\";\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { Tile3DLayer } from '@deck.gl/geo-layers';\nimport { TILE_TYPE, Tileset3D } from '@loaders.gl/tiles';\nimport { load } from '@loaders.gl/core';\nconst defaultProps = {\n colorsByAttribute: null,\n filtersByAttribute: null\n};\n// @ts-expect-error call of private method of the base class\nexport class DataDrivenTile3DLayer extends Tile3DLayer {\n static layerName = 'DataDrivenTile3DLayer';\n static defaultProps = defaultProps;\n state = undefined;\n initializeState() {\n super.initializeState();\n this.setState({\n colorsByAttribute: this.props.colorsByAttribute,\n filtersByAttribute: this.props.filtersByAttribute,\n loadingCounter: 0\n });\n }\n updateState(params) {\n const { props, oldProps, changeFlags } = params;\n if (props.data && props.data !== oldProps.data) {\n this._loadTileset(props.data);\n }\n else if (props.colorsByAttribute !== oldProps.colorsByAttribute) {\n this.setState({\n colorsByAttribute: props.colorsByAttribute\n });\n this._colorizeTileset();\n }\n else if (props.filtersByAttribute !== oldProps.filtersByAttribute) {\n this.setState({\n filtersByAttribute: props.filtersByAttribute\n });\n this._filterTileset();\n }\n else if (changeFlags.viewportChanged) {\n const { activeViewports } = this.state;\n const viewportsNumber = Object.keys(activeViewports).length;\n if (viewportsNumber) {\n if (!this.state.loadingCounter) {\n // @ts-expect-error call of private method of the base class\n super._updateTileset(activeViewports);\n }\n this.state.lastUpdatedViewports = activeViewports;\n this.state.activeViewports = {};\n }\n }\n else {\n super.updateState(params);\n }\n }\n async _loadTileset(tilesetUrl) {\n const { loadOptions = {} } = this.props;\n // TODO: deprecate `loader` in v9.0\n let loader = this.props.loader || this.props.loaders;\n if (Array.isArray(loader)) {\n loader = loader[0];\n }\n const options = { loadOptions: { ...loadOptions } };\n if (loader.preload) {\n const preloadOptions = await loader.preload(tilesetUrl, loadOptions);\n if (preloadOptions.headers) {\n options.loadOptions.fetch = {\n ...options.loadOptions.fetch,\n headers: preloadOptions.headers\n };\n }\n Object.assign(options, preloadOptions);\n }\n const tilesetJson = await load(tilesetUrl, loader, options.loadOptions);\n const tileset3d = new Tileset3D(tilesetJson, {\n onTileLoad: this._onTileLoad.bind(this),\n // @ts-expect-error call of private method of the base class\n onTileUnload: super._onTileUnload.bind(this),\n onTileError: this.props.onTileError,\n // New code ------------------\n onTraversalComplete: this._onTraversalComplete.bind(this),\n // ---------------------------\n ...options\n });\n this.setState({\n tileset3d,\n layerMap: {}\n });\n // @ts-expect-error call of private method of the base class\n super._updateTileset(this.state.activeViewports);\n this.props.onTilesetLoad(tileset3d);\n }\n _onTileLoad(tileHeader) {\n const { lastUpdatedViewports } = this.state;\n // New code ------------------\n this._colorizeTiles([tileHeader]);\n this._filterTiles([tileHeader]);\n // ---------------------------\n this.props.onTileLoad(tileHeader);\n // New code ------------------ condition is added\n if (!this.state.colorsByAttribute && !this.state.filtersByAttribute) {\n // ---------------------------\n // @ts-expect-error call of private method of the base class\n super._updateTileset(lastUpdatedViewports);\n this.setNeedsUpdate();\n // New code ------------------\n }\n // ------------------\n }\n _onTraversalComplete(selectedTiles) {\n this._colorizeTiles(selectedTiles);\n this._filterTiles(selectedTiles);\n return this.props.onTraversalComplete\n ? this.props.onTraversalComplete(selectedTiles)\n : selectedTiles;\n }\n _colorizeTiles(tiles) {\n if (this.props.customizeColors && tiles[0]?.type === TILE_TYPE.MESH) {\n const { layerMap, colorsByAttribute } = this.state;\n const promises = [];\n for (const tile of tiles) {\n promises.push(this.props.customizeColors(tile, colorsByAttribute));\n }\n this.setState({\n loadingCounter: this.state.loadingCounter + 1\n });\n Promise.allSettled(promises).then((result) => {\n this.setState({\n loadingCounter: this.state.loadingCounter - 1\n });\n let isTileChanged = false;\n for (const item of result) {\n if (item.status === 'fulfilled' && item.value.isColored) {\n isTileChanged = true;\n delete layerMap[item.value.id];\n }\n }\n if (isTileChanged && !this.state.loadingCounter) {\n // @ts-expect-error call of private method of the base class\n super._updateTileset(this.state.activeViewports);\n this.setNeedsUpdate();\n }\n });\n }\n }\n _colorizeTileset() {\n const { tileset3d } = this.state;\n if (tileset3d) {\n this._colorizeTiles(tileset3d.selectedTiles);\n }\n }\n _filterTiles(tiles) {\n if (this.props.filterTile && tiles[0]?.type === TILE_TYPE.MESH) {\n const { layerMap, filtersByAttribute } = this.state;\n const promises = [];\n for (const tile of tiles) {\n promises.push(this.props.filterTile(tile, filtersByAttribute));\n }\n this.setState({\n loadingCounter: this.state.loadingCounter + 1\n });\n Promise.allSettled(promises).then((result) => {\n this.setState({\n loadingCounter: this.state.loadingCounter - 1\n });\n let isTileChanged = false;\n for (const item of result) {\n if (item.status === 'fulfilled' && item.value.isFiltered) {\n isTileChanged = true;\n delete layerMap[item.value.id];\n }\n }\n if (isTileChanged && !this.state.loadingCounter) {\n // @ts-expect-error call of private method of the base class\n super._updateTileset(this.state.activeViewports);\n this.setNeedsUpdate();\n }\n });\n }\n }\n _filterTileset() {\n const { tileset3d } = this.state;\n if (tileset3d) {\n this._filterTiles(tileset3d.selectedTiles);\n }\n }\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { customizeColors } from '@loaders.gl/i3s';\n/**\n * Update tile colors with the custom colors assigned to the I3S Loader\n * @returns {Promise<{isColored: boolean; id: string}>} Result of the tile colorization - isColored: true/false and tile id\n */\nexport const colorizeTile = async (tile, colorsByAttribute) => {\n const result = { isColored: false, id: tile.id };\n if (tile.content.customColors !== colorsByAttribute) {\n if (tile.content && colorsByAttribute) {\n if (!tile.content.originalColorsAttributes) {\n tile.content.originalColorsAttributes = {\n ...tile.content.attributes.colors,\n value: new Uint8Array(tile.content.attributes.colors.value)\n };\n }\n else if (colorsByAttribute.mode === 'multiply') {\n tile.content.attributes.colors.value.set(tile.content.originalColorsAttributes.value);\n }\n tile.content.customColors = colorsByAttribute;\n const newColors = await customizeColors(tile.content.attributes.colors, tile.content.featureIds, tile.header.attributeUrls, tile.tileset.tileset.fields, tile.tileset.tileset.attributeStorageInfo, colorsByAttribute, tile.tileset.loadOptions.i3s.token);\n // Make sure custom colors is not changed during async customizeColors execution\n if (tile.content.customColors === colorsByAttribute) {\n tile.content.attributes.colors = newColors;\n result.isColored = true;\n }\n }\n else if (tile.content && tile.content.originalColorsAttributes) {\n tile.content.attributes.colors.value = tile.content.originalColorsAttributes.value;\n tile.content.customColors = null;\n result.isColored = true;\n }\n }\n return result;\n};\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { I3SAttributeLoader } from '@loaders.gl/i3s';\nimport { load } from '@loaders.gl/core';\n/**\n * Filter tile indices by attribute value\n * @param tile - tile to be filtered\n * @param filtersByAttribute - custom filters patameters\n * @returns {Promise<{isFiltered: boolean; id: string}>} Result of the tile filtering - isFiltered: true/false and tile id\n */\nexport const filterTile = async (tile, filtersByAttribute) => {\n const result = { isFiltered: false, id: tile.id };\n if (tile.content.userData?.customFilters !== filtersByAttribute) {\n if (tile.content && filtersByAttribute) {\n if (tile.content.userData?.originalIndices === undefined) {\n tile.content.userData = {};\n // save original indices for filtring cancellation\n tile.content.userData.originalIndices = tile.content.indices;\n }\n tile.content.indices = tile.content.userData?.originalIndices;\n tile.content.userData.customFilters = filtersByAttribute;\n const { indices } = await filterTileIndices(tile, filtersByAttribute, tile.tileset.loadOptions.i3s.token);\n // Make sure custom filters is not changed during async filtring execution\n if (indices && tile.content.userData.customFilters === filtersByAttribute) {\n tile.content.indices = indices;\n result.isFiltered = true;\n }\n }\n else if (tile.content && tile.content.userData?.originalIndices !== undefined) {\n tile.content.indices = tile.content.userData.originalIndices;\n tile.content.userData.customFilters = null;\n result.isFiltered = true;\n }\n }\n return result;\n};\n// eslint-disable-next-line max-statements, complexity\nasync function filterTileIndices(tile, filtersByAttribute, token) {\n if (!filtersByAttribute.attributeName.length) {\n return { success: false };\n }\n const filterAttributeField = tile.tileset.tileset.fields.find(({ name }) => name === filtersByAttribute?.attributeName);\n if (!filterAttributeField ||\n !['esriFieldTypeDouble', 'esriFieldTypeInteger', 'esriFieldTypeSmallInteger'].includes(filterAttributeField.type)) {\n return { success: false };\n }\n const tileFilterAttributeData = await loadFeatureAttributeData(filterAttributeField.name, tile.header.attributeUrls, tile.tileset.tileset.attributeStorageInfo, token);\n if (!tileFilterAttributeData) {\n return { success: false };\n }\n const objectIdField = tile.tileset.tileset.fields.find(({ type }) => type === 'esriFieldTypeOID');\n if (!objectIdField) {\n return { success: false };\n }\n const objectIdAttributeData = await loadFeatureAttributeData(objectIdField.name, tile.header.attributeUrls, tile.tileset.tileset.attributeStorageInfo, token);\n if (!objectIdAttributeData) {\n return { success: false };\n }\n const attributeValuesMap = {};\n objectIdAttributeData[objectIdField.name]?.forEach((elem, index) => {\n attributeValuesMap[elem] = tileFilterAttributeData[filterAttributeField.name][index];\n });\n if (!tile.content.indices) {\n const triangles = [];\n for (let i = 0; i < tile.content.featureIds.length; i += 3) {\n if (attributeValuesMap[tile.content.featureIds[i]] === filtersByAttribute.value) {\n triangles.push(i);\n }\n }\n const indices = new Uint32Array(3 * triangles.length);\n triangles.forEach((vertex, index) => {\n indices[index * 3] = vertex;\n indices[index * 3 + 1] = vertex + 1;\n indices[index * 3 + 2] = vertex + 2;\n });\n return { success: true, indices };\n }\n const triangles = [];\n for (let i = 0; i < tile.content.indices.length; i += 3) {\n if (attributeValuesMap[tile.content.featureIds[tile.content.indices[i]]] ===\n filtersByAttribute.value) {\n triangles.push(i);\n }\n }\n const indices = new Uint32Array(3 * triangles.length);\n triangles.forEach((vertex, index) => {\n indices[index * 3] = tile.content.indices[vertex];\n indices[index * 3 + 1] = tile.content.indices[vertex + 1];\n indices[index * 3 + 2] = tile.content.indices[vertex + 2];\n });\n return { success: true, indices };\n}\nasync function loadFeatureAttributeData(attributeName, attributeUrls, attributesStorageInfo, token) {\n const attributeIndex = attributesStorageInfo.findIndex(({ name }) => attributeName === name);\n if (attributeIndex === -1) {\n return null;\n }\n const objectIdAttributeUrl = getUrlWithToken(attributeUrls[attributeIndex], token);\n const attributeType = getAttributeValueType(attributesStorageInfo[attributeIndex]);\n const objectIdAttributeData = await load(objectIdAttributeUrl, I3SAttributeLoader, {\n attributeName,\n attributeType\n });\n return objectIdAttributeData;\n}\nfunction getUrlWithToken(url, token = null) {\n return token ? `${url}?token=${token}` : url;\n}\nfunction getAttributeValueType(attribute) {\n // eslint-disable-next-line no-prototype-builtins\n if (attribute.hasOwnProperty('objectIds')) {\n return 'Oid32';\n // eslint-disable-next-line no-prototype-builtins\n }\n else if (attribute.hasOwnProperty('attributeValues')) {\n return attribute.attributeValues?.valueType;\n }\n return '';\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACGA,wBAA4B;AAC5B,mBAAqC;AACrC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AAAA,EACX;AACA,QAAM,uBAAuB,gBAAgB,cAAc,cAAc,GAAG,KAAK;AACjF,QAAM,gBAAgB,sBAAsB,sBAAsB,cAAc,CAAC;AACjF,QAAM,wBAAwB,UAAM,mBAAK,sBAAsB,gCAAoB;AAAA,IAC/E;AAAA,IACA;AAAA,EACJ,CAAC;AACD,SAAO;AACX;AACA,SAAS,gBAAgB,KAAK,QAAQ,MAAM;AACxC,SAAO,QAAQ,GAAG,aAAa,UAAU;AAC7C;AACA,SAAS,sBAAsB,WAAW;AA7G1C;AA+GI,MAAI,UAAU,eAAe,WAAW,GAAG;AACvC,WAAO;AAAA,EAEX,WACS,UAAU,eAAe,iBAAiB,GAAG;AAClD,YAAO,eAAU,oBAAV,mBAA2B;AAAA,EACtC;AACA,SAAO;AACX;",
|
|
6
|
+
"names": ["import_i3s", "import_core", "triangles", "indices"]
|
|
7
|
+
}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { DataDrivenTile3DLayer } from "./data-driven-tile-3d-layer/data-driven-tile-3d-layer.js";
|
|
2
|
+
export { colorizeTile } from "./data-driven-tile-3d-layer/utils/colorize-tile.js";
|
|
3
|
+
export { filterTile } from "./data-driven-tile-3d-layer/utils/filter-tile.js";
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,qBAAqB,EAAC,iEAA8D;AAE5F,OAAO,EAAC,YAAY,EAAC,2DAAwD;AAC7E,OAAO,EAAC,UAAU,EAAC,yDAAsD"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// deck.gl-community
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
export { DataDrivenTile3DLayer } from "./data-driven-tile-3d-layer/data-driven-tile-3d-layer.js";
|
|
5
|
+
export { colorizeTile } from "./data-driven-tile-3d-layer/utils/colorize-tile.js";
|
|
6
|
+
export { filterTile } from "./data-driven-tile-3d-layer/utils/filter-tile.js";
|
package/package.json
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@deck.gl-community/experimental",
|
|
3
|
+
"version": "9.0.3",
|
|
4
|
+
"description": "Experimental layers for deck.gl",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"layers",
|
|
8
|
+
"visualization",
|
|
9
|
+
"gpu",
|
|
10
|
+
"deck.gl"
|
|
11
|
+
],
|
|
12
|
+
"type": "module",
|
|
13
|
+
"sideEffects": false,
|
|
14
|
+
"types": "./dist/index.d.ts",
|
|
15
|
+
"main": "./dist/index.cjs",
|
|
16
|
+
"module": "./dist/index.js",
|
|
17
|
+
"exports": {
|
|
18
|
+
".": {
|
|
19
|
+
"types": "./dist/index.d.ts",
|
|
20
|
+
"require": "./dist/index.cjs",
|
|
21
|
+
"import": "./dist/index.js"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"files": [
|
|
25
|
+
"dist",
|
|
26
|
+
"src"
|
|
27
|
+
],
|
|
28
|
+
"scripts": {
|
|
29
|
+
"test": "vitest run",
|
|
30
|
+
"test-watch": "vitest"
|
|
31
|
+
},
|
|
32
|
+
"dependencies": {
|
|
33
|
+
"@deck.gl/core": "^9.0.12",
|
|
34
|
+
"@deck.gl/extensions": "^9.0.12",
|
|
35
|
+
"@deck.gl/geo-layers": "^9.0.12",
|
|
36
|
+
"@deck.gl/layers": "^9.0.12",
|
|
37
|
+
"@deck.gl/mesh-layers": "^9.0.12",
|
|
38
|
+
"@deck.gl/react": "^9.0.12",
|
|
39
|
+
"@loaders.gl/core": "^4.2.0",
|
|
40
|
+
"@loaders.gl/i3s": "^4.2.0",
|
|
41
|
+
"@loaders.gl/loader-utils": "^4.2.0",
|
|
42
|
+
"@loaders.gl/schema": "^4.2.0",
|
|
43
|
+
"@loaders.gl/tiles": "^4.2.0",
|
|
44
|
+
"@luma.gl/core": "^9.0.11",
|
|
45
|
+
"@luma.gl/engine": "^9.0.11"
|
|
46
|
+
},
|
|
47
|
+
"gitHead": "8955b0da47771f3524b65360243ee246abeb3660"
|
|
48
|
+
}
|