@loaders.gl/i3s 4.0.0-alpha.5 → 4.0.0-alpha.6
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/arcgis-webscene-loader.d.ts +7 -0
- package/dist/arcgis-webscene-loader.d.ts.map +1 -0
- package/dist/arcgis-webscene-loader.js +28 -0
- package/dist/bundle.js +2 -2
- package/dist/dist.min.js +8804 -8547
- package/dist/es5/arcgis-webscene-loader.js +40 -0
- package/dist/es5/arcgis-webscene-loader.js.map +1 -0
- package/dist/es5/bundle.js +6 -0
- package/dist/es5/bundle.js.map +1 -0
- package/dist/es5/i3s-attribute-loader.js +195 -0
- package/dist/es5/i3s-attribute-loader.js.map +1 -0
- package/dist/es5/i3s-building-scene-layer-loader.js +46 -0
- package/dist/es5/i3s-building-scene-layer-loader.js.map +1 -0
- package/dist/es5/i3s-content-loader.js +57 -0
- package/dist/es5/i3s-content-loader.js.map +1 -0
- package/dist/es5/i3s-loader.js +193 -0
- package/dist/es5/i3s-loader.js.map +1 -0
- package/dist/es5/i3s-node-page-loader.js +39 -0
- package/dist/es5/i3s-node-page-loader.js.map +1 -0
- package/dist/es5/index.js +61 -0
- package/dist/es5/index.js.map +1 -0
- package/dist/es5/lib/helpers/i3s-nodepages-tiles.js +312 -0
- package/dist/es5/lib/helpers/i3s-nodepages-tiles.js.map +1 -0
- package/dist/es5/lib/parsers/constants.js +72 -0
- package/dist/es5/lib/parsers/constants.js.map +1 -0
- package/dist/es5/lib/parsers/parse-arcgis-webscene.js +158 -0
- package/dist/es5/lib/parsers/parse-arcgis-webscene.js.map +1 -0
- package/dist/es5/lib/parsers/parse-i3s-attribute.js +76 -0
- package/dist/es5/lib/parsers/parse-i3s-attribute.js.map +1 -0
- package/dist/es5/lib/parsers/parse-i3s-building-scene-layer.js +65 -0
- package/dist/es5/lib/parsers/parse-i3s-building-scene-layer.js.map +1 -0
- package/dist/es5/lib/parsers/parse-i3s-tile-content.js +510 -0
- package/dist/es5/lib/parsers/parse-i3s-tile-content.js.map +1 -0
- package/dist/es5/lib/parsers/parse-i3s.js +116 -0
- package/dist/es5/lib/parsers/parse-i3s.js.map +1 -0
- package/dist/es5/lib/utils/convert-i3s-obb-to-mbs.js +17 -0
- package/dist/es5/lib/utils/convert-i3s-obb-to-mbs.js.map +1 -0
- package/dist/es5/lib/utils/customizeColors.js +159 -0
- package/dist/es5/lib/utils/customizeColors.js.map +1 -0
- package/dist/es5/lib/utils/url-utils.js +33 -0
- package/dist/es5/lib/utils/url-utils.js.map +1 -0
- package/dist/es5/types.js +26 -0
- package/dist/es5/types.js.map +1 -0
- package/dist/es5/workers/i3s-content-nodejs-worker.js +7 -0
- package/dist/es5/workers/i3s-content-nodejs-worker.js.map +1 -0
- package/dist/es5/workers/i3s-content-worker.js +6 -0
- package/dist/es5/workers/i3s-content-worker.js.map +1 -0
- package/dist/esm/arcgis-webscene-loader.js +16 -0
- package/dist/esm/arcgis-webscene-loader.js.map +1 -0
- package/dist/esm/bundle.js +4 -0
- package/dist/esm/bundle.js.map +1 -0
- package/dist/esm/i3s-attribute-loader.js +119 -0
- package/dist/esm/i3s-attribute-loader.js.map +1 -0
- package/dist/esm/i3s-building-scene-layer-loader.js +19 -0
- package/dist/esm/i3s-building-scene-layer-loader.js.map +1 -0
- package/dist/esm/i3s-content-loader.js +31 -0
- package/dist/esm/i3s-content-loader.js.map +1 -0
- package/dist/esm/i3s-loader.js +87 -0
- package/dist/esm/i3s-loader.js.map +1 -0
- package/dist/esm/i3s-node-page-loader.js +15 -0
- package/dist/esm/i3s-node-page-loader.js.map +1 -0
- package/dist/esm/index.js +8 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/lib/helpers/i3s-nodepages-tiles.js +198 -0
- package/dist/esm/lib/helpers/i3s-nodepages-tiles.js.map +1 -0
- package/dist/esm/lib/parsers/constants.js +57 -0
- package/dist/esm/lib/parsers/constants.js.map +1 -0
- package/dist/esm/lib/parsers/parse-arcgis-webscene.js +70 -0
- package/dist/esm/lib/parsers/parse-arcgis-webscene.js.map +1 -0
- package/dist/esm/lib/parsers/parse-i3s-attribute.js +60 -0
- package/dist/esm/lib/parsers/parse-i3s-attribute.js.map +1 -0
- package/dist/esm/lib/parsers/parse-i3s-building-scene-layer.js +39 -0
- package/dist/esm/lib/parsers/parse-i3s-building-scene-layer.js.map +1 -0
- package/dist/esm/lib/parsers/parse-i3s-tile-content.js +435 -0
- package/dist/esm/lib/parsers/parse-i3s-tile-content.js.map +1 -0
- package/dist/esm/lib/parsers/parse-i3s.js +83 -0
- package/dist/esm/lib/parsers/parse-i3s.js.map +1 -0
- package/dist/esm/lib/utils/convert-i3s-obb-to-mbs.js +9 -0
- package/dist/esm/lib/utils/convert-i3s-obb-to-mbs.js.map +1 -0
- package/dist/esm/lib/utils/customizeColors.js +92 -0
- package/dist/esm/lib/utils/customizeColors.js.map +1 -0
- package/dist/esm/lib/utils/url-utils.js +28 -0
- package/dist/esm/lib/utils/url-utils.js.map +1 -0
- package/dist/esm/types.js +18 -0
- package/dist/esm/types.js.map +1 -0
- package/dist/esm/workers/i3s-content-nodejs-worker.js +5 -0
- package/dist/esm/workers/i3s-content-nodejs-worker.js.map +1 -0
- package/dist/esm/workers/i3s-content-worker.js +4 -0
- package/dist/esm/workers/i3s-content-worker.js.map +1 -0
- package/dist/i3s-attribute-loader.d.ts +9 -2
- package/dist/i3s-attribute-loader.d.ts.map +1 -1
- package/dist/i3s-attribute-loader.js +155 -132
- package/dist/i3s-building-scene-layer-loader.js +23 -18
- package/dist/i3s-content-loader.d.ts.map +1 -1
- package/dist/i3s-content-loader.js +30 -22
- package/dist/i3s-content-nodejs-worker.js +198 -0
- package/dist/i3s-content-nodejs-worker.js.map +7 -0
- package/dist/i3s-content-worker.js +1119 -1100
- package/dist/i3s-loader.d.ts +5 -0
- package/dist/i3s-loader.d.ts.map +1 -1
- package/dist/i3s-loader.js +88 -83
- package/dist/i3s-node-page-loader.d.ts +3 -2
- package/dist/i3s-node-page-loader.d.ts.map +1 -1
- package/dist/i3s-node-page-loader.js +20 -20
- package/dist/index.d.ts +4 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +19 -6
- package/dist/lib/helpers/i3s-nodepages-tiles.d.ts +1 -0
- package/dist/lib/helpers/i3s-nodepages-tiles.d.ts.map +1 -1
- package/dist/lib/helpers/i3s-nodepages-tiles.js +231 -228
- package/dist/lib/parsers/constants.js +85 -63
- package/dist/lib/parsers/parse-arcgis-webscene.d.ts +7 -0
- package/dist/lib/parsers/parse-arcgis-webscene.d.ts.map +1 -0
- package/dist/lib/parsers/parse-arcgis-webscene.js +88 -0
- package/dist/lib/parsers/parse-i3s-attribute.d.ts +6 -4
- package/dist/lib/parsers/parse-i3s-attribute.d.ts.map +1 -1
- package/dist/lib/parsers/parse-i3s-attribute.js +87 -62
- package/dist/lib/parsers/parse-i3s-building-scene-layer.js +41 -40
- package/dist/lib/parsers/parse-i3s-tile-content.d.ts +2 -2
- package/dist/lib/parsers/parse-i3s-tile-content.d.ts.map +1 -1
- package/dist/lib/parsers/parse-i3s-tile-content.js +454 -454
- package/dist/lib/parsers/parse-i3s.d.ts +1 -1
- package/dist/lib/parsers/parse-i3s.d.ts.map +1 -1
- package/dist/lib/parsers/parse-i3s.js +92 -88
- package/dist/lib/utils/convert-i3s-obb-to-mbs.js +19 -8
- package/dist/lib/utils/customizeColors.d.ts +14 -0
- package/dist/lib/utils/customizeColors.d.ts.map +1 -0
- package/dist/lib/utils/customizeColors.js +94 -0
- package/dist/lib/utils/url-utils.js +41 -28
- package/dist/types.d.ts +518 -97
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +18 -19
- package/dist/workers/i3s-content-nodejs-worker.d.ts +2 -0
- package/dist/workers/i3s-content-nodejs-worker.d.ts.map +1 -0
- package/dist/workers/i3s-content-nodejs-worker.js +6 -0
- package/dist/workers/i3s-content-worker.js +5 -4
- package/package.json +15 -15
- package/src/arcgis-webscene-loader.ts +31 -0
- package/src/i3s-attribute-loader.ts +9 -9
- package/src/i3s-content-loader.ts +19 -6
- package/src/i3s-loader.ts +22 -13
- package/src/i3s-node-page-loader.ts +6 -10
- package/src/index.ts +22 -5
- package/src/lib/helpers/i3s-nodepages-tiles.ts +14 -3
- package/src/lib/parsers/constants.ts +1 -1
- package/src/lib/parsers/parse-arcgis-webscene.ts +102 -0
- package/src/lib/parsers/parse-i3s-attribute.ts +21 -14
- package/src/lib/parsers/parse-i3s-tile-content.ts +99 -76
- package/src/lib/parsers/parse-i3s.ts +8 -3
- package/src/lib/utils/customizeColors.ts +134 -0
- package/src/types.ts +482 -33
- package/src/workers/i3s-content-nodejs-worker.ts +5 -0
- package/dist/bundle.js.map +0 -1
- package/dist/i3s-attribute-loader.js.map +0 -1
- package/dist/i3s-building-scene-layer-loader.js.map +0 -1
- package/dist/i3s-content-loader.js.map +0 -1
- package/dist/i3s-loader.js.map +0 -1
- package/dist/i3s-node-page-loader.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/lib/helpers/i3s-nodepages-tiles.js.map +0 -1
- package/dist/lib/parsers/constants.js.map +0 -1
- package/dist/lib/parsers/parse-i3s-attribute.js.map +0 -1
- package/dist/lib/parsers/parse-i3s-building-scene-layer.js.map +0 -1
- package/dist/lib/parsers/parse-i3s-tile-content.js.map +0 -1
- package/dist/lib/parsers/parse-i3s.js.map +0 -1
- package/dist/lib/utils/convert-i3s-obb-to-mbs.js.map +0 -1
- package/dist/lib/utils/url-utils.js.map +0 -1
- package/dist/types.js.map +0 -1
- package/dist/workers/i3s-content-worker.js.map +0 -1
package/src/types.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type {GLTFMaterial} from '@loaders.gl/gltf';
|
|
2
1
|
import type {Matrix4, Quaternion, Vector3} from '@math.gl/core';
|
|
3
2
|
import type {TypedArray, MeshAttribute, TextureLevel} from '@loaders.gl/schema';
|
|
3
|
+
import {Tile3D, Tileset3D} from '@loaders.gl/tiles';
|
|
4
4
|
|
|
5
5
|
export enum DATA_TYPE {
|
|
6
6
|
UInt8 = 'UInt8',
|
|
@@ -13,6 +13,9 @@ export enum DATA_TYPE {
|
|
|
13
13
|
Float32 = 'Float32',
|
|
14
14
|
Float64 = 'Float64'
|
|
15
15
|
}
|
|
16
|
+
|
|
17
|
+
export type COLOR = [number, number, number, number];
|
|
18
|
+
|
|
16
19
|
/**
|
|
17
20
|
* spec - https://github.com/Esri/i3s-spec/blob/master/docs/1.8/3DSceneLayer.cmn.md
|
|
18
21
|
*/
|
|
@@ -81,6 +84,61 @@ export type I3STileHeader = {
|
|
|
81
84
|
lodSelection?: LodSelection[];
|
|
82
85
|
[key: string]: any;
|
|
83
86
|
};
|
|
87
|
+
|
|
88
|
+
export type I3SParseOptions = {
|
|
89
|
+
/** ArcGIS access token */
|
|
90
|
+
token?: string;
|
|
91
|
+
/** Is 3DSceneLayer json expected in response */
|
|
92
|
+
isTileset?: string;
|
|
93
|
+
/** Is 3DNodeIndexDocument json expected in response */
|
|
94
|
+
isTileHeader?: string;
|
|
95
|
+
/** Tile3D instance. This property used only to load tile content */
|
|
96
|
+
/** Tile-specific options */
|
|
97
|
+
_tileOptions?: I3STileOptions;
|
|
98
|
+
/** Tileset-specific options */
|
|
99
|
+
_tilesetOptions?: I3STilesetOptions;
|
|
100
|
+
/** Load Draco Compressed geometry if available */
|
|
101
|
+
useDracoGeometry?: boolean;
|
|
102
|
+
/** Load compressed textures if available */
|
|
103
|
+
useCompressedTextures?: boolean;
|
|
104
|
+
/** Set false if don't need to parse textures */
|
|
105
|
+
decodeTextures?: boolean;
|
|
106
|
+
/** deck.gl compatible coordinate system.
|
|
107
|
+
* https://github.com/visgl/deck.gl/blob/master/docs/developer-guide/coordinate-systems.md
|
|
108
|
+
* Supported coordinate systems: METER_OFFSETS, LNGLAT_OFFSETS
|
|
109
|
+
*/
|
|
110
|
+
coordinateSystem?: number;
|
|
111
|
+
colorsByAttribute?: {
|
|
112
|
+
attributeName: string;
|
|
113
|
+
minValue: number;
|
|
114
|
+
maxValue: number;
|
|
115
|
+
minColor: COLOR;
|
|
116
|
+
maxColor: COLOR;
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
/** @deprecated */
|
|
120
|
+
tile?: Tile3D | I3STileOptions;
|
|
121
|
+
/** Tileset3D instance. This property used only to load tile content */
|
|
122
|
+
/** @deprecated */
|
|
123
|
+
tileset?: Tileset3D | I3STilesetOptions;
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
export type I3STileOptions = {
|
|
127
|
+
isDracoGeometry: boolean;
|
|
128
|
+
textureUrl?: string;
|
|
129
|
+
textureFormat?: I3STextureFormat;
|
|
130
|
+
textureLoaderOptions?: any;
|
|
131
|
+
materialDefinition?: I3SMaterialDefinition;
|
|
132
|
+
attributeUrls: string[];
|
|
133
|
+
mbs: Mbs;
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
export type I3STilesetOptions = {
|
|
137
|
+
store: Store;
|
|
138
|
+
attributeStorageInfo: AttributeStorageInfo[];
|
|
139
|
+
fields: Field[];
|
|
140
|
+
};
|
|
141
|
+
|
|
84
142
|
// TODO Replace "[key: string]: any" with actual defenition
|
|
85
143
|
export type I3STileContent = {
|
|
86
144
|
attributes: I3SMeshAttributes;
|
|
@@ -113,7 +171,7 @@ export type BoundingVolumes = {
|
|
|
113
171
|
export type Obb = {
|
|
114
172
|
center: number[] | Vector3;
|
|
115
173
|
halfSize: number[] | Vector3;
|
|
116
|
-
quaternion: Quaternion;
|
|
174
|
+
quaternion: number[] | Quaternion;
|
|
117
175
|
};
|
|
118
176
|
|
|
119
177
|
export type Mbs = [number, number, number, number];
|
|
@@ -222,34 +280,34 @@ export type I3SMaterialDefinition = {
|
|
|
222
280
|
/** A set of parameter values that are used to define the metallic-roughness material model from Physically-Based Rendering (PBR) methodology. When not specified, all the default values of pbrMetallicRoughness apply. */
|
|
223
281
|
pbrMetallicRoughness: I3SPbrMetallicRoughness;
|
|
224
282
|
/** The normal texture map. */
|
|
225
|
-
normalTexture
|
|
283
|
+
normalTexture?: I3SMaterialTexture;
|
|
226
284
|
/** The occlusion texture map. */
|
|
227
|
-
occlusionTexture
|
|
285
|
+
occlusionTexture?: I3SMaterialTexture;
|
|
228
286
|
/** The emissive texture map. */
|
|
229
|
-
emissiveTexture
|
|
287
|
+
emissiveTexture?: I3SMaterialTexture;
|
|
230
288
|
/** The emissive color of the material. */
|
|
231
|
-
emissiveFactor
|
|
289
|
+
emissiveFactor?: [number, number, number];
|
|
232
290
|
/** Defines the meaning of the alpha-channel/alpha-mask. */
|
|
233
291
|
alphaMode: 'opaque' | 'mask' | 'blend';
|
|
234
292
|
/** The alpha cutoff value of the material. */
|
|
235
|
-
alphaCutoff
|
|
293
|
+
alphaCutoff?: number;
|
|
236
294
|
/** Specifies whether the material is double sided. */
|
|
237
|
-
doubleSided
|
|
295
|
+
doubleSided?: boolean;
|
|
238
296
|
/** Winding order is counterclockwise. */
|
|
239
|
-
cullFace
|
|
297
|
+
cullFace?: 'none' | 'front' | 'back';
|
|
240
298
|
};
|
|
241
299
|
/** Spec - https://github.com/Esri/i3s-spec/blob/master/docs/1.8/pbrMetallicRoughness.cmn.md */
|
|
242
300
|
export type I3SPbrMetallicRoughness = {
|
|
243
301
|
/** The material's base color factor. default=[1,1,1,1] */
|
|
244
|
-
baseColorFactor
|
|
302
|
+
baseColorFactor?: [number, number, number, number];
|
|
245
303
|
/** The base color texture. */
|
|
246
|
-
baseColorTexture
|
|
304
|
+
baseColorTexture?: I3SMaterialTexture;
|
|
247
305
|
/** the metalness of the material. default=1.0 */
|
|
248
306
|
metallicFactor: number;
|
|
249
307
|
/** the roughness of the material. default=1.0 */
|
|
250
308
|
roughnessFactor: number;
|
|
251
309
|
/** the metallic-roughness texture. */
|
|
252
|
-
metallicRoughnessTexture
|
|
310
|
+
metallicRoughnessTexture?: I3SMaterialTexture;
|
|
253
311
|
};
|
|
254
312
|
/** Spec - https://github.com/Esri/i3s-spec/blob/master/docs/1.8/materialTexture.cmn.md */
|
|
255
313
|
export type I3SMaterialTexture = {
|
|
@@ -306,7 +364,6 @@ export type PopupInfo = {
|
|
|
306
364
|
export type Node3DIndexDocument = {
|
|
307
365
|
id: string;
|
|
308
366
|
version?: string;
|
|
309
|
-
path?: string;
|
|
310
367
|
level?: number;
|
|
311
368
|
mbs?: Mbs;
|
|
312
369
|
obb?: Obb;
|
|
@@ -398,27 +455,83 @@ export type NodeInPage = {
|
|
|
398
455
|
mesh?: NodeMesh;
|
|
399
456
|
};
|
|
400
457
|
|
|
458
|
+
/**
|
|
459
|
+
* https://github.com/Esri/i3s-spec/blob/master/docs/1.8/materialDefinitionInfo.cmn.md
|
|
460
|
+
*/
|
|
461
|
+
export type MaterialDefinitionInfo = {
|
|
462
|
+
/** A name for the material as assigned in the creating application. */
|
|
463
|
+
name?: string;
|
|
464
|
+
/** Indicates the material type, chosen from the supported values. */
|
|
465
|
+
type?: 'standard' | 'water' | 'billboard' | 'leafcard' | 'reference';
|
|
466
|
+
/** The href that resolves to the shared resource bundle in which the material definition is contained. */
|
|
467
|
+
$ref?: string;
|
|
468
|
+
/** Parameter defined for the material.
|
|
469
|
+
* https://github.com/Esri/i3s-spec/blob/master/docs/1.8/materialParams.cmn.md
|
|
470
|
+
*/
|
|
471
|
+
params: {
|
|
472
|
+
/** Indicates transparency of this material; 0 = opaque, 1 = fully transparent. */
|
|
473
|
+
transparency?: number;
|
|
474
|
+
/** Indicates reflectivity of this material. */
|
|
475
|
+
reflectivity?: number;
|
|
476
|
+
/** Indicates shininess of this material. */
|
|
477
|
+
shininess?: number;
|
|
478
|
+
/** Ambient color of this material. Ambient color is the color of an object where it is in shadow.
|
|
479
|
+
* This color is what the object reflects when illuminated by ambient light rather than direct light. */
|
|
480
|
+
ambient?: number[];
|
|
481
|
+
/** Diffuse color of this material. Diffuse color is the most instinctive meaning of the color of an object.
|
|
482
|
+
* It is that essential color that the object reveals under pure white light. It is perceived as the color
|
|
483
|
+
* of the object itself rather than a reflection of the light. */
|
|
484
|
+
diffuse?: number[];
|
|
485
|
+
/** Specular color of this material. Specular color is the color of the light of a specular reflection
|
|
486
|
+
* (specular reflection is the type of reflection that is characteristic of light reflected from a shiny
|
|
487
|
+
* surface). */
|
|
488
|
+
specular?: number[];
|
|
489
|
+
/** Rendering mode. */
|
|
490
|
+
renderMode: 'textured' | 'solid' | 'untextured' | 'wireframe';
|
|
491
|
+
/** TRUE if features with this material should cast shadows. */
|
|
492
|
+
castShadows?: boolean;
|
|
493
|
+
/** TRUE if features with this material should receive shadows */
|
|
494
|
+
receiveShadows?: boolean;
|
|
495
|
+
/** Indicates the material culling options {back, front, none}. */
|
|
496
|
+
cullFace?: string;
|
|
497
|
+
/** This flag indicates that the vertex color attribute of the geometry should be used to color the geometry
|
|
498
|
+
* for rendering. If texture is present, the vertex colors are multiplied by this color.
|
|
499
|
+
* e.g. pixel_color = [interpolated]vertex_color * texel_color. Default is false. */
|
|
500
|
+
vertexColors?: boolean;
|
|
501
|
+
/** This flag indicates that the geometry has uv region vertex attributes. These are used for adressing
|
|
502
|
+
* subtextures in a texture atlas. The uv coordinates are relative to this subtexture in this case.
|
|
503
|
+
* This is mostly useful for repeated textures in a texture atlas. Default is false. */
|
|
504
|
+
vertexRegions?: boolean;
|
|
505
|
+
/** Indicates whether Vertex Colors also contain a transparency channel. Default is false. */
|
|
506
|
+
useVertexColorAlpha?: boolean;
|
|
507
|
+
};
|
|
508
|
+
};
|
|
509
|
+
|
|
510
|
+
/** https://github.com/Esri/i3s-spec/blob/master/docs/1.8/sharedResource.cmn.md */
|
|
401
511
|
export type SharedResources = {
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
512
|
+
/** Materials describe how a Feature or a set of Features is to be rendered. */
|
|
513
|
+
materialDefinitions?: {[key: string]: MaterialDefinitionInfo};
|
|
514
|
+
/** A Texture is a set of images, with some parameters specific to the texture/uv mapping to geometries. */
|
|
515
|
+
textureDefinitions?: {[key: string]: TextureDefinitionInfo};
|
|
405
516
|
};
|
|
406
517
|
|
|
518
|
+
/** https://github.com/Esri/i3s-spec/blob/master/docs/1.8/image.cmn.md */
|
|
407
519
|
type TextureImage = {
|
|
520
|
+
/** A unique ID for each image. Generated using the BuildID function. */
|
|
408
521
|
id: string;
|
|
522
|
+
/** width of this image, in pixels. */
|
|
409
523
|
size?: number;
|
|
524
|
+
/** The maximum size of a single pixel in world units.
|
|
525
|
+
* This property is used by the client to pick the image to load and render. */
|
|
410
526
|
pixelInWorldUnits?: number;
|
|
527
|
+
/** The href to the image(s), one per encoding, in the same order as the encodings. */
|
|
411
528
|
href?: string[];
|
|
529
|
+
/** The byte offset of this image's encodings. There is one per encoding,
|
|
530
|
+
* in the same order as the encodings, in the block in which this texture image resides. */
|
|
412
531
|
byteOffset?: string[];
|
|
532
|
+
/** The length in bytes of this image's encodings. There is one per encoding,
|
|
533
|
+
* in the same order as the encodings. */
|
|
413
534
|
length?: number[];
|
|
414
|
-
mimeType?: string;
|
|
415
|
-
bufferView?: {
|
|
416
|
-
data: ArrayBuffer;
|
|
417
|
-
};
|
|
418
|
-
image?: {
|
|
419
|
-
height: number;
|
|
420
|
-
width: number;
|
|
421
|
-
};
|
|
422
535
|
};
|
|
423
536
|
|
|
424
537
|
export type Attribute = 'OBJECTID' | 'string' | 'double' | 'Int32' | string;
|
|
@@ -527,28 +640,37 @@ export type SpatialReference = {
|
|
|
527
640
|
};
|
|
528
641
|
|
|
529
642
|
/** Spec - https://github.com/Esri/i3s-spec/blob/master/docs/1.8/fullExtent.cmn.md */
|
|
530
|
-
type FullExtent = {
|
|
531
|
-
/** left */
|
|
643
|
+
export type FullExtent = {
|
|
644
|
+
/** left longitude in decimal degrees */
|
|
532
645
|
xmin: number;
|
|
533
|
-
/** right */
|
|
646
|
+
/** right longitude in decimal degrees */
|
|
534
647
|
xmax: number;
|
|
535
|
-
/** bottom */
|
|
648
|
+
/** bottom latitude in decimal degrees*/
|
|
536
649
|
ymin: number;
|
|
537
|
-
/** top */
|
|
650
|
+
/** top latitude in decimal degrees*/
|
|
538
651
|
ymax: number;
|
|
539
|
-
/** lowest elevation */
|
|
652
|
+
/** lowest elevation in meters */
|
|
540
653
|
zmin: number;
|
|
541
|
-
/** highest elevation */
|
|
654
|
+
/** highest elevation in meters */
|
|
542
655
|
zmax: number;
|
|
543
656
|
spatialReference?: SpatialReference;
|
|
544
657
|
};
|
|
545
658
|
|
|
546
|
-
|
|
547
|
-
|
|
659
|
+
/**
|
|
660
|
+
* https://github.com/Esri/i3s-spec/blob/master/docs/1.8/textureDefinitionInfo.cmn.md
|
|
661
|
+
*/
|
|
662
|
+
export type TextureDefinitionInfo = {
|
|
663
|
+
/** MIMEtype - The encoding/content type that is used by all images in this map */
|
|
664
|
+
encoding?: string[];
|
|
665
|
+
/** UV wrapping modes, from {none, repeat, mirror}. */
|
|
548
666
|
wrap?: string[];
|
|
667
|
+
/** TRUE if the Map represents a texture atlas. */
|
|
549
668
|
atlas?: boolean;
|
|
669
|
+
/** The name of the UV set to be used as texture coordinates. */
|
|
550
670
|
uvSet?: string;
|
|
671
|
+
/** Indicates channels description. */
|
|
551
672
|
channels?: 'rbg' | 'rgba' | string;
|
|
673
|
+
/** An image is a binary resource, containing a single raster that can be used to texture a feature or symbol. */
|
|
552
674
|
images: TextureImage[];
|
|
553
675
|
};
|
|
554
676
|
|
|
@@ -707,3 +829,330 @@ export type FieldInfo = {
|
|
|
707
829
|
isEditable: boolean;
|
|
708
830
|
label: string;
|
|
709
831
|
};
|
|
832
|
+
|
|
833
|
+
export type ArcGisWebSceneData = {
|
|
834
|
+
header: ArcGisWebScene;
|
|
835
|
+
layers: OperationalLayer[];
|
|
836
|
+
unsupportedLayers: OperationalLayer[];
|
|
837
|
+
};
|
|
838
|
+
|
|
839
|
+
/**
|
|
840
|
+
* ArcGis WebScene spec - https://developers.arcgis.com/web-scene-specification/objects/webscene/
|
|
841
|
+
*/
|
|
842
|
+
export type ArcGisWebScene = {
|
|
843
|
+
/**
|
|
844
|
+
* @todo add type.
|
|
845
|
+
* Spec - https://developers.arcgis.com/web-scene-specification/objects/applicationProperties/
|
|
846
|
+
* Configuration of application and UI elements.
|
|
847
|
+
*/
|
|
848
|
+
applicationProperties?: any;
|
|
849
|
+
/**
|
|
850
|
+
* Operational layers contain business data which are used to make thematic scenes.
|
|
851
|
+
*/
|
|
852
|
+
operationalLayers: OperationalLayer[];
|
|
853
|
+
/**
|
|
854
|
+
* Basemaps give the web scene a geographic context.
|
|
855
|
+
*/
|
|
856
|
+
baseMap: BaseMap;
|
|
857
|
+
/**
|
|
858
|
+
* Ground defines the main surface of the web scene, based on elevation layers.
|
|
859
|
+
*/
|
|
860
|
+
ground: Ground;
|
|
861
|
+
/**
|
|
862
|
+
* An object that defines the characteristics of the vertical coordinate system used by the web scene.
|
|
863
|
+
*/
|
|
864
|
+
heightModelInfo: HeightModelInfo;
|
|
865
|
+
/**
|
|
866
|
+
* Root element in the web scene specifying a string value indicating the web scene version.
|
|
867
|
+
* Valid values: 1.8, 1.9, 1.10, 1.11, 1.12, 1.13, 1.14, 1.15, 1.16, 1.17, 1.18, 1.19, 1.20, 1.21, 1.22, 1.23, 1.24, 1.25, 1.26, 1.27
|
|
868
|
+
*/
|
|
869
|
+
version: string;
|
|
870
|
+
/**
|
|
871
|
+
* String value indicating the application which authored the webmap
|
|
872
|
+
*/
|
|
873
|
+
authoringApp: string;
|
|
874
|
+
/**
|
|
875
|
+
* String value indicating the authoring App's version number.
|
|
876
|
+
*/
|
|
877
|
+
authoringAppVersion: string;
|
|
878
|
+
/**
|
|
879
|
+
* A presentation consists of multiple slides, where each slide is a specific view into the web scene.
|
|
880
|
+
* Spec - https://developers.arcgis.com/web-scene-specification/objects/presentation/
|
|
881
|
+
* @todo Add presentation type.
|
|
882
|
+
*/
|
|
883
|
+
presentation: ArcGisPresentation;
|
|
884
|
+
/**
|
|
885
|
+
* An object that provides information about the initial environment settings and viewpoint of the web scene.
|
|
886
|
+
*/
|
|
887
|
+
initialState: InitialState;
|
|
888
|
+
/**
|
|
889
|
+
* An object used to specify the spatial reference of the given geometry.
|
|
890
|
+
*/
|
|
891
|
+
spatialReference: SpatialReference;
|
|
892
|
+
viewingMode: 'global' | 'local';
|
|
893
|
+
/**
|
|
894
|
+
* @todo add type.
|
|
895
|
+
* Defines area to be clipped for display.
|
|
896
|
+
*/
|
|
897
|
+
clippingArea?: any;
|
|
898
|
+
/**
|
|
899
|
+
* @todo add type.
|
|
900
|
+
* Spec - https://developers.arcgis.com/web-scene-specification/objects/mapFloorInfo/
|
|
901
|
+
* Contains floor-awareness information for the web scene.
|
|
902
|
+
*/
|
|
903
|
+
mapFloorInfo?: any;
|
|
904
|
+
/**
|
|
905
|
+
* @todo add type.
|
|
906
|
+
* Spec - https://developers.arcgis.com/web-scene-specification/objects/mapRangeInfo/
|
|
907
|
+
* Map Range Information
|
|
908
|
+
*/
|
|
909
|
+
mapRangeInfo?: any;
|
|
910
|
+
/**
|
|
911
|
+
* @todo add type.
|
|
912
|
+
* Spec - https://developers.arcgis.com/web-scene-specification/objects/table/
|
|
913
|
+
* An array of table objects.
|
|
914
|
+
*/
|
|
915
|
+
tables?: any;
|
|
916
|
+
/**
|
|
917
|
+
* @todo add type.
|
|
918
|
+
* Spec - https://developers.arcgis.com/web-scene-specification/objects/transportationNetwork/
|
|
919
|
+
* Used to specify the transportation networks of the scene.
|
|
920
|
+
*/
|
|
921
|
+
transportationNetworks?: any;
|
|
922
|
+
/**
|
|
923
|
+
* @todo add type.
|
|
924
|
+
* Spec - https://developers.arcgis.com/web-scene-specification/objects/widgets/
|
|
925
|
+
* The widgets object contains widgets that should be exposed to the user.
|
|
926
|
+
*/
|
|
927
|
+
widgets?: any;
|
|
928
|
+
};
|
|
929
|
+
|
|
930
|
+
/**
|
|
931
|
+
* Spec - https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Presentation.html
|
|
932
|
+
*/
|
|
933
|
+
type ArcGisPresentation = {
|
|
934
|
+
slides: Slide[];
|
|
935
|
+
};
|
|
936
|
+
|
|
937
|
+
/**
|
|
938
|
+
* A slide stores a snapshot of several pre-set properties of the WebScene and SceneView,
|
|
939
|
+
* such as the basemap, viewpoint and visible layers.
|
|
940
|
+
* Spec - https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html
|
|
941
|
+
*/
|
|
942
|
+
type Slide = {
|
|
943
|
+
id: string;
|
|
944
|
+
title: {
|
|
945
|
+
text: string;
|
|
946
|
+
};
|
|
947
|
+
thumbnail: {
|
|
948
|
+
url: string;
|
|
949
|
+
};
|
|
950
|
+
description: {
|
|
951
|
+
text: string;
|
|
952
|
+
};
|
|
953
|
+
ground: {
|
|
954
|
+
transparency: number;
|
|
955
|
+
};
|
|
956
|
+
baseMap: ArcGisBaseMap;
|
|
957
|
+
visibleLayers: ArcGisVisibleLayer[];
|
|
958
|
+
viewpoint: ArcGisViewPoint;
|
|
959
|
+
};
|
|
960
|
+
|
|
961
|
+
/**
|
|
962
|
+
* The basemap of the scene. Only the base and reference layers of the basemap are stored in a slide.
|
|
963
|
+
* Spec - https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html
|
|
964
|
+
*/
|
|
965
|
+
type ArcGisBaseMap = {
|
|
966
|
+
id: string;
|
|
967
|
+
title: string;
|
|
968
|
+
baseMapLayers: ArcGisBaseMapLayer[];
|
|
969
|
+
};
|
|
970
|
+
|
|
971
|
+
/**
|
|
972
|
+
* The visible layers of the scene.
|
|
973
|
+
* Spec - https://developers.arcgis.com/javascript/latest/api-reference/esri-webscene-Slide.html#visibleLayers
|
|
974
|
+
*/
|
|
975
|
+
type ArcGisVisibleLayer = {
|
|
976
|
+
id: string;
|
|
977
|
+
sublayerIds: number[];
|
|
978
|
+
};
|
|
979
|
+
/**
|
|
980
|
+
* The basemap of the scene.
|
|
981
|
+
* Spec - https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html
|
|
982
|
+
*/
|
|
983
|
+
type ArcGisBaseMapLayer = {
|
|
984
|
+
id: string;
|
|
985
|
+
title: string;
|
|
986
|
+
url: string;
|
|
987
|
+
layerType: string;
|
|
988
|
+
visibility: boolean;
|
|
989
|
+
};
|
|
990
|
+
|
|
991
|
+
/**
|
|
992
|
+
* The viewpoint of the slide. This acts like a bookmark, saving a predefined location or point of view from which to view the scene.
|
|
993
|
+
* Spec - https://developers.arcgis.com/javascript/latest/api-reference/esri-Viewpoint.html
|
|
994
|
+
*/
|
|
995
|
+
type ArcGisViewPoint = {
|
|
996
|
+
scale: number;
|
|
997
|
+
rotation?: number;
|
|
998
|
+
/**
|
|
999
|
+
* Spec - https://developers.arcgis.com/web-scene-specification/objects/viewpoint/
|
|
1000
|
+
*/
|
|
1001
|
+
targetGeometry: any;
|
|
1002
|
+
camera: ArcGisCamera;
|
|
1003
|
+
};
|
|
1004
|
+
|
|
1005
|
+
/**
|
|
1006
|
+
* The camera defines the position, tilt, and heading of the point from which the SceneView's visible extent is observed.
|
|
1007
|
+
* It is not associated with device hardware. This class only applies to 3D SceneViews.
|
|
1008
|
+
* Spec - https://developers.arcgis.com/javascript/latest/api-reference/esri-Camera.html
|
|
1009
|
+
*/
|
|
1010
|
+
export type ArcGisCamera = {
|
|
1011
|
+
position: {
|
|
1012
|
+
x: number;
|
|
1013
|
+
y: number;
|
|
1014
|
+
z: number;
|
|
1015
|
+
};
|
|
1016
|
+
spatialReference: {
|
|
1017
|
+
wkid: number;
|
|
1018
|
+
latestWkid: number;
|
|
1019
|
+
};
|
|
1020
|
+
heading: number;
|
|
1021
|
+
tilt: number;
|
|
1022
|
+
};
|
|
1023
|
+
|
|
1024
|
+
/**
|
|
1025
|
+
* Operational layers contain your data. Usually, a basemap sits beneath your operational layers to give them geographic context.
|
|
1026
|
+
* Spec- https://developers.arcgis.com/web-scene-specification/objects/operationalLayers/
|
|
1027
|
+
*/
|
|
1028
|
+
export type OperationalLayer = {
|
|
1029
|
+
id: string;
|
|
1030
|
+
opacity: number;
|
|
1031
|
+
title: string;
|
|
1032
|
+
url: string;
|
|
1033
|
+
visibility: boolean;
|
|
1034
|
+
itemId: string;
|
|
1035
|
+
layerType: string;
|
|
1036
|
+
LayerDefinition: LayerDefinition;
|
|
1037
|
+
screenSizePerspective: boolean;
|
|
1038
|
+
showLabels?: boolean;
|
|
1039
|
+
disablePopup?: boolean;
|
|
1040
|
+
showLegend?: boolean;
|
|
1041
|
+
layers?: OperationalLayer[];
|
|
1042
|
+
};
|
|
1043
|
+
|
|
1044
|
+
type LayerDefinition = {
|
|
1045
|
+
elevationInfo: ElevationInfo;
|
|
1046
|
+
drawingInfo: DrawingInfo;
|
|
1047
|
+
};
|
|
1048
|
+
|
|
1049
|
+
type BaseMap = {
|
|
1050
|
+
id: string;
|
|
1051
|
+
title: string;
|
|
1052
|
+
baseMapLayers: BaseMapLayer[];
|
|
1053
|
+
elevationLayers: ElevationLayer[];
|
|
1054
|
+
};
|
|
1055
|
+
|
|
1056
|
+
type BaseMapLayer = {
|
|
1057
|
+
id: string;
|
|
1058
|
+
opacity: number;
|
|
1059
|
+
title: string;
|
|
1060
|
+
url: string;
|
|
1061
|
+
visibility: boolean;
|
|
1062
|
+
layerType: string;
|
|
1063
|
+
};
|
|
1064
|
+
|
|
1065
|
+
type ElevationLayer = {
|
|
1066
|
+
id: string;
|
|
1067
|
+
listMode: string;
|
|
1068
|
+
title: string;
|
|
1069
|
+
url: string;
|
|
1070
|
+
visibility: boolean;
|
|
1071
|
+
layerType: string;
|
|
1072
|
+
};
|
|
1073
|
+
|
|
1074
|
+
type Ground = {
|
|
1075
|
+
layers: ElevationLayer[];
|
|
1076
|
+
transparency: number;
|
|
1077
|
+
navigationConstraint: NavigationConstraint;
|
|
1078
|
+
};
|
|
1079
|
+
|
|
1080
|
+
type NavigationConstraint = {
|
|
1081
|
+
type: string;
|
|
1082
|
+
};
|
|
1083
|
+
|
|
1084
|
+
type InitialState = {
|
|
1085
|
+
environment: Enviroment;
|
|
1086
|
+
viewpoint: ViewPoint;
|
|
1087
|
+
};
|
|
1088
|
+
|
|
1089
|
+
type Enviroment = {
|
|
1090
|
+
lighting: Lighting;
|
|
1091
|
+
atmosphereEnabled?: string;
|
|
1092
|
+
starsEnabled?: string;
|
|
1093
|
+
};
|
|
1094
|
+
|
|
1095
|
+
type Lighting = {
|
|
1096
|
+
datetime?: number;
|
|
1097
|
+
displayUTCOffset?: number;
|
|
1098
|
+
};
|
|
1099
|
+
|
|
1100
|
+
type ViewPoint = {
|
|
1101
|
+
camera: Camera;
|
|
1102
|
+
};
|
|
1103
|
+
|
|
1104
|
+
type Camera = {
|
|
1105
|
+
position: CameraPosition;
|
|
1106
|
+
heading: number;
|
|
1107
|
+
tilt: number;
|
|
1108
|
+
};
|
|
1109
|
+
|
|
1110
|
+
type CameraPosition = {
|
|
1111
|
+
spatialReference: SpatialReference;
|
|
1112
|
+
x: number;
|
|
1113
|
+
y: number;
|
|
1114
|
+
z: number;
|
|
1115
|
+
};
|
|
1116
|
+
|
|
1117
|
+
/**
|
|
1118
|
+
* Spec - https://github.com/Esri/i3s-spec/blob/master/docs/1.8/statsInfo.cmn.md
|
|
1119
|
+
*/
|
|
1120
|
+
export type StatsInfo = {
|
|
1121
|
+
/** Represents the count of the value. */
|
|
1122
|
+
totalValuesCount?: number;
|
|
1123
|
+
/** Minimum attribute value for the entire layer. */
|
|
1124
|
+
min?: number;
|
|
1125
|
+
/** Maximum attribute value for the entire layer. */
|
|
1126
|
+
max?: number;
|
|
1127
|
+
/** Count for the entire layer. */
|
|
1128
|
+
count?: number;
|
|
1129
|
+
/** Sum of the attribute values over the entire layer. */
|
|
1130
|
+
sum?: number;
|
|
1131
|
+
/** Representing average or mean value. For example, sum/count. */
|
|
1132
|
+
avg?: number;
|
|
1133
|
+
/** Representing the standard deviation. */
|
|
1134
|
+
stddev?: number;
|
|
1135
|
+
/** Representing variance. For example, stats.stddev *stats.stddev. */
|
|
1136
|
+
variance?: number;
|
|
1137
|
+
/** Represents the histogram. */
|
|
1138
|
+
histogram?: Histogram;
|
|
1139
|
+
/** An array of most frequently used values within the point cloud scene layer. */
|
|
1140
|
+
mostFrequentValues?: ValueCount[];
|
|
1141
|
+
};
|
|
1142
|
+
|
|
1143
|
+
/** Spec - https://github.com/Esri/i3s-spec/blob/master/docs/1.8/histogram.cmn.md */
|
|
1144
|
+
export type Histogram = {
|
|
1145
|
+
/** Minimum attribute value for the entire layer. */
|
|
1146
|
+
minimum: number;
|
|
1147
|
+
/** Maximum attribute value for the entire layer. Maximum array size for stats.histo.counts is 256. */
|
|
1148
|
+
maximum: number;
|
|
1149
|
+
/** Count for the entire layer. */
|
|
1150
|
+
counts: number[];
|
|
1151
|
+
};
|
|
1152
|
+
|
|
1153
|
+
export type ValueCount = {
|
|
1154
|
+
/** Type of the attribute values after decompression, if applicable. Please note that string is not supported for point cloud scene layer attributes. */
|
|
1155
|
+
value: number | string;
|
|
1156
|
+
/** Count of the number of values. May exceed 32 bits. */
|
|
1157
|
+
count: number;
|
|
1158
|
+
};
|
package/dist/bundle.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/bundle.ts"],"names":["moduleExports","require","globalThis","loaders","module","exports","Object","assign"],"mappings":"AACA,MAAMA,aAAa,GAAGC,OAAO,CAAC,SAAD,CAA7B;;AACAC,UAAU,CAACC,OAAX,GAAqBD,UAAU,CAACC,OAAX,IAAsB,EAA3C;AACAC,MAAM,CAACC,OAAP,GAAiBC,MAAM,CAACC,MAAP,CAAcL,UAAU,CAACC,OAAzB,EAAkCH,aAAlC,CAAjB","sourcesContent":["// @ts-nocheck\nconst moduleExports = require('./index');\nglobalThis.loaders = globalThis.loaders || {};\nmodule.exports = Object.assign(globalThis.loaders, moduleExports);\n"],"file":"bundle.js"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/i3s-attribute-loader.ts"],"names":["load","parseI3STileAttribute","getUrlWithToken","VERSION","EMPTY_VALUE","REJECTED_STATUS","I3SAttributeLoader","name","id","module","version","mimeTypes","parse","extensions","options","binary","data","loadFeatureAttributes","tile","featureId","attributeStorageInfo","attributeUrls","tilesetFields","getAttributesData","attributes","attributeLoadPromises","index","length","url","i3s","token","attributeName","attributeType","getAttributeValueType","loadOptions","promise","push","Promise","allSettled","error","generateAttributesByFeatureId","tileset","header","fields","attribute","hasOwnProperty","attributeValues","valueType","getFeatureIdsAttributeName","objectIdsAttribute","find","includes","objectIdsAttributeName","objectIds","value","attributeIndex","indexOf","getFeatureAttributesByIndex","featureIdIndex","attributesObject","codedValues","getAttributeCodedValues","getAttributeByIndexAndAttributeName","formatAttributeValue","attributeField","field","alias","domain","attributesName","attributeObject","status","String","replace","trim","codeValue","codedValue","code","Number"],"mappings":"AACA,SAAQA,IAAR,QAAmB,kBAAnB;AACA,SAAQC,qBAAR,QAAoC,mCAApC;AACA,SAAQC,eAAR,QAA8B,uBAA9B;AAIA,MAAMC,OAAO,GAAG,2BAAuB,WAAvB,qBAAmD,QAAnE;AACA,MAAMC,WAAW,GAAG,EAApB;AACA,MAAMC,eAAe,GAAG,UAAxB;AAIA,OAAO,MAAMC,kBAAoC,GAAG;AAClDC,EAAAA,IAAI,EAAE,eAD4C;AAElDC,EAAAA,EAAE,EAAE,eAF8C;AAGlDC,EAAAA,MAAM,EAAE,KAH0C;AAIlDC,EAAAA,OAAO,EAAEP,OAJyC;AAKlDQ,EAAAA,SAAS,EAAE,CAAC,oBAAD,CALuC;AAMlDC,EAAAA,KANkD;AAOlDC,EAAAA,UAAU,EAAE,CAAC,KAAD,CAPsC;AAQlDC,EAAAA,OAAO,EAAE,EARyC;AASlDC,EAAAA,MAAM,EAAE;AAT0C,CAA7C;;AAYP,eAAeH,KAAf,CAAqBI,IAArB,EAA2BF,OAA3B,EAAoC;AAClCE,EAAAA,IAAI,GAAGf,qBAAqB,CAACe,IAAD,EAAOF,OAAP,CAA5B;AACA,SAAOE,IAAP;AACD;;AAUD,OAAO,eAAeC,qBAAf,CAAqCC,IAArC,EAA2CC,SAA3C,EAAsDL,OAAO,GAAG,EAAhE,EAAoE;AACzE,QAAM;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AAgE0C,cAAhE,EAAgF;AAC9E,QAAMC,eAAe,GAAG7C,UAAU,CAACE,KAAD,CAAlC;;AAEA,MAAI2C,eAAe,CAACC,MAAhB,KAA2BjE,eAA/B,EAAgD;AAC9C,WAAO,IAAP;AACD;;AAED,SAAOgE,eAAe,CAACf,KAAhB,CAAsBc,cAAtB,CAAP;AACD;;AAQD,SAASL,oBAAT,CAA8BnB,SAA9B,EAAyCc,cAAzC,EAAyDE,WAAzD,EAAsE;AACpE,MAAIN,KAAK,GAAGlD,WAAZ;;AAEA,MAAIwC,SAAS,IAAKc,cAAc,IAAId,SAApC,EAAgD;AAE9CU,IAAAA,KAAK,GAAGiB,MAAM,CAAC3B,SAAS,CAACc,cAAD,CAAV,CAAN,CAAkCc,OAAlC,CAA0C,aAA1C,EAAyD,EAAzD,EAA6DC,IAA7D,EAAR;AACD;;AAGD,MAAIb,WAAW,CAACjC,MAAhB,EAAwB;AACtB,UAAM+C,SAAS,GAAGd,WAAW,CAACV,IAAZ,CAAiByB,UAAU,IAAIA,UAAU,CAACC,IAAX,KAAoBC,MAAM,CAACvB,KAAD,CAAzD,CAAlB;AACAA,IAAAA,KAAK,GAAG,CAAAoB,SAAS,SAAT,IAAAA,SAAS,WAAT,YAAAA,SAAS,CAAEnE,IAAX,KAAmBH,WAA3B;AACD;;AAED,SAAOkD,KAAP;AACD","sourcesContent":["import type {LoaderWithParser} from '@loaders.gl/loader-utils';\nimport {load} from '@loaders.gl/core';\nimport {parseI3STileAttribute} from './lib/parsers/parse-i3s-attribute';\nimport {getUrlWithToken} from './lib/utils/url-utils';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\nconst EMPTY_VALUE = '';\nconst REJECTED_STATUS = 'rejected';\n/**\n * Loader for I3S attributes\n */\nexport const I3SAttributeLoader: LoaderWithParser = {\n name: 'I3S Attribute',\n id: 'i3s-attribute',\n module: 'i3s',\n version: VERSION,\n mimeTypes: ['application/binary'],\n parse,\n extensions: ['bin'],\n options: {},\n binary: true\n};\n\nasync function parse(data, options) {\n data = parseI3STileAttribute(data, options);\n return data;\n}\n\n/**\n * Load attributes based on feature id\n * @param {Object} tile\n * @param {number} featureId\n * @param {Object} options\n * @returns {Promise}\n */\n// eslint-disable-next-line complexity\nexport async function loadFeatureAttributes(tile, featureId, options = {}) {\n const {attributeStorageInfo, attributeUrls, tilesetFields} = getAttributesData(tile);\n\n if (!attributeStorageInfo || !attributeUrls || !featureId) {\n return null;\n }\n\n let attributes: object[] = [];\n const attributeLoadPromises: Promise<object>[] = [];\n\n for (let index = 0; index < attributeStorageInfo.length; index++) {\n // @ts-ignore\n const url = getUrlWithToken(attributeUrls[index], options.i3s?.token);\n const attributeName = attributeStorageInfo[index].name;\n const attributeType = getAttributeValueType(attributeStorageInfo[index]);\n const loadOptions = {...options, attributeName, attributeType};\n const promise = load(url, I3SAttributeLoader, loadOptions);\n\n attributeLoadPromises.push(promise);\n }\n try {\n attributes = await Promise.allSettled(attributeLoadPromises);\n } catch (error) {\n // do nothing\n }\n\n if (!attributes.length) {\n return null;\n }\n\n return generateAttributesByFeatureId(attributes, attributeStorageInfo, featureId, tilesetFields);\n}\n\n/**\n * Gets attributes data from tile.\n * @param tile \n * @returns \n */\nfunction getAttributesData(tile) {\n const attributeStorageInfo = tile.tileset?.tileset?.attributeStorageInfo;\n const attributeUrls = tile.header?.attributeUrls;\n const tilesetFields = tile.tileset?.tileset?.fields || [];\n\n return {attributeStorageInfo, attributeUrls, tilesetFields};\n}\n\n/**\n * Get attribute value type based on property names\n * @param {Object} attribute\n * @returns {String}\n */\nfunction getAttributeValueType(attribute) {\n if (attribute.hasOwnProperty('objectIds')) {\n return 'Oid32';\n } else if (attribute.hasOwnProperty('attributeValues')) {\n return attribute.attributeValues.valueType;\n }\n return '';\n}\n\n/**\n * Find in attributeStorageInfo attribute name responsible for feature ids list.\n * @param attributeStorageInfo \n * @returns Feature ids attribute name\n */\nfunction getFeatureIdsAttributeName(attributeStorageInfo) {\n const objectIdsAttribute = attributeStorageInfo.find(attribute => attribute.name.includes('OBJECTID'));\n\n return objectIdsAttribute?.name;\n}\n\n/**\n * Generates mapping featureId to feature attributes\n * @param {Array} attributes\n * @param {Object} attributeStorageInfo\n * @param {number} featureId\n * @returns {Object}\n */\nfunction generateAttributesByFeatureId(attributes, attributeStorageInfo, featureId, tilesetFields) {\n const objectIdsAttributeName = getFeatureIdsAttributeName(attributeStorageInfo);\n const objectIds = attributes.find((attribute) => attribute.value[objectIdsAttributeName]);\n\n if (!objectIds) {\n return null;\n }\n\n const attributeIndex = objectIds.value[objectIdsAttributeName].indexOf(featureId);\n\n if (attributeIndex < 0) {\n return null;\n }\n\n return getFeatureAttributesByIndex(attributes, attributeIndex, attributeStorageInfo, tilesetFields);\n}\n\n/**\n * Generates attribute object for feature mapping by feature id\n * @param {Array} attributes\n * @param {Number} featureIdIndex\n * @param {Object} attributeStorageInfo\n * @returns {Object}\n */\nfunction getFeatureAttributesByIndex(attributes, featureIdIndex, attributeStorageInfo, tilesetFields) {\n const attributesObject = {};\n\n for (let index = 0; index < attributeStorageInfo.length; index++) {\n const attributeName = attributeStorageInfo[index].name;\n const codedValues = getAttributeCodedValues(attributeName, tilesetFields);\n const attribute = getAttributeByIndexAndAttributeName(attributes, index, attributeName);\n attributesObject[attributeName] = formatAttributeValue(attribute, featureIdIndex, codedValues);\n }\n\n return attributesObject;\n}\n\n/**\n * Get coded values list from tileset.\n * @param attributeName \n * @param tilesetFields \n */\nfunction getAttributeCodedValues(attributeName, tilesetFields) {\n const attributeField = tilesetFields\n .find(field => field.name === attributeName || field.alias === attributeName);\n\n return attributeField?.domain?.codedValues || [];\n}\n\n/**\n * Return attribute value if it presents in atrributes list\n * @param {array} attributes\n * @param {number} index\n * @param {string} attributesName\n */\nfunction getAttributeByIndexAndAttributeName(attributes, index, attributesName) {\n const attributeObject = attributes[index];\n\n if (attributeObject.status === REJECTED_STATUS) {\n return null;\n }\n\n return attributeObject.value[attributesName];\n}\n\n/**\n * Do formatting of attribute values or return empty string.\n * @param {Array} attribute\n * @param {Number} featureIdIndex\n * @returns {String}\n */\nfunction formatAttributeValue(attribute, featureIdIndex, codedValues) {\n let value = EMPTY_VALUE;\n\n if (attribute && (featureIdIndex in attribute)) {\n // eslint-disable-next-line no-control-regex\n value = String(attribute[featureIdIndex]).replace(/\\u0000|NaN/g, '').trim();\n }\n\n // Check if coded values are existed. If so we use them.\n if (codedValues.length) {\n const codeValue = codedValues.find(codedValue => codedValue.code === Number(value));\n value = codeValue?.name || EMPTY_VALUE;\n }\n\n return value;\n}\n"],"file":"i3s-attribute-loader.js"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/i3s-building-scene-layer-loader.ts"],"names":["parseBuildingSceneLayer","VERSION","I3SBuildingSceneLayerLoader","name","id","module","version","mimeTypes","parse","extensions","options","data","context","url","Error"],"mappings":"AAGA,SAAQA,uBAAR,QAAsC,8CAAtC;AAKA,MAAMC,OAAO,GAAG,2BAAuB,WAAvB,qBAAmD,MAAnE;AAIA,OAAO,MAAMC,2BAA6C,GAAG;AAC3DC,EAAAA,IAAI,EAAE,0BADqD;AAE3DC,EAAAA,EAAE,EAAE,0BAFuD;AAG3DC,EAAAA,MAAM,EAAE,KAHmD;AAI3DC,EAAAA,OAAO,EAAEL,OAJkD;AAK3DM,EAAAA,SAAS,EAAE,CAAC,kBAAD,CALgD;AAM3DC,EAAAA,KAN2D;AAO3DC,EAAAA,UAAU,EAAE,CAAC,MAAD,CAP+C;AAQ3DC,EAAAA,OAAO,EAAE;AARkD,CAAtD;;AAWP,eAAeF,KAAf,CACEG,IADF,EAEED,OAFF,EAGEE,OAHF,EAIsC;AACpC,MAAI,EAACA,OAAD,aAACA,OAAD,eAACA,OAAO,CAAEC,GAAV,CAAJ,EAAmB;AACjB,UAAM,IAAIC,KAAJ,CAAU,qBAAV,CAAN;AACD;;AAED,SAAOd,uBAAuB,CAACW,IAAD,EAAOC,OAAO,CAACC,GAAf,CAA9B;AACD","sourcesContent":["import type {LoaderWithParser, LoaderOptions, LoaderContext} from '@loaders.gl/loader-utils';\nimport type {BuildingSceneLayerTileset} from './types';\n\nimport {parseBuildingSceneLayer} from './lib/parsers/parse-i3s-building-scene-layer';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\n\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'beta';\n/**\n * Loader for I3S - Building Scene Layer\n */\nexport const I3SBuildingSceneLayerLoader: LoaderWithParser = {\n name: 'I3S Building Scene Layer',\n id: 'i3s-building-scene-layer',\n module: 'i3s',\n version: VERSION,\n mimeTypes: ['application/json'],\n parse,\n extensions: ['json'],\n options: {}\n};\n\nasync function parse(\n data: ArrayBuffer,\n options?: LoaderOptions,\n context?: LoaderContext\n): Promise<BuildingSceneLayerTileset> {\n if (!context?.url) {\n throw new Error('Url is not provided');\n }\n\n return parseBuildingSceneLayer(data, context.url);\n}\n"],"file":"i3s-building-scene-layer-loader.js"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/i3s-content-loader.ts"],"names":["parseI3STileContent","VERSION","I3SContentLoader","name","id","module","worker","version","mimeTypes","parse","extensions","options","data","context","tile","tileset","i3s","content"],"mappings":"AACA,SAAQA,mBAAR,QAAkC,sCAAlC;AAKA,MAAMC,OAAO,GAAG,2BAAuB,WAAvB,qBAAmD,MAAnE;AAIA,OAAO,MAAMC,gBAAkC,GAAG;AAChDC,EAAAA,IAAI,EAAE,oCAD0C;AAEhDC,EAAAA,EAAE,EAAE,aAF4C;AAGhDC,EAAAA,MAAM,EAAE,KAHwC;AAIhDC,EAAAA,MAAM,EAAE,IAJwC;AAKhDC,EAAAA,OAAO,EAAEN,OALuC;AAMhDO,EAAAA,SAAS,EAAE,CAAC,0BAAD,CANqC;AAOhDC,EAAAA,KAPgD;AAQhDC,EAAAA,UAAU,EAAE,CAAC,KAAD,CARoC;AAShDC,EAAAA,OAAO,EAAE;AACP,mBAAe;AADR;AATuC,CAA3C;;AAcP,eAAeF,KAAf,CAAqBG,IAArB,EAA2BD,OAA3B,EAAoDE,OAApD,EAA6E;AAC3E,QAAM;AAACC,IAAAA,IAAD;AAAOC,IAAAA;AAAP,MAAkB,CAAAJ,OAAO,SAAP,IAAAA,OAAO,WAAP,YAAAA,OAAO,CAAEK,GAAT,KAAgB,EAAxC;AACA,QAAMhB,mBAAmB,CAACY,IAAD,EAAOE,IAAP,EAAaC,OAAb,EAAsBJ,OAAtB,EAA+BE,OAA/B,CAAzB;AACA,SAAOC,IAAI,CAACG,OAAZ;AACD","sourcesContent":["import type {LoaderWithParser, LoaderOptions, LoaderContext} from '@loaders.gl/loader-utils';\nimport {parseI3STileContent} from './lib/parsers/parse-i3s-tile-content';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\n\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'beta';\n/**\n * Loader for I3S - Indexed 3D Scene Layer\n */\nexport const I3SContentLoader: LoaderWithParser = {\n name: 'I3S Content (Indexed Scene Layers)',\n id: 'i3s-content',\n module: 'i3s',\n worker: true,\n version: VERSION,\n mimeTypes: ['application/octet-stream'],\n parse,\n extensions: ['bin'],\n options: {\n 'i3s-content': {}\n }\n};\n\nasync function parse(data, options?: LoaderOptions, context?: LoaderContext) {\n const {tile, tileset} = options?.i3s || {};\n await parseI3STileContent(data, tile, tileset, options, context);\n return tile.content;\n}\n"],"file":"i3s-content-loader.js"}
|