@itwin/map-layers-formats 4.0.0-dev.8 → 4.0.0-dev.81
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/.rush/temp/operation/build/all.log +3 -0
- package/.rush/temp/operation/build/state.json +3 -0
- package/.rush/temp/operation/cover/all.log +98 -0
- package/.rush/temp/operation/cover/state.json +1 -1
- package/.rush/temp/operation/docs/all.log +30 -0
- package/.rush/temp/operation/docs/state.json +1 -1
- package/.rush/temp/{package-deps_build_ci.json → package-deps_build.json} +11 -11
- package/.rush/temp/package-deps_cover.json +10 -10
- package/.rush/temp/package-deps_docs.json +10 -10
- package/.rush/temp/shrinkwrap-deps.json +190 -44
- package/CHANGELOG.json +57 -0
- package/CHANGELOG.md +44 -1
- package/config/rush-project.json +1 -2
- package/lib/cjs/ArcGisFeature/ArcGisFeatureFormat.d.ts +8 -8
- package/lib/cjs/ArcGisFeature/ArcGisFeatureFormat.js +14 -14
- package/lib/cjs/ArcGisFeature/ArcGisFeatureFormat.js.map +1 -1
- package/lib/cjs/ArcGisFeature/ArcGisFeatureJSON.d.ts +14 -14
- package/lib/cjs/ArcGisFeature/ArcGisFeatureJSON.js +132 -134
- package/lib/cjs/ArcGisFeature/ArcGisFeatureJSON.js.map +1 -1
- package/lib/cjs/ArcGisFeature/ArcGisFeaturePBF.d.ts +14 -14
- package/lib/cjs/ArcGisFeature/ArcGisFeaturePBF.js +200 -202
- package/lib/cjs/ArcGisFeature/ArcGisFeaturePBF.js.map +1 -1
- package/lib/cjs/ArcGisFeature/ArcGisFeatureProvider.d.ts +44 -44
- package/lib/cjs/ArcGisFeature/ArcGisFeatureProvider.js +421 -422
- package/lib/cjs/ArcGisFeature/ArcGisFeatureProvider.js.map +1 -1
- package/lib/cjs/ArcGisFeature/ArcGisFeatureQuery.d.ts +92 -92
- package/lib/cjs/ArcGisFeature/ArcGisFeatureQuery.d.ts.map +1 -1
- package/lib/cjs/ArcGisFeature/ArcGisFeatureQuery.js +82 -82
- package/lib/cjs/ArcGisFeature/ArcGisFeatureReader.d.ts +17 -17
- package/lib/cjs/ArcGisFeature/ArcGisFeatureReader.js +33 -33
- package/lib/cjs/ArcGisFeature/ArcGisFeatureRenderer.d.ts +32 -32
- package/lib/cjs/ArcGisFeature/ArcGisFeatureRenderer.js +142 -142
- package/lib/cjs/ArcGisFeature/ArcGisFeatureResponse.d.ts +16 -16
- package/lib/cjs/ArcGisFeature/ArcGisFeatureResponse.d.ts.map +1 -1
- package/lib/cjs/ArcGisFeature/ArcGisFeatureResponse.js +42 -43
- package/lib/cjs/ArcGisFeature/ArcGisFeatureResponse.js.map +1 -1
- package/lib/cjs/ArcGisFeature/ArcGisSymbologyRenderer.d.ts +85 -85
- package/lib/cjs/ArcGisFeature/ArcGisSymbologyRenderer.d.ts.map +1 -1
- package/lib/cjs/ArcGisFeature/ArcGisSymbologyRenderer.js +189 -192
- package/lib/cjs/ArcGisFeature/ArcGisSymbologyRenderer.js.map +1 -1
- package/lib/cjs/ArcGisFeature/esriPBuffer.gen.d.ts +1063 -1063
- package/lib/cjs/ArcGisFeature/esriPBuffer.gen.d.ts.map +1 -1
- package/lib/cjs/ArcGisFeature/esriPBuffer.gen.js +2267 -2270
- package/lib/cjs/ArcGisFeature/esriPBuffer.gen.js.map +1 -1
- package/lib/cjs/map-layers-formats.d.ts +8 -8
- package/lib/cjs/map-layers-formats.js +28 -24
- package/lib/cjs/map-layers-formats.js.map +1 -1
- package/lib/cjs/mapLayersFormats.d.ts +10 -10
- package/lib/cjs/mapLayersFormats.js +28 -28
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureFeatureFormats.test.d.ts +1 -1
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureFeatureFormats.test.js +34 -34
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureJSON.test.d.ts +1 -1
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureJSON.test.js +161 -161
- package/lib/cjs/test/ArcGisFeature/ArcGisFeaturePBF.test.d.ts +1 -1
- package/lib/cjs/test/ArcGisFeature/ArcGisFeaturePBF.test.js +167 -167
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureProvider.test.d.ts +1 -1
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureProvider.test.js +679 -680
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureProvider.test.js.map +1 -1
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureQuery.test.d.ts +1 -1
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureQuery.test.js +103 -103
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureRenderer.test.d.ts +1 -1
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureRenderer.test.js +214 -214
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureResponse.test.d.ts +1 -1
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureResponse.test.js +94 -94
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureResponse.test.js.map +1 -1
- package/lib/cjs/test/ArcGisFeature/ArcGisSymbologyRenderer.test.d.ts +1 -1
- package/lib/cjs/test/ArcGisFeature/ArcGisSymbologyRenderer.test.js +59 -59
- package/lib/cjs/test/ArcGisFeature/Mocks.d.ts +6 -6
- package/lib/cjs/test/ArcGisFeature/Mocks.js +18 -18
- package/lib/cjs/test/ArcGisFeature/NewYorkDataset.d.ts +55 -55
- package/lib/cjs/test/ArcGisFeature/NewYorkDataset.d.ts.map +1 -1
- package/lib/cjs/test/ArcGisFeature/NewYorkDataset.js +419 -419
- package/lib/cjs/test/ArcGisFeature/NewYorkDataset.js.map +1 -1
- package/lib/cjs/test/ArcGisFeature/PhillyLandmarksDataset.d.ts +1042 -1042
- package/lib/cjs/test/ArcGisFeature/PhillyLandmarksDataset.d.ts.map +1 -1
- package/lib/cjs/test/ArcGisFeature/PhillyLandmarksDataset.js +426 -426
- package/lib/cjs/test/ArcGisFeature/PhillyLandmarksDataset.js.map +1 -1
- package/lib/cjs/test/coverage/.nyc_output/cd866071-e986-4027-89f6-9a70b6e25ed3.json +1 -0
- package/lib/cjs/test/coverage/.nyc_output/processinfo/4c93adb3-7e95-4a63-9814-a25d79ab4680.json +1 -0
- package/lib/cjs/test/coverage/.nyc_output/processinfo/cd866071-e986-4027-89f6-9a70b6e25ed3.json +1 -0
- package/lib/cjs/test/coverage/.nyc_output/processinfo/index.json +1 -1
- package/lib/cjs/test/coverage/cobertura-coverage.xml +72 -72
- package/lib/cjs/test/coverage/lcov-report/index.html +5 -5
- package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureFormat.ts.html +1 -1
- package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureJSON.ts.html +10 -10
- package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeaturePBF.ts.html +7 -7
- package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureProvider.ts.html +10 -10
- package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureQuery.ts.html +1 -1
- package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureReader.ts.html +1 -1
- package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureRenderer.ts.html +1 -1
- package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureResponse.ts.html +4 -4
- package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisSymbologyRenderer.ts.html +8 -8
- package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/index.html +13 -13
- package/lib/cjs/test/coverage/lcov-report/src/index.html +1 -1
- package/lib/cjs/test/coverage/lcov-report/src/map-layers-formats.ts.html +1 -1
- package/lib/cjs/test/coverage/lcov-report/src/mapLayersFormats.ts.html +1 -1
- package/lib/cjs/test/coverage/lcov.info +355 -531
- package/lib/cjs/tsconfig.tsbuildinfo +1 -1
- package/lib/esm/ArcGisFeature/ArcGisFeatureFormat.d.ts +8 -8
- package/lib/esm/ArcGisFeature/ArcGisFeatureFormat.js +11 -10
- package/lib/esm/ArcGisFeature/ArcGisFeatureFormat.js.map +1 -1
- package/lib/esm/ArcGisFeature/ArcGisFeatureJSON.d.ts +14 -14
- package/lib/esm/ArcGisFeature/ArcGisFeatureJSON.js +128 -130
- package/lib/esm/ArcGisFeature/ArcGisFeatureJSON.js.map +1 -1
- package/lib/esm/ArcGisFeature/ArcGisFeaturePBF.d.ts +14 -14
- package/lib/esm/ArcGisFeature/ArcGisFeaturePBF.js +196 -198
- package/lib/esm/ArcGisFeature/ArcGisFeaturePBF.js.map +1 -1
- package/lib/esm/ArcGisFeature/ArcGisFeatureProvider.d.ts +44 -44
- package/lib/esm/ArcGisFeature/ArcGisFeatureProvider.js +418 -418
- package/lib/esm/ArcGisFeature/ArcGisFeatureProvider.js.map +1 -1
- package/lib/esm/ArcGisFeature/ArcGisFeatureQuery.d.ts +92 -92
- package/lib/esm/ArcGisFeature/ArcGisFeatureQuery.d.ts.map +1 -1
- package/lib/esm/ArcGisFeature/ArcGisFeatureQuery.js +78 -78
- package/lib/esm/ArcGisFeature/ArcGisFeatureReader.d.ts +17 -17
- package/lib/esm/ArcGisFeature/ArcGisFeatureReader.js +29 -29
- package/lib/esm/ArcGisFeature/ArcGisFeatureRenderer.d.ts +32 -32
- package/lib/esm/ArcGisFeature/ArcGisFeatureRenderer.js +138 -138
- package/lib/esm/ArcGisFeature/ArcGisFeatureResponse.d.ts +16 -16
- package/lib/esm/ArcGisFeature/ArcGisFeatureResponse.d.ts.map +1 -1
- package/lib/esm/ArcGisFeature/ArcGisFeatureResponse.js +38 -39
- package/lib/esm/ArcGisFeature/ArcGisFeatureResponse.js.map +1 -1
- package/lib/esm/ArcGisFeature/ArcGisSymbologyRenderer.d.ts +85 -85
- package/lib/esm/ArcGisFeature/ArcGisSymbologyRenderer.d.ts.map +1 -1
- package/lib/esm/ArcGisFeature/ArcGisSymbologyRenderer.js +183 -185
- package/lib/esm/ArcGisFeature/ArcGisSymbologyRenderer.js.map +1 -1
- package/lib/esm/ArcGisFeature/esriPBuffer.gen.d.ts +1063 -1063
- package/lib/esm/ArcGisFeature/esriPBuffer.gen.d.ts.map +1 -1
- package/lib/esm/ArcGisFeature/esriPBuffer.gen.js +2264 -2267
- package/lib/esm/ArcGisFeature/esriPBuffer.gen.js.map +1 -1
- package/lib/esm/map-layers-formats.d.ts +8 -8
- package/lib/esm/map-layers-formats.js +12 -12
- package/lib/esm/mapLayersFormats.d.ts +10 -10
- package/lib/esm/mapLayersFormats.js +24 -24
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureFeatureFormats.test.d.ts +1 -1
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureFeatureFormats.test.js +32 -32
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureJSON.test.d.ts +1 -1
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureJSON.test.js +159 -159
- package/lib/esm/test/ArcGisFeature/ArcGisFeaturePBF.test.d.ts +1 -1
- package/lib/esm/test/ArcGisFeature/ArcGisFeaturePBF.test.js +165 -165
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureProvider.test.d.ts +1 -1
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureProvider.test.js +677 -678
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureProvider.test.js.map +1 -1
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureQuery.test.d.ts +1 -1
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureQuery.test.js +101 -101
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureRenderer.test.d.ts +1 -1
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureRenderer.test.js +212 -212
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureResponse.test.d.ts +1 -1
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureResponse.test.js +92 -92
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureResponse.test.js.map +1 -1
- package/lib/esm/test/ArcGisFeature/ArcGisSymbologyRenderer.test.d.ts +1 -1
- package/lib/esm/test/ArcGisFeature/ArcGisSymbologyRenderer.test.js +57 -57
- package/lib/esm/test/ArcGisFeature/Mocks.d.ts +6 -6
- package/lib/esm/test/ArcGisFeature/Mocks.js +15 -15
- package/lib/esm/test/ArcGisFeature/NewYorkDataset.d.ts +55 -55
- package/lib/esm/test/ArcGisFeature/NewYorkDataset.d.ts.map +1 -1
- package/lib/esm/test/ArcGisFeature/NewYorkDataset.js +416 -415
- package/lib/esm/test/ArcGisFeature/NewYorkDataset.js.map +1 -1
- package/lib/esm/test/ArcGisFeature/PhillyLandmarksDataset.d.ts +1042 -1042
- package/lib/esm/test/ArcGisFeature/PhillyLandmarksDataset.d.ts.map +1 -1
- package/lib/esm/test/ArcGisFeature/PhillyLandmarksDataset.js +423 -422
- package/lib/esm/test/ArcGisFeature/PhillyLandmarksDataset.js.map +1 -1
- package/lib/esm/tsconfig.tsbuildinfo +1 -1
- package/lib/test/junit_results.xml +44 -44
- package/map-layers-formats.build.log +2 -2
- package/package.json +17 -17
- package/src/ArcGisFeature/esriPBuffer.gen.ts +1 -4
- package/src/test/ArcGisFeature/ArcGisFeatureProvider.test.ts +21 -21
- package/src/test/ArcGisFeature/NewYorkDataset.ts +187 -187
- package/src/test/ArcGisFeature/PhillyLandmarksDataset.ts +4 -4
- package/tsconfig.json +1 -2
- package/.rush/temp/operation/build_ci/state.json +0 -3
- package/lib/cjs/test/coverage/.nyc_output/bb9e12be-ea3c-4cee-99d0-c7a34bd2c47a.json +0 -1
- package/lib/cjs/test/coverage/.nyc_output/processinfo/5901bdfe-760d-4ca3-9674-876be7ed11b1.json +0 -1
- package/lib/cjs/test/coverage/.nyc_output/processinfo/bb9e12be-ea3c-4cee-99d0-c7a34bd2c47a.json +0 -1
- /package/lib/cjs/test/coverage/.nyc_output/{5901bdfe-760d-4ca3-9674-876be7ed11b1.json → 4c93adb3-7e95-4a63-9814-a25d79ab4680.json} +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export * from "./mapLayersFormats";
|
|
2
|
-
export * from "./ArcGisFeature/ArcGisFeatureProvider";
|
|
3
|
-
/** @docs-package-description
|
|
4
|
-
* This package provides support for additional map layer formats that are not included in the @itwin/core-frontend package.
|
|
5
|
-
*/
|
|
6
|
-
/** @docs-group-description MapLayersFormats
|
|
7
|
-
* APIs for working with the map layer formats provided by this package.
|
|
8
|
-
*/
|
|
1
|
+
export * from "./mapLayersFormats";
|
|
2
|
+
export * from "./ArcGisFeature/ArcGisFeatureProvider";
|
|
3
|
+
/** @docs-package-description
|
|
4
|
+
* This package provides support for additional map layer formats that are not included in the @itwin/core-frontend package.
|
|
5
|
+
*/
|
|
6
|
+
/** @docs-group-description MapLayersFormats
|
|
7
|
+
* APIs for working with the map layer formats provided by this package.
|
|
8
|
+
*/
|
|
9
9
|
//# sourceMappingURL=map-layers-formats.d.ts.map
|
|
@@ -1,25 +1,29 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*---------------------------------------------------------------------------------------------
|
|
3
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
|
-
*--------------------------------------------------------------------------------------------*/
|
|
6
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7
|
-
if (k2 === undefined) k2 = k;
|
|
8
|
-
Object.
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
__exportStar(
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
/*---------------------------------------------------------------------------------------------
|
|
3
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
|
+
*--------------------------------------------------------------------------------------------*/
|
|
6
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7
|
+
if (k2 === undefined) k2 = k;
|
|
8
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
9
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
10
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
11
|
+
}
|
|
12
|
+
Object.defineProperty(o, k2, desc);
|
|
13
|
+
}) : (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
o[k2] = m[k];
|
|
16
|
+
}));
|
|
17
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
18
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
19
|
+
};
|
|
20
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
+
__exportStar(require("./mapLayersFormats"), exports);
|
|
22
|
+
__exportStar(require("./ArcGisFeature/ArcGisFeatureProvider"), exports);
|
|
23
|
+
/** @docs-package-description
|
|
24
|
+
* This package provides support for additional map layer formats that are not included in the @itwin/core-frontend package.
|
|
25
|
+
*/
|
|
26
|
+
/** @docs-group-description MapLayersFormats
|
|
27
|
+
* APIs for working with the map layer formats provided by this package.
|
|
28
|
+
*/
|
|
25
29
|
//# sourceMappingURL=map-layers-formats.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"map-layers-formats.js","sourceRoot":"","sources":["../../src/map-layers-formats.ts"],"names":[],"mappings":";AAAA;;;+FAG+F
|
|
1
|
+
{"version":3,"file":"map-layers-formats.js","sourceRoot":"","sources":["../../src/map-layers-formats.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;;;;;;;;;;;;;;AAE/F,qDAAmC;AACnC,wEAAsD;AAEtD;;GAEG;AAEH;;GAEG","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\nexport * from \"./mapLayersFormats\";\r\nexport * from \"./ArcGisFeature/ArcGisFeatureProvider\";\r\n\r\n/** @docs-package-description\r\n * This package provides support for additional map layer formats that are not included in the @itwin/core-frontend package.\r\n */\r\n\r\n/** @docs-group-description MapLayersFormats\r\n * APIs for working with the map layer formats provided by this package.\r\n */\r\n"]}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
/** The primary API for the `@itwin/map-layers-formats` package. It allows the package's features to be [[initialize]]d.
|
|
2
|
-
* @beta
|
|
3
|
-
*/
|
|
4
|
-
export declare class MapLayersFormats {
|
|
5
|
-
/** Registers the [MapLayerFormat]($frontend)s provided by this package for use with [IModelApp]($frontend).
|
|
6
|
-
* Typically, an application will call `MapLayersFormats.initialize` immediately after [IModelApp.startup]($frontend).
|
|
7
|
-
* This function has no effect if called **before** [IModelApp.startup]($frontend) or **after** [IModelApp.shutdown]($frontend).
|
|
8
|
-
*/
|
|
9
|
-
static initialize(): void;
|
|
10
|
-
}
|
|
1
|
+
/** The primary API for the `@itwin/map-layers-formats` package. It allows the package's features to be [[initialize]]d.
|
|
2
|
+
* @beta
|
|
3
|
+
*/
|
|
4
|
+
export declare class MapLayersFormats {
|
|
5
|
+
/** Registers the [MapLayerFormat]($frontend)s provided by this package for use with [IModelApp]($frontend).
|
|
6
|
+
* Typically, an application will call `MapLayersFormats.initialize` immediately after [IModelApp.startup]($frontend).
|
|
7
|
+
* This function has no effect if called **before** [IModelApp.startup]($frontend) or **after** [IModelApp.shutdown]($frontend).
|
|
8
|
+
*/
|
|
9
|
+
static initialize(): void;
|
|
10
|
+
}
|
|
11
11
|
//# sourceMappingURL=mapLayersFormats.d.ts.map
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*---------------------------------------------------------------------------------------------
|
|
3
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
|
-
*--------------------------------------------------------------------------------------------*/
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.MapLayersFormats = void 0;
|
|
8
|
-
/** @packageDocumentation
|
|
9
|
-
* @module MapLayersFormats
|
|
10
|
-
*/
|
|
11
|
-
const core_bentley_1 = require("@itwin/core-bentley");
|
|
12
|
-
const core_frontend_1 = require("@itwin/core-frontend");
|
|
13
|
-
const ArcGisFeatureFormat_1 = require("./ArcGisFeature/ArcGisFeatureFormat");
|
|
14
|
-
/** The primary API for the `@itwin/map-layers-formats` package. It allows the package's features to be [[initialize]]d.
|
|
15
|
-
* @beta
|
|
16
|
-
*/
|
|
17
|
-
class MapLayersFormats {
|
|
18
|
-
/** Registers the [MapLayerFormat]($frontend)s provided by this package for use with [IModelApp]($frontend).
|
|
19
|
-
* Typically, an application will call `MapLayersFormats.initialize` immediately after [IModelApp.startup]($frontend).
|
|
20
|
-
* This function has no effect if called **before** [IModelApp.startup]($frontend) or **after** [IModelApp.shutdown]($frontend).
|
|
21
|
-
*/
|
|
22
|
-
static initialize() {
|
|
23
|
-
(0, core_bentley_1.assert)(core_frontend_1.IModelApp.initialized, "MapLayersFormats.initialize must be called after IModelApp.startup and before IModelApp.shutdown");
|
|
24
|
-
if (core_frontend_1.IModelApp.initialized)
|
|
25
|
-
core_frontend_1.IModelApp.mapLayerFormatRegistry.register(ArcGisFeatureFormat_1.ArcGisFeatureMapLayerFormat);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
exports.MapLayersFormats = MapLayersFormats;
|
|
1
|
+
"use strict";
|
|
2
|
+
/*---------------------------------------------------------------------------------------------
|
|
3
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
|
+
*--------------------------------------------------------------------------------------------*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.MapLayersFormats = void 0;
|
|
8
|
+
/** @packageDocumentation
|
|
9
|
+
* @module MapLayersFormats
|
|
10
|
+
*/
|
|
11
|
+
const core_bentley_1 = require("@itwin/core-bentley");
|
|
12
|
+
const core_frontend_1 = require("@itwin/core-frontend");
|
|
13
|
+
const ArcGisFeatureFormat_1 = require("./ArcGisFeature/ArcGisFeatureFormat");
|
|
14
|
+
/** The primary API for the `@itwin/map-layers-formats` package. It allows the package's features to be [[initialize]]d.
|
|
15
|
+
* @beta
|
|
16
|
+
*/
|
|
17
|
+
class MapLayersFormats {
|
|
18
|
+
/** Registers the [MapLayerFormat]($frontend)s provided by this package for use with [IModelApp]($frontend).
|
|
19
|
+
* Typically, an application will call `MapLayersFormats.initialize` immediately after [IModelApp.startup]($frontend).
|
|
20
|
+
* This function has no effect if called **before** [IModelApp.startup]($frontend) or **after** [IModelApp.shutdown]($frontend).
|
|
21
|
+
*/
|
|
22
|
+
static initialize() {
|
|
23
|
+
(0, core_bentley_1.assert)(core_frontend_1.IModelApp.initialized, "MapLayersFormats.initialize must be called after IModelApp.startup and before IModelApp.shutdown");
|
|
24
|
+
if (core_frontend_1.IModelApp.initialized)
|
|
25
|
+
core_frontend_1.IModelApp.mapLayerFormatRegistry.register(ArcGisFeatureFormat_1.ArcGisFeatureMapLayerFormat);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
exports.MapLayersFormats = MapLayersFormats;
|
|
29
29
|
//# sourceMappingURL=mapLayersFormats.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
|
2
2
|
//# sourceMappingURL=ArcGisFeatureFeatureFormats.test.d.ts.map
|
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*---------------------------------------------------------------------------------------------
|
|
3
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
|
-
*--------------------------------------------------------------------------------------------*/
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
const core_common_1 = require("@itwin/core-common");
|
|
8
|
-
const core_frontend_1 = require("@itwin/core-frontend");
|
|
9
|
-
const chai_1 = require("chai");
|
|
10
|
-
const ArcGisFeatureFormat_1 = require("../../ArcGisFeature/ArcGisFeatureFormat");
|
|
11
|
-
const Mocks_1 = require("./Mocks");
|
|
12
|
-
const sinon = require("sinon");
|
|
13
|
-
describe("ArcGisFeaturePBF", () => {
|
|
14
|
-
const sandbox = sinon.createSandbox();
|
|
15
|
-
afterEach(async () => {
|
|
16
|
-
sandbox.restore();
|
|
17
|
-
});
|
|
18
|
-
it("should createImageryProvider", async () => {
|
|
19
|
-
const provider = ArcGisFeatureFormat_1.ArcGisFeatureMapLayerFormat.createImageryProvider(core_common_1.ImageMapLayerSettings.fromJSON(Mocks_1.esriFeatureSampleSource));
|
|
20
|
-
(0, chai_1.expect)(provider).to.not.undefined;
|
|
21
|
-
});
|
|
22
|
-
it("should validateSource", async () => {
|
|
23
|
-
const fakeMethod = async (_url, _formatId, _filter, _userName, _password, _ignoreCache) => {
|
|
24
|
-
return { status: core_frontend_1.MapLayerSourceStatus.Valid };
|
|
25
|
-
};
|
|
26
|
-
const validateSourceStub = sinon.stub(core_frontend_1.ArcGisUtilities, "validateSource").callsFake(fakeMethod);
|
|
27
|
-
await ArcGisFeatureFormat_1.ArcGisFeatureMapLayerFormat.validateSource(Mocks_1.esriFeatureSampleSource.url);
|
|
28
|
-
(0, chai_1.expect)(validateSourceStub.calledOnce).to.be.true;
|
|
29
|
-
const firstCall = validateSourceStub.getCalls()[0];
|
|
30
|
-
(0, chai_1.expect)(firstCall.args[0]).to.equals(Mocks_1.esriFeatureSampleSource.url);
|
|
31
|
-
(0, chai_1.expect)(firstCall.args[1]).to.equals(ArcGisFeatureFormat_1.ArcGisFeatureMapLayerFormat.formatId);
|
|
32
|
-
(0, chai_1.expect)(firstCall.args[2]).to.eqls(["query"]);
|
|
33
|
-
});
|
|
34
|
-
});
|
|
1
|
+
"use strict";
|
|
2
|
+
/*---------------------------------------------------------------------------------------------
|
|
3
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
|
+
*--------------------------------------------------------------------------------------------*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
const core_common_1 = require("@itwin/core-common");
|
|
8
|
+
const core_frontend_1 = require("@itwin/core-frontend");
|
|
9
|
+
const chai_1 = require("chai");
|
|
10
|
+
const ArcGisFeatureFormat_1 = require("../../ArcGisFeature/ArcGisFeatureFormat");
|
|
11
|
+
const Mocks_1 = require("./Mocks");
|
|
12
|
+
const sinon = require("sinon");
|
|
13
|
+
describe("ArcGisFeaturePBF", () => {
|
|
14
|
+
const sandbox = sinon.createSandbox();
|
|
15
|
+
afterEach(async () => {
|
|
16
|
+
sandbox.restore();
|
|
17
|
+
});
|
|
18
|
+
it("should createImageryProvider", async () => {
|
|
19
|
+
const provider = ArcGisFeatureFormat_1.ArcGisFeatureMapLayerFormat.createImageryProvider(core_common_1.ImageMapLayerSettings.fromJSON(Mocks_1.esriFeatureSampleSource));
|
|
20
|
+
(0, chai_1.expect)(provider).to.not.undefined;
|
|
21
|
+
});
|
|
22
|
+
it("should validateSource", async () => {
|
|
23
|
+
const fakeMethod = async (_url, _formatId, _filter, _userName, _password, _ignoreCache) => {
|
|
24
|
+
return { status: core_frontend_1.MapLayerSourceStatus.Valid };
|
|
25
|
+
};
|
|
26
|
+
const validateSourceStub = sinon.stub(core_frontend_1.ArcGisUtilities, "validateSource").callsFake(fakeMethod);
|
|
27
|
+
await ArcGisFeatureFormat_1.ArcGisFeatureMapLayerFormat.validateSource(Mocks_1.esriFeatureSampleSource.url);
|
|
28
|
+
(0, chai_1.expect)(validateSourceStub.calledOnce).to.be.true;
|
|
29
|
+
const firstCall = validateSourceStub.getCalls()[0];
|
|
30
|
+
(0, chai_1.expect)(firstCall.args[0]).to.equals(Mocks_1.esriFeatureSampleSource.url);
|
|
31
|
+
(0, chai_1.expect)(firstCall.args[1]).to.equals(ArcGisFeatureFormat_1.ArcGisFeatureMapLayerFormat.formatId);
|
|
32
|
+
(0, chai_1.expect)(firstCall.args[2]).to.eqls(["query"]);
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
35
|
//# sourceMappingURL=ArcGisFeatureFeatureFormats.test.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
|
2
2
|
//# sourceMappingURL=ArcGisFeatureJSON.test.d.ts.map
|
|
@@ -1,162 +1,162 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*---------------------------------------------------------------------------------------------
|
|
3
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
|
-
*--------------------------------------------------------------------------------------------*/
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
const core_bentley_1 = require("@itwin/core-bentley");
|
|
8
|
-
const core_common_1 = require("@itwin/core-common");
|
|
9
|
-
const chai_1 = require("chai");
|
|
10
|
-
const sinon = require("sinon");
|
|
11
|
-
const ArcGisFeatureFormat_1 = require("../../ArcGisFeature/ArcGisFeatureFormat");
|
|
12
|
-
const ArcGisFeatureJSON_1 = require("../../ArcGisFeature/ArcGisFeatureJSON");
|
|
13
|
-
const ArcGisFeatureRenderer_1 = require("../../ArcGisFeature/ArcGisFeatureRenderer");
|
|
14
|
-
const ArcGisSymbologyRenderer_1 = require("../../ArcGisFeature/ArcGisSymbologyRenderer");
|
|
15
|
-
const Mocks_1 = require("./Mocks");
|
|
16
|
-
const PhillyLandmarksDataset_1 = require("./PhillyLandmarksDataset");
|
|
17
|
-
const esriFeatureSampleSource = { name: "dummyFeatureLayer", url: "https://dummy.com", formatId: ArcGisFeatureFormat_1.ArcGisFeatureMapLayerFormat.formatId };
|
|
18
|
-
const createFeatureJSON = () => {
|
|
19
|
-
const settings = core_common_1.ImageMapLayerSettings.fromJSON(esriFeatureSampleSource);
|
|
20
|
-
const featurePbf = new ArcGisFeatureJSON_1.ArcGisFeatureJSON(settings, { name: "SampleLayer" });
|
|
21
|
-
// Locale configuration depends on the testing machine (i.e. linux vs windows),
|
|
22
|
-
// so we need to force date display to Iso to get a consistent value.
|
|
23
|
-
// In real scenario, we still want dates to be displayed in end-user's locale.
|
|
24
|
-
featurePbf.forceDateDisplayValueToIso = true;
|
|
25
|
-
return featurePbf;
|
|
26
|
-
};
|
|
27
|
-
describe("ArcGisFeatureJSON", () => {
|
|
28
|
-
const sandbox = sinon.createSandbox();
|
|
29
|
-
afterEach(async () => {
|
|
30
|
-
sandbox.restore();
|
|
31
|
-
});
|
|
32
|
-
it("should read FeatureInfo in JSON (phillyTansportation)", async () => {
|
|
33
|
-
const featureJson = createFeatureJSON();
|
|
34
|
-
// In some cases, PBF gives more floating-point precision than JSON.
|
|
35
|
-
// Since I want to use the same output reference for both formats, I force a max precision of 8.
|
|
36
|
-
featureJson.floatPrecision = 8;
|
|
37
|
-
const results = [];
|
|
38
|
-
featureJson.readFeatureInfo({ data: PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillyTransportationGetFeatureInfoQueryJson, exceedTransferLimit: false }, results);
|
|
39
|
-
(0, chai_1.expect)(JSON.stringify(results)).equals(JSON.stringify(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillyTansportationGetFeatureInfoResultRef));
|
|
40
|
-
});
|
|
41
|
-
it("should read FeatureInfo in JSON (phillyAirport)", async () => {
|
|
42
|
-
const settings = core_common_1.ImageMapLayerSettings.fromJSON(esriFeatureSampleSource);
|
|
43
|
-
const featureJson = new ArcGisFeatureJSON_1.ArcGisFeatureJSON(settings, { name: "SampleLayer" });
|
|
44
|
-
// In some cases, PBF gives more floating-point precision than JSON.
|
|
45
|
-
// Since I want to use the same output reference for both formats, I force a max precision of 8.
|
|
46
|
-
featureJson.floatPrecision = 8;
|
|
47
|
-
const results = [];
|
|
48
|
-
const data = JSON.parse(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillyAirportGetFeatureInfoQueryJson);
|
|
49
|
-
featureJson.readFeatureInfo({ data, exceedTransferLimit: false }, results);
|
|
50
|
-
const _test = JSON.stringify(results);
|
|
51
|
-
(0, chai_1.expect)(_test).equals(JSON.stringify(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillyAirportGetFeatureInfoResultRef));
|
|
52
|
-
});
|
|
53
|
-
it("should deflate coordinates array", async () => {
|
|
54
|
-
// Simple deflate stride = 2
|
|
55
|
-
let doubleArray = [[1, 2], [3, 4]];
|
|
56
|
-
let deflated = [];
|
|
57
|
-
let offset = ArcGisFeatureJSON_1.ArcGisFeatureJSON.deflateCoordinates(doubleArray, deflated, 2, 0);
|
|
58
|
-
(0, chai_1.expect)(offset).to.equals(4);
|
|
59
|
-
(0, chai_1.expect)(deflated).to.eql([1, 2, 3, 4]);
|
|
60
|
-
/// Check offset with stride = 2
|
|
61
|
-
doubleArray = [[5, 6]];
|
|
62
|
-
offset = ArcGisFeatureJSON_1.ArcGisFeatureJSON.deflateCoordinates(doubleArray, deflated, 2, offset);
|
|
63
|
-
(0, chai_1.expect)(offset).to.equals(6);
|
|
64
|
-
(0, chai_1.expect)(deflated).to.eql([1, 2, 3, 4, 5, 6]);
|
|
65
|
-
// Simple deflate stride = 3
|
|
66
|
-
doubleArray = [[1, 2, 3], [4, 5, 6]];
|
|
67
|
-
deflated = [];
|
|
68
|
-
offset = ArcGisFeatureJSON_1.ArcGisFeatureJSON.deflateCoordinates(doubleArray, deflated, 3, 0);
|
|
69
|
-
(0, chai_1.expect)(offset).to.equals(6);
|
|
70
|
-
(0, chai_1.expect)(deflated).to.eql([1, 2, 3, 4, 5, 6]);
|
|
71
|
-
/// Check offset with stride = 3
|
|
72
|
-
doubleArray = [[7, 8, 9]];
|
|
73
|
-
offset = ArcGisFeatureJSON_1.ArcGisFeatureJSON.deflateCoordinates(doubleArray, deflated, 3, offset);
|
|
74
|
-
(0, chai_1.expect)(offset).to.equals(9);
|
|
75
|
-
(0, chai_1.expect)(deflated).to.eql([1, 2, 3, 4, 5, 6, 7, 8, 9]);
|
|
76
|
-
});
|
|
77
|
-
it("should readAndRender single ring polygon feature", async () => {
|
|
78
|
-
const featureJson = createFeatureJSON();
|
|
79
|
-
const data = PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillySimplePolyQueryJson;
|
|
80
|
-
const symbolRenderer = new ArcGisSymbologyRenderer_1.ArcGisSymbologyRenderer(data.geometryType, PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillySimplePolyDrawingInfo.drawingInfo.renderer);
|
|
81
|
-
const featureRenderer = new ArcGisFeatureRenderer_1.ArcGisFeatureRenderer(Mocks_1.fakeContext, symbolRenderer);
|
|
82
|
-
const renderPathSpy = sinon.spy(featureRenderer, "renderPath");
|
|
83
|
-
featureJson.readAndRender({ data, exceedTransferLimit: false }, featureRenderer);
|
|
84
|
-
(0, chai_1.expect)(renderPathSpy.calledOnce);
|
|
85
|
-
const firstCall = renderPathSpy.getCalls()[0];
|
|
86
|
-
(0, chai_1.expect)(firstCall.args[0]).to.eql(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillySimplePolyQueryPbf.queryResult.featureResult.features[0].geometry.lengths); // geometryLengths
|
|
87
|
-
(0, chai_1.expect)(firstCall.args[1]).to.eql(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillySimplePolyQueryPbf.queryResult.featureResult.features[0].geometry.coords); // geometryCoords
|
|
88
|
-
(0, chai_1.expect)(firstCall.args[2]).to.eql(true); // fill
|
|
89
|
-
(0, chai_1.expect)(firstCall.args[3]).to.eql(2); // stride
|
|
90
|
-
});
|
|
91
|
-
it("should readAndRender multiple ring polygon feature", async () => {
|
|
92
|
-
const featureJson = createFeatureJSON();
|
|
93
|
-
const data = PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillyDoubleRingPolyQueryJson;
|
|
94
|
-
const symbolRenderer = new ArcGisSymbologyRenderer_1.ArcGisSymbologyRenderer(data.geometryType, PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillySimplePolyDrawingInfo.drawingInfo.renderer);
|
|
95
|
-
const featureRenderer = new ArcGisFeatureRenderer_1.ArcGisFeatureRenderer(Mocks_1.fakeContext, symbolRenderer);
|
|
96
|
-
const renderPathSpy = sinon.spy(featureRenderer, "renderPath");
|
|
97
|
-
featureJson.readAndRender({ data, exceedTransferLimit: false }, featureRenderer);
|
|
98
|
-
(0, chai_1.expect)(renderPathSpy.calledOnce);
|
|
99
|
-
const firstCall = renderPathSpy.getCalls()[0];
|
|
100
|
-
(0, chai_1.expect)(firstCall.args[0]).to.eql(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillyDoubleRingPolyQueryPbf.queryResult.featureResult.features[0].geometry.lengths); // geometryLengths
|
|
101
|
-
(0, chai_1.expect)(firstCall.args[1]).to.eql(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillyDoubleRingPolyQueryPbf.queryResult.featureResult.features[0].geometry.coords); // geometryCoords
|
|
102
|
-
(0, chai_1.expect)(firstCall.args[2]).to.eql(true); // fill
|
|
103
|
-
(0, chai_1.expect)(firstCall.args[3]).to.eql(2); // stride
|
|
104
|
-
});
|
|
105
|
-
it("should readAndRender simple path", async () => {
|
|
106
|
-
const featureJson = createFeatureJSON();
|
|
107
|
-
const data = PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillySimplePathQueryJson;
|
|
108
|
-
const symbolRenderer = new ArcGisSymbologyRenderer_1.ArcGisSymbologyRenderer(data.geometryType, PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillySimpleLineDrawingInfo.drawingInfo.renderer);
|
|
109
|
-
const featureRenderer = new ArcGisFeatureRenderer_1.ArcGisFeatureRenderer(Mocks_1.fakeContext, symbolRenderer);
|
|
110
|
-
const renderPathSpy = sinon.spy(featureRenderer, "renderPath");
|
|
111
|
-
featureJson.readAndRender({ data, exceedTransferLimit: false }, featureRenderer);
|
|
112
|
-
(0, chai_1.expect)(renderPathSpy.calledOnce);
|
|
113
|
-
const geometryCoords = [360, 491, -2, -1, -1, 0, -1, 0, -1, 0, -1, 1, -4, 1, -10, 2, -15, 3, -1, 0, -1, 0, -2, 0, -1, 0, -1, 0, -1, -1, -1, 0, -2, -1, 0, -1, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0];
|
|
114
|
-
const firstCall = renderPathSpy.getCalls()[0];
|
|
115
|
-
(0, chai_1.expect)(firstCall.args[0]).to.eql([24]); // geometryLengths
|
|
116
|
-
(0, chai_1.expect)(firstCall.args[1]).to.eql(geometryCoords); // geometryCoords
|
|
117
|
-
(0, chai_1.expect)(firstCall.args[2]).to.eql(false); // fill
|
|
118
|
-
(0, chai_1.expect)(firstCall.args[3]).to.eql(2); // stride
|
|
119
|
-
});
|
|
120
|
-
it("should readAndRender multi path", async () => {
|
|
121
|
-
const featureJson = createFeatureJSON();
|
|
122
|
-
const data = PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillyMultiPathQueryJson;
|
|
123
|
-
const symbolRenderer = new ArcGisSymbologyRenderer_1.ArcGisSymbologyRenderer(data.geometryType, PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillySimpleLineDrawingInfo.drawingInfo.renderer);
|
|
124
|
-
const featureRenderer = new ArcGisFeatureRenderer_1.ArcGisFeatureRenderer(Mocks_1.fakeContext, symbolRenderer);
|
|
125
|
-
const renderPathSpy = sinon.spy(featureRenderer, "renderPath");
|
|
126
|
-
featureJson.readAndRender({ data, exceedTransferLimit: false }, featureRenderer);
|
|
127
|
-
(0, chai_1.expect)(renderPathSpy.calledOnce);
|
|
128
|
-
// Pbf contains already the right output format expect, lets rely on that.
|
|
129
|
-
const firstCall = renderPathSpy.getCalls()[0];
|
|
130
|
-
(0, chai_1.expect)(firstCall.args[0]).to.eql(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillyMultiPathQueryPbf.queryResult.featureResult.features[0].geometry.lengths);
|
|
131
|
-
(0, chai_1.expect)(firstCall.args[1]).to.eql(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillyMultiPathQueryPbf.queryResult.featureResult.features[0].geometry.coords);
|
|
132
|
-
(0, chai_1.expect)(firstCall.args[2]).to.eql(false); // fill
|
|
133
|
-
(0, chai_1.expect)(firstCall.args[3]).to.eql(2); // stride
|
|
134
|
-
});
|
|
135
|
-
it("should readAndRender simple point", async () => {
|
|
136
|
-
const featureJson = createFeatureJSON();
|
|
137
|
-
const data = PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillySimplePointQueryJson;
|
|
138
|
-
const symbolRenderer = new ArcGisSymbologyRenderer_1.ArcGisSymbologyRenderer(data.geometryType, PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillySimplePointDrawingInfo.drawingInfo.renderer);
|
|
139
|
-
const featureRenderer = new ArcGisFeatureRenderer_1.ArcGisFeatureRenderer(Mocks_1.fakeContext, symbolRenderer);
|
|
140
|
-
const spy = sinon.spy(featureRenderer, "renderPoint");
|
|
141
|
-
featureJson.readAndRender({ data, exceedTransferLimit: false }, featureRenderer);
|
|
142
|
-
(0, chai_1.expect)(spy.calledOnce);
|
|
143
|
-
// Pbf contains already the right output format expect, lets rely on that.
|
|
144
|
-
const geometryCoords = PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillySimplePointQueryPbf.queryResult.featureResult.features[0].geometry.coords;
|
|
145
|
-
const firstCall = spy.getCalls()[0];
|
|
146
|
-
(0, chai_1.expect)(firstCall.args[0]).to.eql(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillySimplePointQueryPbf.queryResult.featureResult.features[0].geometry.lengths); // geometryLengths
|
|
147
|
-
(0, chai_1.expect)(firstCall.args[1]).to.eql(geometryCoords); // geometryCoords
|
|
148
|
-
(0, chai_1.expect)(firstCall.args[2]).to.eql(2); // stride
|
|
149
|
-
});
|
|
150
|
-
it("should log error when readAndRender / readFeatureInfo is called invalid response Data", async () => {
|
|
151
|
-
const featureJson = createFeatureJSON();
|
|
152
|
-
const symbolRenderer = new ArcGisSymbologyRenderer_1.ArcGisSymbologyRenderer("esriGeometryAny", PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillySimplePointDrawingInfo.drawingInfo.renderer);
|
|
153
|
-
const featureRenderer = new ArcGisFeatureRenderer_1.ArcGisFeatureRenderer(Mocks_1.fakeContext, symbolRenderer);
|
|
154
|
-
const logErrorSpy = sandbox.spy(core_bentley_1.Logger, "logError");
|
|
155
|
-
featureJson.readAndRender({ data: { test: "test" }, exceedTransferLimit: false }, featureRenderer);
|
|
156
|
-
(0, chai_1.expect)(logErrorSpy.calledOnce);
|
|
157
|
-
logErrorSpy.resetHistory();
|
|
158
|
-
featureJson.readFeatureInfo({ data: { test: "test" }, exceedTransferLimit: false }, []);
|
|
159
|
-
(0, chai_1.expect)(logErrorSpy.calledOnce);
|
|
160
|
-
});
|
|
161
|
-
});
|
|
1
|
+
"use strict";
|
|
2
|
+
/*---------------------------------------------------------------------------------------------
|
|
3
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
|
+
*--------------------------------------------------------------------------------------------*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
const core_bentley_1 = require("@itwin/core-bentley");
|
|
8
|
+
const core_common_1 = require("@itwin/core-common");
|
|
9
|
+
const chai_1 = require("chai");
|
|
10
|
+
const sinon = require("sinon");
|
|
11
|
+
const ArcGisFeatureFormat_1 = require("../../ArcGisFeature/ArcGisFeatureFormat");
|
|
12
|
+
const ArcGisFeatureJSON_1 = require("../../ArcGisFeature/ArcGisFeatureJSON");
|
|
13
|
+
const ArcGisFeatureRenderer_1 = require("../../ArcGisFeature/ArcGisFeatureRenderer");
|
|
14
|
+
const ArcGisSymbologyRenderer_1 = require("../../ArcGisFeature/ArcGisSymbologyRenderer");
|
|
15
|
+
const Mocks_1 = require("./Mocks");
|
|
16
|
+
const PhillyLandmarksDataset_1 = require("./PhillyLandmarksDataset");
|
|
17
|
+
const esriFeatureSampleSource = { name: "dummyFeatureLayer", url: "https://dummy.com", formatId: ArcGisFeatureFormat_1.ArcGisFeatureMapLayerFormat.formatId };
|
|
18
|
+
const createFeatureJSON = () => {
|
|
19
|
+
const settings = core_common_1.ImageMapLayerSettings.fromJSON(esriFeatureSampleSource);
|
|
20
|
+
const featurePbf = new ArcGisFeatureJSON_1.ArcGisFeatureJSON(settings, { name: "SampleLayer" });
|
|
21
|
+
// Locale configuration depends on the testing machine (i.e. linux vs windows),
|
|
22
|
+
// so we need to force date display to Iso to get a consistent value.
|
|
23
|
+
// In real scenario, we still want dates to be displayed in end-user's locale.
|
|
24
|
+
featurePbf.forceDateDisplayValueToIso = true;
|
|
25
|
+
return featurePbf;
|
|
26
|
+
};
|
|
27
|
+
describe("ArcGisFeatureJSON", () => {
|
|
28
|
+
const sandbox = sinon.createSandbox();
|
|
29
|
+
afterEach(async () => {
|
|
30
|
+
sandbox.restore();
|
|
31
|
+
});
|
|
32
|
+
it("should read FeatureInfo in JSON (phillyTansportation)", async () => {
|
|
33
|
+
const featureJson = createFeatureJSON();
|
|
34
|
+
// In some cases, PBF gives more floating-point precision than JSON.
|
|
35
|
+
// Since I want to use the same output reference for both formats, I force a max precision of 8.
|
|
36
|
+
featureJson.floatPrecision = 8;
|
|
37
|
+
const results = [];
|
|
38
|
+
featureJson.readFeatureInfo({ data: PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillyTransportationGetFeatureInfoQueryJson, exceedTransferLimit: false }, results);
|
|
39
|
+
(0, chai_1.expect)(JSON.stringify(results)).equals(JSON.stringify(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillyTansportationGetFeatureInfoResultRef));
|
|
40
|
+
});
|
|
41
|
+
it("should read FeatureInfo in JSON (phillyAirport)", async () => {
|
|
42
|
+
const settings = core_common_1.ImageMapLayerSettings.fromJSON(esriFeatureSampleSource);
|
|
43
|
+
const featureJson = new ArcGisFeatureJSON_1.ArcGisFeatureJSON(settings, { name: "SampleLayer" });
|
|
44
|
+
// In some cases, PBF gives more floating-point precision than JSON.
|
|
45
|
+
// Since I want to use the same output reference for both formats, I force a max precision of 8.
|
|
46
|
+
featureJson.floatPrecision = 8;
|
|
47
|
+
const results = [];
|
|
48
|
+
const data = JSON.parse(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillyAirportGetFeatureInfoQueryJson);
|
|
49
|
+
featureJson.readFeatureInfo({ data, exceedTransferLimit: false }, results);
|
|
50
|
+
const _test = JSON.stringify(results);
|
|
51
|
+
(0, chai_1.expect)(_test).equals(JSON.stringify(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillyAirportGetFeatureInfoResultRef));
|
|
52
|
+
});
|
|
53
|
+
it("should deflate coordinates array", async () => {
|
|
54
|
+
// Simple deflate stride = 2
|
|
55
|
+
let doubleArray = [[1, 2], [3, 4]];
|
|
56
|
+
let deflated = [];
|
|
57
|
+
let offset = ArcGisFeatureJSON_1.ArcGisFeatureJSON.deflateCoordinates(doubleArray, deflated, 2, 0);
|
|
58
|
+
(0, chai_1.expect)(offset).to.equals(4);
|
|
59
|
+
(0, chai_1.expect)(deflated).to.eql([1, 2, 3, 4]);
|
|
60
|
+
/// Check offset with stride = 2
|
|
61
|
+
doubleArray = [[5, 6]];
|
|
62
|
+
offset = ArcGisFeatureJSON_1.ArcGisFeatureJSON.deflateCoordinates(doubleArray, deflated, 2, offset);
|
|
63
|
+
(0, chai_1.expect)(offset).to.equals(6);
|
|
64
|
+
(0, chai_1.expect)(deflated).to.eql([1, 2, 3, 4, 5, 6]);
|
|
65
|
+
// Simple deflate stride = 3
|
|
66
|
+
doubleArray = [[1, 2, 3], [4, 5, 6]];
|
|
67
|
+
deflated = [];
|
|
68
|
+
offset = ArcGisFeatureJSON_1.ArcGisFeatureJSON.deflateCoordinates(doubleArray, deflated, 3, 0);
|
|
69
|
+
(0, chai_1.expect)(offset).to.equals(6);
|
|
70
|
+
(0, chai_1.expect)(deflated).to.eql([1, 2, 3, 4, 5, 6]);
|
|
71
|
+
/// Check offset with stride = 3
|
|
72
|
+
doubleArray = [[7, 8, 9]];
|
|
73
|
+
offset = ArcGisFeatureJSON_1.ArcGisFeatureJSON.deflateCoordinates(doubleArray, deflated, 3, offset);
|
|
74
|
+
(0, chai_1.expect)(offset).to.equals(9);
|
|
75
|
+
(0, chai_1.expect)(deflated).to.eql([1, 2, 3, 4, 5, 6, 7, 8, 9]);
|
|
76
|
+
});
|
|
77
|
+
it("should readAndRender single ring polygon feature", async () => {
|
|
78
|
+
const featureJson = createFeatureJSON();
|
|
79
|
+
const data = PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillySimplePolyQueryJson;
|
|
80
|
+
const symbolRenderer = new ArcGisSymbologyRenderer_1.ArcGisSymbologyRenderer(data.geometryType, PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillySimplePolyDrawingInfo.drawingInfo.renderer);
|
|
81
|
+
const featureRenderer = new ArcGisFeatureRenderer_1.ArcGisFeatureRenderer(Mocks_1.fakeContext, symbolRenderer);
|
|
82
|
+
const renderPathSpy = sinon.spy(featureRenderer, "renderPath");
|
|
83
|
+
featureJson.readAndRender({ data, exceedTransferLimit: false }, featureRenderer);
|
|
84
|
+
(0, chai_1.expect)(renderPathSpy.calledOnce);
|
|
85
|
+
const firstCall = renderPathSpy.getCalls()[0];
|
|
86
|
+
(0, chai_1.expect)(firstCall.args[0]).to.eql(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillySimplePolyQueryPbf.queryResult.featureResult.features[0].geometry.lengths); // geometryLengths
|
|
87
|
+
(0, chai_1.expect)(firstCall.args[1]).to.eql(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillySimplePolyQueryPbf.queryResult.featureResult.features[0].geometry.coords); // geometryCoords
|
|
88
|
+
(0, chai_1.expect)(firstCall.args[2]).to.eql(true); // fill
|
|
89
|
+
(0, chai_1.expect)(firstCall.args[3]).to.eql(2); // stride
|
|
90
|
+
});
|
|
91
|
+
it("should readAndRender multiple ring polygon feature", async () => {
|
|
92
|
+
const featureJson = createFeatureJSON();
|
|
93
|
+
const data = PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillyDoubleRingPolyQueryJson;
|
|
94
|
+
const symbolRenderer = new ArcGisSymbologyRenderer_1.ArcGisSymbologyRenderer(data.geometryType, PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillySimplePolyDrawingInfo.drawingInfo.renderer);
|
|
95
|
+
const featureRenderer = new ArcGisFeatureRenderer_1.ArcGisFeatureRenderer(Mocks_1.fakeContext, symbolRenderer);
|
|
96
|
+
const renderPathSpy = sinon.spy(featureRenderer, "renderPath");
|
|
97
|
+
featureJson.readAndRender({ data, exceedTransferLimit: false }, featureRenderer);
|
|
98
|
+
(0, chai_1.expect)(renderPathSpy.calledOnce);
|
|
99
|
+
const firstCall = renderPathSpy.getCalls()[0];
|
|
100
|
+
(0, chai_1.expect)(firstCall.args[0]).to.eql(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillyDoubleRingPolyQueryPbf.queryResult.featureResult.features[0].geometry.lengths); // geometryLengths
|
|
101
|
+
(0, chai_1.expect)(firstCall.args[1]).to.eql(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillyDoubleRingPolyQueryPbf.queryResult.featureResult.features[0].geometry.coords); // geometryCoords
|
|
102
|
+
(0, chai_1.expect)(firstCall.args[2]).to.eql(true); // fill
|
|
103
|
+
(0, chai_1.expect)(firstCall.args[3]).to.eql(2); // stride
|
|
104
|
+
});
|
|
105
|
+
it("should readAndRender simple path", async () => {
|
|
106
|
+
const featureJson = createFeatureJSON();
|
|
107
|
+
const data = PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillySimplePathQueryJson;
|
|
108
|
+
const symbolRenderer = new ArcGisSymbologyRenderer_1.ArcGisSymbologyRenderer(data.geometryType, PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillySimpleLineDrawingInfo.drawingInfo.renderer);
|
|
109
|
+
const featureRenderer = new ArcGisFeatureRenderer_1.ArcGisFeatureRenderer(Mocks_1.fakeContext, symbolRenderer);
|
|
110
|
+
const renderPathSpy = sinon.spy(featureRenderer, "renderPath");
|
|
111
|
+
featureJson.readAndRender({ data, exceedTransferLimit: false }, featureRenderer);
|
|
112
|
+
(0, chai_1.expect)(renderPathSpy.calledOnce);
|
|
113
|
+
const geometryCoords = [360, 491, -2, -1, -1, 0, -1, 0, -1, 0, -1, 1, -4, 1, -10, 2, -15, 3, -1, 0, -1, 0, -2, 0, -1, 0, -1, 0, -1, -1, -1, 0, -2, -1, 0, -1, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0];
|
|
114
|
+
const firstCall = renderPathSpy.getCalls()[0];
|
|
115
|
+
(0, chai_1.expect)(firstCall.args[0]).to.eql([24]); // geometryLengths
|
|
116
|
+
(0, chai_1.expect)(firstCall.args[1]).to.eql(geometryCoords); // geometryCoords
|
|
117
|
+
(0, chai_1.expect)(firstCall.args[2]).to.eql(false); // fill
|
|
118
|
+
(0, chai_1.expect)(firstCall.args[3]).to.eql(2); // stride
|
|
119
|
+
});
|
|
120
|
+
it("should readAndRender multi path", async () => {
|
|
121
|
+
const featureJson = createFeatureJSON();
|
|
122
|
+
const data = PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillyMultiPathQueryJson;
|
|
123
|
+
const symbolRenderer = new ArcGisSymbologyRenderer_1.ArcGisSymbologyRenderer(data.geometryType, PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillySimpleLineDrawingInfo.drawingInfo.renderer);
|
|
124
|
+
const featureRenderer = new ArcGisFeatureRenderer_1.ArcGisFeatureRenderer(Mocks_1.fakeContext, symbolRenderer);
|
|
125
|
+
const renderPathSpy = sinon.spy(featureRenderer, "renderPath");
|
|
126
|
+
featureJson.readAndRender({ data, exceedTransferLimit: false }, featureRenderer);
|
|
127
|
+
(0, chai_1.expect)(renderPathSpy.calledOnce);
|
|
128
|
+
// Pbf contains already the right output format expect, lets rely on that.
|
|
129
|
+
const firstCall = renderPathSpy.getCalls()[0];
|
|
130
|
+
(0, chai_1.expect)(firstCall.args[0]).to.eql(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillyMultiPathQueryPbf.queryResult.featureResult.features[0].geometry.lengths);
|
|
131
|
+
(0, chai_1.expect)(firstCall.args[1]).to.eql(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillyMultiPathQueryPbf.queryResult.featureResult.features[0].geometry.coords);
|
|
132
|
+
(0, chai_1.expect)(firstCall.args[2]).to.eql(false); // fill
|
|
133
|
+
(0, chai_1.expect)(firstCall.args[3]).to.eql(2); // stride
|
|
134
|
+
});
|
|
135
|
+
it("should readAndRender simple point", async () => {
|
|
136
|
+
const featureJson = createFeatureJSON();
|
|
137
|
+
const data = PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillySimplePointQueryJson;
|
|
138
|
+
const symbolRenderer = new ArcGisSymbologyRenderer_1.ArcGisSymbologyRenderer(data.geometryType, PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillySimplePointDrawingInfo.drawingInfo.renderer);
|
|
139
|
+
const featureRenderer = new ArcGisFeatureRenderer_1.ArcGisFeatureRenderer(Mocks_1.fakeContext, symbolRenderer);
|
|
140
|
+
const spy = sinon.spy(featureRenderer, "renderPoint");
|
|
141
|
+
featureJson.readAndRender({ data, exceedTransferLimit: false }, featureRenderer);
|
|
142
|
+
(0, chai_1.expect)(spy.calledOnce);
|
|
143
|
+
// Pbf contains already the right output format expect, lets rely on that.
|
|
144
|
+
const geometryCoords = PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillySimplePointQueryPbf.queryResult.featureResult.features[0].geometry.coords;
|
|
145
|
+
const firstCall = spy.getCalls()[0];
|
|
146
|
+
(0, chai_1.expect)(firstCall.args[0]).to.eql(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillySimplePointQueryPbf.queryResult.featureResult.features[0].geometry.lengths); // geometryLengths
|
|
147
|
+
(0, chai_1.expect)(firstCall.args[1]).to.eql(geometryCoords); // geometryCoords
|
|
148
|
+
(0, chai_1.expect)(firstCall.args[2]).to.eql(2); // stride
|
|
149
|
+
});
|
|
150
|
+
it("should log error when readAndRender / readFeatureInfo is called invalid response Data", async () => {
|
|
151
|
+
const featureJson = createFeatureJSON();
|
|
152
|
+
const symbolRenderer = new ArcGisSymbologyRenderer_1.ArcGisSymbologyRenderer("esriGeometryAny", PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillySimplePointDrawingInfo.drawingInfo.renderer);
|
|
153
|
+
const featureRenderer = new ArcGisFeatureRenderer_1.ArcGisFeatureRenderer(Mocks_1.fakeContext, symbolRenderer);
|
|
154
|
+
const logErrorSpy = sandbox.spy(core_bentley_1.Logger, "logError");
|
|
155
|
+
featureJson.readAndRender({ data: { test: "test" }, exceedTransferLimit: false }, featureRenderer);
|
|
156
|
+
(0, chai_1.expect)(logErrorSpy.calledOnce);
|
|
157
|
+
logErrorSpy.resetHistory();
|
|
158
|
+
featureJson.readFeatureInfo({ data: { test: "test" }, exceedTransferLimit: false }, []);
|
|
159
|
+
(0, chai_1.expect)(logErrorSpy.calledOnce);
|
|
160
|
+
});
|
|
161
|
+
});
|
|
162
162
|
//# sourceMappingURL=ArcGisFeatureJSON.test.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
|
2
2
|
//# sourceMappingURL=ArcGisFeaturePBF.test.d.ts.map
|