@itwin/map-layers-formats 4.0.0-dev.46 → 4.0.0-dev.48
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/8bff29d08b86f148ce24ab9a3ab9851766ca18f7.log +10 -0
- package/.rush/temp/operation/build_ci/state.json +1 -1
- package/.rush/temp/operation/cover/state.json +1 -1
- package/.rush/temp/operation/docs/state.json +1 -1
- package/.rush/temp/package-deps_cover.json +2 -2
- package/.rush/temp/package-deps_docs.json +2 -2
- package/.rush/temp/shrinkwrap-deps.json +19 -17
- 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 -132
- 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 -200
- 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 -421
- package/lib/cjs/ArcGisFeature/ArcGisFeatureProvider.js.map +1 -1
- package/lib/cjs/ArcGisFeature/ArcGisFeatureQuery.d.ts +92 -92
- package/lib/cjs/ArcGisFeature/ArcGisFeatureQuery.js +82 -82
- package/lib/cjs/ArcGisFeature/ArcGisFeatureQuery.js.map +1 -1
- package/lib/cjs/ArcGisFeature/ArcGisFeatureReader.d.ts +17 -17
- package/lib/cjs/ArcGisFeature/ArcGisFeatureReader.js +33 -33
- package/lib/cjs/ArcGisFeature/ArcGisFeatureReader.js.map +1 -1
- package/lib/cjs/ArcGisFeature/ArcGisFeatureRenderer.d.ts +32 -32
- package/lib/cjs/ArcGisFeature/ArcGisFeatureRenderer.js +142 -142
- package/lib/cjs/ArcGisFeature/ArcGisFeatureRenderer.js.map +1 -1
- package/lib/cjs/ArcGisFeature/ArcGisFeatureResponse.d.ts +16 -16
- package/lib/cjs/ArcGisFeature/ArcGisFeatureResponse.js +42 -42
- package/lib/cjs/ArcGisFeature/ArcGisFeatureResponse.js.map +1 -1
- package/lib/cjs/ArcGisFeature/ArcGisSymbologyRenderer.d.ts +85 -85
- package/lib/cjs/ArcGisFeature/ArcGisSymbologyRenderer.js +189 -189
- 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.js +2270 -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 +24 -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/mapLayersFormats.js.map +1 -1
- 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/ArcGisFeatureFeatureFormats.test.js.map +1 -1
- 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/ArcGisFeatureJSON.test.js.map +1 -1
- 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/ArcGisFeaturePBF.test.js.map +1 -1
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureProvider.test.d.ts +1 -1
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureProvider.test.js +679 -679
- 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/ArcGisFeatureQuery.test.js.map +1 -1
- 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/ArcGisFeatureRenderer.test.js.map +1 -1
- 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/ArcGisSymbologyRenderer.test.js.map +1 -1
- package/lib/cjs/test/ArcGisFeature/Mocks.d.ts +6 -6
- package/lib/cjs/test/ArcGisFeature/Mocks.js +18 -18
- package/lib/cjs/test/ArcGisFeature/Mocks.js.map +1 -1
- package/lib/cjs/test/ArcGisFeature/NewYorkDataset.d.ts +55 -55
- 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.js +426 -426
- package/lib/cjs/test/ArcGisFeature/PhillyLandmarksDataset.js.map +1 -1
- package/lib/cjs/test/coverage/.nyc_output/b643b26c-8393-414a-a1f5-85ec76eac15b.json +1 -0
- package/lib/cjs/test/coverage/.nyc_output/processinfo/3a013ea8-427a-43ec-a667-b7a0c921d50d.json +1 -0
- package/lib/cjs/test/coverage/.nyc_output/processinfo/b643b26c-8393-414a-a1f5-85ec76eac15b.json +1 -0
- package/lib/cjs/test/coverage/.nyc_output/processinfo/index.json +1 -1
- package/lib/cjs/test/coverage/cobertura-coverage.xml +2 -2
- package/lib/cjs/test/coverage/lcov-report/index.html +1 -1
- 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 +1 -1
- 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 +1 -1
- package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/index.html +1 -1
- 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/tsconfig.tsbuildinfo +1 -1
- package/lib/esm/ArcGisFeature/ArcGisFeatureFormat.d.ts +8 -8
- package/lib/esm/ArcGisFeature/ArcGisFeatureFormat.js +10 -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 -128
- 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 -196
- package/lib/esm/ArcGisFeature/ArcGisFeaturePBF.js.map +1 -1
- package/lib/esm/ArcGisFeature/ArcGisFeatureProvider.d.ts +44 -44
- package/lib/esm/ArcGisFeature/ArcGisFeatureProvider.js +417 -417
- package/lib/esm/ArcGisFeature/ArcGisFeatureProvider.js.map +1 -1
- package/lib/esm/ArcGisFeature/ArcGisFeatureQuery.d.ts +92 -92
- package/lib/esm/ArcGisFeature/ArcGisFeatureQuery.js +78 -78
- package/lib/esm/ArcGisFeature/ArcGisFeatureQuery.js.map +1 -1
- package/lib/esm/ArcGisFeature/ArcGisFeatureReader.d.ts +17 -17
- package/lib/esm/ArcGisFeature/ArcGisFeatureReader.js +29 -29
- package/lib/esm/ArcGisFeature/ArcGisFeatureReader.js.map +1 -1
- package/lib/esm/ArcGisFeature/ArcGisFeatureRenderer.d.ts +32 -32
- package/lib/esm/ArcGisFeature/ArcGisFeatureRenderer.js +138 -138
- package/lib/esm/ArcGisFeature/ArcGisFeatureRenderer.js.map +1 -1
- package/lib/esm/ArcGisFeature/ArcGisFeatureResponse.d.ts +16 -16
- package/lib/esm/ArcGisFeature/ArcGisFeatureResponse.js +38 -38
- package/lib/esm/ArcGisFeature/ArcGisFeatureResponse.js.map +1 -1
- package/lib/esm/ArcGisFeature/ArcGisSymbologyRenderer.d.ts +85 -85
- package/lib/esm/ArcGisFeature/ArcGisSymbologyRenderer.js +182 -182
- 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.js +2267 -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/map-layers-formats.js.map +1 -1
- package/lib/esm/mapLayersFormats.d.ts +10 -10
- package/lib/esm/mapLayersFormats.js +24 -24
- package/lib/esm/mapLayersFormats.js.map +1 -1
- 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/ArcGisFeatureFeatureFormats.test.js.map +1 -1
- 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/ArcGisFeatureJSON.test.js.map +1 -1
- 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/ArcGisFeaturePBF.test.js.map +1 -1
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureProvider.test.d.ts +1 -1
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureProvider.test.js +677 -677
- 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/ArcGisFeatureQuery.test.js.map +1 -1
- 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/ArcGisFeatureRenderer.test.js.map +1 -1
- 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/ArcGisSymbologyRenderer.test.js.map +1 -1
- package/lib/esm/test/ArcGisFeature/Mocks.d.ts +6 -6
- package/lib/esm/test/ArcGisFeature/Mocks.js +15 -15
- package/lib/esm/test/ArcGisFeature/Mocks.js.map +1 -1
- package/lib/esm/test/ArcGisFeature/NewYorkDataset.d.ts +55 -55
- package/lib/esm/test/ArcGisFeature/NewYorkDataset.js +415 -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.js +422 -422
- package/lib/esm/test/ArcGisFeature/PhillyLandmarksDataset.js.map +1 -1
- package/lib/esm/tsconfig.tsbuildinfo +1 -1
- package/lib/test/junit_results.xml +50 -50
- package/map-layers-formats.build.log +2 -2
- package/package.json +11 -11
- package/.rush/temp/package-deps_build_ci.json +0 -36
- package/lib/cjs/test/coverage/.nyc_output/9b174ce6-19d3-43b7-b7b4-4983bff3f738.json +0 -1
- package/lib/cjs/test/coverage/.nyc_output/processinfo/9b174ce6-19d3-43b7-b7b4-4983bff3f738.json +0 -1
- package/lib/cjs/test/coverage/.nyc_output/processinfo/a6617e03-c53c-4c1e-9294-2513ec9352fd.json +0 -1
- /package/lib/cjs/test/coverage/.nyc_output/{a6617e03-c53c-4c1e-9294-2513ec9352fd.json → 3a013ea8-427a-43ec-a667-b7a0c921d50d.json} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ArcGisFeatureQuery.test.js","sourceRoot":"","sources":["../../../../src/test/ArcGisFeature/ArcGisFeatureQuery.test.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAC9B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAgB,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAE1F,QAAQ,CAAC,oBAAoB,EAAE,GAAG,EAAE;IAElC,MAAM,OAAO,GAAG,KAAK,CAAC,aAAa,EAAE,CAAC;IAEtC,UAAU,CAAC,KAAK,IAAI,EAAE;IACtB,CAAC,CAAC,CAAC;IAEH,SAAS,CAAC,KAAK,IAAI,EAAE;QACnB,OAAO,CAAC,OAAO,EAAE,CAAC;IACpB,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,mDAAmD,EAAE,KAAK,IAAI,EAAE;QAEjE,MAAM,KAAK,GAAG,IAAI,kBAAkB,CAAC,wBAAwB,EAAC,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;QAC/E,MAAM,QAAQ,GAAG,KAAK,CAAC,QAAQ,EAAE,CAAC;QAClC,MAAM,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,QAAQ,CAAC,mBAAmB,CAAC,CAAC;QACtD,MAAM,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC;QACjD,MAAM,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAC;QACnD,MAAM,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,QAAQ,CAAC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CAAC,CAAC,EAAE,CAAC,QAAQ,CAAC,qKAAqK,CAAC,CAAC;QACpM,MAAM,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC;IAE9C,CAAC,CAAC,CAAC;AAEL,CAAC,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\
|
|
1
|
+
{"version":3,"file":"ArcGisFeatureQuery.test.js","sourceRoot":"","sources":["../../../../src/test/ArcGisFeature/ArcGisFeatureQuery.test.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAC9B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAgB,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAE1F,QAAQ,CAAC,oBAAoB,EAAE,GAAG,EAAE;IAElC,MAAM,OAAO,GAAG,KAAK,CAAC,aAAa,EAAE,CAAC;IAEtC,UAAU,CAAC,KAAK,IAAI,EAAE;IACtB,CAAC,CAAC,CAAC;IAEH,SAAS,CAAC,KAAK,IAAI,EAAE;QACnB,OAAO,CAAC,OAAO,EAAE,CAAC;IACpB,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,mDAAmD,EAAE,KAAK,IAAI,EAAE;QAEjE,MAAM,KAAK,GAAG,IAAI,kBAAkB,CAAC,wBAAwB,EAAC,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;QAC/E,MAAM,QAAQ,GAAG,KAAK,CAAC,QAAQ,EAAE,CAAC;QAClC,MAAM,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,QAAQ,CAAC,mBAAmB,CAAC,CAAC;QACtD,MAAM,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC;QACjD,MAAM,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,QAAQ,CAA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CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,QAAQ,CAAC,mCAAmC,CAAC,CAAC;QAClE,MAAM,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,QAAQ,CAAC,qKAAqK,CAAC,CAAC;QACpM,MAAM,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC;IAE9C,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 { expect } from \"chai\";\nimport * as sinon from \"sinon\";\nimport { ArcGisExtent, ArcGisFeatureQuery } from \"../../ArcGisFeature/ArcGisFeatureQuery\";\n\ndescribe(\"ArcGisFeatureQuery\", () => {\n\n const sandbox = sinon.createSandbox();\n\n beforeEach(async () => {\n });\n\n afterEach(async () => {\n sandbox.restore();\n });\n\n it(\"should not apply different switches if not needed\", async () => {\n\n const query = new ArcGisFeatureQuery(\"https://test.com/rest/\",0, \"JSON\", 3857);\n const queryUrl = query.toString();\n expect(queryUrl).to.not.contains(\"resultRecordCount\");\n expect(queryUrl).to.not.contains(\"resultOffset\");\n expect(queryUrl).to.not.contains(\"returnGeometry\");\n expect(queryUrl).to.not.contains(\"resultType\");\n expect(queryUrl).to.not.contains(\"maxRecordCountFactor\");\n expect(queryUrl).to.not.contains(\"returnExceededLimitFeatures\");\n expect(queryUrl).to.not.contains(\"geometryType\");\n expect(queryUrl).to.not.contains(\"geometry\");\n expect(queryUrl).to.not.contains(\"inSR\");\n expect(queryUrl).to.not.contains(\"inSR\");\n expect(queryUrl).to.contains(\"where=1%3D1\");\n });\n\n it(\"should not apply different switches if not needed\", async () => {\n\n const extentSize = 100;\n const fakeEnvelope: ArcGisExtent = {\n xmin : 0,\n ymin : 0,\n xmax : extentSize,\n ymax : extentSize,\n spatialReference : {\n wkid : 102100,\n latestWkid : 3857,\n }};\n const query = new ArcGisFeatureQuery(\"https://test.com/rest/\",0, \"JSON\", 3857,\n {\n resultRecordCount: 10,\n resultOffset: 11,\n returnGeometry: true,\n geometry: {type:\"esriGeometryEnvelope\", geom:fakeEnvelope},\n geometryType: \"esriGeometryEnvelope\",\n spatialRel: \"esriSpatialRelIntersects\",\n resultType: \"tile\",\n maxRecordCountFactor: 1000,\n returnExceededLimitFeatures: false,\n quantizationParameters: {\n mode: \"view\",\n originPosition: \"upperLeft\",\n tolerance: 10,\n extent: fakeEnvelope,\n },\n outFields: \"test\",\n distance: 100,\n });\n const queryUrl = query.toString();\n expect(queryUrl).to.contains(\"resultRecordCount=10\");\n expect(queryUrl).to.contains(\"resultOffset=11\");\n expect(queryUrl).to.contains(\"returnGeometry=true\");\n expect(queryUrl).to.contains(`resultType=tile`);\n expect(queryUrl).to.contains(\"maxRecordCountFactor=1000\");\n expect(queryUrl).to.contains(\"returnExceededLimitFeatures=false\");\n expect(queryUrl).to.contains(\"geometryType=esriGeometryEnvelope\");\n expect(queryUrl).to.contains(`geometry=%7B%22xmin%22%3A0%2C%22ymin%22%3A0%2C%22xmax%22%3A100%2C%22ymax%22%3A100%2C%22spatialReference%22%3A%7B%22wkid%22%3A102100%2C%22latestWkid%22%3A3857%7D%7D`);\n expect(queryUrl).to.contains(\"inSR=102100\");\n expect(queryUrl).to.contains(\"outFields=test\");\n expect(queryUrl).to.contains(\"distance=100\");\n expect(queryUrl).to.contains(\"units=esriSRUnit_Meter\");\n\n });\n\n it(\"should not include geometry only when applicable\", async () => {\n\n const extentSize = 100;\n const fakeEnvelope: ArcGisExtent = {\n xmin : 0,\n ymin : 0,\n xmax : extentSize,\n ymax : extentSize,\n spatialReference : {\n wkid : 102100,\n latestWkid : 3857,\n }};\n const query = new ArcGisFeatureQuery(\"https://test.com/rest/\",0, \"JSON\", 3857,\n {\n spatialRel: \"esriSpatialRelIntersects\",\n });\n\n let queryUrl = query.toString();\n expect(queryUrl).to.not.contains(\"geometryType=\");\n expect(queryUrl).to.not.contains(`geometry=`);\n expect(queryUrl).to.not.contains(\"inSR=\");\n\n query.spatialRel = undefined;\n query.geometry = {type:\"esriGeometryEnvelope\", geom:fakeEnvelope};\n queryUrl = query.toString();\n expect(queryUrl).to.contains(\"geometryType=esriGeometryEnvelope\");\n expect(queryUrl).to.contains(`geometry=%7B%22xmin%22%3A0%2C%22ymin%22%3A0%2C%22xmax%22%3A100%2C%22ymax%22%3A100%2C%22spatialReference%22%3A%7B%22wkid%22%3A102100%2C%22latestWkid%22%3A3857%7D%7D`);\n expect(queryUrl).to.contains(\"inSR=102100\");\n\n });\n\n});\n"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
|
2
2
|
//# sourceMappingURL=ArcGisFeatureRenderer.test.d.ts.map
|
|
@@ -1,213 +1,213 @@
|
|
|
1
|
-
/*---------------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
-
*--------------------------------------------------------------------------------------------*/
|
|
5
|
-
import { expect } from "chai";
|
|
6
|
-
import * as sinon from "sinon";
|
|
7
|
-
import { fakeContext } from "./Mocks";
|
|
8
|
-
import { ArcGisSymbologyRenderer } from "../../ArcGisFeature/ArcGisSymbologyRenderer";
|
|
9
|
-
import { PhillyLandmarksDataset } from "./PhillyLandmarksDataset";
|
|
10
|
-
import { ArcGisFeatureRenderer } from "../../ArcGisFeature/ArcGisFeatureRenderer";
|
|
11
|
-
import { Point3d, Transform } from "@itwin/core-geometry";
|
|
12
|
-
describe("ArcGisFeatureRenderer", () => {
|
|
13
|
-
const sandbox = sinon.createSandbox();
|
|
14
|
-
let beginPathSpy;
|
|
15
|
-
let moveToSpy;
|
|
16
|
-
let lineToSpy;
|
|
17
|
-
let strokeSpy;
|
|
18
|
-
let fillSpy;
|
|
19
|
-
let closePathSpy;
|
|
20
|
-
beforeEach(async () => {
|
|
21
|
-
beginPathSpy = sandbox.spy(fakeContext, "beginPath");
|
|
22
|
-
moveToSpy = sandbox.spy(fakeContext, "moveTo");
|
|
23
|
-
lineToSpy = sandbox.spy(fakeContext, "lineTo");
|
|
24
|
-
strokeSpy = sandbox.spy(fakeContext, "stroke");
|
|
25
|
-
fillSpy = sandbox.spy(fakeContext, "fill");
|
|
26
|
-
closePathSpy = sandbox.spy(fakeContext, "closePath");
|
|
27
|
-
});
|
|
28
|
-
afterEach(async () => {
|
|
29
|
-
sandbox.restore();
|
|
30
|
-
});
|
|
31
|
-
it("should render simple path, stride = 2", async () => {
|
|
32
|
-
const symbolRenderer = new ArcGisSymbologyRenderer("esriGeometryLine", PhillyLandmarksDataset.phillySimpleLineDrawingInfo.drawingInfo.renderer);
|
|
33
|
-
const renderer = new ArcGisFeatureRenderer(fakeContext, symbolRenderer);
|
|
34
|
-
const coords = [1, 2, 3, 4];
|
|
35
|
-
const applyFillStyleSpy = sandbox.spy(symbolRenderer, "applyFillStyle");
|
|
36
|
-
const applyStrokeStyleSpy = sandbox.spy(symbolRenderer, "applyStrokeStyle");
|
|
37
|
-
renderer.renderPath([2], coords, false, 2, true);
|
|
38
|
-
expect(beginPathSpy.calledOnce).to.be.true;
|
|
39
|
-
expect(moveToSpy.calledOnce).to.be.true;
|
|
40
|
-
expect(moveToSpy.getCalls()[0].args[0]).to.equals(coords[0]);
|
|
41
|
-
expect(moveToSpy.getCalls()[0].args[1]).to.equals(coords[1]);
|
|
42
|
-
expect(lineToSpy.calledOnce).to.be.true;
|
|
43
|
-
// IMPORTANT: Only first coord is absolute, following coords are expressed relative to previous coord.
|
|
44
|
-
expect(lineToSpy.getCalls()[0].args[0]).to.equals(coords[0] + coords[2]);
|
|
45
|
-
expect(lineToSpy.getCalls()[0].args[1]).to.equals(coords[1] + coords[3]);
|
|
46
|
-
expect(strokeSpy.calledOnce).to.be.true;
|
|
47
|
-
expect(fillSpy.called).to.be.false;
|
|
48
|
-
expect(closePathSpy.called).to.be.false;
|
|
49
|
-
expect(applyFillStyleSpy.calledOnce).to.be.false;
|
|
50
|
-
expect(applyStrokeStyleSpy.calledOnce).to.be.true;
|
|
51
|
-
});
|
|
52
|
-
it("should render simple filled path", async () => {
|
|
53
|
-
const symbolRenderer = new ArcGisSymbologyRenderer("esriGeometryLine", PhillyLandmarksDataset.phillySimpleLineDrawingInfo.drawingInfo.renderer);
|
|
54
|
-
const renderer = new ArcGisFeatureRenderer(fakeContext, symbolRenderer);
|
|
55
|
-
const coords = [1, 2, 3, 4];
|
|
56
|
-
const applyFillStyleSpy = sandbox.spy(symbolRenderer, "applyFillStyle");
|
|
57
|
-
const applyStrokeStyleSpy = sandbox.spy(symbolRenderer, "applyStrokeStyle");
|
|
58
|
-
renderer.renderPath([2], coords, true, 2, true);
|
|
59
|
-
expect(beginPathSpy.calledOnce).to.be.true;
|
|
60
|
-
expect(moveToSpy.calledOnce).to.be.true;
|
|
61
|
-
expect(moveToSpy.getCalls()[0].args[0]).to.equals(coords[0]);
|
|
62
|
-
expect(moveToSpy.getCalls()[0].args[1]).to.equals(coords[1]);
|
|
63
|
-
expect(lineToSpy.calledOnce).to.be.true;
|
|
64
|
-
// IMPORTANT: Only first coord is absolute, following coords are expressed relative to previous coord.
|
|
65
|
-
expect(lineToSpy.getCalls()[0].args[0]).to.equals(coords[0] + coords[2]);
|
|
66
|
-
expect(lineToSpy.getCalls()[0].args[1]).to.equals(coords[1] + coords[3]);
|
|
67
|
-
expect(strokeSpy.calledOnce).to.be.true;
|
|
68
|
-
expect(fillSpy.calledOnce).to.be.true;
|
|
69
|
-
expect(closePathSpy.calledOnce).to.be.true;
|
|
70
|
-
expect(applyFillStyleSpy.calledOnce).to.be.true;
|
|
71
|
-
expect(applyStrokeStyleSpy.calledOnce).to.be.true;
|
|
72
|
-
});
|
|
73
|
-
it("should render simple Path, stride = 3", async () => {
|
|
74
|
-
const symbolRenderer = new ArcGisSymbologyRenderer("esriGeometryLine", PhillyLandmarksDataset.phillySimpleLineDrawingInfo.drawingInfo.renderer);
|
|
75
|
-
const renderer = new ArcGisFeatureRenderer(fakeContext, symbolRenderer);
|
|
76
|
-
const coords = [1, 2, 3, 4, 5, 6];
|
|
77
|
-
renderer.renderPath([2], coords, false, 3, true);
|
|
78
|
-
expect(beginPathSpy.calledOnce).to.be.true;
|
|
79
|
-
expect(moveToSpy.calledOnce).to.be.true;
|
|
80
|
-
expect(moveToSpy.getCalls()[0].args[0]).to.equals(coords[0]);
|
|
81
|
-
expect(moveToSpy.getCalls()[0].args[1]).to.equals(coords[1]);
|
|
82
|
-
expect(lineToSpy.calledOnce).to.be.true;
|
|
83
|
-
expect(lineToSpy.getCalls()[0].args[0]).to.equals(coords[0] + coords[3]);
|
|
84
|
-
expect(lineToSpy.getCalls()[0].args[1]).to.equals(coords[1] + coords[4]);
|
|
85
|
-
expect(strokeSpy.calledOnce).to.be.true;
|
|
86
|
-
expect(fillSpy.called).to.be.false;
|
|
87
|
-
expect(closePathSpy.called).to.be.false;
|
|
88
|
-
});
|
|
89
|
-
it("should render multiple Paths, stride = 2", async () => {
|
|
90
|
-
const symbolRenderer = new ArcGisSymbologyRenderer("esriGeometryLine", PhillyLandmarksDataset.phillySimpleLineDrawingInfo.drawingInfo.renderer);
|
|
91
|
-
const renderer = new ArcGisFeatureRenderer(fakeContext, symbolRenderer);
|
|
92
|
-
const coords = [1, 2, 3, 4];
|
|
93
|
-
const applyFillStyleSpy = sandbox.spy(symbolRenderer, "applyFillStyle");
|
|
94
|
-
const applyStrokeStyleSpy = sandbox.spy(symbolRenderer, "applyStrokeStyle");
|
|
95
|
-
renderer.renderPath([2], coords, false, 2, true);
|
|
96
|
-
expect(beginPathSpy.calledOnce).to.be.true;
|
|
97
|
-
expect(moveToSpy.calledOnce).to.be.true;
|
|
98
|
-
expect(moveToSpy.getCalls()[0].args[0]).to.equals(coords[0]);
|
|
99
|
-
expect(moveToSpy.getCalls()[0].args[1]).to.equals(coords[1]);
|
|
100
|
-
expect(lineToSpy.calledOnce).to.be.true;
|
|
101
|
-
// IMPORTANT: Only first coord is absolute, following coords are expressed relative to previous coord.
|
|
102
|
-
expect(lineToSpy.getCalls()[0].args[0]).to.equals(coords[0] + coords[2]);
|
|
103
|
-
expect(lineToSpy.getCalls()[0].args[1]).to.equals(coords[1] + coords[3]);
|
|
104
|
-
expect(strokeSpy.calledOnce).to.be.true;
|
|
105
|
-
expect(fillSpy.called).to.be.false;
|
|
106
|
-
expect(closePathSpy.called).to.be.false;
|
|
107
|
-
expect(applyFillStyleSpy.calledOnce).to.be.false;
|
|
108
|
-
expect(applyStrokeStyleSpy.calledOnce).to.be.true;
|
|
109
|
-
});
|
|
110
|
-
it("should not render invalid with stride value", async () => {
|
|
111
|
-
const symbolRenderer = new ArcGisSymbologyRenderer("esriGeometryLine", PhillyLandmarksDataset.phillySimpleLineDrawingInfo.drawingInfo.renderer);
|
|
112
|
-
const renderer = new ArcGisFeatureRenderer(fakeContext, symbolRenderer);
|
|
113
|
-
const coords = [1, 2, 3, 4];
|
|
114
|
-
renderer.renderPath([2], coords, false, 1, true);
|
|
115
|
-
renderer.renderPath([2], coords, false, 4, true);
|
|
116
|
-
renderer.renderPoint([2], coords, 1, true);
|
|
117
|
-
renderer.renderPoint([2], coords, 4, true);
|
|
118
|
-
expect(lineToSpy.calledOnce).to.be.false;
|
|
119
|
-
expect(strokeSpy.calledOnce).to.be.false;
|
|
120
|
-
expect(fillSpy.called).to.be.false;
|
|
121
|
-
expect(closePathSpy.called).to.be.false;
|
|
122
|
-
});
|
|
123
|
-
it("should render Path and apply transform, relativeCoords OFF", async () => {
|
|
124
|
-
const symbolRenderer = new ArcGisSymbologyRenderer("esriGeometryLine", PhillyLandmarksDataset.phillySimpleLineDrawingInfo.drawingInfo.renderer);
|
|
125
|
-
const fakeOffset = 10;
|
|
126
|
-
const renderer = new ArcGisFeatureRenderer(fakeContext, symbolRenderer, Transform.createTranslation(Point3d.create(fakeOffset, fakeOffset)));
|
|
127
|
-
const coords = [1, 2, 3, 4];
|
|
128
|
-
renderer.renderPath([2], coords, false, 2, false);
|
|
129
|
-
expect(beginPathSpy.calledOnce).to.be.true;
|
|
130
|
-
expect(moveToSpy.calledOnce).to.be.true;
|
|
131
|
-
expect(moveToSpy.getCalls()[0].args[0]).to.equals(coords[0] + fakeOffset);
|
|
132
|
-
expect(moveToSpy.getCalls()[0].args[1]).to.equals(coords[1] + fakeOffset);
|
|
133
|
-
expect(lineToSpy.calledOnce).to.be.true;
|
|
134
|
-
// IMPORTANT: Only first coord is absolute, following coords are expressed relative to previous coord.
|
|
135
|
-
expect(lineToSpy.getCalls()[0].args[0]).to.equals(coords[2] + fakeOffset);
|
|
136
|
-
expect(lineToSpy.getCalls()[0].args[1]).to.equals(coords[3] + fakeOffset);
|
|
137
|
-
});
|
|
138
|
-
it("should render single Point, no transform, relativeCoords OFF", async () => {
|
|
139
|
-
const symbolRenderer = new ArcGisSymbologyRenderer("esriGeometryPoint", PhillyLandmarksDataset.phillySimplePointDrawingInfo.drawingInfo.renderer);
|
|
140
|
-
const renderer = new ArcGisFeatureRenderer(fakeContext, symbolRenderer);
|
|
141
|
-
const drawPointStub = sandbox.stub(ArcGisSymbologyRenderer.prototype, "drawPoint");
|
|
142
|
-
const coords = [1, 2];
|
|
143
|
-
renderer.renderPoint([], coords, 2, false);
|
|
144
|
-
expect(drawPointStub.calledOnce).to.be.true;
|
|
145
|
-
expect(drawPointStub.getCalls()[0].args[1]).to.equals(coords[0]);
|
|
146
|
-
expect(drawPointStub.getCalls()[0].args[2]).to.equals(coords[1]);
|
|
147
|
-
});
|
|
148
|
-
it("should render single Point and apply transform, relativeCoords OFF", async () => {
|
|
149
|
-
const symbolRenderer = new ArcGisSymbologyRenderer("esriGeometryPoint", PhillyLandmarksDataset.phillySimplePointDrawingInfo.drawingInfo.renderer);
|
|
150
|
-
const fakeOffset = 10;
|
|
151
|
-
const renderer = new ArcGisFeatureRenderer(fakeContext, symbolRenderer, Transform.createTranslation(Point3d.create(fakeOffset, fakeOffset)));
|
|
152
|
-
const drawPointStub = sandbox.stub(ArcGisSymbologyRenderer.prototype, "drawPoint");
|
|
153
|
-
const coords = [1, 2];
|
|
154
|
-
renderer.renderPoint([], coords, 2, false);
|
|
155
|
-
expect(drawPointStub.calledOnce).to.be.true;
|
|
156
|
-
expect(drawPointStub.getCalls()[0].args[1]).to.equals(coords[0] + fakeOffset);
|
|
157
|
-
expect(drawPointStub.getCalls()[0].args[2]).to.equals(coords[1] + fakeOffset);
|
|
158
|
-
});
|
|
159
|
-
it("should render multi Point, transform, relativeCoords OFF", async () => {
|
|
160
|
-
const symbolRenderer = new ArcGisSymbologyRenderer("esriGeometryPoint", PhillyLandmarksDataset.phillySimplePointDrawingInfo.drawingInfo.renderer);
|
|
161
|
-
const renderer = new ArcGisFeatureRenderer(fakeContext, symbolRenderer);
|
|
162
|
-
const drawPointStub = sandbox.stub(ArcGisSymbologyRenderer.prototype, "drawPoint");
|
|
163
|
-
const coords = [1, 2, 3, 4];
|
|
164
|
-
renderer.renderPoint([2], coords, 2, false);
|
|
165
|
-
expect(drawPointStub.getCalls().length).to.equals(2);
|
|
166
|
-
expect(drawPointStub.getCalls()[0].args[1]).to.equals(coords[0]);
|
|
167
|
-
expect(drawPointStub.getCalls()[0].args[2]).to.equals(coords[1]);
|
|
168
|
-
expect(drawPointStub.getCalls()[1].args[1]).to.equals(coords[2]);
|
|
169
|
-
expect(drawPointStub.getCalls()[1].args[2]).to.equals(coords[3]);
|
|
170
|
-
});
|
|
171
|
-
it("should render multi Point and apply transform, relativeCoords OFF", async () => {
|
|
172
|
-
const symbolRenderer = new ArcGisSymbologyRenderer("esriGeometryPoint", PhillyLandmarksDataset.phillySimplePointDrawingInfo.drawingInfo.renderer);
|
|
173
|
-
const fakeOffset = 10;
|
|
174
|
-
const renderer = new ArcGisFeatureRenderer(fakeContext, symbolRenderer, Transform.createTranslation(Point3d.create(fakeOffset, fakeOffset)));
|
|
175
|
-
const drawPointStub = sandbox.stub(ArcGisSymbologyRenderer.prototype, "drawPoint");
|
|
176
|
-
const coords = [1, 2, 3, 4];
|
|
177
|
-
renderer.renderPoint([2], coords, 2, false);
|
|
178
|
-
expect(drawPointStub.getCalls().length).to.equals(2);
|
|
179
|
-
expect(drawPointStub.getCalls()[0].args[1]).to.equals(coords[0] + fakeOffset);
|
|
180
|
-
expect(drawPointStub.getCalls()[0].args[2]).to.equals(coords[1] + fakeOffset);
|
|
181
|
-
expect(drawPointStub.getCalls()[1].args[1]).to.equals(coords[2] + fakeOffset);
|
|
182
|
-
expect(drawPointStub.getCalls()[1].args[2]).to.equals(coords[3] + fakeOffset);
|
|
183
|
-
});
|
|
184
|
-
it("should render multi Point and apply transform, relativeCoords ON", async () => {
|
|
185
|
-
const symbolRenderer = new ArcGisSymbologyRenderer("esriGeometryPoint", PhillyLandmarksDataset.phillySimplePointDrawingInfo.drawingInfo.renderer);
|
|
186
|
-
const fakeOffset = 10;
|
|
187
|
-
const renderer = new ArcGisFeatureRenderer(fakeContext, symbolRenderer, Transform.createTranslation(Point3d.create(fakeOffset, fakeOffset)));
|
|
188
|
-
const drawPointStub = sandbox.stub(ArcGisSymbologyRenderer.prototype, "drawPoint");
|
|
189
|
-
const coords = [1, 2, 3, 4];
|
|
190
|
-
renderer.renderPoint([2], coords, 2, true);
|
|
191
|
-
expect(drawPointStub.getCalls().length).to.equals(2);
|
|
192
|
-
expect(drawPointStub.getCalls()[0].args[1]).to.equals(coords[0] + fakeOffset);
|
|
193
|
-
expect(drawPointStub.getCalls()[0].args[2]).to.equals(coords[1] + fakeOffset);
|
|
194
|
-
expect(drawPointStub.getCalls()[1].args[1]).to.equals(coords[0] + coords[2] + fakeOffset);
|
|
195
|
-
expect(drawPointStub.getCalls()[1].args[2]).to.equals(coords[1] + coords[3] + fakeOffset);
|
|
196
|
-
});
|
|
197
|
-
it("should render and apply transform, relativeCoords ON", async () => {
|
|
198
|
-
const symbolRenderer = new ArcGisSymbologyRenderer("esriGeometryLine", PhillyLandmarksDataset.phillySimpleLineDrawingInfo.drawingInfo.renderer);
|
|
199
|
-
const fakeOffset = 10;
|
|
200
|
-
const renderer = new ArcGisFeatureRenderer(fakeContext, symbolRenderer, Transform.createTranslation(Point3d.create(fakeOffset, fakeOffset)));
|
|
201
|
-
const coords = [1, 2, 3, 4];
|
|
202
|
-
renderer.renderPath([2], coords, false, 2, true);
|
|
203
|
-
expect(beginPathSpy.calledOnce).to.be.true;
|
|
204
|
-
expect(moveToSpy.calledOnce).to.be.true;
|
|
205
|
-
expect(moveToSpy.getCalls()[0].args[0]).to.equals(coords[0] + fakeOffset);
|
|
206
|
-
expect(moveToSpy.getCalls()[0].args[1]).to.equals(coords[1] + fakeOffset);
|
|
207
|
-
expect(lineToSpy.calledOnce).to.be.true;
|
|
208
|
-
// IMPORTANT: Only first coord is absolute, following coords are expressed relative to previous coord.
|
|
209
|
-
expect(lineToSpy.getCalls()[0].args[0]).to.equals(coords[0] + coords[2] + fakeOffset);
|
|
210
|
-
expect(lineToSpy.getCalls()[0].args[1]).to.equals(coords[1] + coords[3] + fakeOffset);
|
|
211
|
-
});
|
|
212
|
-
});
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { expect } from "chai";
|
|
6
|
+
import * as sinon from "sinon";
|
|
7
|
+
import { fakeContext } from "./Mocks";
|
|
8
|
+
import { ArcGisSymbologyRenderer } from "../../ArcGisFeature/ArcGisSymbologyRenderer";
|
|
9
|
+
import { PhillyLandmarksDataset } from "./PhillyLandmarksDataset";
|
|
10
|
+
import { ArcGisFeatureRenderer } from "../../ArcGisFeature/ArcGisFeatureRenderer";
|
|
11
|
+
import { Point3d, Transform } from "@itwin/core-geometry";
|
|
12
|
+
describe("ArcGisFeatureRenderer", () => {
|
|
13
|
+
const sandbox = sinon.createSandbox();
|
|
14
|
+
let beginPathSpy;
|
|
15
|
+
let moveToSpy;
|
|
16
|
+
let lineToSpy;
|
|
17
|
+
let strokeSpy;
|
|
18
|
+
let fillSpy;
|
|
19
|
+
let closePathSpy;
|
|
20
|
+
beforeEach(async () => {
|
|
21
|
+
beginPathSpy = sandbox.spy(fakeContext, "beginPath");
|
|
22
|
+
moveToSpy = sandbox.spy(fakeContext, "moveTo");
|
|
23
|
+
lineToSpy = sandbox.spy(fakeContext, "lineTo");
|
|
24
|
+
strokeSpy = sandbox.spy(fakeContext, "stroke");
|
|
25
|
+
fillSpy = sandbox.spy(fakeContext, "fill");
|
|
26
|
+
closePathSpy = sandbox.spy(fakeContext, "closePath");
|
|
27
|
+
});
|
|
28
|
+
afterEach(async () => {
|
|
29
|
+
sandbox.restore();
|
|
30
|
+
});
|
|
31
|
+
it("should render simple path, stride = 2", async () => {
|
|
32
|
+
const symbolRenderer = new ArcGisSymbologyRenderer("esriGeometryLine", PhillyLandmarksDataset.phillySimpleLineDrawingInfo.drawingInfo.renderer);
|
|
33
|
+
const renderer = new ArcGisFeatureRenderer(fakeContext, symbolRenderer);
|
|
34
|
+
const coords = [1, 2, 3, 4];
|
|
35
|
+
const applyFillStyleSpy = sandbox.spy(symbolRenderer, "applyFillStyle");
|
|
36
|
+
const applyStrokeStyleSpy = sandbox.spy(symbolRenderer, "applyStrokeStyle");
|
|
37
|
+
renderer.renderPath([2], coords, false, 2, true);
|
|
38
|
+
expect(beginPathSpy.calledOnce).to.be.true;
|
|
39
|
+
expect(moveToSpy.calledOnce).to.be.true;
|
|
40
|
+
expect(moveToSpy.getCalls()[0].args[0]).to.equals(coords[0]);
|
|
41
|
+
expect(moveToSpy.getCalls()[0].args[1]).to.equals(coords[1]);
|
|
42
|
+
expect(lineToSpy.calledOnce).to.be.true;
|
|
43
|
+
// IMPORTANT: Only first coord is absolute, following coords are expressed relative to previous coord.
|
|
44
|
+
expect(lineToSpy.getCalls()[0].args[0]).to.equals(coords[0] + coords[2]);
|
|
45
|
+
expect(lineToSpy.getCalls()[0].args[1]).to.equals(coords[1] + coords[3]);
|
|
46
|
+
expect(strokeSpy.calledOnce).to.be.true;
|
|
47
|
+
expect(fillSpy.called).to.be.false;
|
|
48
|
+
expect(closePathSpy.called).to.be.false;
|
|
49
|
+
expect(applyFillStyleSpy.calledOnce).to.be.false;
|
|
50
|
+
expect(applyStrokeStyleSpy.calledOnce).to.be.true;
|
|
51
|
+
});
|
|
52
|
+
it("should render simple filled path", async () => {
|
|
53
|
+
const symbolRenderer = new ArcGisSymbologyRenderer("esriGeometryLine", PhillyLandmarksDataset.phillySimpleLineDrawingInfo.drawingInfo.renderer);
|
|
54
|
+
const renderer = new ArcGisFeatureRenderer(fakeContext, symbolRenderer);
|
|
55
|
+
const coords = [1, 2, 3, 4];
|
|
56
|
+
const applyFillStyleSpy = sandbox.spy(symbolRenderer, "applyFillStyle");
|
|
57
|
+
const applyStrokeStyleSpy = sandbox.spy(symbolRenderer, "applyStrokeStyle");
|
|
58
|
+
renderer.renderPath([2], coords, true, 2, true);
|
|
59
|
+
expect(beginPathSpy.calledOnce).to.be.true;
|
|
60
|
+
expect(moveToSpy.calledOnce).to.be.true;
|
|
61
|
+
expect(moveToSpy.getCalls()[0].args[0]).to.equals(coords[0]);
|
|
62
|
+
expect(moveToSpy.getCalls()[0].args[1]).to.equals(coords[1]);
|
|
63
|
+
expect(lineToSpy.calledOnce).to.be.true;
|
|
64
|
+
// IMPORTANT: Only first coord is absolute, following coords are expressed relative to previous coord.
|
|
65
|
+
expect(lineToSpy.getCalls()[0].args[0]).to.equals(coords[0] + coords[2]);
|
|
66
|
+
expect(lineToSpy.getCalls()[0].args[1]).to.equals(coords[1] + coords[3]);
|
|
67
|
+
expect(strokeSpy.calledOnce).to.be.true;
|
|
68
|
+
expect(fillSpy.calledOnce).to.be.true;
|
|
69
|
+
expect(closePathSpy.calledOnce).to.be.true;
|
|
70
|
+
expect(applyFillStyleSpy.calledOnce).to.be.true;
|
|
71
|
+
expect(applyStrokeStyleSpy.calledOnce).to.be.true;
|
|
72
|
+
});
|
|
73
|
+
it("should render simple Path, stride = 3", async () => {
|
|
74
|
+
const symbolRenderer = new ArcGisSymbologyRenderer("esriGeometryLine", PhillyLandmarksDataset.phillySimpleLineDrawingInfo.drawingInfo.renderer);
|
|
75
|
+
const renderer = new ArcGisFeatureRenderer(fakeContext, symbolRenderer);
|
|
76
|
+
const coords = [1, 2, 3, 4, 5, 6];
|
|
77
|
+
renderer.renderPath([2], coords, false, 3, true);
|
|
78
|
+
expect(beginPathSpy.calledOnce).to.be.true;
|
|
79
|
+
expect(moveToSpy.calledOnce).to.be.true;
|
|
80
|
+
expect(moveToSpy.getCalls()[0].args[0]).to.equals(coords[0]);
|
|
81
|
+
expect(moveToSpy.getCalls()[0].args[1]).to.equals(coords[1]);
|
|
82
|
+
expect(lineToSpy.calledOnce).to.be.true;
|
|
83
|
+
expect(lineToSpy.getCalls()[0].args[0]).to.equals(coords[0] + coords[3]);
|
|
84
|
+
expect(lineToSpy.getCalls()[0].args[1]).to.equals(coords[1] + coords[4]);
|
|
85
|
+
expect(strokeSpy.calledOnce).to.be.true;
|
|
86
|
+
expect(fillSpy.called).to.be.false;
|
|
87
|
+
expect(closePathSpy.called).to.be.false;
|
|
88
|
+
});
|
|
89
|
+
it("should render multiple Paths, stride = 2", async () => {
|
|
90
|
+
const symbolRenderer = new ArcGisSymbologyRenderer("esriGeometryLine", PhillyLandmarksDataset.phillySimpleLineDrawingInfo.drawingInfo.renderer);
|
|
91
|
+
const renderer = new ArcGisFeatureRenderer(fakeContext, symbolRenderer);
|
|
92
|
+
const coords = [1, 2, 3, 4];
|
|
93
|
+
const applyFillStyleSpy = sandbox.spy(symbolRenderer, "applyFillStyle");
|
|
94
|
+
const applyStrokeStyleSpy = sandbox.spy(symbolRenderer, "applyStrokeStyle");
|
|
95
|
+
renderer.renderPath([2], coords, false, 2, true);
|
|
96
|
+
expect(beginPathSpy.calledOnce).to.be.true;
|
|
97
|
+
expect(moveToSpy.calledOnce).to.be.true;
|
|
98
|
+
expect(moveToSpy.getCalls()[0].args[0]).to.equals(coords[0]);
|
|
99
|
+
expect(moveToSpy.getCalls()[0].args[1]).to.equals(coords[1]);
|
|
100
|
+
expect(lineToSpy.calledOnce).to.be.true;
|
|
101
|
+
// IMPORTANT: Only first coord is absolute, following coords are expressed relative to previous coord.
|
|
102
|
+
expect(lineToSpy.getCalls()[0].args[0]).to.equals(coords[0] + coords[2]);
|
|
103
|
+
expect(lineToSpy.getCalls()[0].args[1]).to.equals(coords[1] + coords[3]);
|
|
104
|
+
expect(strokeSpy.calledOnce).to.be.true;
|
|
105
|
+
expect(fillSpy.called).to.be.false;
|
|
106
|
+
expect(closePathSpy.called).to.be.false;
|
|
107
|
+
expect(applyFillStyleSpy.calledOnce).to.be.false;
|
|
108
|
+
expect(applyStrokeStyleSpy.calledOnce).to.be.true;
|
|
109
|
+
});
|
|
110
|
+
it("should not render invalid with stride value", async () => {
|
|
111
|
+
const symbolRenderer = new ArcGisSymbologyRenderer("esriGeometryLine", PhillyLandmarksDataset.phillySimpleLineDrawingInfo.drawingInfo.renderer);
|
|
112
|
+
const renderer = new ArcGisFeatureRenderer(fakeContext, symbolRenderer);
|
|
113
|
+
const coords = [1, 2, 3, 4];
|
|
114
|
+
renderer.renderPath([2], coords, false, 1, true);
|
|
115
|
+
renderer.renderPath([2], coords, false, 4, true);
|
|
116
|
+
renderer.renderPoint([2], coords, 1, true);
|
|
117
|
+
renderer.renderPoint([2], coords, 4, true);
|
|
118
|
+
expect(lineToSpy.calledOnce).to.be.false;
|
|
119
|
+
expect(strokeSpy.calledOnce).to.be.false;
|
|
120
|
+
expect(fillSpy.called).to.be.false;
|
|
121
|
+
expect(closePathSpy.called).to.be.false;
|
|
122
|
+
});
|
|
123
|
+
it("should render Path and apply transform, relativeCoords OFF", async () => {
|
|
124
|
+
const symbolRenderer = new ArcGisSymbologyRenderer("esriGeometryLine", PhillyLandmarksDataset.phillySimpleLineDrawingInfo.drawingInfo.renderer);
|
|
125
|
+
const fakeOffset = 10;
|
|
126
|
+
const renderer = new ArcGisFeatureRenderer(fakeContext, symbolRenderer, Transform.createTranslation(Point3d.create(fakeOffset, fakeOffset)));
|
|
127
|
+
const coords = [1, 2, 3, 4];
|
|
128
|
+
renderer.renderPath([2], coords, false, 2, false);
|
|
129
|
+
expect(beginPathSpy.calledOnce).to.be.true;
|
|
130
|
+
expect(moveToSpy.calledOnce).to.be.true;
|
|
131
|
+
expect(moveToSpy.getCalls()[0].args[0]).to.equals(coords[0] + fakeOffset);
|
|
132
|
+
expect(moveToSpy.getCalls()[0].args[1]).to.equals(coords[1] + fakeOffset);
|
|
133
|
+
expect(lineToSpy.calledOnce).to.be.true;
|
|
134
|
+
// IMPORTANT: Only first coord is absolute, following coords are expressed relative to previous coord.
|
|
135
|
+
expect(lineToSpy.getCalls()[0].args[0]).to.equals(coords[2] + fakeOffset);
|
|
136
|
+
expect(lineToSpy.getCalls()[0].args[1]).to.equals(coords[3] + fakeOffset);
|
|
137
|
+
});
|
|
138
|
+
it("should render single Point, no transform, relativeCoords OFF", async () => {
|
|
139
|
+
const symbolRenderer = new ArcGisSymbologyRenderer("esriGeometryPoint", PhillyLandmarksDataset.phillySimplePointDrawingInfo.drawingInfo.renderer);
|
|
140
|
+
const renderer = new ArcGisFeatureRenderer(fakeContext, symbolRenderer);
|
|
141
|
+
const drawPointStub = sandbox.stub(ArcGisSymbologyRenderer.prototype, "drawPoint");
|
|
142
|
+
const coords = [1, 2];
|
|
143
|
+
renderer.renderPoint([], coords, 2, false);
|
|
144
|
+
expect(drawPointStub.calledOnce).to.be.true;
|
|
145
|
+
expect(drawPointStub.getCalls()[0].args[1]).to.equals(coords[0]);
|
|
146
|
+
expect(drawPointStub.getCalls()[0].args[2]).to.equals(coords[1]);
|
|
147
|
+
});
|
|
148
|
+
it("should render single Point and apply transform, relativeCoords OFF", async () => {
|
|
149
|
+
const symbolRenderer = new ArcGisSymbologyRenderer("esriGeometryPoint", PhillyLandmarksDataset.phillySimplePointDrawingInfo.drawingInfo.renderer);
|
|
150
|
+
const fakeOffset = 10;
|
|
151
|
+
const renderer = new ArcGisFeatureRenderer(fakeContext, symbolRenderer, Transform.createTranslation(Point3d.create(fakeOffset, fakeOffset)));
|
|
152
|
+
const drawPointStub = sandbox.stub(ArcGisSymbologyRenderer.prototype, "drawPoint");
|
|
153
|
+
const coords = [1, 2];
|
|
154
|
+
renderer.renderPoint([], coords, 2, false);
|
|
155
|
+
expect(drawPointStub.calledOnce).to.be.true;
|
|
156
|
+
expect(drawPointStub.getCalls()[0].args[1]).to.equals(coords[0] + fakeOffset);
|
|
157
|
+
expect(drawPointStub.getCalls()[0].args[2]).to.equals(coords[1] + fakeOffset);
|
|
158
|
+
});
|
|
159
|
+
it("should render multi Point, transform, relativeCoords OFF", async () => {
|
|
160
|
+
const symbolRenderer = new ArcGisSymbologyRenderer("esriGeometryPoint", PhillyLandmarksDataset.phillySimplePointDrawingInfo.drawingInfo.renderer);
|
|
161
|
+
const renderer = new ArcGisFeatureRenderer(fakeContext, symbolRenderer);
|
|
162
|
+
const drawPointStub = sandbox.stub(ArcGisSymbologyRenderer.prototype, "drawPoint");
|
|
163
|
+
const coords = [1, 2, 3, 4];
|
|
164
|
+
renderer.renderPoint([2], coords, 2, false);
|
|
165
|
+
expect(drawPointStub.getCalls().length).to.equals(2);
|
|
166
|
+
expect(drawPointStub.getCalls()[0].args[1]).to.equals(coords[0]);
|
|
167
|
+
expect(drawPointStub.getCalls()[0].args[2]).to.equals(coords[1]);
|
|
168
|
+
expect(drawPointStub.getCalls()[1].args[1]).to.equals(coords[2]);
|
|
169
|
+
expect(drawPointStub.getCalls()[1].args[2]).to.equals(coords[3]);
|
|
170
|
+
});
|
|
171
|
+
it("should render multi Point and apply transform, relativeCoords OFF", async () => {
|
|
172
|
+
const symbolRenderer = new ArcGisSymbologyRenderer("esriGeometryPoint", PhillyLandmarksDataset.phillySimplePointDrawingInfo.drawingInfo.renderer);
|
|
173
|
+
const fakeOffset = 10;
|
|
174
|
+
const renderer = new ArcGisFeatureRenderer(fakeContext, symbolRenderer, Transform.createTranslation(Point3d.create(fakeOffset, fakeOffset)));
|
|
175
|
+
const drawPointStub = sandbox.stub(ArcGisSymbologyRenderer.prototype, "drawPoint");
|
|
176
|
+
const coords = [1, 2, 3, 4];
|
|
177
|
+
renderer.renderPoint([2], coords, 2, false);
|
|
178
|
+
expect(drawPointStub.getCalls().length).to.equals(2);
|
|
179
|
+
expect(drawPointStub.getCalls()[0].args[1]).to.equals(coords[0] + fakeOffset);
|
|
180
|
+
expect(drawPointStub.getCalls()[0].args[2]).to.equals(coords[1] + fakeOffset);
|
|
181
|
+
expect(drawPointStub.getCalls()[1].args[1]).to.equals(coords[2] + fakeOffset);
|
|
182
|
+
expect(drawPointStub.getCalls()[1].args[2]).to.equals(coords[3] + fakeOffset);
|
|
183
|
+
});
|
|
184
|
+
it("should render multi Point and apply transform, relativeCoords ON", async () => {
|
|
185
|
+
const symbolRenderer = new ArcGisSymbologyRenderer("esriGeometryPoint", PhillyLandmarksDataset.phillySimplePointDrawingInfo.drawingInfo.renderer);
|
|
186
|
+
const fakeOffset = 10;
|
|
187
|
+
const renderer = new ArcGisFeatureRenderer(fakeContext, symbolRenderer, Transform.createTranslation(Point3d.create(fakeOffset, fakeOffset)));
|
|
188
|
+
const drawPointStub = sandbox.stub(ArcGisSymbologyRenderer.prototype, "drawPoint");
|
|
189
|
+
const coords = [1, 2, 3, 4];
|
|
190
|
+
renderer.renderPoint([2], coords, 2, true);
|
|
191
|
+
expect(drawPointStub.getCalls().length).to.equals(2);
|
|
192
|
+
expect(drawPointStub.getCalls()[0].args[1]).to.equals(coords[0] + fakeOffset);
|
|
193
|
+
expect(drawPointStub.getCalls()[0].args[2]).to.equals(coords[1] + fakeOffset);
|
|
194
|
+
expect(drawPointStub.getCalls()[1].args[1]).to.equals(coords[0] + coords[2] + fakeOffset);
|
|
195
|
+
expect(drawPointStub.getCalls()[1].args[2]).to.equals(coords[1] + coords[3] + fakeOffset);
|
|
196
|
+
});
|
|
197
|
+
it("should render and apply transform, relativeCoords ON", async () => {
|
|
198
|
+
const symbolRenderer = new ArcGisSymbologyRenderer("esriGeometryLine", PhillyLandmarksDataset.phillySimpleLineDrawingInfo.drawingInfo.renderer);
|
|
199
|
+
const fakeOffset = 10;
|
|
200
|
+
const renderer = new ArcGisFeatureRenderer(fakeContext, symbolRenderer, Transform.createTranslation(Point3d.create(fakeOffset, fakeOffset)));
|
|
201
|
+
const coords = [1, 2, 3, 4];
|
|
202
|
+
renderer.renderPath([2], coords, false, 2, true);
|
|
203
|
+
expect(beginPathSpy.calledOnce).to.be.true;
|
|
204
|
+
expect(moveToSpy.calledOnce).to.be.true;
|
|
205
|
+
expect(moveToSpy.getCalls()[0].args[0]).to.equals(coords[0] + fakeOffset);
|
|
206
|
+
expect(moveToSpy.getCalls()[0].args[1]).to.equals(coords[1] + fakeOffset);
|
|
207
|
+
expect(lineToSpy.calledOnce).to.be.true;
|
|
208
|
+
// IMPORTANT: Only first coord is absolute, following coords are expressed relative to previous coord.
|
|
209
|
+
expect(lineToSpy.getCalls()[0].args[0]).to.equals(coords[0] + coords[2] + fakeOffset);
|
|
210
|
+
expect(lineToSpy.getCalls()[0].args[1]).to.equals(coords[1] + coords[3] + fakeOffset);
|
|
211
|
+
});
|
|
212
|
+
});
|
|
213
213
|
//# sourceMappingURL=ArcGisFeatureRenderer.test.js.map
|