@itwin/map-layers-formats 4.1.0-dev.40 → 4.1.0-dev.50
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 +1 -3
- package/.rush/temp/operation/build/state.json +1 -1
- package/.rush/temp/operation/cover/all.log +12 -7
- package/.rush/temp/operation/cover/state.json +1 -1
- package/.rush/temp/operation/docs/all.log +2 -2
- package/.rush/temp/operation/docs/state.json +1 -1
- package/.rush/temp/package-deps_build.json +36 -0
- package/.rush/temp/package-deps_cover.json +7 -7
- package/.rush/temp/package-deps_docs.json +7 -7
- package/.rush/temp/shrinkwrap-deps.json +70 -80
- package/CHANGELOG.json +30 -0
- package/CHANGELOG.md +26 -1
- package/lib/cjs/ArcGisFeature/ArcGisFeatureFormat.js.map +1 -1
- package/lib/cjs/ArcGisFeature/ArcGisFeatureJSON.js.map +1 -1
- package/lib/cjs/ArcGisFeature/ArcGisFeaturePBF.js.map +1 -1
- package/lib/cjs/ArcGisFeature/ArcGisFeatureProvider.d.ts +3 -0
- package/lib/cjs/ArcGisFeature/ArcGisFeatureProvider.d.ts.map +1 -1
- package/lib/cjs/ArcGisFeature/ArcGisFeatureProvider.js +49 -11
- package/lib/cjs/ArcGisFeature/ArcGisFeatureProvider.js.map +1 -1
- package/lib/cjs/ArcGisFeature/ArcGisFeatureQuery.js.map +1 -1
- package/lib/cjs/ArcGisFeature/ArcGisFeatureReader.js.map +1 -1
- package/lib/cjs/ArcGisFeature/ArcGisFeatureRenderer.js.map +1 -1
- package/lib/cjs/ArcGisFeature/ArcGisFeatureResponse.js.map +1 -1
- package/lib/cjs/ArcGisFeature/ArcGisSymbologyRenderer.js +3 -3
- package/lib/cjs/ArcGisFeature/ArcGisSymbologyRenderer.js.map +1 -1
- package/lib/cjs/ArcGisFeature/esriPBuffer.gen.js.map +1 -1
- package/lib/cjs/map-layers-formats.js.map +1 -1
- package/lib/cjs/mapLayersFormats.js.map +1 -1
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureFeatureFormats.test.js.map +1 -1
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureJSON.test.js.map +1 -1
- package/lib/cjs/test/ArcGisFeature/ArcGisFeaturePBF.test.js.map +1 -1
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureProvider.test.js +133 -6
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureProvider.test.js.map +1 -1
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureQuery.test.js.map +1 -1
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureRenderer.test.js.map +1 -1
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureResponse.test.js.map +1 -1
- package/lib/cjs/test/ArcGisFeature/ArcGisSymbologyRenderer.test.js.map +1 -1
- package/lib/cjs/test/ArcGisFeature/Mocks.js.map +1 -1
- package/lib/cjs/test/ArcGisFeature/NewYorkDataset.js.map +1 -1
- package/lib/cjs/test/ArcGisFeature/PhillyLandmarksDataset.js.map +1 -1
- package/lib/cjs/test/coverage/.nyc_output/49eeff8d-f0c9-43b5-9fa7-717e2ee4f36b.json +1 -0
- package/lib/cjs/test/coverage/.nyc_output/processinfo/49eeff8d-f0c9-43b5-9fa7-717e2ee4f36b.json +1 -0
- package/lib/cjs/test/coverage/.nyc_output/processinfo/b749190e-f7e9-4cdb-80df-74589d31e28d.json +1 -0
- package/lib/cjs/test/coverage/.nyc_output/processinfo/index.json +1 -1
- package/lib/cjs/test/coverage/cobertura-coverage.xml +291 -257
- package/lib/cjs/test/coverage/lcov-report/index.html +18 -18
- 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 +1 -1
- package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeaturePBF.ts.html +1 -1
- package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureProvider.ts.html +202 -76
- 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 +1 -1
- package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisSymbologyRenderer.ts.html +13 -13
- package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/index.html +18 -18
- 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 +420 -384
- package/lib/cjs/tsconfig.tsbuildinfo +1 -1
- package/lib/esm/ArcGisFeature/ArcGisFeatureFormat.js.map +1 -1
- package/lib/esm/ArcGisFeature/ArcGisFeatureJSON.js.map +1 -1
- package/lib/esm/ArcGisFeature/ArcGisFeaturePBF.js.map +1 -1
- package/lib/esm/ArcGisFeature/ArcGisFeatureProvider.d.ts +3 -0
- package/lib/esm/ArcGisFeature/ArcGisFeatureProvider.d.ts.map +1 -1
- package/lib/esm/ArcGisFeature/ArcGisFeatureProvider.js +49 -11
- package/lib/esm/ArcGisFeature/ArcGisFeatureProvider.js.map +1 -1
- package/lib/esm/ArcGisFeature/ArcGisFeatureQuery.js.map +1 -1
- package/lib/esm/ArcGisFeature/ArcGisFeatureReader.js.map +1 -1
- package/lib/esm/ArcGisFeature/ArcGisFeatureRenderer.js.map +1 -1
- package/lib/esm/ArcGisFeature/ArcGisFeatureResponse.js.map +1 -1
- package/lib/esm/ArcGisFeature/ArcGisSymbologyRenderer.js +3 -3
- package/lib/esm/ArcGisFeature/ArcGisSymbologyRenderer.js.map +1 -1
- package/lib/esm/ArcGisFeature/esriPBuffer.gen.js.map +1 -1
- package/lib/esm/map-layers-formats.js.map +1 -1
- package/lib/esm/mapLayersFormats.js.map +1 -1
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureFeatureFormats.test.js.map +1 -1
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureJSON.test.js.map +1 -1
- package/lib/esm/test/ArcGisFeature/ArcGisFeaturePBF.test.js.map +1 -1
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureProvider.test.js +134 -7
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureProvider.test.js.map +1 -1
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureQuery.test.js.map +1 -1
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureRenderer.test.js.map +1 -1
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureResponse.test.js.map +1 -1
- package/lib/esm/test/ArcGisFeature/ArcGisSymbologyRenderer.test.js.map +1 -1
- package/lib/esm/test/ArcGisFeature/Mocks.js.map +1 -1
- package/lib/esm/test/ArcGisFeature/NewYorkDataset.js.map +1 -1
- package/lib/esm/test/ArcGisFeature/PhillyLandmarksDataset.js.map +1 -1
- package/lib/esm/tsconfig.tsbuildinfo +1 -1
- package/lib/test/junit_results.xml +49 -39
- package/map-layers-formats.build.cache.log +2 -0
- package/map-layers-formats.cover.log +103 -0
- package/{map-layers-formats.build.log → map-layers-formats.docs.log} +2 -2
- package/map-layers-formats.lint.error.log +1 -0
- package/map-layers-formats.lint.log +2 -0
- package/package.json +12 -12
- package/src/ArcGisFeature/ArcGisFeatureProvider.ts +53 -11
- package/src/ArcGisFeature/ArcGisSymbologyRenderer.ts +3 -3
- package/src/test/ArcGisFeature/ArcGisFeatureProvider.test.ts +173 -7
- package/.rush/temp/56b9a37b833db0202ea00aa252f5eaa1d19cf7bd.log +0 -10
- package/lib/cjs/test/coverage/.nyc_output/4dc5f60e-8ae8-48d3-b717-f77ecf525371.json +0 -1
- package/lib/cjs/test/coverage/.nyc_output/processinfo/4dc5f60e-8ae8-48d3-b717-f77ecf525371.json +0 -1
- package/lib/cjs/test/coverage/.nyc_output/processinfo/dac1e7eb-315e-4558-9250-262b6f23cf4a.json +0 -1
- /package/lib/cjs/test/coverage/.nyc_output/{dac1e7eb-315e-4558-9250-262b6f23cf4a.json → b749190e-f7e9-4cdb-80df-74589d31e28d.json} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"map-layers-formats.js","sourceRoot":"","sources":["../../src/map-layers-formats.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F,cAAc,oBAAoB,CAAC;AACnC,cAAc,uCAAuC,CAAC;AAEtD;;GAEG;AAEH;;GAEG","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\nexport * from \"./mapLayersFormats\";\nexport * from \"./ArcGisFeature/ArcGisFeatureProvider\";\n\n/** @docs-package-description\n * This package provides support for additional map layer formats that are not included in the @itwin/core-frontend package.\n */\n\n/** @docs-group-description MapLayersFormats\n * APIs for working with the map layer formats provided by this package.\n */\n"]}
|
|
1
|
+
{"version":3,"file":"map-layers-formats.js","sourceRoot":"","sources":["../../src/map-layers-formats.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F,cAAc,oBAAoB,CAAC;AACnC,cAAc,uCAAuC,CAAC;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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mapLayersFormats.js","sourceRoot":"","sources":["../../src/mapLayersFormats.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,2BAA2B,EAAE,MAAM,qCAAqC,CAAC;AAElF;;GAEG;AACH,MAAM,OAAO,gBAAgB;IAC3B;;;OAGG;IACI,MAAM,CAAC,UAAU;QACtB,MAAM,CAAC,SAAS,CAAC,WAAW,EAAE,kGAAkG,CAAC,CAAC;QAClI,IAAI,SAAS,CAAC,WAAW;YACvB,SAAS,CAAC,sBAAsB,CAAC,QAAQ,CAAC,2BAA2B,CAAC,CAAC;IAC3E,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module MapLayersFormats\n */\nimport { assert } from \"@itwin/core-bentley\";\nimport { IModelApp } from \"@itwin/core-frontend\";\nimport { ArcGisFeatureMapLayerFormat } from \"./ArcGisFeature/ArcGisFeatureFormat\";\n\n/** The primary API for the `@itwin/map-layers-formats` package. It allows the package's features to be [[initialize]]d.\n * @beta\n */\nexport class MapLayersFormats {\n /** Registers the [MapLayerFormat]($frontend)s provided by this package for use with [IModelApp]($frontend).\n * Typically, an application will call `MapLayersFormats.initialize` immediately after [IModelApp.startup]($frontend).\n * This function has no effect if called **before** [IModelApp.startup]($frontend) or **after** [IModelApp.shutdown]($frontend).\n */\n public static initialize() {\n assert(IModelApp.initialized, \"MapLayersFormats.initialize must be called after IModelApp.startup and before IModelApp.shutdown\");\n if (IModelApp.initialized)\n IModelApp.mapLayerFormatRegistry.register(ArcGisFeatureMapLayerFormat);\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"mapLayersFormats.js","sourceRoot":"","sources":["../../src/mapLayersFormats.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,2BAA2B,EAAE,MAAM,qCAAqC,CAAC;AAElF;;GAEG;AACH,MAAM,OAAO,gBAAgB;IAC3B;;;OAGG;IACI,MAAM,CAAC,UAAU;QACtB,MAAM,CAAC,SAAS,CAAC,WAAW,EAAE,kGAAkG,CAAC,CAAC;QAClI,IAAI,SAAS,CAAC,WAAW;YACvB,SAAS,CAAC,sBAAsB,CAAC,QAAQ,CAAC,2BAA2B,CAAC,CAAC;IAC3E,CAAC;CACF","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\n/** @packageDocumentation\r\n * @module MapLayersFormats\r\n */\r\nimport { assert } from \"@itwin/core-bentley\";\r\nimport { IModelApp } from \"@itwin/core-frontend\";\r\nimport { ArcGisFeatureMapLayerFormat } from \"./ArcGisFeature/ArcGisFeatureFormat\";\r\n\r\n/** The primary API for the `@itwin/map-layers-formats` package. It allows the package's features to be [[initialize]]d.\r\n * @beta\r\n */\r\nexport class MapLayersFormats {\r\n /** Registers the [MapLayerFormat]($frontend)s provided by this package for use with [IModelApp]($frontend).\r\n * Typically, an application will call `MapLayersFormats.initialize` immediately after [IModelApp.startup]($frontend).\r\n * This function has no effect if called **before** [IModelApp.startup]($frontend) or **after** [IModelApp.shutdown]($frontend).\r\n */\r\n public static initialize() {\r\n assert(IModelApp.initialized, \"MapLayersFormats.initialize must be called after IModelApp.startup and before IModelApp.shutdown\");\r\n if (IModelApp.initialized)\r\n IModelApp.mapLayerFormatRegistry.register(ArcGisFeatureMapLayerFormat);\r\n }\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ArcGisFeatureFeatureFormats.test.js","sourceRoot":"","sources":["../../../../src/test/ArcGisFeature/ArcGisFeatureFeatureFormats.test.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EACL,eAAe,EACf,oBAAoB,GACrB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAC9B,OAAO,EAAE,2BAA2B,EAAE,MAAM,yCAAyC,CAAC;AACtF,OAAO,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAC;AAClD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,QAAQ,CAAC,kBAAkB,EAAE,GAAG,EAAE;IAEhC,MAAM,OAAO,GAAG,KAAK,CAAC,aAAa,EAAE,CAAC;IAEtC,SAAS,CAAC,KAAK,IAAI,EAAE;QACnB,OAAO,CAAC,OAAO,EAAE,CAAC;IACpB,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,8BAA8B,EAAE,KAAK,IAAI,EAAE;QAC5C,MAAM,QAAQ,GAAG,2BAA2B,CAAC,qBAAqB,CAAC,qBAAqB,CAAC,QAAQ,CAAC,uBAAuB,CAAC,CAAC,CAAC;QAC5H,MAAM,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,SAAS,CAAC;IACpC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,uBAAuB,EAAE,KAAK,IAAI,EAAE;QAErC,MAAM,UAAU,GAAG,KAAK,EAAE,IAAY,EAAE,SAAiB,EAAC,OAAiB,EAAE,SAAkB,EAAE,SAAkB,EAAE,YAAsB,EAAE,EAAE;YAC7I,OAAO,EAAC,MAAM,EAAE,oBAAoB,CAAC,KAAK,EAAC,CAAC;QAE9C,CAAC,CAAC;QACF,MAAM,kBAAkB,GAAG,KAAK,CAAC,IAAI,CAAC,eAAe,EAAE,gBAAgB,CAAC,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;QAE/F,MAAM,2BAA2B,CAAC,cAAc,CAAC,uBAAuB,CAAC,GAAG,CAAC,CAAC;QAE9E,MAAM,CAAC,kBAAkB,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC;QACjD,MAAM,SAAS,GAAG,kBAAkB,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,CAAC;QACnD,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,uBAAuB,CAAC,GAAG,CAAC,CAAC;QACjE,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,2BAA2B,CAAC,QAAQ,CAAC,CAAC;QAC1E,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;IAC/C,CAAC,CAAC,CAAC;AAEL,CAAC,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\nimport { ImageMapLayerSettings } from \"@itwin/core-common\";\nimport {\n ArcGisUtilities,\n MapLayerSourceStatus,\n} from \"@itwin/core-frontend\";\nimport { expect } from \"chai\";\nimport { ArcGisFeatureMapLayerFormat } from \"../../ArcGisFeature/ArcGisFeatureFormat\";\nimport { esriFeatureSampleSource } from \"./Mocks\";\nimport * as sinon from \"sinon\";\n\ndescribe(\"ArcGisFeaturePBF\", () => {\n\n const sandbox = sinon.createSandbox();\n\n afterEach(async () => {\n sandbox.restore();\n });\n\n it(\"should createImageryProvider\", async () => {\n const provider = ArcGisFeatureMapLayerFormat.createImageryProvider(ImageMapLayerSettings.fromJSON(esriFeatureSampleSource));\n expect(provider).to.not.undefined;\n });\n\n it(\"should validateSource\", async () => {\n\n const fakeMethod = async (_url: string, _formatId: string,_filter: string[], _userName?: string, _password?: string, _ignoreCache?: boolean) => {\n return {status: MapLayerSourceStatus.Valid};\n\n };\n const validateSourceStub = sinon.stub(ArcGisUtilities, \"validateSource\").callsFake(fakeMethod);\n\n await ArcGisFeatureMapLayerFormat.validateSource(esriFeatureSampleSource.url);\n\n expect(validateSourceStub.calledOnce).to.be.true;\n const firstCall = validateSourceStub.getCalls()[0];\n expect(firstCall.args[0]).to.equals(esriFeatureSampleSource.url);\n expect(firstCall.args[1]).to.equals(ArcGisFeatureMapLayerFormat.formatId);\n expect(firstCall.args[2]).to.eqls([\"query\"]);\n });\n\n});\n"]}
|
|
1
|
+
{"version":3,"file":"ArcGisFeatureFeatureFormats.test.js","sourceRoot":"","sources":["../../../../src/test/ArcGisFeature/ArcGisFeatureFeatureFormats.test.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EACL,eAAe,EACf,oBAAoB,GACrB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAC9B,OAAO,EAAE,2BAA2B,EAAE,MAAM,yCAAyC,CAAC;AACtF,OAAO,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAC;AAClD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,QAAQ,CAAC,kBAAkB,EAAE,GAAG,EAAE;IAEhC,MAAM,OAAO,GAAG,KAAK,CAAC,aAAa,EAAE,CAAC;IAEtC,SAAS,CAAC,KAAK,IAAI,EAAE;QACnB,OAAO,C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,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;IAC/C,CAAC,CAAC,CAAC;AAEL,CAAC,CAAC,CAAC","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\nimport { ImageMapLayerSettings } from \"@itwin/core-common\";\r\nimport {\r\n ArcGisUtilities,\r\n MapLayerSourceStatus,\r\n} from \"@itwin/core-frontend\";\r\nimport { expect } from \"chai\";\r\nimport { ArcGisFeatureMapLayerFormat } from \"../../ArcGisFeature/ArcGisFeatureFormat\";\r\nimport { esriFeatureSampleSource } from \"./Mocks\";\r\nimport * as sinon from \"sinon\";\r\n\r\ndescribe(\"ArcGisFeaturePBF\", () => {\r\n\r\n const sandbox = sinon.createSandbox();\r\n\r\n afterEach(async () => {\r\n sandbox.restore();\r\n });\r\n\r\n it(\"should createImageryProvider\", async () => {\r\n const provider = ArcGisFeatureMapLayerFormat.createImageryProvider(ImageMapLayerSettings.fromJSON(esriFeatureSampleSource));\r\n expect(provider).to.not.undefined;\r\n });\r\n\r\n it(\"should validateSource\", async () => {\r\n\r\n const fakeMethod = async (_url: string, _formatId: string,_filter: string[], _userName?: string, _password?: string, _ignoreCache?: boolean) => {\r\n return {status: MapLayerSourceStatus.Valid};\r\n\r\n };\r\n const validateSourceStub = sinon.stub(ArcGisUtilities, \"validateSource\").callsFake(fakeMethod);\r\n\r\n await ArcGisFeatureMapLayerFormat.validateSource(esriFeatureSampleSource.url);\r\n\r\n expect(validateSourceStub.calledOnce).to.be.true;\r\n const firstCall = validateSourceStub.getCalls()[0];\r\n expect(firstCall.args[0]).to.equals(esriFeatureSampleSource.url);\r\n expect(firstCall.args[1]).to.equals(ArcGisFeatureMapLayerFormat.formatId);\r\n expect(firstCall.args[2]).to.eqls([\"query\"]);\r\n });\r\n\r\n});\r\n"]}
|
|
@@ -1 +1 @@
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eAAe,CAAC,CAAC;QAC9F,MAAM,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;QAE/B,WAAW,CAAC,YAAY,EAAE,CAAC;QAC3B,WAAW,CAAC,eAAe,CAAC,EAAC,IAAI,EAAE,EAAC,IAAI,EAAC,MAAM,EAAC,EAAE,mBAAmB,EAAE,KAAK,EAAC,EAAE,EAAE,CAAC,CAAC;QACnF,MAAM,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;IAEjC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\nimport { Logger } from \"@itwin/core-bentley\";\nimport { ImageMapLayerSettings } from \"@itwin/core-common\";\nimport { MapLayerFeatureInfo } from \"@itwin/core-frontend\";\nimport { expect } from \"chai\";\nimport * as sinon from \"sinon\";\nimport { ArcGisFeatureMapLayerFormat } from \"../../ArcGisFeature/ArcGisFeatureFormat\";\nimport { ArcGisFeatureJSON } from \"../../ArcGisFeature/ArcGisFeatureJSON\";\nimport { ArcGisFeatureGeometryType } from \"../../ArcGisFeature/ArcGisFeatureQuery\";\nimport { ArcGisFeatureRenderer } from \"../../ArcGisFeature/ArcGisFeatureRenderer\";\nimport { ArcGisSymbologyRenderer } from \"../../ArcGisFeature/ArcGisSymbologyRenderer\";\nimport { fakeContext } from \"./Mocks\";\nimport { PhillyLandmarksDataset } from \"./PhillyLandmarksDataset\";\n\nconst esriFeatureSampleSource = {name: \"dummyFeatureLayer\", url: \"https://dummy.com\", formatId: ArcGisFeatureMapLayerFormat.formatId};\n\nconst createFeatureJSON = () => {\n const settings = ImageMapLayerSettings.fromJSON(esriFeatureSampleSource);\n const featurePbf = new ArcGisFeatureJSON(settings, {name: \"SampleLayer\"});\n\n // Locale configuration depends on the testing machine (i.e. linux vs windows),\n // so we need to force date display to Iso to get a consistent value.\n // In real scenario, we still want dates to be displayed in end-user's locale.\n featurePbf.forceDateDisplayValueToIso = true;\n return featurePbf;\n};\n\ndescribe(\"ArcGisFeatureJSON\", () => {\n\n const sandbox = sinon.createSandbox();\n\n afterEach(async () => {\n sandbox.restore();\n });\n\n it(\"should read FeatureInfo in JSON (phillyTansportation)\", async () => {\n const featureJson = createFeatureJSON();\n // In some cases, PBF gives more floating-point precision than JSON.\n // Since I want to use the same output reference for both formats, I force a max precision of 8.\n featureJson.floatPrecision = 8;\n const results: MapLayerFeatureInfo[] = [];\n featureJson.readFeatureInfo({data: PhillyLandmarksDataset.phillyTransportationGetFeatureInfoQueryJson, exceedTransferLimit: false}, results);\n expect(JSON.stringify(results)).equals(JSON.stringify(PhillyLandmarksDataset.phillyTansportationGetFeatureInfoResultRef));\n });\n\n it(\"should read FeatureInfo in JSON (phillyAirport)\", async () => {\n const settings = ImageMapLayerSettings.fromJSON(esriFeatureSampleSource);\n const featureJson = new ArcGisFeatureJSON(settings, {name: \"SampleLayer\"});\n // In some cases, PBF gives more floating-point precision than JSON.\n // Since I want to use the same output reference for both formats, I force a max precision of 8.\n featureJson.floatPrecision = 8;\n const results: MapLayerFeatureInfo[] = [];\n const data = JSON.parse(PhillyLandmarksDataset.phillyAirportGetFeatureInfoQueryJson);\n featureJson.readFeatureInfo({data, exceedTransferLimit: false}, results);\n const _test = JSON.stringify(results);\n expect(_test).equals(JSON.stringify(PhillyLandmarksDataset.phillyAirportGetFeatureInfoResultRef));\n });\n\n it(\"should deflate coordinates array\", async () => {\n // Simple deflate stride = 2\n let doubleArray = [[1,2], [3,4]];\n let deflated: number[] = [];\n let offset = (ArcGisFeatureJSON as any).deflateCoordinates(doubleArray, deflated, 2, 0);\n expect(offset).to.equals(4);\n expect(deflated).to.eql([1,2,3,4]);\n\n /// Check offset with stride = 2\n doubleArray = [[5,6]];\n offset = (ArcGisFeatureJSON as any).deflateCoordinates(doubleArray, deflated, 2, offset);\n expect(offset).to.equals(6);\n expect(deflated).to.eql([1,2,3,4,5,6]);\n\n // Simple deflate stride = 3\n doubleArray = [[1,2,3], [4,5,6]];\n deflated = [];\n offset = (ArcGisFeatureJSON as any).deflateCoordinates(doubleArray, deflated, 3, 0);\n expect(offset).to.equals(6);\n expect(deflated).to.eql([1,2,3,4,5,6]);\n\n /// Check offset with stride = 3\n doubleArray = [[7,8,9]];\n offset = (ArcGisFeatureJSON as any).deflateCoordinates(doubleArray, deflated, 3, offset);\n expect(offset).to.equals(9);\n expect(deflated).to.eql([1,2,3,4,5,6,7,8,9]);\n });\n\n it(\"should readAndRender single ring polygon feature\", async () => {\n const featureJson = createFeatureJSON();\n\n const data = PhillyLandmarksDataset.phillySimplePolyQueryJson;\n\n const symbolRenderer = new ArcGisSymbologyRenderer(data.geometryType as ArcGisFeatureGeometryType, PhillyLandmarksDataset.phillySimplePolyDrawingInfo.drawingInfo.renderer);\n\n const featureRenderer = new ArcGisFeatureRenderer(fakeContext, symbolRenderer);\n const renderPathSpy = sinon.spy(featureRenderer, \"renderPath\");\n featureJson.readAndRender({data, exceedTransferLimit: false}, featureRenderer);\n expect(renderPathSpy.calledOnce);\n\n const firstCall = renderPathSpy.getCalls()[0];\n expect(firstCall.args[0]).to.eql(PhillyLandmarksDataset.phillySimplePolyQueryPbf.queryResult.featureResult.features[0].geometry.lengths); // geometryLengths\n expect(firstCall.args[1]).to.eql(PhillyLandmarksDataset.phillySimplePolyQueryPbf.queryResult.featureResult.features[0].geometry.coords); // geometryCoords\n expect(firstCall.args[2]).to.eql(true); // fill\n expect(firstCall.args[3]).to.eql(2); // stride\n });\n\n it(\"should readAndRender multiple ring polygon feature\", async () => {\n const featureJson = createFeatureJSON();\n\n const data = PhillyLandmarksDataset.phillyDoubleRingPolyQueryJson;\n\n const symbolRenderer = new ArcGisSymbologyRenderer(data.geometryType as ArcGisFeatureGeometryType, PhillyLandmarksDataset.phillySimplePolyDrawingInfo.drawingInfo.renderer);\n\n const featureRenderer = new ArcGisFeatureRenderer(fakeContext, symbolRenderer);\n const renderPathSpy = sinon.spy(featureRenderer, \"renderPath\");\n featureJson.readAndRender({data, exceedTransferLimit: false}, featureRenderer);\n expect(renderPathSpy.calledOnce);\n\n const firstCall = renderPathSpy.getCalls()[0];\n expect(firstCall.args[0]).to.eql(PhillyLandmarksDataset.phillyDoubleRingPolyQueryPbf.queryResult.featureResult.features[0].geometry.lengths); // geometryLengths\n expect(firstCall.args[1]).to.eql(PhillyLandmarksDataset.phillyDoubleRingPolyQueryPbf.queryResult.featureResult.features[0].geometry.coords); // geometryCoords\n expect(firstCall.args[2]).to.eql(true); // fill\n expect(firstCall.args[3]).to.eql(2); // stride\n });\n\n it(\"should readAndRender simple path\", async () => {\n const featureJson = createFeatureJSON();\n const data = PhillyLandmarksDataset.phillySimplePathQueryJson;\n const symbolRenderer = new ArcGisSymbologyRenderer(data.geometryType as ArcGisFeatureGeometryType,\n PhillyLandmarksDataset.phillySimpleLineDrawingInfo.drawingInfo.renderer);\n\n const featureRenderer = new ArcGisFeatureRenderer(fakeContext, symbolRenderer);\n const renderPathSpy = sinon.spy(featureRenderer, \"renderPath\");\n featureJson.readAndRender({data, exceedTransferLimit: false}, featureRenderer);\n expect(renderPathSpy.calledOnce);\n\n 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];\n const firstCall = renderPathSpy.getCalls()[0];\n expect(firstCall.args[0]).to.eql([24]); // geometryLengths\n expect(firstCall.args[1]).to.eql(geometryCoords); // geometryCoords\n expect(firstCall.args[2]).to.eql(false); // fill\n expect(firstCall.args[3]).to.eql(2); // stride\n });\n\n it(\"should readAndRender multi path\", async () => {\n const featureJson = createFeatureJSON();\n const data = PhillyLandmarksDataset.phillyMultiPathQueryJson;\n const symbolRenderer = new ArcGisSymbologyRenderer(data.geometryType as ArcGisFeatureGeometryType, PhillyLandmarksDataset.phillySimpleLineDrawingInfo.drawingInfo.renderer);\n\n const featureRenderer = new ArcGisFeatureRenderer(fakeContext, symbolRenderer);\n const renderPathSpy = sinon.spy(featureRenderer, \"renderPath\");\n featureJson.readAndRender({data, exceedTransferLimit: false}, featureRenderer);\n expect(renderPathSpy.calledOnce);\n\n // Pbf contains already the right output format expect, lets rely on that.\n const firstCall = renderPathSpy.getCalls()[0];\n expect(firstCall.args[0]).to.eql(PhillyLandmarksDataset.phillyMultiPathQueryPbf.queryResult.featureResult.features[0].geometry.lengths);\n expect(firstCall.args[1]).to.eql(PhillyLandmarksDataset.phillyMultiPathQueryPbf.queryResult.featureResult.features[0].geometry.coords);\n expect(firstCall.args[2]).to.eql(false); // fill\n expect(firstCall.args[3]).to.eql(2); // stride\n });\n\n it(\"should readAndRender simple point\", async () => {\n const featureJson = createFeatureJSON();\n const data = PhillyLandmarksDataset.phillySimplePointQueryJson;\n const symbolRenderer = new ArcGisSymbologyRenderer(\n data.geometryType as ArcGisFeatureGeometryType,\n PhillyLandmarksDataset.phillySimplePointDrawingInfo.drawingInfo.renderer);\n\n const featureRenderer = new ArcGisFeatureRenderer(fakeContext, symbolRenderer);\n const spy = sinon.spy(featureRenderer, \"renderPoint\");\n featureJson.readAndRender({data, exceedTransferLimit: false}, featureRenderer);\n expect(spy.calledOnce);\n\n // Pbf contains already the right output format expect, lets rely on that.\n const geometryCoords = PhillyLandmarksDataset.phillySimplePointQueryPbf.queryResult.featureResult.features[0].geometry.coords;\n const firstCall = spy.getCalls()[0];\n expect(firstCall.args[0]).to.eql(PhillyLandmarksDataset.phillySimplePointQueryPbf.queryResult.featureResult.features[0].geometry.lengths); // geometryLengths\n expect(firstCall.args[1]).to.eql(geometryCoords); // geometryCoords\n expect(firstCall.args[2]).to.eql(2); // stride\n });\n\n it(\"should log error when readAndRender / readFeatureInfo is called invalid response Data\", async () => {\n const featureJson = createFeatureJSON();\n const symbolRenderer = new ArcGisSymbologyRenderer(\n \"esriGeometryAny\",\n PhillyLandmarksDataset.phillySimplePointDrawingInfo.drawingInfo.renderer);\n\n const featureRenderer = new ArcGisFeatureRenderer(fakeContext, symbolRenderer);\n const logErrorSpy = sandbox.spy(Logger, \"logError\");\n featureJson.readAndRender({data: {test:\"test\"}, exceedTransferLimit: false}, featureRenderer);\n expect(logErrorSpy.calledOnce);\n\n logErrorSpy.resetHistory();\n featureJson.readFeatureInfo({data: {test:\"test\"}, exceedTransferLimit: false}, []);\n expect(logErrorSpy.calledOnce);\n\n });\n});\n"]}
|
|
1
|
+
{"version":3,"file":"ArcGisFeatureJSON.test.js","sourceRoot":"","sources":["../../../../src/test/ArcGisFeature/ArcGisFeatureJSON.test.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAE3D,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAC9B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,2BAA2B,EAAE,MAAM,yCAAyC,CAAC;AACtF,OAAO,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAE1E,OAAO,EAAE,qBAAqB,EAAE,MAAM,2CAA2C,CAAC;AAClF,OAAO,EAAE,uBAAuB,EAAE,MAAM,6CAA6C,CAAC;AACtF,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACtC,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAElE,MAAM,uBAAuB,GAAG,EAAC,IAAI,EAAE,mBAAmB,EAAE,GAAG,EAAE,mBAAmB,EAAE,QAAQ,EAAE,2BAA2B,CAAC,QAAQ,EAAC,CAAC;AAEtI,MAAM,iBAAiB,GAAI,GAAG,EAAE;IAC9B,MAAM,QAAQ,GAAG,qBAAqB,CAAC,QAAQ,CAAC,uBAAuB,CAAC,CAAC;IACzE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BAAsB,CAAC,4BAA4B,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;QAE5E,MAAM,eAAe,GAAG,IAAI,qBAAqB,CAAC,WAAW,EAAE,cAAc,CAAC,CAAC;QAC/E,MAAM,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;QACpD,WAAW,CAAC,aAAa,CAAC,EAAC,IAAI,EAAE,EAAC,IAAI,EAAC,MAAM,EAAC,EAAE,mBAAmB,EAAE,KAAK,EAAC,EAAE,eAAe,CAAC,CAAC;QAC9F,MAAM,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;QAE/B,WAAW,CAAC,YAAY,EAAE,CAAC;QAC3B,WAAW,CAAC,eAAe,CAAC,EAAC,IAAI,EAAE,EAAC,IAAI,EAAC,MAAM,EAAC,EAAE,mBAAmB,EAAE,KAAK,EAAC,EAAE,EAAE,CAAC,CAAC;QACnF,MAAM,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;IAEjC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","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\nimport { Logger } from \"@itwin/core-bentley\";\r\nimport { ImageMapLayerSettings } from \"@itwin/core-common\";\r\nimport { MapLayerFeatureInfo } from \"@itwin/core-frontend\";\r\nimport { expect } from \"chai\";\r\nimport * as sinon from \"sinon\";\r\nimport { ArcGisFeatureMapLayerFormat } from \"../../ArcGisFeature/ArcGisFeatureFormat\";\r\nimport { ArcGisFeatureJSON } from \"../../ArcGisFeature/ArcGisFeatureJSON\";\r\nimport { ArcGisFeatureGeometryType } from \"../../ArcGisFeature/ArcGisFeatureQuery\";\r\nimport { ArcGisFeatureRenderer } from \"../../ArcGisFeature/ArcGisFeatureRenderer\";\r\nimport { ArcGisSymbologyRenderer } from \"../../ArcGisFeature/ArcGisSymbologyRenderer\";\r\nimport { fakeContext } from \"./Mocks\";\r\nimport { PhillyLandmarksDataset } from \"./PhillyLandmarksDataset\";\r\n\r\nconst esriFeatureSampleSource = {name: \"dummyFeatureLayer\", url: \"https://dummy.com\", formatId: ArcGisFeatureMapLayerFormat.formatId};\r\n\r\nconst createFeatureJSON = () => {\r\n const settings = ImageMapLayerSettings.fromJSON(esriFeatureSampleSource);\r\n const featurePbf = new ArcGisFeatureJSON(settings, {name: \"SampleLayer\"});\r\n\r\n // Locale configuration depends on the testing machine (i.e. linux vs windows),\r\n // so we need to force date display to Iso to get a consistent value.\r\n // In real scenario, we still want dates to be displayed in end-user's locale.\r\n featurePbf.forceDateDisplayValueToIso = true;\r\n return featurePbf;\r\n};\r\n\r\ndescribe(\"ArcGisFeatureJSON\", () => {\r\n\r\n const sandbox = sinon.createSandbox();\r\n\r\n afterEach(async () => {\r\n sandbox.restore();\r\n });\r\n\r\n it(\"should read FeatureInfo in JSON (phillyTansportation)\", async () => {\r\n const featureJson = createFeatureJSON();\r\n // In some cases, PBF gives more floating-point precision than JSON.\r\n // Since I want to use the same output reference for both formats, I force a max precision of 8.\r\n featureJson.floatPrecision = 8;\r\n const results: MapLayerFeatureInfo[] = [];\r\n featureJson.readFeatureInfo({data: PhillyLandmarksDataset.phillyTransportationGetFeatureInfoQueryJson, exceedTransferLimit: false}, results);\r\n expect(JSON.stringify(results)).equals(JSON.stringify(PhillyLandmarksDataset.phillyTansportationGetFeatureInfoResultRef));\r\n });\r\n\r\n it(\"should read FeatureInfo in JSON (phillyAirport)\", async () => {\r\n const settings = ImageMapLayerSettings.fromJSON(esriFeatureSampleSource);\r\n const featureJson = new ArcGisFeatureJSON(settings, {name: \"SampleLayer\"});\r\n // In some cases, PBF gives more floating-point precision than JSON.\r\n // Since I want to use the same output reference for both formats, I force a max precision of 8.\r\n featureJson.floatPrecision = 8;\r\n const results: MapLayerFeatureInfo[] = [];\r\n const data = JSON.parse(PhillyLandmarksDataset.phillyAirportGetFeatureInfoQueryJson);\r\n featureJson.readFeatureInfo({data, exceedTransferLimit: false}, results);\r\n const _test = JSON.stringify(results);\r\n expect(_test).equals(JSON.stringify(PhillyLandmarksDataset.phillyAirportGetFeatureInfoResultRef));\r\n });\r\n\r\n it(\"should deflate coordinates array\", async () => {\r\n // Simple deflate stride = 2\r\n let doubleArray = [[1,2], [3,4]];\r\n let deflated: number[] = [];\r\n let offset = (ArcGisFeatureJSON as any).deflateCoordinates(doubleArray, deflated, 2, 0);\r\n expect(offset).to.equals(4);\r\n expect(deflated).to.eql([1,2,3,4]);\r\n\r\n /// Check offset with stride = 2\r\n doubleArray = [[5,6]];\r\n offset = (ArcGisFeatureJSON as any).deflateCoordinates(doubleArray, deflated, 2, offset);\r\n expect(offset).to.equals(6);\r\n expect(deflated).to.eql([1,2,3,4,5,6]);\r\n\r\n // Simple deflate stride = 3\r\n doubleArray = [[1,2,3], [4,5,6]];\r\n deflated = [];\r\n offset = (ArcGisFeatureJSON as any).deflateCoordinates(doubleArray, deflated, 3, 0);\r\n expect(offset).to.equals(6);\r\n expect(deflated).to.eql([1,2,3,4,5,6]);\r\n\r\n /// Check offset with stride = 3\r\n doubleArray = [[7,8,9]];\r\n offset = (ArcGisFeatureJSON as any).deflateCoordinates(doubleArray, deflated, 3, offset);\r\n expect(offset).to.equals(9);\r\n expect(deflated).to.eql([1,2,3,4,5,6,7,8,9]);\r\n });\r\n\r\n it(\"should readAndRender single ring polygon feature\", async () => {\r\n const featureJson = createFeatureJSON();\r\n\r\n const data = PhillyLandmarksDataset.phillySimplePolyQueryJson;\r\n\r\n const symbolRenderer = new ArcGisSymbologyRenderer(data.geometryType as ArcGisFeatureGeometryType, PhillyLandmarksDataset.phillySimplePolyDrawingInfo.drawingInfo.renderer);\r\n\r\n const featureRenderer = new ArcGisFeatureRenderer(fakeContext, symbolRenderer);\r\n const renderPathSpy = sinon.spy(featureRenderer, \"renderPath\");\r\n featureJson.readAndRender({data, exceedTransferLimit: false}, featureRenderer);\r\n expect(renderPathSpy.calledOnce);\r\n\r\n const firstCall = renderPathSpy.getCalls()[0];\r\n expect(firstCall.args[0]).to.eql(PhillyLandmarksDataset.phillySimplePolyQueryPbf.queryResult.featureResult.features[0].geometry.lengths); // geometryLengths\r\n expect(firstCall.args[1]).to.eql(PhillyLandmarksDataset.phillySimplePolyQueryPbf.queryResult.featureResult.features[0].geometry.coords); // geometryCoords\r\n expect(firstCall.args[2]).to.eql(true); // fill\r\n expect(firstCall.args[3]).to.eql(2); // stride\r\n });\r\n\r\n it(\"should readAndRender multiple ring polygon feature\", async () => {\r\n const featureJson = createFeatureJSON();\r\n\r\n const data = PhillyLandmarksDataset.phillyDoubleRingPolyQueryJson;\r\n\r\n const symbolRenderer = new ArcGisSymbologyRenderer(data.geometryType as ArcGisFeatureGeometryType, PhillyLandmarksDataset.phillySimplePolyDrawingInfo.drawingInfo.renderer);\r\n\r\n const featureRenderer = new ArcGisFeatureRenderer(fakeContext, symbolRenderer);\r\n const renderPathSpy = sinon.spy(featureRenderer, \"renderPath\");\r\n featureJson.readAndRender({data, exceedTransferLimit: false}, featureRenderer);\r\n expect(renderPathSpy.calledOnce);\r\n\r\n const firstCall = renderPathSpy.getCalls()[0];\r\n expect(firstCall.args[0]).to.eql(PhillyLandmarksDataset.phillyDoubleRingPolyQueryPbf.queryResult.featureResult.features[0].geometry.lengths); // geometryLengths\r\n expect(firstCall.args[1]).to.eql(PhillyLandmarksDataset.phillyDoubleRingPolyQueryPbf.queryResult.featureResult.features[0].geometry.coords); // geometryCoords\r\n expect(firstCall.args[2]).to.eql(true); // fill\r\n expect(firstCall.args[3]).to.eql(2); // stride\r\n });\r\n\r\n it(\"should readAndRender simple path\", async () => {\r\n const featureJson = createFeatureJSON();\r\n const data = PhillyLandmarksDataset.phillySimplePathQueryJson;\r\n const symbolRenderer = new ArcGisSymbologyRenderer(data.geometryType as ArcGisFeatureGeometryType,\r\n PhillyLandmarksDataset.phillySimpleLineDrawingInfo.drawingInfo.renderer);\r\n\r\n const featureRenderer = new ArcGisFeatureRenderer(fakeContext, symbolRenderer);\r\n const renderPathSpy = sinon.spy(featureRenderer, \"renderPath\");\r\n featureJson.readAndRender({data, exceedTransferLimit: false}, featureRenderer);\r\n expect(renderPathSpy.calledOnce);\r\n\r\n 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];\r\n const firstCall = renderPathSpy.getCalls()[0];\r\n expect(firstCall.args[0]).to.eql([24]); // geometryLengths\r\n expect(firstCall.args[1]).to.eql(geometryCoords); // geometryCoords\r\n expect(firstCall.args[2]).to.eql(false); // fill\r\n expect(firstCall.args[3]).to.eql(2); // stride\r\n });\r\n\r\n it(\"should readAndRender multi path\", async () => {\r\n const featureJson = createFeatureJSON();\r\n const data = PhillyLandmarksDataset.phillyMultiPathQueryJson;\r\n const symbolRenderer = new ArcGisSymbologyRenderer(data.geometryType as ArcGisFeatureGeometryType, PhillyLandmarksDataset.phillySimpleLineDrawingInfo.drawingInfo.renderer);\r\n\r\n const featureRenderer = new ArcGisFeatureRenderer(fakeContext, symbolRenderer);\r\n const renderPathSpy = sinon.spy(featureRenderer, \"renderPath\");\r\n featureJson.readAndRender({data, exceedTransferLimit: false}, featureRenderer);\r\n expect(renderPathSpy.calledOnce);\r\n\r\n // Pbf contains already the right output format expect, lets rely on that.\r\n const firstCall = renderPathSpy.getCalls()[0];\r\n expect(firstCall.args[0]).to.eql(PhillyLandmarksDataset.phillyMultiPathQueryPbf.queryResult.featureResult.features[0].geometry.lengths);\r\n expect(firstCall.args[1]).to.eql(PhillyLandmarksDataset.phillyMultiPathQueryPbf.queryResult.featureResult.features[0].geometry.coords);\r\n expect(firstCall.args[2]).to.eql(false); // fill\r\n expect(firstCall.args[3]).to.eql(2); // stride\r\n });\r\n\r\n it(\"should readAndRender simple point\", async () => {\r\n const featureJson = createFeatureJSON();\r\n const data = PhillyLandmarksDataset.phillySimplePointQueryJson;\r\n const symbolRenderer = new ArcGisSymbologyRenderer(\r\n data.geometryType as ArcGisFeatureGeometryType,\r\n PhillyLandmarksDataset.phillySimplePointDrawingInfo.drawingInfo.renderer);\r\n\r\n const featureRenderer = new ArcGisFeatureRenderer(fakeContext, symbolRenderer);\r\n const spy = sinon.spy(featureRenderer, \"renderPoint\");\r\n featureJson.readAndRender({data, exceedTransferLimit: false}, featureRenderer);\r\n expect(spy.calledOnce);\r\n\r\n // Pbf contains already the right output format expect, lets rely on that.\r\n const geometryCoords = PhillyLandmarksDataset.phillySimplePointQueryPbf.queryResult.featureResult.features[0].geometry.coords;\r\n const firstCall = spy.getCalls()[0];\r\n expect(firstCall.args[0]).to.eql(PhillyLandmarksDataset.phillySimplePointQueryPbf.queryResult.featureResult.features[0].geometry.lengths); // geometryLengths\r\n expect(firstCall.args[1]).to.eql(geometryCoords); // geometryCoords\r\n expect(firstCall.args[2]).to.eql(2); // stride\r\n });\r\n\r\n it(\"should log error when readAndRender / readFeatureInfo is called invalid response Data\", async () => {\r\n const featureJson = createFeatureJSON();\r\n const symbolRenderer = new ArcGisSymbologyRenderer(\r\n \"esriGeometryAny\",\r\n PhillyLandmarksDataset.phillySimplePointDrawingInfo.drawingInfo.renderer);\r\n\r\n const featureRenderer = new ArcGisFeatureRenderer(fakeContext, symbolRenderer);\r\n const logErrorSpy = sandbox.spy(Logger, \"logError\");\r\n featureJson.readAndRender({data: {test:\"test\"}, exceedTransferLimit: false}, featureRenderer);\r\n expect(logErrorSpy.calledOnce);\r\n\r\n logErrorSpy.resetHistory();\r\n featureJson.readFeatureInfo({data: {test:\"test\"}, exceedTransferLimit: false}, []);\r\n expect(logErrorSpy.calledOnce);\r\n\r\n });\r\n});\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ArcGisFeaturePBF.test.js","sourceRoot":"","sources":["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AU,CAAC,CAAC;QAE/B,WAAW,CAAC,YAAY,EAAE,CAAC;QAC3B,UAAU,CAAC,eAAe,CAAC,EAAC,IAAI,EAAE,EAAC,IAAI,EAAC,MAAM,EAAC,EAAE,mBAAmB,EAAE,KAAK,EAAC,EAAE,EAAE,CAAC,CAAC;QAClF,MAAM,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;IAEjC,CAAC,CAAC,CAAC;AAEL,CAAC,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\nimport { Logger } from \"@itwin/core-bentley\";\nimport { Base64EncodedString, ImageMapLayerSettings } from \"@itwin/core-common\";\nimport { MapLayerFeatureInfo } from \"@itwin/core-frontend\";\nimport { expect } from \"chai\";\nimport * as sinon from \"sinon\";\nimport { ArcGisFeaturePBF } from \"../../ArcGisFeature/ArcGisFeaturePBF\";\nimport { ArcGisFeatureRenderer } from \"../../ArcGisFeature/ArcGisFeatureRenderer\";\nimport { ArcGisSymbologyRenderer } from \"../../ArcGisFeature/ArcGisSymbologyRenderer\";\nimport { esriPBuffer } from \"../../ArcGisFeature/esriPBuffer.gen\";\nimport { esriFeatureSampleSource, fakeContext } from \"./Mocks\";\nimport { PhillyLandmarksDataset } from \"./PhillyLandmarksDataset\";\n\nconst createFeaturePBF = () => {\n const settings = ImageMapLayerSettings.fromJSON(esriFeatureSampleSource);\n const featurePbf = new ArcGisFeaturePBF(settings, {name: \"SampleLayer\"});\n\n // Locale configuration depends on the testing machine (i.e. linux vs windows),\n // so we need to force date display to Iso to get a consistent value.\n // In real scenario, we still want dates to be displayed in end-user's locale.\n featurePbf.forceDateDisplayValueToIso = true;\n return featurePbf;\n};\n\ndescribe(\"ArcGisFeaturePBF\", () => {\n\n const sandbox = sinon.createSandbox();\n\n afterEach(async () => {\n sandbox.restore();\n });\n\n it(\"should convert pbf geometry type to Esri types\", async () => {\n\n expect (\n ArcGisFeaturePBF.getArcGisFeatureGeometryType(esriPBuffer.FeatureCollectionPBuffer.GeometryType.esriGeometryTypeMultipatch))\n .to.equals(\"esriGeometryMultiPatch\");\n\n expect (\n ArcGisFeaturePBF.getArcGisFeatureGeometryType(esriPBuffer.FeatureCollectionPBuffer.GeometryType.esriGeometryTypeMultipoint))\n .to.equals(\"esriGeometryMultipoint\");\n\n expect (\n ArcGisFeaturePBF.getArcGisFeatureGeometryType(esriPBuffer.FeatureCollectionPBuffer.GeometryType.esriGeometryTypePoint))\n .to.equals(\"esriGeometryPoint\");\n\n expect (\n ArcGisFeaturePBF.getArcGisFeatureGeometryType(esriPBuffer.FeatureCollectionPBuffer.GeometryType.esriGeometryTypePolygon))\n .to.equals(\"esriGeometryPolygon\");\n\n expect (\n ArcGisFeaturePBF.getArcGisFeatureGeometryType(esriPBuffer.FeatureCollectionPBuffer.GeometryType.esriGeometryTypePolyline))\n .to.equals(\"esriGeometryPolyline\");\n\n expect (\n ArcGisFeaturePBF.getArcGisFeatureGeometryType(\"\" as unknown as esriPBuffer.FeatureCollectionPBuffer.GeometryType))\n .to.equals(\"esriGeometryNull\");\n\n });\n\n it(\"should read FeatureInfo in PBF\", async () => {\n const byteArray = Base64EncodedString.toUint8Array(PhillyLandmarksDataset.phillyAirportGetFeatureInfoQueryPbf);\n const featureCollection = esriPBuffer.FeatureCollectionPBuffer.deserialize(byteArray);\n\n const settings = ImageMapLayerSettings.fromJSON(esriFeatureSampleSource);\n const featurePbf = new ArcGisFeaturePBF(settings, {name: \"SampleLayer\"});\n\n // In some cases, PBF gives more floating-point precision than JSON.\n // Since I want to use the same output reference for both formats, I force a max precision of 8.\n featurePbf.floatPrecision = 8;\n const results: MapLayerFeatureInfo[] = [];\n featurePbf.readFeatureInfo({data:featureCollection, exceedTransferLimit: false}, results);\n\n // Make deep comparison by using JSON.stringify\n expect(JSON.stringify(results)).equals(JSON.stringify(PhillyLandmarksDataset.phillyAirportGetFeatureInfoResultRef));\n\n });\n\n it(\"should read FeatureInfo from PBF (philly transportation)\", async () => {\n\n const byteArray = Base64EncodedString.toUint8Array(PhillyLandmarksDataset.phillyTransportationGetFeatureInfoQueryEncodedPbf);\n const featureCollection = esriPBuffer.FeatureCollectionPBuffer.deserialize(byteArray);\n const featurePbf = createFeaturePBF();\n\n // In some cases, PBF gives more floating-point precision than JSON.\n // Since I want to use the same output reference for both formats, I force a max precision.\n featurePbf.floatPrecision = 2;\n const results: MapLayerFeatureInfo[] = [];\n featurePbf.readFeatureInfo({data:featureCollection, exceedTransferLimit: false}, results);\n\n // Make deep comparison by using JSON.stringify\n expect(JSON.stringify(results)).equals(JSON.stringify(PhillyLandmarksDataset.phillyTansportationGetFeatureInfoResultRef));\n\n });\n\n it(\"should read all data types from FeatureInfo \", async () => {\n\n // In this test we use a synthetic PBuffer object to initialize a feature collection object.\n // The is to ensure we cover correctly all possible attribute value types.\n const featureCollection = esriPBuffer.FeatureCollectionPBuffer.fromObject(PhillyLandmarksDataset.fieldsCoveragePbufferCollection);\n\n const featurePbf = createFeaturePBF();\n\n const results: MapLayerFeatureInfo[] = [];\n featurePbf.readFeatureInfo({data:featureCollection, exceedTransferLimit: false}, results);\n\n // Make deep comparison by using JSON.stringify\n expect(JSON.stringify(results)).equals(JSON.stringify(PhillyLandmarksDataset.fieldsCoverageGetFeatureInfoResultRef));\n });\n\n it(\"should readAndRender single ring polygon feature\", async () => {\n const featurePbf = createFeaturePBF();\n\n const data = esriPBuffer.FeatureCollectionPBuffer.fromObject(PhillyLandmarksDataset.phillySimplePolyQueryPbf);\n const geomType = ArcGisFeaturePBF.getArcGisFeatureGeometryType(PhillyLandmarksDataset.phillySimplePolyQueryPbf.queryResult.featureResult.geometryType);\n const symbolRenderer = new ArcGisSymbologyRenderer(geomType, PhillyLandmarksDataset.phillySimplePolyDrawingInfo.drawingInfo.renderer);\n\n const featureRenderer = new ArcGisFeatureRenderer(fakeContext, symbolRenderer);\n const renderPathSpy = sinon.spy(featureRenderer, \"renderPath\");\n featurePbf.readAndRender({data, exceedTransferLimit: false}, featureRenderer);\n expect(renderPathSpy.calledOnce);\n\n const firstCall = renderPathSpy.getCalls()[0];\n expect(firstCall.args[0]).to.eql(PhillyLandmarksDataset.phillySimplePolyQueryPbf.queryResult.featureResult.features[0].geometry.lengths); // geometryLengths\n expect(firstCall.args[1]).to.eql(PhillyLandmarksDataset.phillySimplePolyQueryPbf.queryResult.featureResult.features[0].geometry.coords); // geometryCoords\n expect(firstCall.args[2]).to.eql(true); // fill\n expect(firstCall.args[3]).to.eql(2); // stride\n });\n\n it(\"should readAndRender multiple ring polygon feature\", async () => {\n const featurePbf = createFeaturePBF();\n\n const geomType = ArcGisFeaturePBF.getArcGisFeatureGeometryType(PhillyLandmarksDataset.phillyDoubleRingPolyQueryPbf.queryResult.featureResult.geometryType);\n const data = esriPBuffer.FeatureCollectionPBuffer.fromObject(PhillyLandmarksDataset.phillyDoubleRingPolyQueryPbf);\n\n const symbolRenderer = new ArcGisSymbologyRenderer(geomType, PhillyLandmarksDataset.phillySimplePolyDrawingInfo.drawingInfo.renderer);\n\n const featureRenderer = new ArcGisFeatureRenderer(fakeContext, symbolRenderer);\n const renderPathSpy = sinon.spy(featureRenderer, \"renderPath\");\n featurePbf.readAndRender({data, exceedTransferLimit: false}, featureRenderer);\n expect(renderPathSpy.calledOnce);\n\n const firstCall = renderPathSpy.getCalls()[0];\n expect(firstCall.args[0]).to.eql(PhillyLandmarksDataset.phillyDoubleRingPolyQueryPbf.queryResult.featureResult.features[0].geometry.lengths); // geometryLengths\n expect(firstCall.args[1]).to.eql(PhillyLandmarksDataset.phillyDoubleRingPolyQueryPbf.queryResult.featureResult.features[0].geometry.coords); // geometryCoords\n expect(firstCall.args[2]).to.eql(true); // fill\n expect(firstCall.args[3]).to.eql(2); // stride\n });\n\n it(\"should readAndRender simple path\", async () => {\n const featurePbf = createFeaturePBF();\n const data = esriPBuffer.FeatureCollectionPBuffer.fromObject(PhillyLandmarksDataset.phillySimplePathQueryPbf);\n const symbolRenderer = new ArcGisSymbologyRenderer(\n ArcGisFeaturePBF.getArcGisFeatureGeometryType(PhillyLandmarksDataset.phillySimplePathQueryPbf.queryResult.featureResult.geometryType),\n PhillyLandmarksDataset.phillySimpleLineDrawingInfo.drawingInfo.renderer);\n\n const featureRenderer = new ArcGisFeatureRenderer(fakeContext, symbolRenderer);\n const renderPathSpy = sinon.spy(featureRenderer, \"renderPath\");\n featurePbf.readAndRender({data, exceedTransferLimit: false}, featureRenderer);\n expect(renderPathSpy.calledOnce);\n\n const firstCall = renderPathSpy.getCalls()[0];\n expect(firstCall).to.not.undefined;\n expect(firstCall.args[0]).to.eql(PhillyLandmarksDataset.phillySimplePathQueryPbf.queryResult.featureResult.features[0].geometry.lengths); // geometryLengths\n expect(firstCall.args[1]).to.eql(PhillyLandmarksDataset.phillySimplePathQueryPbf.queryResult.featureResult.features[0].geometry.coords); // geometryCoords\n expect(firstCall.args[2]).to.eql(false); // fill\n expect(firstCall.args[3]).to.eql(2); // stride\n });\n\n it(\"should readAndRender multi path\", async () => {\n const featurePbf = createFeaturePBF();\n const data = esriPBuffer.FeatureCollectionPBuffer.fromObject(PhillyLandmarksDataset.phillyMultiPathQueryPbf);\n const geomType = ArcGisFeaturePBF.getArcGisFeatureGeometryType(PhillyLandmarksDataset.phillyMultiPathQueryPbf.queryResult.featureResult.geometryType);\n const symbolRenderer = new ArcGisSymbologyRenderer(geomType, PhillyLandmarksDataset.phillySimpleLineDrawingInfo.drawingInfo.renderer);\n const featureRenderer = new ArcGisFeatureRenderer(fakeContext, symbolRenderer);\n const renderPathSpy = sinon.spy(featureRenderer, \"renderPath\");\n featurePbf.readAndRender({data, exceedTransferLimit: false}, featureRenderer);\n expect(renderPathSpy.calledOnce);\n\n const firstCall = renderPathSpy.getCalls()[0];\n expect(firstCall.args[0]).to.eql(PhillyLandmarksDataset.phillyMultiPathQueryPbf.queryResult.featureResult.features[0].geometry.lengths); // geometryLengths\n expect(firstCall.args[1]).to.eql(PhillyLandmarksDataset.phillyMultiPathQueryPbf.queryResult.featureResult.features[0].geometry.coords); // geometryCoords\n expect(firstCall.args[2]).to.eql(false); // fill\n expect(firstCall.args[3]).to.eql(2); // stride\n });\n\n it(\"should readAndRender simple point\", async () => {\n const featurePbf = createFeaturePBF();\n const data = esriPBuffer.FeatureCollectionPBuffer.fromObject(PhillyLandmarksDataset.phillySimplePointQueryPbf);\n const geomType = ArcGisFeaturePBF.getArcGisFeatureGeometryType(PhillyLandmarksDataset.phillyMultiPathQueryPbf.queryResult.featureResult.geometryType);\n const symbolRenderer = new ArcGisSymbologyRenderer(geomType, PhillyLandmarksDataset.phillySimplePointDrawingInfo.drawingInfo.renderer);\n\n const featureRenderer = new ArcGisFeatureRenderer(fakeContext, symbolRenderer);\n const spy = sinon.spy(featureRenderer, \"renderPoint\");\n featurePbf.readAndRender({data, exceedTransferLimit: false}, featureRenderer);\n expect(spy.calledOnce);\n\n // Pbf contains already the right output format expect, lets rely on that.\n const geometryCoords = PhillyLandmarksDataset.phillySimplePointQueryPbf.queryResult.featureResult.features[0].geometry.coords;\n const firstCall = spy.getCalls()[0];\n expect(firstCall.args[0]).to.eql(PhillyLandmarksDataset.phillySimplePointQueryPbf.queryResult.featureResult.features[0].geometry.lengths); // geometryLengths\n expect(firstCall.args[1]).to.eql(geometryCoords); // geometryCoords\n expect(firstCall.args[2]).to.eql(2); // stride\n });\n\n it(\"should log error when readAndRender / readFeatureInfo is called invalid response Data\", async () => {\n const featurePbf = createFeaturePBF();\n const symbolRenderer = new ArcGisSymbologyRenderer(\n \"esriGeometryAny\",\n PhillyLandmarksDataset.phillySimplePointDrawingInfo.drawingInfo.renderer);\n\n const featureRenderer = new ArcGisFeatureRenderer(fakeContext, symbolRenderer);\n const logErrorSpy = sandbox.spy(Logger, \"logError\");\n featurePbf.readAndRender({data: {test:\"test\"}, exceedTransferLimit: false}, featureRenderer);\n expect(logErrorSpy.calledOnce);\n\n logErrorSpy.resetHistory();\n featurePbf.readFeatureInfo({data: {test:\"test\"}, exceedTransferLimit: false}, []);\n expect(logErrorSpy.calledOnce);\n\n });\n\n});\n"]}
|
|
1
|
+
{"version":3,"file":"ArcGisFeaturePBF.test.js","sourceRoot":"","sources":["../../../../src/test/ArcGisFeature/ArcGisFeaturePBF.test.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAEhF,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAC9B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,EAAE,qBAAqB,EAAE,MAAM,2CAA2C,CAAC;AAClF,OAAO,EAAE,uBAAuB,EAAE,MAAM,6CAA6C,CAAC;AACtF,OAAO,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AAClE,OAAO,EAAE,uBAAuB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAC/D,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAElE,MAAM,gBAAgB,GAAI,GAAG,EAAE;IAC7B,MAAM,QAAQ,GAAG,qBAAqB,CAAC,QAAQ,CAAC,uBAAuB,CAAC,CAAC;IACzE,MAAM,UAAU,GAAG,IAAI,gBAAgB,CAAC,QAAQ,EAAE,EAAC,IAAI,EAAE,aAAa,EAAC,CAAC,CAAC;IAEzE,+EAA+E;IAC/E,qEAAqE;IACrE,8EAA8E;IAC9E,UAAU,CAAC,0BAA0B,GAAG,IAAI,CAAC;IAC7C,OAAO,UAAU,CAAC;AACpB,CAAC,CAAC;AAEF,QAAQ,CAAC,kBAAkB,EAAE,GAAG,EAAE;IAEhC,MAAM,OAAO,GAAG,KAAK,CAAC,aAAa,EAAE,CAAC;IAEtC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,UAAU,CAAC,aAAa,CAAC,EAAC,IAAI,EAAE,EAAC,IAAI,EAAC,MAAM,EAAC,EAAE,mBAAmB,EAAE,KAAK,EAAC,EAAE,eAAe,CAAC,CAAC;QAC7F,MAAM,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;QAE/B,WAAW,CAAC,YAAY,EAAE,CAAC;QAC3B,UAAU,CAAC,eAAe,CAAC,EAAC,IAAI,EAAE,EAAC,IAAI,EAAC,MAAM,EAAC,EAAE,mBAAmB,EAAE,KAAK,EAAC,EAAE,EAAE,CAAC,CAAC;QAClF,MAAM,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;IAEjC,CAAC,CAAC,CAAC;AAEL,CAAC,CAAC,CAAC","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\nimport { Logger } from \"@itwin/core-bentley\";\r\nimport { Base64EncodedString, ImageMapLayerSettings } from \"@itwin/core-common\";\r\nimport { MapLayerFeatureInfo } from \"@itwin/core-frontend\";\r\nimport { expect } from \"chai\";\r\nimport * as sinon from \"sinon\";\r\nimport { ArcGisFeaturePBF } from \"../../ArcGisFeature/ArcGisFeaturePBF\";\r\nimport { ArcGisFeatureRenderer } from \"../../ArcGisFeature/ArcGisFeatureRenderer\";\r\nimport { ArcGisSymbologyRenderer } from \"../../ArcGisFeature/ArcGisSymbologyRenderer\";\r\nimport { esriPBuffer } from \"../../ArcGisFeature/esriPBuffer.gen\";\r\nimport { esriFeatureSampleSource, fakeContext } from \"./Mocks\";\r\nimport { PhillyLandmarksDataset } from \"./PhillyLandmarksDataset\";\r\n\r\nconst createFeaturePBF = () => {\r\n const settings = ImageMapLayerSettings.fromJSON(esriFeatureSampleSource);\r\n const featurePbf = new ArcGisFeaturePBF(settings, {name: \"SampleLayer\"});\r\n\r\n // Locale configuration depends on the testing machine (i.e. linux vs windows),\r\n // so we need to force date display to Iso to get a consistent value.\r\n // In real scenario, we still want dates to be displayed in end-user's locale.\r\n featurePbf.forceDateDisplayValueToIso = true;\r\n return featurePbf;\r\n};\r\n\r\ndescribe(\"ArcGisFeaturePBF\", () => {\r\n\r\n const sandbox = sinon.createSandbox();\r\n\r\n afterEach(async () => {\r\n sandbox.restore();\r\n });\r\n\r\n it(\"should convert pbf geometry type to Esri types\", async () => {\r\n\r\n expect (\r\n ArcGisFeaturePBF.getArcGisFeatureGeometryType(esriPBuffer.FeatureCollectionPBuffer.GeometryType.esriGeometryTypeMultipatch))\r\n .to.equals(\"esriGeometryMultiPatch\");\r\n\r\n expect (\r\n ArcGisFeaturePBF.getArcGisFeatureGeometryType(esriPBuffer.FeatureCollectionPBuffer.GeometryType.esriGeometryTypeMultipoint))\r\n .to.equals(\"esriGeometryMultipoint\");\r\n\r\n expect (\r\n ArcGisFeaturePBF.getArcGisFeatureGeometryType(esriPBuffer.FeatureCollectionPBuffer.GeometryType.esriGeometryTypePoint))\r\n .to.equals(\"esriGeometryPoint\");\r\n\r\n expect (\r\n ArcGisFeaturePBF.getArcGisFeatureGeometryType(esriPBuffer.FeatureCollectionPBuffer.GeometryType.esriGeometryTypePolygon))\r\n .to.equals(\"esriGeometryPolygon\");\r\n\r\n expect (\r\n ArcGisFeaturePBF.getArcGisFeatureGeometryType(esriPBuffer.FeatureCollectionPBuffer.GeometryType.esriGeometryTypePolyline))\r\n .to.equals(\"esriGeometryPolyline\");\r\n\r\n expect (\r\n ArcGisFeaturePBF.getArcGisFeatureGeometryType(\"\" as unknown as esriPBuffer.FeatureCollectionPBuffer.GeometryType))\r\n .to.equals(\"esriGeometryNull\");\r\n\r\n });\r\n\r\n it(\"should read FeatureInfo in PBF\", async () => {\r\n const byteArray = Base64EncodedString.toUint8Array(PhillyLandmarksDataset.phillyAirportGetFeatureInfoQueryPbf);\r\n const featureCollection = esriPBuffer.FeatureCollectionPBuffer.deserialize(byteArray);\r\n\r\n const settings = ImageMapLayerSettings.fromJSON(esriFeatureSampleSource);\r\n const featurePbf = new ArcGisFeaturePBF(settings, {name: \"SampleLayer\"});\r\n\r\n // In some cases, PBF gives more floating-point precision than JSON.\r\n // Since I want to use the same output reference for both formats, I force a max precision of 8.\r\n featurePbf.floatPrecision = 8;\r\n const results: MapLayerFeatureInfo[] = [];\r\n featurePbf.readFeatureInfo({data:featureCollection, exceedTransferLimit: false}, results);\r\n\r\n // Make deep comparison by using JSON.stringify\r\n expect(JSON.stringify(results)).equals(JSON.stringify(PhillyLandmarksDataset.phillyAirportGetFeatureInfoResultRef));\r\n\r\n });\r\n\r\n it(\"should read FeatureInfo from PBF (philly transportation)\", async () => {\r\n\r\n const byteArray = Base64EncodedString.toUint8Array(PhillyLandmarksDataset.phillyTransportationGetFeatureInfoQueryEncodedPbf);\r\n const featureCollection = esriPBuffer.FeatureCollectionPBuffer.deserialize(byteArray);\r\n const featurePbf = createFeaturePBF();\r\n\r\n // In some cases, PBF gives more floating-point precision than JSON.\r\n // Since I want to use the same output reference for both formats, I force a max precision.\r\n featurePbf.floatPrecision = 2;\r\n const results: MapLayerFeatureInfo[] = [];\r\n featurePbf.readFeatureInfo({data:featureCollection, exceedTransferLimit: false}, results);\r\n\r\n // Make deep comparison by using JSON.stringify\r\n expect(JSON.stringify(results)).equals(JSON.stringify(PhillyLandmarksDataset.phillyTansportationGetFeatureInfoResultRef));\r\n\r\n });\r\n\r\n it(\"should read all data types from FeatureInfo \", async () => {\r\n\r\n // In this test we use a synthetic PBuffer object to initialize a feature collection object.\r\n // The is to ensure we cover correctly all possible attribute value types.\r\n const featureCollection = esriPBuffer.FeatureCollectionPBuffer.fromObject(PhillyLandmarksDataset.fieldsCoveragePbufferCollection);\r\n\r\n const featurePbf = createFeaturePBF();\r\n\r\n const results: MapLayerFeatureInfo[] = [];\r\n featurePbf.readFeatureInfo({data:featureCollection, exceedTransferLimit: false}, results);\r\n\r\n // Make deep comparison by using JSON.stringify\r\n expect(JSON.stringify(results)).equals(JSON.stringify(PhillyLandmarksDataset.fieldsCoverageGetFeatureInfoResultRef));\r\n });\r\n\r\n it(\"should readAndRender single ring polygon feature\", async () => {\r\n const featurePbf = createFeaturePBF();\r\n\r\n const data = esriPBuffer.FeatureCollectionPBuffer.fromObject(PhillyLandmarksDataset.phillySimplePolyQueryPbf);\r\n const geomType = ArcGisFeaturePBF.getArcGisFeatureGeometryType(PhillyLandmarksDataset.phillySimplePolyQueryPbf.queryResult.featureResult.geometryType);\r\n const symbolRenderer = new ArcGisSymbologyRenderer(geomType, PhillyLandmarksDataset.phillySimplePolyDrawingInfo.drawingInfo.renderer);\r\n\r\n const featureRenderer = new ArcGisFeatureRenderer(fakeContext, symbolRenderer);\r\n const renderPathSpy = sinon.spy(featureRenderer, \"renderPath\");\r\n featurePbf.readAndRender({data, exceedTransferLimit: false}, featureRenderer);\r\n expect(renderPathSpy.calledOnce);\r\n\r\n const firstCall = renderPathSpy.getCalls()[0];\r\n expect(firstCall.args[0]).to.eql(PhillyLandmarksDataset.phillySimplePolyQueryPbf.queryResult.featureResult.features[0].geometry.lengths); // geometryLengths\r\n expect(firstCall.args[1]).to.eql(PhillyLandmarksDataset.phillySimplePolyQueryPbf.queryResult.featureResult.features[0].geometry.coords); // geometryCoords\r\n expect(firstCall.args[2]).to.eql(true); // fill\r\n expect(firstCall.args[3]).to.eql(2); // stride\r\n });\r\n\r\n it(\"should readAndRender multiple ring polygon feature\", async () => {\r\n const featurePbf = createFeaturePBF();\r\n\r\n const geomType = ArcGisFeaturePBF.getArcGisFeatureGeometryType(PhillyLandmarksDataset.phillyDoubleRingPolyQueryPbf.queryResult.featureResult.geometryType);\r\n const data = esriPBuffer.FeatureCollectionPBuffer.fromObject(PhillyLandmarksDataset.phillyDoubleRingPolyQueryPbf);\r\n\r\n const symbolRenderer = new ArcGisSymbologyRenderer(geomType, PhillyLandmarksDataset.phillySimplePolyDrawingInfo.drawingInfo.renderer);\r\n\r\n const featureRenderer = new ArcGisFeatureRenderer(fakeContext, symbolRenderer);\r\n const renderPathSpy = sinon.spy(featureRenderer, \"renderPath\");\r\n featurePbf.readAndRender({data, exceedTransferLimit: false}, featureRenderer);\r\n expect(renderPathSpy.calledOnce);\r\n\r\n const firstCall = renderPathSpy.getCalls()[0];\r\n expect(firstCall.args[0]).to.eql(PhillyLandmarksDataset.phillyDoubleRingPolyQueryPbf.queryResult.featureResult.features[0].geometry.lengths); // geometryLengths\r\n expect(firstCall.args[1]).to.eql(PhillyLandmarksDataset.phillyDoubleRingPolyQueryPbf.queryResult.featureResult.features[0].geometry.coords); // geometryCoords\r\n expect(firstCall.args[2]).to.eql(true); // fill\r\n expect(firstCall.args[3]).to.eql(2); // stride\r\n });\r\n\r\n it(\"should readAndRender simple path\", async () => {\r\n const featurePbf = createFeaturePBF();\r\n const data = esriPBuffer.FeatureCollectionPBuffer.fromObject(PhillyLandmarksDataset.phillySimplePathQueryPbf);\r\n const symbolRenderer = new ArcGisSymbologyRenderer(\r\n ArcGisFeaturePBF.getArcGisFeatureGeometryType(PhillyLandmarksDataset.phillySimplePathQueryPbf.queryResult.featureResult.geometryType),\r\n PhillyLandmarksDataset.phillySimpleLineDrawingInfo.drawingInfo.renderer);\r\n\r\n const featureRenderer = new ArcGisFeatureRenderer(fakeContext, symbolRenderer);\r\n const renderPathSpy = sinon.spy(featureRenderer, \"renderPath\");\r\n featurePbf.readAndRender({data, exceedTransferLimit: false}, featureRenderer);\r\n expect(renderPathSpy.calledOnce);\r\n\r\n const firstCall = renderPathSpy.getCalls()[0];\r\n expect(firstCall).to.not.undefined;\r\n expect(firstCall.args[0]).to.eql(PhillyLandmarksDataset.phillySimplePathQueryPbf.queryResult.featureResult.features[0].geometry.lengths); // geometryLengths\r\n expect(firstCall.args[1]).to.eql(PhillyLandmarksDataset.phillySimplePathQueryPbf.queryResult.featureResult.features[0].geometry.coords); // geometryCoords\r\n expect(firstCall.args[2]).to.eql(false); // fill\r\n expect(firstCall.args[3]).to.eql(2); // stride\r\n });\r\n\r\n it(\"should readAndRender multi path\", async () => {\r\n const featurePbf = createFeaturePBF();\r\n const data = esriPBuffer.FeatureCollectionPBuffer.fromObject(PhillyLandmarksDataset.phillyMultiPathQueryPbf);\r\n const geomType = ArcGisFeaturePBF.getArcGisFeatureGeometryType(PhillyLandmarksDataset.phillyMultiPathQueryPbf.queryResult.featureResult.geometryType);\r\n const symbolRenderer = new ArcGisSymbologyRenderer(geomType, PhillyLandmarksDataset.phillySimpleLineDrawingInfo.drawingInfo.renderer);\r\n const featureRenderer = new ArcGisFeatureRenderer(fakeContext, symbolRenderer);\r\n const renderPathSpy = sinon.spy(featureRenderer, \"renderPath\");\r\n featurePbf.readAndRender({data, exceedTransferLimit: false}, featureRenderer);\r\n expect(renderPathSpy.calledOnce);\r\n\r\n const firstCall = renderPathSpy.getCalls()[0];\r\n expect(firstCall.args[0]).to.eql(PhillyLandmarksDataset.phillyMultiPathQueryPbf.queryResult.featureResult.features[0].geometry.lengths); // geometryLengths\r\n expect(firstCall.args[1]).to.eql(PhillyLandmarksDataset.phillyMultiPathQueryPbf.queryResult.featureResult.features[0].geometry.coords); // geometryCoords\r\n expect(firstCall.args[2]).to.eql(false); // fill\r\n expect(firstCall.args[3]).to.eql(2); // stride\r\n });\r\n\r\n it(\"should readAndRender simple point\", async () => {\r\n const featurePbf = createFeaturePBF();\r\n const data = esriPBuffer.FeatureCollectionPBuffer.fromObject(PhillyLandmarksDataset.phillySimplePointQueryPbf);\r\n const geomType = ArcGisFeaturePBF.getArcGisFeatureGeometryType(PhillyLandmarksDataset.phillyMultiPathQueryPbf.queryResult.featureResult.geometryType);\r\n const symbolRenderer = new ArcGisSymbologyRenderer(geomType, PhillyLandmarksDataset.phillySimplePointDrawingInfo.drawingInfo.renderer);\r\n\r\n const featureRenderer = new ArcGisFeatureRenderer(fakeContext, symbolRenderer);\r\n const spy = sinon.spy(featureRenderer, \"renderPoint\");\r\n featurePbf.readAndRender({data, exceedTransferLimit: false}, featureRenderer);\r\n expect(spy.calledOnce);\r\n\r\n // Pbf contains already the right output format expect, lets rely on that.\r\n const geometryCoords = PhillyLandmarksDataset.phillySimplePointQueryPbf.queryResult.featureResult.features[0].geometry.coords;\r\n const firstCall = spy.getCalls()[0];\r\n expect(firstCall.args[0]).to.eql(PhillyLandmarksDataset.phillySimplePointQueryPbf.queryResult.featureResult.features[0].geometry.lengths); // geometryLengths\r\n expect(firstCall.args[1]).to.eql(geometryCoords); // geometryCoords\r\n expect(firstCall.args[2]).to.eql(2); // stride\r\n });\r\n\r\n it(\"should log error when readAndRender / readFeatureInfo is called invalid response Data\", async () => {\r\n const featurePbf = createFeaturePBF();\r\n const symbolRenderer = new ArcGisSymbologyRenderer(\r\n \"esriGeometryAny\",\r\n PhillyLandmarksDataset.phillySimplePointDrawingInfo.drawingInfo.renderer);\r\n\r\n const featureRenderer = new ArcGisFeatureRenderer(fakeContext, symbolRenderer);\r\n const logErrorSpy = sandbox.spy(Logger, \"logError\");\r\n featurePbf.readAndRender({data: {test:\"test\"}, exceedTransferLimit: false}, featureRenderer);\r\n expect(logErrorSpy.calledOnce);\r\n\r\n logErrorSpy.resetHistory();\r\n featurePbf.readFeatureInfo({data: {test:\"test\"}, exceedTransferLimit: false}, []);\r\n expect(logErrorSpy.calledOnce);\r\n\r\n });\r\n\r\n});\r\n"]}
|
|
@@ -13,12 +13,12 @@ import { NewYorkDataset } from "./NewYorkDataset";
|
|
|
13
13
|
import { base64StringToUint8Array, ByteStream, Logger } from "@itwin/core-bentley";
|
|
14
14
|
import { PhillyLandmarksDataset } from "./PhillyLandmarksDataset";
|
|
15
15
|
import { ArcGisFeatureResponse } from "../../ArcGisFeature/ArcGisFeatureResponse";
|
|
16
|
-
import { Point3d } from "@itwin/core-geometry";
|
|
16
|
+
import { Angle, Point3d } from "@itwin/core-geometry";
|
|
17
17
|
import { ArcGisFeaturePBF } from "../../ArcGisFeature/ArcGisFeaturePBF";
|
|
18
18
|
import { ArcGisFeatureJSON } from "../../ArcGisFeature/ArcGisFeatureJSON";
|
|
19
19
|
const expect = chai.expect;
|
|
20
20
|
chai.use(chaiAsPromised);
|
|
21
|
-
const esriFeatureSampleSource = { name: "dummyFeatureLayer", url: "https://dummy.com", formatId: ArcGisFeatureMapLayerFormat.formatId };
|
|
21
|
+
const esriFeatureSampleSource = { name: "dummyFeatureLayer", url: "https://dummy.com/SomeGuid/ArcGIS/rest/services/SomeService/FeatureServer", formatId: ArcGisFeatureMapLayerFormat.formatId };
|
|
22
22
|
const pngTransparent1x1 = "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPhfDwAChwGA60e6kgAAAABJRU5ErkJggg==";
|
|
23
23
|
describe("ArcGisFeatureProvider", () => {
|
|
24
24
|
const sandbox = sinon.createSandbox();
|
|
@@ -30,7 +30,7 @@ describe("ArcGisFeatureProvider", () => {
|
|
|
30
30
|
afterEach(async () => {
|
|
31
31
|
sandbox.restore();
|
|
32
32
|
});
|
|
33
|
-
it("should initialize with valid
|
|
33
|
+
it("should initialize with valid service metadata", async () => {
|
|
34
34
|
sandbox.stub(ArcGisUtilities, "getServiceJson").callsFake(async function _(_url, _formatId, _userName, _password, _ignoreCache, _requireToken) {
|
|
35
35
|
return { accessTokenRequired: false, content: NewYorkDataset.serviceCapabilities };
|
|
36
36
|
});
|
|
@@ -43,6 +43,133 @@ describe("ArcGisFeatureProvider", () => {
|
|
|
43
43
|
expect(provider._minDepthFromLod).to.equals(11);
|
|
44
44
|
expect(provider._maxDepthFromLod).to.equals(22);
|
|
45
45
|
});
|
|
46
|
+
it("should initialize and set cartoRange without making extra extent request", async () => {
|
|
47
|
+
sandbox.stub(ArcGisUtilities, "getServiceJson").callsFake(async function _(_url, _formatId, _userName, _password, _ignoreCache, _requireToken) {
|
|
48
|
+
return { accessTokenRequired: false, content: NewYorkDataset.serviceCapabilities };
|
|
49
|
+
});
|
|
50
|
+
sandbox.stub(ArcGisFeatureProvider.prototype, "getLayerMetadata").callsFake(async function _(_layerId) {
|
|
51
|
+
return NewYorkDataset.streetsLayerCapabilities;
|
|
52
|
+
});
|
|
53
|
+
const setCartoSpy = sandbox.spy(ArcGisFeatureProvider.prototype, "setCartoRangeFromExtentJson");
|
|
54
|
+
const fetchLayerExtentSpy = sandbox.spy(ArcGisFeatureProvider.prototype, "fetchLayerExtent");
|
|
55
|
+
const settings = ImageMapLayerSettings.fromJSON(esriFeatureSampleSource);
|
|
56
|
+
const provider = new ArcGisFeatureProvider(settings);
|
|
57
|
+
await provider.initialize();
|
|
58
|
+
expect(setCartoSpy.called).to.be.true;
|
|
59
|
+
expect(setCartoSpy.args[0][0]).to.be.equals(NewYorkDataset.streetsLayerCapabilities.extent);
|
|
60
|
+
expect(fetchLayerExtentSpy.called).to.be.false;
|
|
61
|
+
});
|
|
62
|
+
it("should make an extra extent request when none available in layer metadata", async () => {
|
|
63
|
+
sandbox.stub(ArcGisUtilities, "getServiceJson").callsFake(async function _(_url, _formatId, _userName, _password, _ignoreCache, _requireToken) {
|
|
64
|
+
return { accessTokenRequired: false, content: NewYorkDataset.serviceCapabilities };
|
|
65
|
+
});
|
|
66
|
+
const setCartoSpy = sandbox.spy(ArcGisFeatureProvider.prototype, "setCartoRangeFromExtentJson");
|
|
67
|
+
const layerExtent = { ...NewYorkDataset.streetsLayerCapabilities.extent };
|
|
68
|
+
const fetchLayerExtentStub = sandbox.stub(ArcGisFeatureProvider.prototype, "fetchLayerExtent").callsFake(async function _(_layerId) {
|
|
69
|
+
return layerExtent;
|
|
70
|
+
});
|
|
71
|
+
const layerCapabilitiesNoExtent = { ...NewYorkDataset.streetsLayerCapabilities, extent: null };
|
|
72
|
+
sandbox.stub(ArcGisFeatureProvider.prototype, "getLayerMetadata").callsFake(async function _(_layerId) {
|
|
73
|
+
return layerCapabilitiesNoExtent;
|
|
74
|
+
});
|
|
75
|
+
const settings = ImageMapLayerSettings.fromJSON(esriFeatureSampleSource);
|
|
76
|
+
const provider = new ArcGisFeatureProvider(settings);
|
|
77
|
+
await provider.initialize();
|
|
78
|
+
expect(fetchLayerExtentStub.called).to.be.true;
|
|
79
|
+
expect(setCartoSpy.called).to.be.true;
|
|
80
|
+
expect(setCartoSpy.args[0][0]).to.be.equals(layerExtent);
|
|
81
|
+
});
|
|
82
|
+
it("should make an extra extent request when none available in layer metadata", async () => {
|
|
83
|
+
sandbox.stub(ArcGisUtilities, "getServiceJson").callsFake(async function _(_url, _formatId, _userName, _password, _ignoreCache, _requireToken) {
|
|
84
|
+
return { accessTokenRequired: false, content: NewYorkDataset.serviceCapabilities };
|
|
85
|
+
});
|
|
86
|
+
const setCartoSpy = sandbox.spy(ArcGisFeatureProvider.prototype, "setCartoRangeFromExtentJson");
|
|
87
|
+
const layerExtent = { ...NewYorkDataset.streetsLayerCapabilities.extent };
|
|
88
|
+
const fetchLayerExtentStub = sandbox.stub(ArcGisFeatureProvider.prototype, "fetchLayerExtent").callsFake(async function _(_layerId) {
|
|
89
|
+
return layerExtent;
|
|
90
|
+
});
|
|
91
|
+
const layerExtentBadSrs = { ...NewYorkDataset.streetsLayerCapabilities };
|
|
92
|
+
layerExtentBadSrs.extent.spatialReference.wkid = 1234;
|
|
93
|
+
layerExtentBadSrs.extent.spatialReference.latestWkid = 1234;
|
|
94
|
+
sandbox.stub(ArcGisFeatureProvider.prototype, "getLayerMetadata").callsFake(async function _(_layerId) {
|
|
95
|
+
return layerExtentBadSrs;
|
|
96
|
+
});
|
|
97
|
+
const settings = ImageMapLayerSettings.fromJSON(esriFeatureSampleSource);
|
|
98
|
+
const provider = new ArcGisFeatureProvider(settings);
|
|
99
|
+
await provider.initialize();
|
|
100
|
+
expect(fetchLayerExtentStub.called).to.be.true;
|
|
101
|
+
expect(setCartoSpy.called).to.be.true;
|
|
102
|
+
expect(setCartoSpy.args[0][0]).to.be.equals(layerExtent);
|
|
103
|
+
});
|
|
104
|
+
it("should set cartoRange from Extent json", async () => {
|
|
105
|
+
const newYorkLayerExtent = NewYorkDataset.streetsLayerCapabilities.extent;
|
|
106
|
+
const settings = ImageMapLayerSettings.fromJSON(esriFeatureSampleSource);
|
|
107
|
+
const provider = new ArcGisFeatureProvider(settings);
|
|
108
|
+
const west = provider.getEPSG4326Lon(newYorkLayerExtent.xmin);
|
|
109
|
+
const south = provider.getEPSG4326Lat(newYorkLayerExtent.ymin);
|
|
110
|
+
const east = provider.getEPSG4326Lon(newYorkLayerExtent.xmax);
|
|
111
|
+
const north = provider.getEPSG4326Lat(newYorkLayerExtent.ymax);
|
|
112
|
+
provider.setCartoRangeFromExtentJson(newYorkLayerExtent);
|
|
113
|
+
expect(provider.cartoRange).to.be.not.undefined;
|
|
114
|
+
const delta = 0.0000001;
|
|
115
|
+
expect(provider.cartoRange.west * Angle.degreesPerRadian).to.approximately(west, delta);
|
|
116
|
+
expect(provider.cartoRange.south * Angle.degreesPerRadian).to.approximately(south, delta);
|
|
117
|
+
expect(provider.cartoRange.east * Angle.degreesPerRadian).to.approximately(east, delta);
|
|
118
|
+
expect(provider.cartoRange.north * Angle.degreesPerRadian).to.approximately(north, delta);
|
|
119
|
+
});
|
|
120
|
+
it("should compose proper request to get extent", async () => {
|
|
121
|
+
fetchStub.restore(); // fetch is always stubbed by default, restore and provide our own stub
|
|
122
|
+
sandbox.stub(ArcGisUtilities, "getServiceJson").callsFake(async function _(_url, _formatId, _userName, _password, _ignoreCache, _requireToken) {
|
|
123
|
+
return { accessTokenRequired: false, content: NewYorkDataset.serviceCapabilities };
|
|
124
|
+
});
|
|
125
|
+
const layerCapabilitiesNoExtent = { ...NewYorkDataset.streetsLayerCapabilities };
|
|
126
|
+
sandbox.stub(ArcGisFeatureProvider.prototype, "getLayerMetadata").callsFake(async function _(_layerId) {
|
|
127
|
+
return layerCapabilitiesNoExtent;
|
|
128
|
+
});
|
|
129
|
+
const referenceExtent = { extent: NewYorkDataset.streetsLayerCapabilities.extent };
|
|
130
|
+
const stub = sandbox.stub(ArcGISImageryProvider.prototype, "fetch").callsFake(async function _(_url, _options) {
|
|
131
|
+
const test = {
|
|
132
|
+
headers: { "content-type": "json" },
|
|
133
|
+
json: async () => {
|
|
134
|
+
return referenceExtent;
|
|
135
|
+
},
|
|
136
|
+
status: 200,
|
|
137
|
+
}; // By using unknown type, I can define parts of Response I really need
|
|
138
|
+
return test;
|
|
139
|
+
});
|
|
140
|
+
let layerId = 0;
|
|
141
|
+
let expectedUrl = `https://dummy.com/SomeGuid/ArcGIS/rest/services/SomeService/FeatureServer/${layerId}/query?where=1%3D1&outSR=3857&returnExtentOnly=true&f=json`;
|
|
142
|
+
let cachedExtent = ArcGisFeatureProvider._extentCache.get(expectedUrl);
|
|
143
|
+
expect(cachedExtent).to.be.undefined;
|
|
144
|
+
const settings = ImageMapLayerSettings.fromJSON(esriFeatureSampleSource);
|
|
145
|
+
const provider = new ArcGisFeatureProvider(settings);
|
|
146
|
+
await provider.initialize();
|
|
147
|
+
let fetchExtent = await provider.fetchLayerExtent();
|
|
148
|
+
expect(fetchExtent).to.equals(referenceExtent.extent);
|
|
149
|
+
expect(stub.getCalls().length).to.equals(1);
|
|
150
|
+
expect(stub.args[0][0].toString()).to.be.equals(expectedUrl);
|
|
151
|
+
// Check if entry has been created in cache
|
|
152
|
+
cachedExtent = ArcGisFeatureProvider._extentCache.get(expectedUrl);
|
|
153
|
+
expect(cachedExtent).to.be.not.undefined;
|
|
154
|
+
expect(cachedExtent).to.equals(referenceExtent);
|
|
155
|
+
// Make sure cache is used
|
|
156
|
+
await provider.fetchLayerExtent();
|
|
157
|
+
expect(stub.getCalls().length).to.equals(1);
|
|
158
|
+
// Force a different layerId, and check a new request has been made
|
|
159
|
+
layerId = 2;
|
|
160
|
+
expectedUrl = `https://dummy.com/SomeGuid/ArcGIS/rest/services/SomeService/FeatureServer/${layerId}/query?where=1%3D1&outSR=3857&returnExtentOnly=true&f=json`;
|
|
161
|
+
cachedExtent = ArcGisFeatureProvider._extentCache.get(expectedUrl);
|
|
162
|
+
expect(cachedExtent).to.be.undefined;
|
|
163
|
+
provider._layerId = layerId;
|
|
164
|
+
fetchExtent = await provider.fetchLayerExtent();
|
|
165
|
+
expect(fetchExtent).to.equals(referenceExtent.extent);
|
|
166
|
+
expect(stub.getCalls().length).to.equals(2);
|
|
167
|
+
expect(stub.args[1][0].toString()).to.be.equals(expectedUrl);
|
|
168
|
+
// check cache has been updated with a new entry
|
|
169
|
+
cachedExtent = ArcGisFeatureProvider._extentCache.get(expectedUrl);
|
|
170
|
+
expect(cachedExtent).to.be.not.undefined;
|
|
171
|
+
expect(cachedExtent).to.equals(referenceExtent);
|
|
172
|
+
});
|
|
46
173
|
it("should not initialize with no service metadata", async () => {
|
|
47
174
|
sandbox.stub(ArcGisUtilities, "getServiceJson").callsFake(async function _(_url, _formatId, _userName, _password, _ignoreCache, _requireToken) {
|
|
48
175
|
return undefined;
|
|
@@ -236,7 +363,7 @@ describe("ArcGisFeatureProvider", () => {
|
|
|
236
363
|
latestWkid: 3857,
|
|
237
364
|
},
|
|
238
365
|
};
|
|
239
|
-
expect(url?.url).to.equals(
|
|
366
|
+
expect(url?.url).to.equals("https://dummy.com/SomeGuid/ArcGIS/rest/services/SomeService/FeatureServer/0/query?f=PBF&resultType=tile&maxRecordCountFactor=3&returnExceededLimitFeatures=false&outSR=102100&geometryType=esriGeometryEnvelope&geometry=%7B%22xmin%22%3A-20037508.34%2C%22ymin%22%3A-20037508.339999996%2C%22xmax%22%3A20037508.34%2C%22ymax%22%3A20037508.340000004%2C%22spatialReference%22%3A%7B%22wkid%22%3A102100%2C%22latestWkid%22%3A3857%7D%7D&units=esriSRUnit_Meter&inSR=102100");
|
|
240
367
|
expect(url?.envelope?.xmin).to.be.closeTo(extent.xmin, 0.01);
|
|
241
368
|
expect(url?.envelope?.ymin).to.be.closeTo(extent.ymin, 0.01);
|
|
242
369
|
expect(url?.envelope?.xmax).to.be.closeTo(extent.xmax, 0.01);
|
|
@@ -255,7 +382,7 @@ describe("ArcGisFeatureProvider", () => {
|
|
|
255
382
|
const provider2 = new ArcGisFeatureProvider(settings);
|
|
256
383
|
await provider2.initialize();
|
|
257
384
|
url = provider2.constructFeatureUrl(0, 0, 0, "PBF");
|
|
258
|
-
expect(url?.url).to.equals(
|
|
385
|
+
expect(url?.url).to.equals("https://dummy.com/SomeGuid/ArcGIS/rest/services/SomeService/FeatureServer/0/query?f=PBF&resultType=tile&maxRecordCountFactor=3&returnExceededLimitFeatures=false&outSR=102100&geometryType=esriGeometryEnvelope&geometry=%7B%22xmin%22%3A-20037508.34%2C%22ymin%22%3A-20037508.339999996%2C%22xmax%22%3A20037508.34%2C%22ymax%22%3A20037508.340000004%2C%22spatialReference%22%3A%7B%22wkid%22%3A102100%2C%22latestWkid%22%3A3857%7D%7D&units=esriSRUnit_Meter&inSR=102100&quantizationParameters=%7B%22mode%22%3A%22view%22%2C%22originPosition%22%3A%22upperLeft%22%2C%22tolerance%22%3A78271.516953125%2C%22extent%22%3A%7B%22xmin%22%3A-20037508.34%2C%22ymin%22%3A-20037508.339999996%2C%22xmax%22%3A20037508.34%2C%22ymax%22%3A20037508.340000004%2C%22spatialReference%22%3A%7B%22wkid%22%3A102100%2C%22latestWkid%22%3A3857%7D%7D%7D");
|
|
259
386
|
expect(url?.envelope?.xmin).to.be.closeTo(extent.xmin, 0.01);
|
|
260
387
|
expect(url?.envelope?.ymin).to.be.closeTo(extent.ymin, 0.01);
|
|
261
388
|
expect(url?.envelope?.xmax).to.be.closeTo(extent.xmax, 0.01);
|
|
@@ -279,7 +406,7 @@ describe("ArcGisFeatureProvider", () => {
|
|
|
279
406
|
const provider3 = new ArcGisFeatureProvider(settings);
|
|
280
407
|
await provider3.initialize();
|
|
281
408
|
url = provider3.constructFeatureUrl(0, 0, 0, "PBF", overrideGeom);
|
|
282
|
-
expect(url?.url).to.equals(
|
|
409
|
+
expect(url?.url).to.equals("https://dummy.com/SomeGuid/ArcGIS/rest/services/SomeService/FeatureServer/0/query?f=PBF&resultType=tile&maxRecordCountFactor=3&returnExceededLimitFeatures=false&outSR=102100&geometryType=esriGeometryEnvelope&geometry=%7B%22xmin%22%3A-50%2C%22ymin%22%3A-50%2C%22xmax%22%3A50%2C%22ymax%22%3A50%2C%22spatialReference%22%3A%7B%22wkid%22%3A102100%2C%22latestWkid%22%3A3857%7D%7D&units=esriSRUnit_Meter&inSR=102100&quantizationParameters=%7B%22mode%22%3A%22view%22%2C%22originPosition%22%3A%22upperLeft%22%2C%22tolerance%22%3A78271.516953125%2C%22extent%22%3A%7B%22xmin%22%3A-20037508.34%2C%22ymin%22%3A-20037508.339999996%2C%22xmax%22%3A20037508.34%2C%22ymax%22%3A20037508.340000004%2C%22spatialReference%22%3A%7B%22wkid%22%3A102100%2C%22latestWkid%22%3A3857%7D%7D%7D");
|
|
283
410
|
expect(url?.envelope?.xmin).to.be.closeTo(overrideGeom.geom.xmin, 0.01);
|
|
284
411
|
expect(url?.envelope?.ymin).to.be.closeTo(overrideGeom.geom.ymin, 0.01);
|
|
285
412
|
expect(url?.envelope?.xmax).to.be.closeTo(overrideGeom.geom.xmax, 0.01);
|
|
@@ -288,7 +415,7 @@ describe("ArcGisFeatureProvider", () => {
|
|
|
288
415
|
expect(url?.envelope?.spatialReference.latestWkid).to.be.equal(overrideGeom.geom.spatialReference.latestWkid);
|
|
289
416
|
// Now test with a different tolerance value
|
|
290
417
|
url = provider3.constructFeatureUrl(0, 0, 0, "PBF", overrideGeom, undefined, 10);
|
|
291
|
-
expect(url?.url).to.equals(
|
|
418
|
+
expect(url?.url).to.equals("https://dummy.com/SomeGuid/ArcGIS/rest/services/SomeService/FeatureServer/0/query?f=PBF&resultType=tile&maxRecordCountFactor=3&returnExceededLimitFeatures=false&outSR=102100&geometryType=esriGeometryEnvelope&geometry=%7B%22xmin%22%3A-50%2C%22ymin%22%3A-50%2C%22xmax%22%3A50%2C%22ymax%22%3A50%2C%22spatialReference%22%3A%7B%22wkid%22%3A102100%2C%22latestWkid%22%3A3857%7D%7D&units=esriSRUnit_Meter&inSR=102100&quantizationParameters=%7B%22mode%22%3A%22view%22%2C%22originPosition%22%3A%22upperLeft%22%2C%22tolerance%22%3A78271.516953125%2C%22extent%22%3A%7B%22xmin%22%3A-20037508.34%2C%22ymin%22%3A-20037508.339999996%2C%22xmax%22%3A20037508.34%2C%22ymax%22%3A20037508.340000004%2C%22spatialReference%22%3A%7B%22wkid%22%3A102100%2C%22latestWkid%22%3A3857%7D%7D%7D&distance=782715.16953125");
|
|
292
419
|
expect(url?.envelope?.xmin).to.be.closeTo(overrideGeom.geom.xmin, 0.01);
|
|
293
420
|
expect(url?.envelope?.ymin).to.be.closeTo(overrideGeom.geom.ymin, 0.01);
|
|
294
421
|
expect(url?.envelope?.xmax).to.be.closeTo(overrideGeom.geom.xmax, 0.01);
|