@loaders.gl/tile-converter 4.0.0-beta.8 → 4.0.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/converter.min.cjs +109 -109
- package/dist/i3s-converter/helpers/attribute-metadata-info.d.ts +74 -0
- package/dist/i3s-converter/helpers/attribute-metadata-info.d.ts.map +1 -0
- package/dist/i3s-converter/helpers/attribute-metadata-info.js +157 -0
- package/dist/i3s-converter/helpers/attribute-metadata-info.js.map +1 -0
- package/dist/i3s-converter/helpers/feature-attributes.d.ts +3 -28
- package/dist/i3s-converter/helpers/feature-attributes.d.ts.map +1 -1
- package/dist/i3s-converter/helpers/feature-attributes.js +16 -125
- package/dist/i3s-converter/helpers/feature-attributes.js.map +1 -1
- package/dist/i3s-converter/i3s-converter.d.ts +11 -5
- package/dist/i3s-converter/i3s-converter.d.ts.map +1 -1
- package/dist/i3s-converter/i3s-converter.js +31 -44
- package/dist/i3s-converter/i3s-converter.js.map +1 -1
- package/dist/i3s-converter/types.d.ts +15 -0
- package/dist/i3s-converter/types.d.ts.map +1 -1
- package/dist/i3s-converter/types.js +6 -0
- package/dist/i3s-converter/types.js.map +1 -1
- package/dist/i3s-server/app.d.ts.map +1 -1
- package/dist/i3s-server/app.js +3 -6
- package/dist/i3s-server/app.js.map +1 -1
- package/dist/i3s-server/bin/i3s-server.min.cjs +86 -86
- package/dist/i3s-server/bin/www.js.map +1 -1
- package/dist/i3s-server/routes/index.d.ts +1 -1
- package/dist/i3s-server/routes/index.d.ts.map +1 -1
- package/dist/i3s-server/routes/index.js +2 -5
- package/dist/i3s-server/routes/index.js.map +1 -1
- package/dist/i3s-server/routes/slpk-router.d.ts.map +1 -1
- package/dist/i3s-server/routes/slpk-router.js +3 -3
- package/dist/i3s-server/routes/slpk-router.js.map +1 -1
- package/dist/index.cjs +269 -173
- package/package.json +15 -15
- package/src/i3s-converter/helpers/attribute-metadata-info.ts +246 -0
- package/src/i3s-converter/helpers/feature-attributes.ts +18 -180
- package/src/i3s-converter/i3s-converter.ts +46 -65
- package/src/i3s-converter/types.ts +16 -0
- package/src/i3s-server/app.ts +9 -4
- package/src/i3s-server/bin/www.ts +6 -0
- package/src/i3s-server/routes/index.ts +2 -4
- package/src/i3s-server/routes/slpk-router.ts +4 -3
|
@@ -201,4 +201,19 @@ export type GLTFAttributesData = {
|
|
|
201
201
|
/** Model matrix to convert coordinate system of POSITION and NORMAL attributes from METER_OFFSETS to CARTESIAN */
|
|
202
202
|
cartesianModelMatrix: Matrix4;
|
|
203
203
|
};
|
|
204
|
+
/**
|
|
205
|
+
* I3S' types difine the following:
|
|
206
|
+
* type Attribute = 'OBJECTID' | 'string' | 'double' | 'Int32' | string;
|
|
207
|
+
* The AttributeType contains the string values of the Attribute type.
|
|
208
|
+
*/
|
|
209
|
+
export declare const AttributeType: {
|
|
210
|
+
/** Type of attribute that is linked with feature ids */
|
|
211
|
+
readonly OBJECT_ID_TYPE: "OBJECTID";
|
|
212
|
+
/** String data type name for feature attributes */
|
|
213
|
+
readonly STRING_TYPE: "string";
|
|
214
|
+
/** Double data type name for feature attributes */
|
|
215
|
+
readonly DOUBLE_TYPE: "double";
|
|
216
|
+
/** Integer data type name for feature attributes */
|
|
217
|
+
readonly SHORT_INT_TYPE: "Int32";
|
|
218
|
+
};
|
|
204
219
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/i3s-converter/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,sBAAsB,EAAE,qBAAqB,EAAC,MAAM,kBAAkB,CAAC;AAC/E,OAAO,EACL,eAAe,EACf,qBAAqB,EACrB,sBAAsB,EACtB,qBAAqB,EACtB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAC,OAAO,EAAE,OAAO,EAAC,MAAM,eAAe,CAAC;AAE/C,4CAA4C;AAC5C,MAAM,MAAM,qBAAqB,GAAG;IAClC;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AAC,uBAAuB,CAAC,CAAC;IAChD;;;;;OAKG;IACH,eAAe,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;CAC9B,CAAC;AAEF,uDAAuD;AACvD,MAAM,MAAM,sBAAsB,GAAG;IACnC,4BAA4B;IAC5B,IAAI,EAAE,UAAU,CAAC;IACjB,gCAAgC;IAChC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,oCAAoC;IACpC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,mCAAmC;IACnC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,mDAAmD;IACnD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,uCAAuC;IACvC,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,oDAAoD;AACpD,MAAM,MAAM,kBAAkB,GAAG;IAC/B,+CAA+C;IAC/C,aAAa,CAAC,EAAE;QAAC,EAAE,EAAE,MAAM,CAAA;KAAC,EAAE,CAAC;IAC/B,0BAA0B;IAC1B,KAAK,EAAE,qBAAqB,EAAE,CAAC;IAC/B,gEAAgE;IAChE,MAAM,EAAE,CAAC,IAAI,GAAG,sBAAsB,CAAC,EAAE,CAAC;IAC1C,uEAAuE;IACvE,kBAAkB,EAAE,OAAO,CAAC;IAC5B,mHAAmH;IACnH,oBAAoB,EAAE,OAAO,CAAC;CAC/B,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,aAAa;IACxB,wDAAwD;;IAExD,mDAAmD;;IAEnD,mDAAmD;;IAEnD,oDAAoD;;CAE5C,CAAC"}
|
|
@@ -8,4 +8,10 @@ export let GLTFPrimitiveModeString = function (GLTFPrimitiveModeString) {
|
|
|
8
8
|
GLTFPrimitiveModeString["TRIANGLE_FAN"] = "TRIANGLE_FAN";
|
|
9
9
|
return GLTFPrimitiveModeString;
|
|
10
10
|
}({});
|
|
11
|
+
export const AttributeType = {
|
|
12
|
+
OBJECT_ID_TYPE: 'OBJECTID',
|
|
13
|
+
STRING_TYPE: 'string',
|
|
14
|
+
DOUBLE_TYPE: 'double',
|
|
15
|
+
SHORT_INT_TYPE: 'Int32'
|
|
16
|
+
};
|
|
11
17
|
//# sourceMappingURL=types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":["GLTFPrimitiveModeString"],"sources":["../../src/i3s-converter/types.ts"],"sourcesContent":["import {GLTFImagePostprocessed, GLTFNodePostprocessed} from '@loaders.gl/gltf';\nimport {\n BoundingVolumes,\n I3SMaterialDefinition,\n MaterialDefinitionInfo,\n TextureDefinitionInfo\n} from '@loaders.gl/i3s';\nimport {Matrix4, Vector3} from '@math.gl/core';\n\n/** Converted resources for specific node */\nexport type I3SConvertedResources = {\n /**\n * Node id\n */\n nodeId?: number;\n /** Non-compressed geometry buffer that have structure met\n * https://github.com/Esri/i3s-spec/blob/master/docs/1.8/defaultGeometrySchema.cmn.md\n * (Geometry buffer)\n */\n geometry: ArrayBuffer | null;\n /**\n * Draco compressed geometry\n */\n compressedGeometry?: Promise<ArrayBuffer> | null;\n /**\n * Texture image content\n */\n texture: any | null;\n /**\n * If the resource has uvRegions geometry attribute\n */\n hasUvRegions: boolean;\n /**\n * Shared resources built from GLTF material\n */\n sharedResources: SharedResourcesArrays | null;\n /**\n * Material definition of the node\n */\n meshMaterial?: I3SMaterialDefinition | null;\n /**\n * Number of vertices in the node\n */\n vertexCount: number | null;\n /**\n * Feature attributes contents\n */\n attributes: ArrayBuffer[] | null;\n /**\n * Number of features in the node\n */\n featureCount: number | null;\n /**\n * MBS and/or OBB bounding volumes of the node\n */\n boundingVolumes: BoundingVolumes | null;\n};\n\n/**\n * Geometry and feature attributes converted from GLTF primitives\n */\nexport type ConvertedAttributes = {\n /** POSITION attribute value */\n positions: Float32Array;\n /** NORMAL attribute value */\n normals: Float32Array;\n /** TEXCOORD_0 attribute value */\n texCoords: Float32Array;\n /** COLOR_0 attribute value */\n colors: Uint8Array;\n /** uvRegion attribute for a texture atlas */\n uvRegions: Uint16Array;\n /** Feature indices grouped by ...\n * converted from \"batch ids\" of GLTF\n */\n featureIndicesGroups?: number[][];\n /** Feature indices converted from \"batch ids\" */\n featureIndices: number[];\n /**\n * MBS and/or OBB bounding volumes of the node\n */\n boundingVolumes: null | BoundingVolumes;\n /** merged materials data */\n mergedMaterials: MergedMaterial[];\n};\n\n/** Postprocessed geometry and feature attributes\n * https://github.com/Esri/i3s-spec/blob/master/docs/1.8/defaultGeometrySchema.cmn.md\n */\nexport type GeometryAttributes = {\n /** POSITION attribute value */\n positions: Float32Array;\n /** NORMAL attribute value */\n normals: Float32Array;\n /** TEXCOORD_0 attribute value */\n texCoords: Float32Array;\n /** COLOR_0 attribute value */\n colors: Uint8Array;\n /** uvRegion attribute for a texture atlas */\n uvRegions: Uint16Array;\n /** faceRanges attribute value */\n faceRange: Uint32Array;\n /** feature Ids attribute value */\n featureIds: number[];\n /** number of features in the node */\n featureCount: number;\n};\n\n/** Geometry attributes applicable for reordering by featureId */\nexport type GroupedAttributes = {\n /** POSITION attribute value */\n positions: Float32Array;\n /** NORMAL attribute value */\n normals: Float32Array;\n /** COLOR_0 attribute value */\n colors: Uint8Array;\n /** uvRegion attribute for a texture atlas */\n uvRegions: Uint16Array;\n /** TEXCOORD_0 attribute value */\n texCoords: Float32Array;\n};\n\n/** Geometry attributes specific for the particular feature */\nexport type GroupedByFeatureIdAttributes = GroupedAttributes & {\n /** Feature Id */\n featureId: number;\n};\n\n/** Shared resources made from GLTF material */\nexport type SharedResourcesArrays = {\n /** material definitions list https://github.com/Esri/i3s-spec/blob/master/docs/1.8/materialDefinitionInfo.cmn.md */\n materialDefinitionInfos?: MaterialDefinitionInfo[];\n /** texture definitions list https://github.com/Esri/i3s-spec/blob/master/docs/1.8/textureDefinitionInfo.cmn.md*/\n textureDefinitionInfos?: TextureDefinitionInfo[];\n /** node id to make unique SharedResource ids */\n nodePath?: string;\n};\n\n/** I3S material definition and texture content taken from GLTF material */\nexport type I3SMaterialWithTexture = {\n /** Material definition https://github.com/Esri/i3s-spec/blob/master/docs/1.8/materialDefinitions.cmn.md */\n material: I3SMaterialDefinition;\n /** Texture content (image) */\n texture?: GLTFImagePostprocessed;\n /** Metadata of all merged materials */\n mergedMaterials: MergedMaterial[];\n};\n\n/** Metadata of some original texture */\nexport type MergedMaterial = {\n /** Gltf material Id */\n originalMaterialId: string;\n /** Original texture size */\n textureSize?: {\n width: number;\n height: number;\n };\n /** Uint16Array of 4 elements https://github.com/Esri/i3s-spec/blob/master/docs/1.7/geometryUVRegion.cmn.md */\n uvRegion?: Uint16Array;\n};\n\nexport type TypedArrayConstructor =\n | Uint8ArrayConstructor\n | Int8ArrayConstructor\n | Uint16ArrayConstructor\n | Int16ArrayConstructor\n | Int32ArrayConstructor\n | Uint32ArrayConstructor\n | Float32ArrayConstructor\n | Float64ArrayConstructor;\n\n/**\n * glTF primitive modes (mesh topology types)\n * @see https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html#_mesh_primitive_mode\n */\nexport enum GLTFPrimitiveModeString {\n POINTS = 'POINTS',\n LINES = 'LINES',\n LINE_LOOP = 'LINE_LOOP',\n LINE_STRIP = 'LINE_STRIP',\n TRIANGLES = 'TRIANGLES',\n TRIANGLE_STRIP = 'TRIANGLE_STRIP',\n TRIANGLE_FAN = 'TRIANGLE_FAN'\n}\n\n/** Preprocessed data gathered from child tiles binary content */\nexport type PreprocessData = {\n /** Mesh topology types used in gltf primitives of the tileset */\n meshTopologyTypes: Set<GLTFPrimitiveModeString>;\n /**\n * Feature metadata classes found in glTF extensions\n * The tileset might contain multiple metadata classes provided by EXT_feature_metadata and EXT_structural_metadata extensions.\n * Every class is a set of properties. But I3S can consume only one set of properties.\n * On the pre-process we collect all classes from the tileset in order to show the prompt to select one class for conversion to I3S.\n */\n metadataClasses: Set<string>;\n};\n\n/** Texture image properties required for conversion */\nexport type TextureImageProperties = {\n /** Array with image data */\n data: Uint8Array;\n /** Is the texture compressed */\n compressed?: boolean;\n /** Height of the texture's image */\n height?: number;\n /** Width of the texture's image */\n width?: number;\n /** Number of components (3 for RGB, 4 for RGBA) */\n components?: number;\n /** Mime type of the texture's image */\n mimeType?: string;\n};\n\n/** glTF attributes data, prepared for conversion */\nexport type GLTFAttributesData = {\n /** glTF PBR materials (only id is required) */\n gltfMaterials?: {id: string}[];\n /** glTF geometry nodes */\n nodes: GLTFNodePostprocessed[];\n /** glTF texture images (set to null for compressed textures) */\n images: (null | TextureImageProperties)[];\n /** Source tile origin coordinates in cartographic coordinate system */\n cartographicOrigin: Vector3;\n /** Model matrix to convert coordinate system of POSITION and NORMAL attributes from METER_OFFSETS to CARTESIAN */\n cartesianModelMatrix: Matrix4;\n};\n"],"mappings":"AA+KA,WAAYA,uBAAuB,aAAvBA,uBAAuB;EAAvBA,uBAAuB;EAAvBA,uBAAuB;EAAvBA,uBAAuB;EAAvBA,uBAAuB;EAAvBA,uBAAuB;EAAvBA,uBAAuB;EAAvBA,uBAAuB;EAAA,OAAvBA,uBAAuB;AAAA"}
|
|
1
|
+
{"version":3,"file":"types.js","names":["GLTFPrimitiveModeString","AttributeType","OBJECT_ID_TYPE","STRING_TYPE","DOUBLE_TYPE","SHORT_INT_TYPE"],"sources":["../../src/i3s-converter/types.ts"],"sourcesContent":["import {GLTFImagePostprocessed, GLTFNodePostprocessed} from '@loaders.gl/gltf';\nimport {\n BoundingVolumes,\n I3SMaterialDefinition,\n MaterialDefinitionInfo,\n TextureDefinitionInfo\n} from '@loaders.gl/i3s';\nimport {Matrix4, Vector3} from '@math.gl/core';\n\n/** Converted resources for specific node */\nexport type I3SConvertedResources = {\n /**\n * Node id\n */\n nodeId?: number;\n /** Non-compressed geometry buffer that have structure met\n * https://github.com/Esri/i3s-spec/blob/master/docs/1.8/defaultGeometrySchema.cmn.md\n * (Geometry buffer)\n */\n geometry: ArrayBuffer | null;\n /**\n * Draco compressed geometry\n */\n compressedGeometry?: Promise<ArrayBuffer> | null;\n /**\n * Texture image content\n */\n texture: any | null;\n /**\n * If the resource has uvRegions geometry attribute\n */\n hasUvRegions: boolean;\n /**\n * Shared resources built from GLTF material\n */\n sharedResources: SharedResourcesArrays | null;\n /**\n * Material definition of the node\n */\n meshMaterial?: I3SMaterialDefinition | null;\n /**\n * Number of vertices in the node\n */\n vertexCount: number | null;\n /**\n * Feature attributes contents\n */\n attributes: ArrayBuffer[] | null;\n /**\n * Number of features in the node\n */\n featureCount: number | null;\n /**\n * MBS and/or OBB bounding volumes of the node\n */\n boundingVolumes: BoundingVolumes | null;\n};\n\n/**\n * Geometry and feature attributes converted from GLTF primitives\n */\nexport type ConvertedAttributes = {\n /** POSITION attribute value */\n positions: Float32Array;\n /** NORMAL attribute value */\n normals: Float32Array;\n /** TEXCOORD_0 attribute value */\n texCoords: Float32Array;\n /** COLOR_0 attribute value */\n colors: Uint8Array;\n /** uvRegion attribute for a texture atlas */\n uvRegions: Uint16Array;\n /** Feature indices grouped by ...\n * converted from \"batch ids\" of GLTF\n */\n featureIndicesGroups?: number[][];\n /** Feature indices converted from \"batch ids\" */\n featureIndices: number[];\n /**\n * MBS and/or OBB bounding volumes of the node\n */\n boundingVolumes: null | BoundingVolumes;\n /** merged materials data */\n mergedMaterials: MergedMaterial[];\n};\n\n/** Postprocessed geometry and feature attributes\n * https://github.com/Esri/i3s-spec/blob/master/docs/1.8/defaultGeometrySchema.cmn.md\n */\nexport type GeometryAttributes = {\n /** POSITION attribute value */\n positions: Float32Array;\n /** NORMAL attribute value */\n normals: Float32Array;\n /** TEXCOORD_0 attribute value */\n texCoords: Float32Array;\n /** COLOR_0 attribute value */\n colors: Uint8Array;\n /** uvRegion attribute for a texture atlas */\n uvRegions: Uint16Array;\n /** faceRanges attribute value */\n faceRange: Uint32Array;\n /** feature Ids attribute value */\n featureIds: number[];\n /** number of features in the node */\n featureCount: number;\n};\n\n/** Geometry attributes applicable for reordering by featureId */\nexport type GroupedAttributes = {\n /** POSITION attribute value */\n positions: Float32Array;\n /** NORMAL attribute value */\n normals: Float32Array;\n /** COLOR_0 attribute value */\n colors: Uint8Array;\n /** uvRegion attribute for a texture atlas */\n uvRegions: Uint16Array;\n /** TEXCOORD_0 attribute value */\n texCoords: Float32Array;\n};\n\n/** Geometry attributes specific for the particular feature */\nexport type GroupedByFeatureIdAttributes = GroupedAttributes & {\n /** Feature Id */\n featureId: number;\n};\n\n/** Shared resources made from GLTF material */\nexport type SharedResourcesArrays = {\n /** material definitions list https://github.com/Esri/i3s-spec/blob/master/docs/1.8/materialDefinitionInfo.cmn.md */\n materialDefinitionInfos?: MaterialDefinitionInfo[];\n /** texture definitions list https://github.com/Esri/i3s-spec/blob/master/docs/1.8/textureDefinitionInfo.cmn.md*/\n textureDefinitionInfos?: TextureDefinitionInfo[];\n /** node id to make unique SharedResource ids */\n nodePath?: string;\n};\n\n/** I3S material definition and texture content taken from GLTF material */\nexport type I3SMaterialWithTexture = {\n /** Material definition https://github.com/Esri/i3s-spec/blob/master/docs/1.8/materialDefinitions.cmn.md */\n material: I3SMaterialDefinition;\n /** Texture content (image) */\n texture?: GLTFImagePostprocessed;\n /** Metadata of all merged materials */\n mergedMaterials: MergedMaterial[];\n};\n\n/** Metadata of some original texture */\nexport type MergedMaterial = {\n /** Gltf material Id */\n originalMaterialId: string;\n /** Original texture size */\n textureSize?: {\n width: number;\n height: number;\n };\n /** Uint16Array of 4 elements https://github.com/Esri/i3s-spec/blob/master/docs/1.7/geometryUVRegion.cmn.md */\n uvRegion?: Uint16Array;\n};\n\nexport type TypedArrayConstructor =\n | Uint8ArrayConstructor\n | Int8ArrayConstructor\n | Uint16ArrayConstructor\n | Int16ArrayConstructor\n | Int32ArrayConstructor\n | Uint32ArrayConstructor\n | Float32ArrayConstructor\n | Float64ArrayConstructor;\n\n/**\n * glTF primitive modes (mesh topology types)\n * @see https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html#_mesh_primitive_mode\n */\nexport enum GLTFPrimitiveModeString {\n POINTS = 'POINTS',\n LINES = 'LINES',\n LINE_LOOP = 'LINE_LOOP',\n LINE_STRIP = 'LINE_STRIP',\n TRIANGLES = 'TRIANGLES',\n TRIANGLE_STRIP = 'TRIANGLE_STRIP',\n TRIANGLE_FAN = 'TRIANGLE_FAN'\n}\n\n/** Preprocessed data gathered from child tiles binary content */\nexport type PreprocessData = {\n /** Mesh topology types used in gltf primitives of the tileset */\n meshTopologyTypes: Set<GLTFPrimitiveModeString>;\n /**\n * Feature metadata classes found in glTF extensions\n * The tileset might contain multiple metadata classes provided by EXT_feature_metadata and EXT_structural_metadata extensions.\n * Every class is a set of properties. But I3S can consume only one set of properties.\n * On the pre-process we collect all classes from the tileset in order to show the prompt to select one class for conversion to I3S.\n */\n metadataClasses: Set<string>;\n};\n\n/** Texture image properties required for conversion */\nexport type TextureImageProperties = {\n /** Array with image data */\n data: Uint8Array;\n /** Is the texture compressed */\n compressed?: boolean;\n /** Height of the texture's image */\n height?: number;\n /** Width of the texture's image */\n width?: number;\n /** Number of components (3 for RGB, 4 for RGBA) */\n components?: number;\n /** Mime type of the texture's image */\n mimeType?: string;\n};\n\n/** glTF attributes data, prepared for conversion */\nexport type GLTFAttributesData = {\n /** glTF PBR materials (only id is required) */\n gltfMaterials?: {id: string}[];\n /** glTF geometry nodes */\n nodes: GLTFNodePostprocessed[];\n /** glTF texture images (set to null for compressed textures) */\n images: (null | TextureImageProperties)[];\n /** Source tile origin coordinates in cartographic coordinate system */\n cartographicOrigin: Vector3;\n /** Model matrix to convert coordinate system of POSITION and NORMAL attributes from METER_OFFSETS to CARTESIAN */\n cartesianModelMatrix: Matrix4;\n};\n\n/**\n * I3S' types difine the following:\n * type Attribute = 'OBJECTID' | 'string' | 'double' | 'Int32' | string;\n * The AttributeType contains the string values of the Attribute type.\n */\nexport const AttributeType = {\n /** Type of attribute that is linked with feature ids */\n OBJECT_ID_TYPE: 'OBJECTID',\n /** String data type name for feature attributes */\n STRING_TYPE: 'string',\n /** Double data type name for feature attributes */\n DOUBLE_TYPE: 'double',\n /** Integer data type name for feature attributes */\n SHORT_INT_TYPE: 'Int32'\n} as const;\n"],"mappings":"AA+KA,WAAYA,uBAAuB,aAAvBA,uBAAuB;EAAvBA,uBAAuB;EAAvBA,uBAAuB;EAAvBA,uBAAuB;EAAvBA,uBAAuB;EAAvBA,uBAAuB;EAAvBA,uBAAuB;EAAvBA,uBAAuB;EAAA,OAAvBA,uBAAuB;AAAA;AA0DnC,OAAO,MAAMC,aAAa,GAAG;EAE3BC,cAAc,EAAE,UAAU;EAE1BC,WAAW,EAAE,QAAQ;EAErBC,WAAW,EAAE,QAAQ;EAErBC,cAAc,EAAE;AAClB,CAAU"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../src/i3s-server/app.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../src/i3s-server/app.ts"],"names":[],"mappings":"AAiBA,eAAO,MAAM,GAAG,6CAAY,CAAC"}
|
package/dist/i3s-server/app.js
CHANGED
|
@@ -3,10 +3,10 @@ import path from 'path';
|
|
|
3
3
|
import logger from 'morgan';
|
|
4
4
|
import cors from 'cors';
|
|
5
5
|
import { loadArchive } from "./controllers/slpk-controller.js";
|
|
6
|
+
import { router as indexRouter } from "./routes/index.js";
|
|
7
|
+
import { sceneServerRouter, router } from "./routes/slpk-router.js";
|
|
6
8
|
const I3S_LAYER_PATH = process.env.I3sLayerPath || '';
|
|
7
9
|
const FULL_LAYER_PATH = path.join(process.cwd(), I3S_LAYER_PATH);
|
|
8
|
-
loadArchive(FULL_LAYER_PATH);
|
|
9
|
-
const indexRouter = require('./routes/index');
|
|
10
10
|
export const app = express();
|
|
11
11
|
app.use(logger('dev'));
|
|
12
12
|
app.use(express.json());
|
|
@@ -16,10 +16,7 @@ app.use(express.urlencoded({
|
|
|
16
16
|
app.use(express.static(path.join(__dirname, 'public')));
|
|
17
17
|
app.use(cors());
|
|
18
18
|
if (/\.slpk$/.test(I3S_LAYER_PATH)) {
|
|
19
|
-
|
|
20
|
-
sceneServerRouter,
|
|
21
|
-
router
|
|
22
|
-
} = require('./routes/slpk-router');
|
|
19
|
+
loadArchive(FULL_LAYER_PATH);
|
|
23
20
|
app.use('/SceneServer/layers/0', router);
|
|
24
21
|
app.use('/SceneServer', sceneServerRouter);
|
|
25
22
|
} else {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app.js","names":["express","path","logger","cors","loadArchive","I3S_LAYER_PATH","process","env","I3sLayerPath","FULL_LAYER_PATH","join","cwd","
|
|
1
|
+
{"version":3,"file":"app.js","names":["express","path","logger","cors","loadArchive","router","indexRouter","sceneServerRouter","I3S_LAYER_PATH","process","env","I3sLayerPath","FULL_LAYER_PATH","join","cwd","app","use","json","urlencoded","extended","static","__dirname","test"],"sources":["../../src/i3s-server/app.ts"],"sourcesContent":["import express from 'express';\nimport path from 'path';\nimport logger from 'morgan';\nimport cors from 'cors';\n// For local debug\n// import {fileURLToPath} from 'url';\nimport {loadArchive} from './controllers/slpk-controller';\nimport {router as indexRouter} from './routes';\nimport {sceneServerRouter, router} from './routes/slpk-router';\n\n// For local debug\n// const __filename = fileURLToPath(import.meta.url);\n// const __dirname = path.dirname(__filename);\n\nconst I3S_LAYER_PATH = process.env.I3sLayerPath || ''; // eslint-disable-line no-process-env, no-undef\nconst FULL_LAYER_PATH = path.join(process.cwd(), I3S_LAYER_PATH); // eslint-disable-line no-undef\n\nexport const app = express();\n\napp.use(logger('dev'));\napp.use(express.json());\napp.use(express.urlencoded({extended: false}));\napp.use(express.static(path.join(__dirname, 'public')));\napp.use(cors());\n\nif (/\\.slpk$/.test(I3S_LAYER_PATH)) {\n loadArchive(FULL_LAYER_PATH);\n app.use('/SceneServer/layers/0', router);\n app.use('/SceneServer', sceneServerRouter);\n} else {\n app.use('/', indexRouter);\n}\n"],"mappings":"AAAA,OAAOA,OAAO,MAAM,SAAS;AAC7B,OAAOC,IAAI,MAAM,MAAM;AACvB,OAAOC,MAAM,MAAM,QAAQ;AAC3B,OAAOC,IAAI,MAAM,MAAM;AAAC,SAGhBC,WAAW;AAAA,SACXC,MAAM,IAAIC,WAAW;AAAA,SACrBC,iBAAiB,EAAEF,MAAM;AAMjC,MAAMG,cAAc,GAAGC,OAAO,CAACC,GAAG,CAACC,YAAY,IAAI,EAAE;AACrD,MAAMC,eAAe,GAAGX,IAAI,CAACY,IAAI,CAACJ,OAAO,CAACK,GAAG,CAAC,CAAC,EAAEN,cAAc,CAAC;AAEhE,OAAO,MAAMO,GAAG,GAAGf,OAAO,CAAC,CAAC;AAE5Be,GAAG,CAACC,GAAG,CAACd,MAAM,CAAC,KAAK,CAAC,CAAC;AACtBa,GAAG,CAACC,GAAG,CAAChB,OAAO,CAACiB,IAAI,CAAC,CAAC,CAAC;AACvBF,GAAG,CAACC,GAAG,CAAChB,OAAO,CAACkB,UAAU,CAAC;EAACC,QAAQ,EAAE;AAAK,CAAC,CAAC,CAAC;AAC9CJ,GAAG,CAACC,GAAG,CAAChB,OAAO,CAACoB,MAAM,CAACnB,IAAI,CAACY,IAAI,CAACQ,SAAS,EAAE,QAAQ,CAAC,CAAC,CAAC;AACvDN,GAAG,CAACC,GAAG,CAACb,IAAI,CAAC,CAAC,CAAC;AAEf,IAAI,SAAS,CAACmB,IAAI,CAACd,cAAc,CAAC,EAAE;EAClCJ,WAAW,CAACQ,eAAe,CAAC;EAC5BG,GAAG,CAACC,GAAG,CAAC,uBAAuB,EAAEX,MAAM,CAAC;EACxCU,GAAG,CAACC,GAAG,CAAC,cAAc,EAAET,iBAAiB,CAAC;AAC5C,CAAC,MAAM;EACLQ,GAAG,CAACC,GAAG,CAAC,GAAG,EAAEV,WAAW,CAAC;AAC3B"}
|