@itwin/map-layers-formats 4.1.0-dev.7 → 4.1.0-dev.70
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/CHANGELOG.md +69 -1
- package/lib/cjs/ArcGisFeature/ArcGisCanvasRenderer.d.ts +19 -0
- package/lib/cjs/ArcGisFeature/ArcGisCanvasRenderer.d.ts.map +1 -0
- package/lib/cjs/ArcGisFeature/ArcGisCanvasRenderer.js +46 -0
- package/lib/cjs/ArcGisFeature/ArcGisCanvasRenderer.js.map +1 -0
- package/lib/cjs/ArcGisFeature/ArcGisFeatureFormat.d.ts.map +1 -1
- package/lib/cjs/ArcGisFeature/ArcGisFeatureFormat.js +3 -0
- package/lib/cjs/ArcGisFeature/ArcGisFeatureFormat.js.map +1 -1
- package/lib/cjs/ArcGisFeature/ArcGisFeatureProvider.d.ts +16 -8
- package/lib/cjs/ArcGisFeature/ArcGisFeatureProvider.d.ts.map +1 -1
- package/lib/cjs/ArcGisFeature/ArcGisFeatureProvider.js +157 -45
- package/lib/cjs/ArcGisFeature/ArcGisFeatureProvider.js.map +1 -1
- package/lib/cjs/ArcGisFeature/ArcGisFeatureQuery.d.ts +5 -0
- package/lib/cjs/ArcGisFeature/ArcGisFeatureQuery.d.ts.map +1 -1
- package/lib/cjs/ArcGisFeature/ArcGisFeatureQuery.js +4 -0
- package/lib/cjs/ArcGisFeature/ArcGisFeatureQuery.js.map +1 -1
- package/lib/cjs/ArcGisFeature/ArcGisFeatureReader.d.ts +15 -6
- package/lib/cjs/ArcGisFeature/ArcGisFeatureReader.d.ts.map +1 -1
- package/lib/cjs/ArcGisFeature/ArcGisFeatureReader.js +6 -4
- package/lib/cjs/ArcGisFeature/ArcGisFeatureReader.js.map +1 -1
- package/lib/cjs/ArcGisFeature/ArcGisJsonFeatureReader.d.ts +14 -0
- package/lib/cjs/ArcGisFeature/ArcGisJsonFeatureReader.d.ts.map +1 -0
- package/lib/cjs/ArcGisFeature/{ArcGisFeatureJSON.js → ArcGisJsonFeatureReader.js} +51 -55
- package/lib/cjs/ArcGisFeature/ArcGisJsonFeatureReader.js.map +1 -0
- package/lib/cjs/ArcGisFeature/ArcGisPbfFeatureReader.d.ts +22 -0
- package/lib/cjs/ArcGisFeature/ArcGisPbfFeatureReader.d.ts.map +1 -0
- package/lib/cjs/ArcGisFeature/ArcGisPbfFeatureReader.js +249 -0
- package/lib/cjs/ArcGisFeature/ArcGisPbfFeatureReader.js.map +1 -0
- package/lib/cjs/ArcGisFeature/ArcGisSymbologyRenderer.d.ts +32 -77
- package/lib/cjs/ArcGisFeature/ArcGisSymbologyRenderer.d.ts.map +1 -1
- package/lib/cjs/ArcGisFeature/ArcGisSymbologyRenderer.js +88 -128
- package/lib/cjs/ArcGisFeature/ArcGisSymbologyRenderer.js.map +1 -1
- package/lib/cjs/ArcGisFeature/EsriSymbology.d.ts +152 -0
- package/lib/cjs/ArcGisFeature/EsriSymbology.d.ts.map +1 -0
- package/lib/cjs/ArcGisFeature/EsriSymbology.js +181 -0
- package/lib/cjs/ArcGisFeature/EsriSymbology.js.map +1 -0
- package/lib/cjs/Tools/MapFeatureInfoDecorator.d.ts +34 -0
- package/lib/cjs/Tools/MapFeatureInfoDecorator.d.ts.map +1 -0
- package/lib/cjs/Tools/MapFeatureInfoDecorator.js +281 -0
- package/lib/cjs/Tools/MapFeatureInfoDecorator.js.map +1 -0
- package/lib/cjs/Tools/MapFeatureInfoTool.d.ts +38 -0
- package/lib/cjs/Tools/MapFeatureInfoTool.d.ts.map +1 -0
- package/lib/cjs/Tools/MapFeatureInfoTool.js +113 -0
- package/lib/cjs/Tools/MapFeatureInfoTool.js.map +1 -0
- package/lib/cjs/map-layers-formats.d.ts +1 -0
- package/lib/cjs/map-layers-formats.d.ts.map +1 -1
- package/lib/cjs/map-layers-formats.js +1 -0
- package/lib/cjs/map-layers-formats.js.map +1 -1
- package/lib/cjs/mapLayersFormats.d.ts +12 -1
- package/lib/cjs/mapLayersFormats.d.ts.map +1 -1
- package/lib/cjs/mapLayersFormats.js +11 -1
- package/lib/cjs/mapLayersFormats.js.map +1 -1
- package/lib/esm/ArcGisFeature/ArcGisCanvasRenderer.d.ts +19 -0
- package/lib/esm/ArcGisFeature/ArcGisCanvasRenderer.d.ts.map +1 -0
- package/lib/esm/ArcGisFeature/ArcGisCanvasRenderer.js +42 -0
- package/lib/esm/ArcGisFeature/ArcGisCanvasRenderer.js.map +1 -0
- package/lib/esm/ArcGisFeature/ArcGisFeatureFormat.d.ts.map +1 -1
- package/lib/esm/ArcGisFeature/ArcGisFeatureFormat.js +4 -1
- package/lib/esm/ArcGisFeature/ArcGisFeatureFormat.js.map +1 -1
- package/lib/esm/ArcGisFeature/ArcGisFeatureProvider.d.ts +16 -8
- package/lib/esm/ArcGisFeature/ArcGisFeatureProvider.d.ts.map +1 -1
- package/lib/esm/ArcGisFeature/ArcGisFeatureProvider.js +158 -46
- package/lib/esm/ArcGisFeature/ArcGisFeatureProvider.js.map +1 -1
- package/lib/esm/ArcGisFeature/ArcGisFeatureQuery.d.ts +5 -0
- package/lib/esm/ArcGisFeature/ArcGisFeatureQuery.d.ts.map +1 -1
- package/lib/esm/ArcGisFeature/ArcGisFeatureQuery.js +4 -0
- package/lib/esm/ArcGisFeature/ArcGisFeatureQuery.js.map +1 -1
- package/lib/esm/ArcGisFeature/ArcGisFeatureReader.d.ts +15 -6
- package/lib/esm/ArcGisFeature/ArcGisFeatureReader.d.ts.map +1 -1
- package/lib/esm/ArcGisFeature/ArcGisFeatureReader.js +4 -2
- package/lib/esm/ArcGisFeature/ArcGisFeatureReader.js.map +1 -1
- package/lib/esm/ArcGisFeature/ArcGisJsonFeatureReader.d.ts +14 -0
- package/lib/esm/ArcGisFeature/ArcGisJsonFeatureReader.d.ts.map +1 -0
- package/lib/esm/ArcGisFeature/{ArcGisFeatureJSON.js → ArcGisJsonFeatureReader.js} +51 -55
- package/lib/esm/ArcGisFeature/ArcGisJsonFeatureReader.js.map +1 -0
- package/lib/esm/ArcGisFeature/ArcGisPbfFeatureReader.d.ts +22 -0
- package/lib/esm/ArcGisFeature/ArcGisPbfFeatureReader.d.ts.map +1 -0
- package/lib/esm/ArcGisFeature/ArcGisPbfFeatureReader.js +245 -0
- package/lib/esm/ArcGisFeature/ArcGisPbfFeatureReader.js.map +1 -0
- package/lib/esm/ArcGisFeature/ArcGisSymbologyRenderer.d.ts +32 -77
- package/lib/esm/ArcGisFeature/ArcGisSymbologyRenderer.d.ts.map +1 -1
- package/lib/esm/ArcGisFeature/ArcGisSymbologyRenderer.js +84 -124
- package/lib/esm/ArcGisFeature/ArcGisSymbologyRenderer.js.map +1 -1
- package/lib/esm/ArcGisFeature/EsriSymbology.d.ts +152 -0
- package/lib/esm/ArcGisFeature/EsriSymbology.d.ts.map +1 -0
- package/lib/esm/ArcGisFeature/EsriSymbology.js +170 -0
- package/lib/esm/ArcGisFeature/EsriSymbology.js.map +1 -0
- package/lib/esm/Tools/MapFeatureInfoDecorator.d.ts +34 -0
- package/lib/esm/Tools/MapFeatureInfoDecorator.d.ts.map +1 -0
- package/lib/esm/Tools/MapFeatureInfoDecorator.js +277 -0
- package/lib/esm/Tools/MapFeatureInfoDecorator.js.map +1 -0
- package/lib/esm/Tools/MapFeatureInfoTool.d.ts +38 -0
- package/lib/esm/Tools/MapFeatureInfoTool.d.ts.map +1 -0
- package/lib/esm/Tools/MapFeatureInfoTool.js +110 -0
- package/lib/esm/Tools/MapFeatureInfoTool.js.map +1 -0
- package/lib/esm/map-layers-formats.d.ts +1 -0
- package/lib/esm/map-layers-formats.d.ts.map +1 -1
- package/lib/esm/map-layers-formats.js +1 -0
- package/lib/esm/map-layers-formats.js.map +1 -1
- package/lib/esm/mapLayersFormats.d.ts +12 -1
- package/lib/esm/mapLayersFormats.d.ts.map +1 -1
- package/lib/esm/mapLayersFormats.js +13 -2
- package/lib/esm/mapLayersFormats.js.map +1 -1
- package/lib/public/locales/en/mapLayersFormats.json +12 -0
- package/package.json +19 -22
- package/.nycrc +0 -10
- package/.rush/temp/operation/build/all.log +0 -3
- package/.rush/temp/operation/build/state.json +0 -3
- package/.rush/temp/operation/cover/all.log +0 -98
- package/.rush/temp/operation/cover/state.json +0 -3
- package/.rush/temp/operation/docs/all.log +0 -30
- package/.rush/temp/operation/docs/state.json +0 -3
- package/.rush/temp/package-deps_build.json +0 -36
- package/.rush/temp/package-deps_cover.json +0 -36
- package/.rush/temp/package-deps_docs.json +0 -36
- package/.rush/temp/shrinkwrap-deps.json +0 -505
- package/CHANGELOG.json +0 -119
- package/config/rush-project.json +0 -6
- package/lib/cjs/ArcGisFeature/ArcGisFeatureJSON.d.ts +0 -15
- package/lib/cjs/ArcGisFeature/ArcGisFeatureJSON.d.ts.map +0 -1
- package/lib/cjs/ArcGisFeature/ArcGisFeatureJSON.js.map +0 -1
- package/lib/cjs/ArcGisFeature/ArcGisFeaturePBF.d.ts +0 -15
- package/lib/cjs/ArcGisFeature/ArcGisFeaturePBF.d.ts.map +0 -1
- package/lib/cjs/ArcGisFeature/ArcGisFeaturePBF.js +0 -201
- package/lib/cjs/ArcGisFeature/ArcGisFeaturePBF.js.map +0 -1
- package/lib/cjs/ArcGisFeature/ArcGisFeatureRenderer.d.ts +0 -33
- package/lib/cjs/ArcGisFeature/ArcGisFeatureRenderer.d.ts.map +0 -1
- package/lib/cjs/ArcGisFeature/ArcGisFeatureRenderer.js +0 -143
- package/lib/cjs/ArcGisFeature/ArcGisFeatureRenderer.js.map +0 -1
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureFeatureFormats.test.d.ts +0 -2
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureFeatureFormats.test.d.ts.map +0 -1
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureFeatureFormats.test.js +0 -35
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureFeatureFormats.test.js.map +0 -1
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureJSON.test.d.ts +0 -2
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureJSON.test.d.ts.map +0 -1
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureJSON.test.js +0 -162
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureJSON.test.js.map +0 -1
- package/lib/cjs/test/ArcGisFeature/ArcGisFeaturePBF.test.d.ts +0 -2
- package/lib/cjs/test/ArcGisFeature/ArcGisFeaturePBF.test.d.ts.map +0 -1
- package/lib/cjs/test/ArcGisFeature/ArcGisFeaturePBF.test.js +0 -168
- package/lib/cjs/test/ArcGisFeature/ArcGisFeaturePBF.test.js.map +0 -1
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureProvider.test.d.ts +0 -2
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureProvider.test.d.ts.map +0 -1
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureProvider.test.js +0 -680
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureProvider.test.js.map +0 -1
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureQuery.test.d.ts +0 -2
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureQuery.test.d.ts.map +0 -1
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureQuery.test.js +0 -104
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureQuery.test.js.map +0 -1
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureRenderer.test.d.ts +0 -2
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureRenderer.test.d.ts.map +0 -1
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureRenderer.test.js +0 -215
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureRenderer.test.js.map +0 -1
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureResponse.test.d.ts +0 -2
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureResponse.test.d.ts.map +0 -1
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureResponse.test.js +0 -95
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureResponse.test.js.map +0 -1
- package/lib/cjs/test/ArcGisFeature/ArcGisSymbologyRenderer.test.d.ts +0 -2
- package/lib/cjs/test/ArcGisFeature/ArcGisSymbologyRenderer.test.d.ts.map +0 -1
- package/lib/cjs/test/ArcGisFeature/ArcGisSymbologyRenderer.test.js +0 -60
- package/lib/cjs/test/ArcGisFeature/ArcGisSymbologyRenderer.test.js.map +0 -1
- package/lib/cjs/test/ArcGisFeature/Mocks.d.ts +0 -7
- package/lib/cjs/test/ArcGisFeature/Mocks.d.ts.map +0 -1
- package/lib/cjs/test/ArcGisFeature/Mocks.js +0 -19
- package/lib/cjs/test/ArcGisFeature/Mocks.js.map +0 -1
- package/lib/cjs/test/ArcGisFeature/NewYorkDataset.d.ts +0 -56
- package/lib/cjs/test/ArcGisFeature/NewYorkDataset.d.ts.map +0 -1
- package/lib/cjs/test/ArcGisFeature/NewYorkDataset.js +0 -420
- package/lib/cjs/test/ArcGisFeature/NewYorkDataset.js.map +0 -1
- package/lib/cjs/test/ArcGisFeature/PhillyLandmarksDataset.d.ts +0 -1043
- package/lib/cjs/test/ArcGisFeature/PhillyLandmarksDataset.d.ts.map +0 -1
- package/lib/cjs/test/ArcGisFeature/PhillyLandmarksDataset.js +0 -427
- package/lib/cjs/test/ArcGisFeature/PhillyLandmarksDataset.js.map +0 -1
- package/lib/cjs/test/coverage/.nyc_output/2a6113c3-018f-40b1-ae8f-f3d0cbe030ce.json +0 -1
- package/lib/cjs/test/coverage/.nyc_output/74410d89-cce2-4b2a-89c9-6d56490c73f1.json +0 -1
- package/lib/cjs/test/coverage/.nyc_output/processinfo/2a6113c3-018f-40b1-ae8f-f3d0cbe030ce.json +0 -1
- package/lib/cjs/test/coverage/.nyc_output/processinfo/74410d89-cce2-4b2a-89c9-6d56490c73f1.json +0 -1
- package/lib/cjs/test/coverage/.nyc_output/processinfo/index.json +0 -1
- package/lib/cjs/test/coverage/cobertura-coverage.xml +0 -1169
- package/lib/cjs/test/coverage/lcov-report/base.css +0 -224
- package/lib/cjs/test/coverage/lcov-report/block-navigation.js +0 -87
- package/lib/cjs/test/coverage/lcov-report/favicon.png +0 -0
- package/lib/cjs/test/coverage/lcov-report/index.html +0 -131
- package/lib/cjs/test/coverage/lcov-report/prettify.css +0 -1
- package/lib/cjs/test/coverage/lcov-report/prettify.js +0 -2
- package/lib/cjs/test/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/lib/cjs/test/coverage/lcov-report/sorter.js +0 -196
- package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureFormat.ts.html +0 -133
- package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureJSON.ts.html +0 -550
- package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeaturePBF.ts.html +0 -730
- package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureProvider.ts.html +0 -1546
- package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureQuery.ts.html +0 -763
- package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureReader.ts.html +0 -223
- package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureRenderer.ts.html +0 -598
- package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureResponse.ts.html +0 -301
- package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisSymbologyRenderer.ts.html +0 -832
- package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/index.html +0 -236
- package/lib/cjs/test/coverage/lcov-report/src/index.html +0 -131
- package/lib/cjs/test/coverage/lcov-report/src/map-layers-formats.ts.html +0 -130
- package/lib/cjs/test/coverage/lcov-report/src/mapLayersFormats.ts.html +0 -163
- package/lib/cjs/test/coverage/lcov.info +0 -1358
- package/lib/cjs/tsconfig.tsbuildinfo +0 -1
- package/lib/esm/ArcGisFeature/ArcGisFeatureJSON.d.ts +0 -15
- package/lib/esm/ArcGisFeature/ArcGisFeatureJSON.d.ts.map +0 -1
- package/lib/esm/ArcGisFeature/ArcGisFeatureJSON.js.map +0 -1
- package/lib/esm/ArcGisFeature/ArcGisFeaturePBF.d.ts +0 -15
- package/lib/esm/ArcGisFeature/ArcGisFeaturePBF.d.ts.map +0 -1
- package/lib/esm/ArcGisFeature/ArcGisFeaturePBF.js +0 -197
- package/lib/esm/ArcGisFeature/ArcGisFeaturePBF.js.map +0 -1
- package/lib/esm/ArcGisFeature/ArcGisFeatureRenderer.d.ts +0 -33
- package/lib/esm/ArcGisFeature/ArcGisFeatureRenderer.d.ts.map +0 -1
- package/lib/esm/ArcGisFeature/ArcGisFeatureRenderer.js +0 -139
- package/lib/esm/ArcGisFeature/ArcGisFeatureRenderer.js.map +0 -1
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureFeatureFormats.test.d.ts +0 -2
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureFeatureFormats.test.d.ts.map +0 -1
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureFeatureFormats.test.js +0 -33
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureFeatureFormats.test.js.map +0 -1
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureJSON.test.d.ts +0 -2
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureJSON.test.d.ts.map +0 -1
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureJSON.test.js +0 -160
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureJSON.test.js.map +0 -1
- package/lib/esm/test/ArcGisFeature/ArcGisFeaturePBF.test.d.ts +0 -2
- package/lib/esm/test/ArcGisFeature/ArcGisFeaturePBF.test.d.ts.map +0 -1
- package/lib/esm/test/ArcGisFeature/ArcGisFeaturePBF.test.js +0 -166
- package/lib/esm/test/ArcGisFeature/ArcGisFeaturePBF.test.js.map +0 -1
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureProvider.test.d.ts +0 -2
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureProvider.test.d.ts.map +0 -1
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureProvider.test.js +0 -678
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureProvider.test.js.map +0 -1
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureQuery.test.d.ts +0 -2
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureQuery.test.d.ts.map +0 -1
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureQuery.test.js +0 -102
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureQuery.test.js.map +0 -1
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureRenderer.test.d.ts +0 -2
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureRenderer.test.d.ts.map +0 -1
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureRenderer.test.js +0 -213
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureRenderer.test.js.map +0 -1
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureResponse.test.d.ts +0 -2
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureResponse.test.d.ts.map +0 -1
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureResponse.test.js +0 -93
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureResponse.test.js.map +0 -1
- package/lib/esm/test/ArcGisFeature/ArcGisSymbologyRenderer.test.d.ts +0 -2
- package/lib/esm/test/ArcGisFeature/ArcGisSymbologyRenderer.test.d.ts.map +0 -1
- package/lib/esm/test/ArcGisFeature/ArcGisSymbologyRenderer.test.js +0 -58
- package/lib/esm/test/ArcGisFeature/ArcGisSymbologyRenderer.test.js.map +0 -1
- package/lib/esm/test/ArcGisFeature/Mocks.d.ts +0 -7
- package/lib/esm/test/ArcGisFeature/Mocks.d.ts.map +0 -1
- package/lib/esm/test/ArcGisFeature/Mocks.js +0 -16
- package/lib/esm/test/ArcGisFeature/Mocks.js.map +0 -1
- package/lib/esm/test/ArcGisFeature/NewYorkDataset.d.ts +0 -56
- package/lib/esm/test/ArcGisFeature/NewYorkDataset.d.ts.map +0 -1
- package/lib/esm/test/ArcGisFeature/NewYorkDataset.js +0 -417
- package/lib/esm/test/ArcGisFeature/NewYorkDataset.js.map +0 -1
- package/lib/esm/test/ArcGisFeature/PhillyLandmarksDataset.d.ts +0 -1043
- package/lib/esm/test/ArcGisFeature/PhillyLandmarksDataset.d.ts.map +0 -1
- package/lib/esm/test/ArcGisFeature/PhillyLandmarksDataset.js +0 -424
- package/lib/esm/test/ArcGisFeature/PhillyLandmarksDataset.js.map +0 -1
- package/lib/esm/tsconfig.tsbuildinfo +0 -1
- package/lib/test/junit_results.xml +0 -159
- package/map-layers-formats.build.log +0 -30
- package/src/ArcGisFeature/ArcGisFeatureFormat.ts +0 -16
- package/src/ArcGisFeature/ArcGisFeatureJSON.ts +0 -155
- package/src/ArcGisFeature/ArcGisFeaturePBF.ts +0 -215
- package/src/ArcGisFeature/ArcGisFeatureProvider.ts +0 -487
- package/src/ArcGisFeature/ArcGisFeatureQuery.ts +0 -226
- package/src/ArcGisFeature/ArcGisFeatureReader.ts +0 -46
- package/src/ArcGisFeature/ArcGisFeatureRenderer.ts +0 -171
- package/src/ArcGisFeature/ArcGisFeatureResponse.ts +0 -72
- package/src/ArcGisFeature/ArcGisSymbologyRenderer.ts +0 -249
- package/src/ArcGisFeature/esriPBuffer.gen.ts +0 -2612
- package/src/map-layers-formats.ts +0 -15
- package/src/mapLayersFormats.ts +0 -26
- package/src/test/ArcGisFeature/ArcGisFeatureFeatureFormats.test.ts +0 -46
- package/src/test/ArcGisFeature/ArcGisFeatureJSON.test.ts +0 -202
- package/src/test/ArcGisFeature/ArcGisFeaturePBF.test.ts +0 -227
- package/src/test/ArcGisFeature/ArcGisFeatureProvider.test.ts +0 -805
- package/src/test/ArcGisFeature/ArcGisFeatureQuery.test.ts +0 -117
- package/src/test/ArcGisFeature/ArcGisFeatureRenderer.test.ts +0 -296
- package/src/test/ArcGisFeature/ArcGisFeatureResponse.test.ts +0 -109
- package/src/test/ArcGisFeature/ArcGisSymbologyRenderer.test.ts +0 -77
- package/src/test/ArcGisFeature/Mocks.ts +0 -19
- package/src/test/ArcGisFeature/NewYorkDataset.ts +0 -423
- package/src/test/ArcGisFeature/PhillyLandmarksDataset.ts +0 -455
- package/tsconfig.json +0 -20
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ArcGisFeatureRenderer.js","sourceRoot":"","sources":["../../../src/ArcGisFeature/ArcGisFeatureRenderer.ts"],"names":[],"mappings":";;;AAOA,gBAAgB;AAChB,MAAa,qBAAqB;IAKhC,YAAY,OAAiC,EAAE,MAA+B,EAAE,oBAAgC;QAC9G,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;QACxB,IAAI,CAAC,UAAU,GAAG,oBAAoB,CAAC;IACzC,CAAC;IAED,IAAW,SAAS,KAAI,OAAO,IAAI,CAAC,UAAU,CAAC,CAAA,CAAC;IAEhD,0CAA0C;IAClC,SAAS;QACf,IAAI,CAAC,QAAQ,CAAC,SAAS,EAAE,CAAC;IAC5B,CAAC;IAEO,MAAM,CAAC,CAAS,EAAE,CAAS;QACjC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,EAAC,CAAC,CAAC,CAAC;IAC5B,CAAC;IAEO,MAAM,CAAC,CAAS,EAAE,CAAS;QACjC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,EAAC,CAAC,CAAC,CAAC;IAC5B,CAAC;IAEO,IAAI;QACV,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;IACvB,CAAC;IAEO,MAAM;QACZ,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;IACzB,CAAC;IAED;;;;;;;MAOE;IACK,UAAU,CAAC,eAAyB,EAAE,cAAwB,EAAE,IAAa,EAAE,MAAc,EAAE,cAAuB;QAC3H,IAAI,MAAM,GAAG,CAAC,IAAI,MAAM,GAAG,CAAC,EAAE;YAC5B,OAAO;SACR;QAED,2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E/C;gBACD,YAAY,IAAE,MAAM,GAAC,WAAW,CAAC;aAClC;SACF;IAEH,CAAC;CAEF;AAlKD,sDAkKC","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\nimport { Transform } from \"@itwin/core-geometry\";\r\nimport { ArcGisSymbologyRenderer } from \"./ArcGisSymbologyRenderer\";\r\n\r\n/** @internal */\r\nexport class ArcGisFeatureRenderer {\r\n private _symbol: ArcGisSymbologyRenderer;\r\n private _transform: Transform|undefined;\r\n private _context: CanvasRenderingContext2D;\r\n\r\n constructor(context: CanvasRenderingContext2D, symbol: ArcGisSymbologyRenderer, world2PixelTransform?: Transform) {\r\n this._symbol = symbol;\r\n this._context = context;\r\n this._transform = world2PixelTransform;\r\n }\r\n\r\n public get transform() {return this._transform;}\r\n\r\n // Utility functions to make ease testing.\r\n private closePath() {\r\n this._context.closePath();\r\n }\r\n\r\n private lineTo(x: number, y: number) {\r\n this._context.lineTo(x,y);\r\n }\r\n\r\n private moveTo(x: number, y: number) {\r\n this._context.moveTo(x,y);\r\n }\r\n\r\n private fill() {\r\n this._context.fill();\r\n }\r\n\r\n private stroke() {\r\n this._context.stroke();\r\n }\r\n\r\n /**\r\n * Render a path on the renderer's context.\r\n * Note: Inputs are designed based on the PBF format, to avoid any data transformation.\r\n * @param geometryLengths Array be used to determine the start and end of each sub-path / rings. (i.e. [5,5] = two rings of 5 vertices)\r\n * @param geometryCoords Array that linearly encodes the vertices of each sub-path of a polyline / ring of a polygon\r\n * @param fill Indicates if the path should be filled or not.\r\n * @param stride Dimension of each vertices (i.e. 2 or 3. 3 could be X,Y,Z, X,YM) Currently 3rd dimension is ignored.\r\n */\r\n public renderPath(geometryLengths: number[], geometryCoords: number[], fill: boolean, stride: number, relativeCoords: boolean) {\r\n if (stride < 2 || stride > 3) {\r\n return;\r\n }\r\n\r\n // Keep track of our position in the in the 'coords' array:\r\n // Every time we loop on the 'lengths' array, the position\r\n // to start reading vertices in the 'coords' must be the sum of all previously read vertices.\r\n let coordsOffset = 0;\r\n\r\n // Begin the path here.\r\n // Note: Even though path is closed inside the 'geometryLengths' loop,\r\n // it's import to begin the path only once.\r\n this._context.beginPath();\r\n for (const vertexCount of geometryLengths) {\r\n let lastPtX = 0, lastPtY = 0;\r\n for (let vertexIdx=0 ; vertexIdx <vertexCount; vertexIdx++) {\r\n let pX = geometryCoords[coordsOffset+(vertexIdx*stride)];\r\n let pY = geometryCoords[coordsOffset+(vertexIdx*stride)+1];\r\n if (vertexIdx === 0) {\r\n // first vertex is always \"absolute\" and must be drawn as 'moveTo' (i.e. not lineTo)\r\n if (relativeCoords) {\r\n lastPtX = pX;\r\n lastPtY = pY;\r\n }\r\n\r\n if (this._transform) {\r\n const transformedPoint = this._transform.multiplyPoint2d({x: pX, y:pY});\r\n pX = transformedPoint.x;\r\n pY = transformedPoint.y;\r\n }\r\n\r\n this.moveTo(pX, pY);\r\n } else {\r\n\r\n // Following vertices are relative to the previous one (sadly not really well documented by ESRI)\r\n // typically this happens when 'coordinates quantization' is active (i.e. no client side transformation is needed)\r\n if (relativeCoords) {\r\n pX = lastPtX = lastPtX+pX;\r\n pY = lastPtY = lastPtY+pY;\r\n }\r\n\r\n if (this._transform) {\r\n const transformedPoint = this._transform.multiplyPoint2d({x: pX, y:pY});\r\n pX = transformedPoint.x;\r\n pY = transformedPoint.y;\r\n }\r\n this.lineTo(pX, pY);\r\n }\r\n\r\n }\r\n coordsOffset+=stride*vertexCount;\r\n if (fill) {\r\n // ClosePath but do not 'fill' here, only at the very end (otherwise it will mess up holes)\r\n this.closePath();\r\n }\r\n }\r\n\r\n if (fill) {\r\n this._symbol.applyFillStyle(this._context);\r\n this.fill();\r\n }\r\n\r\n this._symbol.applyStrokeStyle(this._context);\r\n this.stroke(); // draw line path or polygon outline\r\n }\r\n\r\n /**\r\n * Render a point on the renderer's context.\r\n * Note: Inputs are designed based on the PBF format, to avoid any data transformation.\r\n * @param geometryLengths Array be used to determine the start and end of each multi-point array, empty for single point.\r\n * @param geometryCoords Array that linearly encodes vertices.\r\n * @param stride Dimension of each vertices (i.e. 2 or 3. 3 could be X,Y,Z, X,YM) Currently 3rd dimension is ignored.\r\n */\r\n public renderPoint(geometryLengths: number[], geometryCoords: number[], stride: number, relativeCoords: boolean) {\r\n\r\n if (stride < 2 || stride > 3) {\r\n return;\r\n }\r\n let coordsOffset = 0;\r\n if (geometryLengths.length === 0) {\r\n // Strangely, for points, 'lengths' array is empty, so we assume there is a single vertex in 'coords' array.\r\n if (geometryCoords.length >= stride) {\r\n\r\n if (this._transform) {\r\n const transformedPoint = this._transform.multiplyPoint2d({x: geometryCoords[0], y:geometryCoords[1]});\r\n this._symbol.drawPoint(this._context, transformedPoint.x, transformedPoint.y);\r\n } else {\r\n this._symbol.drawPoint(this._context, geometryCoords[0], geometryCoords[1]);\r\n }\r\n }\r\n } else {\r\n // MULTI-POINTS: Needs testing\r\n // I assume 'lengths' array will get populated and 'coords' array will look similar to line/polygons.\r\n for (const vertexCount of geometryLengths) {\r\n let lastPtX = 0, lastPtY = 0;\r\n for (let vertexIdx=0 ; vertexIdx <vertexCount; vertexIdx++) {\r\n let pX = geometryCoords[coordsOffset+(vertexIdx*stride)];\r\n let pY = geometryCoords[coordsOffset+(vertexIdx*stride)+1];\r\n\r\n if (relativeCoords) {\r\n pX = lastPtX = lastPtX+pX;\r\n pY = lastPtY = lastPtY+pY;\r\n }\r\n\r\n if (this._transform) {\r\n const transformedPoint = this._transform.multiplyPoint2d({x: pX, y:pY});\r\n pX = transformedPoint.x;\r\n pY = transformedPoint.y;\r\n }\r\n\r\n this._symbol.drawPoint(this._context, pX, pY);\r\n\r\n }\r\n coordsOffset+=stride*vertexCount;\r\n }\r\n }\r\n\r\n }\r\n\r\n}\r\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ArcGisFeatureFeatureFormats.test.d.ts","sourceRoot":"","sources":["../../../../src/test/ArcGisFeature/ArcGisFeatureFeatureFormats.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*---------------------------------------------------------------------------------------------
|
|
3
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
|
-
*--------------------------------------------------------------------------------------------*/
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
const core_common_1 = require("@itwin/core-common");
|
|
8
|
-
const core_frontend_1 = require("@itwin/core-frontend");
|
|
9
|
-
const chai_1 = require("chai");
|
|
10
|
-
const ArcGisFeatureFormat_1 = require("../../ArcGisFeature/ArcGisFeatureFormat");
|
|
11
|
-
const Mocks_1 = require("./Mocks");
|
|
12
|
-
const sinon = require("sinon");
|
|
13
|
-
describe("ArcGisFeaturePBF", () => {
|
|
14
|
-
const sandbox = sinon.createSandbox();
|
|
15
|
-
afterEach(async () => {
|
|
16
|
-
sandbox.restore();
|
|
17
|
-
});
|
|
18
|
-
it("should createImageryProvider", async () => {
|
|
19
|
-
const provider = ArcGisFeatureFormat_1.ArcGisFeatureMapLayerFormat.createImageryProvider(core_common_1.ImageMapLayerSettings.fromJSON(Mocks_1.esriFeatureSampleSource));
|
|
20
|
-
(0, chai_1.expect)(provider).to.not.undefined;
|
|
21
|
-
});
|
|
22
|
-
it("should validateSource", async () => {
|
|
23
|
-
const fakeMethod = async (_url, _formatId, _filter, _userName, _password, _ignoreCache) => {
|
|
24
|
-
return { status: core_frontend_1.MapLayerSourceStatus.Valid };
|
|
25
|
-
};
|
|
26
|
-
const validateSourceStub = sinon.stub(core_frontend_1.ArcGisUtilities, "validateSource").callsFake(fakeMethod);
|
|
27
|
-
await ArcGisFeatureFormat_1.ArcGisFeatureMapLayerFormat.validateSource(Mocks_1.esriFeatureSampleSource.url);
|
|
28
|
-
(0, chai_1.expect)(validateSourceStub.calledOnce).to.be.true;
|
|
29
|
-
const firstCall = validateSourceStub.getCalls()[0];
|
|
30
|
-
(0, chai_1.expect)(firstCall.args[0]).to.equals(Mocks_1.esriFeatureSampleSource.url);
|
|
31
|
-
(0, chai_1.expect)(firstCall.args[1]).to.equals(ArcGisFeatureFormat_1.ArcGisFeatureMapLayerFormat.formatId);
|
|
32
|
-
(0, chai_1.expect)(firstCall.args[2]).to.eqls(["query"]);
|
|
33
|
-
});
|
|
34
|
-
});
|
|
35
|
-
//# sourceMappingURL=ArcGisFeatureFeatureFormats.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ArcGisFeatureFeatureFormats.test.js","sourceRoot":"","sources":["../../../../src/test/ArcGisFeature/ArcGisFeatureFeatureFormats.test.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;AAE/F,oDAA2D;AAC3D,wDAG8B;AAC9B,+BAA8B;AAC9B,iFAAsF;AACtF,mCAAkD;AAClD,+BAA+B;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,iDAA2B,CAAC,qBAAqB,CAAC,mCAAqB,CAAC,QAAQ,CAAC,+BAAuB,CAAC,CAAC,CAAC;QAC5H,IAAA,aAAM,EAAC,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,oCAAoB,CAAC,KAAK,EAAC,CAAC;QAE9C,CAAC,CAAC;QACF,MAAM,kBAAkB,GAAG,KAAK,CAAC,IAAI,CAAC,+BAAe,EAAE,gBAAgB,CAAC,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;QAE/F,MAAM,iDAA2B,CAAC,cAAc,CAAC,+BAAuB,CAAC,GAAG,CAAC,CAAC;QAE9E,IAAA,aAAM,EAAC,kBAAkB,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC;QACjD,MAAM,SAAS,GAAG,kBAAkB,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,CAAC;QACnD,IAAA,aAAM,EAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,+BAAuB,CAAC,GAAG,CAAC,CAAC;QACjE,IAAA,aAAM,EAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,iDAA2B,CAAC,QAAQ,CAAC,CAAC;QAC1E,IAAA,aAAM,EAAC,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":["/*---------------------------------------------------------------------------------------------\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 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ArcGisFeatureJSON.test.d.ts","sourceRoot":"","sources":["../../../../src/test/ArcGisFeature/ArcGisFeatureJSON.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,162 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*---------------------------------------------------------------------------------------------
|
|
3
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
|
-
*--------------------------------------------------------------------------------------------*/
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
const core_bentley_1 = require("@itwin/core-bentley");
|
|
8
|
-
const core_common_1 = require("@itwin/core-common");
|
|
9
|
-
const chai_1 = require("chai");
|
|
10
|
-
const sinon = require("sinon");
|
|
11
|
-
const ArcGisFeatureFormat_1 = require("../../ArcGisFeature/ArcGisFeatureFormat");
|
|
12
|
-
const ArcGisFeatureJSON_1 = require("../../ArcGisFeature/ArcGisFeatureJSON");
|
|
13
|
-
const ArcGisFeatureRenderer_1 = require("../../ArcGisFeature/ArcGisFeatureRenderer");
|
|
14
|
-
const ArcGisSymbologyRenderer_1 = require("../../ArcGisFeature/ArcGisSymbologyRenderer");
|
|
15
|
-
const Mocks_1 = require("./Mocks");
|
|
16
|
-
const PhillyLandmarksDataset_1 = require("./PhillyLandmarksDataset");
|
|
17
|
-
const esriFeatureSampleSource = { name: "dummyFeatureLayer", url: "https://dummy.com", formatId: ArcGisFeatureFormat_1.ArcGisFeatureMapLayerFormat.formatId };
|
|
18
|
-
const createFeatureJSON = () => {
|
|
19
|
-
const settings = core_common_1.ImageMapLayerSettings.fromJSON(esriFeatureSampleSource);
|
|
20
|
-
const featurePbf = new ArcGisFeatureJSON_1.ArcGisFeatureJSON(settings, { name: "SampleLayer" });
|
|
21
|
-
// Locale configuration depends on the testing machine (i.e. linux vs windows),
|
|
22
|
-
// so we need to force date display to Iso to get a consistent value.
|
|
23
|
-
// In real scenario, we still want dates to be displayed in end-user's locale.
|
|
24
|
-
featurePbf.forceDateDisplayValueToIso = true;
|
|
25
|
-
return featurePbf;
|
|
26
|
-
};
|
|
27
|
-
describe("ArcGisFeatureJSON", () => {
|
|
28
|
-
const sandbox = sinon.createSandbox();
|
|
29
|
-
afterEach(async () => {
|
|
30
|
-
sandbox.restore();
|
|
31
|
-
});
|
|
32
|
-
it("should read FeatureInfo in JSON (phillyTansportation)", async () => {
|
|
33
|
-
const featureJson = createFeatureJSON();
|
|
34
|
-
// In some cases, PBF gives more floating-point precision than JSON.
|
|
35
|
-
// Since I want to use the same output reference for both formats, I force a max precision of 8.
|
|
36
|
-
featureJson.floatPrecision = 8;
|
|
37
|
-
const results = [];
|
|
38
|
-
featureJson.readFeatureInfo({ data: PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillyTransportationGetFeatureInfoQueryJson, exceedTransferLimit: false }, results);
|
|
39
|
-
(0, chai_1.expect)(JSON.stringify(results)).equals(JSON.stringify(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillyTansportationGetFeatureInfoResultRef));
|
|
40
|
-
});
|
|
41
|
-
it("should read FeatureInfo in JSON (phillyAirport)", async () => {
|
|
42
|
-
const settings = core_common_1.ImageMapLayerSettings.fromJSON(esriFeatureSampleSource);
|
|
43
|
-
const featureJson = new ArcGisFeatureJSON_1.ArcGisFeatureJSON(settings, { name: "SampleLayer" });
|
|
44
|
-
// In some cases, PBF gives more floating-point precision than JSON.
|
|
45
|
-
// Since I want to use the same output reference for both formats, I force a max precision of 8.
|
|
46
|
-
featureJson.floatPrecision = 8;
|
|
47
|
-
const results = [];
|
|
48
|
-
const data = JSON.parse(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillyAirportGetFeatureInfoQueryJson);
|
|
49
|
-
featureJson.readFeatureInfo({ data, exceedTransferLimit: false }, results);
|
|
50
|
-
const _test = JSON.stringify(results);
|
|
51
|
-
(0, chai_1.expect)(_test).equals(JSON.stringify(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillyAirportGetFeatureInfoResultRef));
|
|
52
|
-
});
|
|
53
|
-
it("should deflate coordinates array", async () => {
|
|
54
|
-
// Simple deflate stride = 2
|
|
55
|
-
let doubleArray = [[1, 2], [3, 4]];
|
|
56
|
-
let deflated = [];
|
|
57
|
-
let offset = ArcGisFeatureJSON_1.ArcGisFeatureJSON.deflateCoordinates(doubleArray, deflated, 2, 0);
|
|
58
|
-
(0, chai_1.expect)(offset).to.equals(4);
|
|
59
|
-
(0, chai_1.expect)(deflated).to.eql([1, 2, 3, 4]);
|
|
60
|
-
/// Check offset with stride = 2
|
|
61
|
-
doubleArray = [[5, 6]];
|
|
62
|
-
offset = ArcGisFeatureJSON_1.ArcGisFeatureJSON.deflateCoordinates(doubleArray, deflated, 2, offset);
|
|
63
|
-
(0, chai_1.expect)(offset).to.equals(6);
|
|
64
|
-
(0, chai_1.expect)(deflated).to.eql([1, 2, 3, 4, 5, 6]);
|
|
65
|
-
// Simple deflate stride = 3
|
|
66
|
-
doubleArray = [[1, 2, 3], [4, 5, 6]];
|
|
67
|
-
deflated = [];
|
|
68
|
-
offset = ArcGisFeatureJSON_1.ArcGisFeatureJSON.deflateCoordinates(doubleArray, deflated, 3, 0);
|
|
69
|
-
(0, chai_1.expect)(offset).to.equals(6);
|
|
70
|
-
(0, chai_1.expect)(deflated).to.eql([1, 2, 3, 4, 5, 6]);
|
|
71
|
-
/// Check offset with stride = 3
|
|
72
|
-
doubleArray = [[7, 8, 9]];
|
|
73
|
-
offset = ArcGisFeatureJSON_1.ArcGisFeatureJSON.deflateCoordinates(doubleArray, deflated, 3, offset);
|
|
74
|
-
(0, chai_1.expect)(offset).to.equals(9);
|
|
75
|
-
(0, chai_1.expect)(deflated).to.eql([1, 2, 3, 4, 5, 6, 7, 8, 9]);
|
|
76
|
-
});
|
|
77
|
-
it("should readAndRender single ring polygon feature", async () => {
|
|
78
|
-
const featureJson = createFeatureJSON();
|
|
79
|
-
const data = PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillySimplePolyQueryJson;
|
|
80
|
-
const symbolRenderer = new ArcGisSymbologyRenderer_1.ArcGisSymbologyRenderer(data.geometryType, PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillySimplePolyDrawingInfo.drawingInfo.renderer);
|
|
81
|
-
const featureRenderer = new ArcGisFeatureRenderer_1.ArcGisFeatureRenderer(Mocks_1.fakeContext, symbolRenderer);
|
|
82
|
-
const renderPathSpy = sinon.spy(featureRenderer, "renderPath");
|
|
83
|
-
featureJson.readAndRender({ data, exceedTransferLimit: false }, featureRenderer);
|
|
84
|
-
(0, chai_1.expect)(renderPathSpy.calledOnce);
|
|
85
|
-
const firstCall = renderPathSpy.getCalls()[0];
|
|
86
|
-
(0, chai_1.expect)(firstCall.args[0]).to.eql(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillySimplePolyQueryPbf.queryResult.featureResult.features[0].geometry.lengths); // geometryLengths
|
|
87
|
-
(0, chai_1.expect)(firstCall.args[1]).to.eql(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillySimplePolyQueryPbf.queryResult.featureResult.features[0].geometry.coords); // geometryCoords
|
|
88
|
-
(0, chai_1.expect)(firstCall.args[2]).to.eql(true); // fill
|
|
89
|
-
(0, chai_1.expect)(firstCall.args[3]).to.eql(2); // stride
|
|
90
|
-
});
|
|
91
|
-
it("should readAndRender multiple ring polygon feature", async () => {
|
|
92
|
-
const featureJson = createFeatureJSON();
|
|
93
|
-
const data = PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillyDoubleRingPolyQueryJson;
|
|
94
|
-
const symbolRenderer = new ArcGisSymbologyRenderer_1.ArcGisSymbologyRenderer(data.geometryType, PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillySimplePolyDrawingInfo.drawingInfo.renderer);
|
|
95
|
-
const featureRenderer = new ArcGisFeatureRenderer_1.ArcGisFeatureRenderer(Mocks_1.fakeContext, symbolRenderer);
|
|
96
|
-
const renderPathSpy = sinon.spy(featureRenderer, "renderPath");
|
|
97
|
-
featureJson.readAndRender({ data, exceedTransferLimit: false }, featureRenderer);
|
|
98
|
-
(0, chai_1.expect)(renderPathSpy.calledOnce);
|
|
99
|
-
const firstCall = renderPathSpy.getCalls()[0];
|
|
100
|
-
(0, chai_1.expect)(firstCall.args[0]).to.eql(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillyDoubleRingPolyQueryPbf.queryResult.featureResult.features[0].geometry.lengths); // geometryLengths
|
|
101
|
-
(0, chai_1.expect)(firstCall.args[1]).to.eql(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillyDoubleRingPolyQueryPbf.queryResult.featureResult.features[0].geometry.coords); // geometryCoords
|
|
102
|
-
(0, chai_1.expect)(firstCall.args[2]).to.eql(true); // fill
|
|
103
|
-
(0, chai_1.expect)(firstCall.args[3]).to.eql(2); // stride
|
|
104
|
-
});
|
|
105
|
-
it("should readAndRender simple path", async () => {
|
|
106
|
-
const featureJson = createFeatureJSON();
|
|
107
|
-
const data = PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillySimplePathQueryJson;
|
|
108
|
-
const symbolRenderer = new ArcGisSymbologyRenderer_1.ArcGisSymbologyRenderer(data.geometryType, PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillySimpleLineDrawingInfo.drawingInfo.renderer);
|
|
109
|
-
const featureRenderer = new ArcGisFeatureRenderer_1.ArcGisFeatureRenderer(Mocks_1.fakeContext, symbolRenderer);
|
|
110
|
-
const renderPathSpy = sinon.spy(featureRenderer, "renderPath");
|
|
111
|
-
featureJson.readAndRender({ data, exceedTransferLimit: false }, featureRenderer);
|
|
112
|
-
(0, chai_1.expect)(renderPathSpy.calledOnce);
|
|
113
|
-
const geometryCoords = [360, 491, -2, -1, -1, 0, -1, 0, -1, 0, -1, 1, -4, 1, -10, 2, -15, 3, -1, 0, -1, 0, -2, 0, -1, 0, -1, 0, -1, -1, -1, 0, -2, -1, 0, -1, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0];
|
|
114
|
-
const firstCall = renderPathSpy.getCalls()[0];
|
|
115
|
-
(0, chai_1.expect)(firstCall.args[0]).to.eql([24]); // geometryLengths
|
|
116
|
-
(0, chai_1.expect)(firstCall.args[1]).to.eql(geometryCoords); // geometryCoords
|
|
117
|
-
(0, chai_1.expect)(firstCall.args[2]).to.eql(false); // fill
|
|
118
|
-
(0, chai_1.expect)(firstCall.args[3]).to.eql(2); // stride
|
|
119
|
-
});
|
|
120
|
-
it("should readAndRender multi path", async () => {
|
|
121
|
-
const featureJson = createFeatureJSON();
|
|
122
|
-
const data = PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillyMultiPathQueryJson;
|
|
123
|
-
const symbolRenderer = new ArcGisSymbologyRenderer_1.ArcGisSymbologyRenderer(data.geometryType, PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillySimpleLineDrawingInfo.drawingInfo.renderer);
|
|
124
|
-
const featureRenderer = new ArcGisFeatureRenderer_1.ArcGisFeatureRenderer(Mocks_1.fakeContext, symbolRenderer);
|
|
125
|
-
const renderPathSpy = sinon.spy(featureRenderer, "renderPath");
|
|
126
|
-
featureJson.readAndRender({ data, exceedTransferLimit: false }, featureRenderer);
|
|
127
|
-
(0, chai_1.expect)(renderPathSpy.calledOnce);
|
|
128
|
-
// Pbf contains already the right output format expect, lets rely on that.
|
|
129
|
-
const firstCall = renderPathSpy.getCalls()[0];
|
|
130
|
-
(0, chai_1.expect)(firstCall.args[0]).to.eql(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillyMultiPathQueryPbf.queryResult.featureResult.features[0].geometry.lengths);
|
|
131
|
-
(0, chai_1.expect)(firstCall.args[1]).to.eql(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillyMultiPathQueryPbf.queryResult.featureResult.features[0].geometry.coords);
|
|
132
|
-
(0, chai_1.expect)(firstCall.args[2]).to.eql(false); // fill
|
|
133
|
-
(0, chai_1.expect)(firstCall.args[3]).to.eql(2); // stride
|
|
134
|
-
});
|
|
135
|
-
it("should readAndRender simple point", async () => {
|
|
136
|
-
const featureJson = createFeatureJSON();
|
|
137
|
-
const data = PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillySimplePointQueryJson;
|
|
138
|
-
const symbolRenderer = new ArcGisSymbologyRenderer_1.ArcGisSymbologyRenderer(data.geometryType, PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillySimplePointDrawingInfo.drawingInfo.renderer);
|
|
139
|
-
const featureRenderer = new ArcGisFeatureRenderer_1.ArcGisFeatureRenderer(Mocks_1.fakeContext, symbolRenderer);
|
|
140
|
-
const spy = sinon.spy(featureRenderer, "renderPoint");
|
|
141
|
-
featureJson.readAndRender({ data, exceedTransferLimit: false }, featureRenderer);
|
|
142
|
-
(0, chai_1.expect)(spy.calledOnce);
|
|
143
|
-
// Pbf contains already the right output format expect, lets rely on that.
|
|
144
|
-
const geometryCoords = PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillySimplePointQueryPbf.queryResult.featureResult.features[0].geometry.coords;
|
|
145
|
-
const firstCall = spy.getCalls()[0];
|
|
146
|
-
(0, chai_1.expect)(firstCall.args[0]).to.eql(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillySimplePointQueryPbf.queryResult.featureResult.features[0].geometry.lengths); // geometryLengths
|
|
147
|
-
(0, chai_1.expect)(firstCall.args[1]).to.eql(geometryCoords); // geometryCoords
|
|
148
|
-
(0, chai_1.expect)(firstCall.args[2]).to.eql(2); // stride
|
|
149
|
-
});
|
|
150
|
-
it("should log error when readAndRender / readFeatureInfo is called invalid response Data", async () => {
|
|
151
|
-
const featureJson = createFeatureJSON();
|
|
152
|
-
const symbolRenderer = new ArcGisSymbologyRenderer_1.ArcGisSymbologyRenderer("esriGeometryAny", PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillySimplePointDrawingInfo.drawingInfo.renderer);
|
|
153
|
-
const featureRenderer = new ArcGisFeatureRenderer_1.ArcGisFeatureRenderer(Mocks_1.fakeContext, symbolRenderer);
|
|
154
|
-
const logErrorSpy = sandbox.spy(core_bentley_1.Logger, "logError");
|
|
155
|
-
featureJson.readAndRender({ data: { test: "test" }, exceedTransferLimit: false }, featureRenderer);
|
|
156
|
-
(0, chai_1.expect)(logErrorSpy.calledOnce);
|
|
157
|
-
logErrorSpy.resetHistory();
|
|
158
|
-
featureJson.readFeatureInfo({ data: { test: "test" }, exceedTransferLimit: false }, []);
|
|
159
|
-
(0, chai_1.expect)(logErrorSpy.calledOnce);
|
|
160
|
-
});
|
|
161
|
-
});
|
|
162
|
-
//# sourceMappingURL=ArcGisFeatureJSON.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{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C,IAAI,EAAC,MAAM,EAAC,EAAE,mBAAmB,EAAE,KAAK,EAAC,EAAE,EAAE,CAAC,CAAC;QACnF,IAAA,aAAM,EAAC,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 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ArcGisFeaturePBF.test.d.ts","sourceRoot":"","sources":["../../../../src/test/ArcGisFeature/ArcGisFeaturePBF.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,168 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*---------------------------------------------------------------------------------------------
|
|
3
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
|
-
*--------------------------------------------------------------------------------------------*/
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
const core_bentley_1 = require("@itwin/core-bentley");
|
|
8
|
-
const core_common_1 = require("@itwin/core-common");
|
|
9
|
-
const chai_1 = require("chai");
|
|
10
|
-
const sinon = require("sinon");
|
|
11
|
-
const ArcGisFeaturePBF_1 = require("../../ArcGisFeature/ArcGisFeaturePBF");
|
|
12
|
-
const ArcGisFeatureRenderer_1 = require("../../ArcGisFeature/ArcGisFeatureRenderer");
|
|
13
|
-
const ArcGisSymbologyRenderer_1 = require("../../ArcGisFeature/ArcGisSymbologyRenderer");
|
|
14
|
-
const esriPBuffer_gen_1 = require("../../ArcGisFeature/esriPBuffer.gen");
|
|
15
|
-
const Mocks_1 = require("./Mocks");
|
|
16
|
-
const PhillyLandmarksDataset_1 = require("./PhillyLandmarksDataset");
|
|
17
|
-
const createFeaturePBF = () => {
|
|
18
|
-
const settings = core_common_1.ImageMapLayerSettings.fromJSON(Mocks_1.esriFeatureSampleSource);
|
|
19
|
-
const featurePbf = new ArcGisFeaturePBF_1.ArcGisFeaturePBF(settings, { name: "SampleLayer" });
|
|
20
|
-
// Locale configuration depends on the testing machine (i.e. linux vs windows),
|
|
21
|
-
// so we need to force date display to Iso to get a consistent value.
|
|
22
|
-
// In real scenario, we still want dates to be displayed in end-user's locale.
|
|
23
|
-
featurePbf.forceDateDisplayValueToIso = true;
|
|
24
|
-
return featurePbf;
|
|
25
|
-
};
|
|
26
|
-
describe("ArcGisFeaturePBF", () => {
|
|
27
|
-
const sandbox = sinon.createSandbox();
|
|
28
|
-
afterEach(async () => {
|
|
29
|
-
sandbox.restore();
|
|
30
|
-
});
|
|
31
|
-
it("should convert pbf geometry type to Esri types", async () => {
|
|
32
|
-
(0, chai_1.expect)(ArcGisFeaturePBF_1.ArcGisFeaturePBF.getArcGisFeatureGeometryType(esriPBuffer_gen_1.esriPBuffer.FeatureCollectionPBuffer.GeometryType.esriGeometryTypeMultipatch))
|
|
33
|
-
.to.equals("esriGeometryMultiPatch");
|
|
34
|
-
(0, chai_1.expect)(ArcGisFeaturePBF_1.ArcGisFeaturePBF.getArcGisFeatureGeometryType(esriPBuffer_gen_1.esriPBuffer.FeatureCollectionPBuffer.GeometryType.esriGeometryTypeMultipoint))
|
|
35
|
-
.to.equals("esriGeometryMultipoint");
|
|
36
|
-
(0, chai_1.expect)(ArcGisFeaturePBF_1.ArcGisFeaturePBF.getArcGisFeatureGeometryType(esriPBuffer_gen_1.esriPBuffer.FeatureCollectionPBuffer.GeometryType.esriGeometryTypePoint))
|
|
37
|
-
.to.equals("esriGeometryPoint");
|
|
38
|
-
(0, chai_1.expect)(ArcGisFeaturePBF_1.ArcGisFeaturePBF.getArcGisFeatureGeometryType(esriPBuffer_gen_1.esriPBuffer.FeatureCollectionPBuffer.GeometryType.esriGeometryTypePolygon))
|
|
39
|
-
.to.equals("esriGeometryPolygon");
|
|
40
|
-
(0, chai_1.expect)(ArcGisFeaturePBF_1.ArcGisFeaturePBF.getArcGisFeatureGeometryType(esriPBuffer_gen_1.esriPBuffer.FeatureCollectionPBuffer.GeometryType.esriGeometryTypePolyline))
|
|
41
|
-
.to.equals("esriGeometryPolyline");
|
|
42
|
-
(0, chai_1.expect)(ArcGisFeaturePBF_1.ArcGisFeaturePBF.getArcGisFeatureGeometryType(""))
|
|
43
|
-
.to.equals("esriGeometryNull");
|
|
44
|
-
});
|
|
45
|
-
it("should read FeatureInfo in PBF", async () => {
|
|
46
|
-
const byteArray = core_common_1.Base64EncodedString.toUint8Array(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillyAirportGetFeatureInfoQueryPbf);
|
|
47
|
-
const featureCollection = esriPBuffer_gen_1.esriPBuffer.FeatureCollectionPBuffer.deserialize(byteArray);
|
|
48
|
-
const settings = core_common_1.ImageMapLayerSettings.fromJSON(Mocks_1.esriFeatureSampleSource);
|
|
49
|
-
const featurePbf = new ArcGisFeaturePBF_1.ArcGisFeaturePBF(settings, { name: "SampleLayer" });
|
|
50
|
-
// In some cases, PBF gives more floating-point precision than JSON.
|
|
51
|
-
// Since I want to use the same output reference for both formats, I force a max precision of 8.
|
|
52
|
-
featurePbf.floatPrecision = 8;
|
|
53
|
-
const results = [];
|
|
54
|
-
featurePbf.readFeatureInfo({ data: featureCollection, exceedTransferLimit: false }, results);
|
|
55
|
-
// Make deep comparison by using JSON.stringify
|
|
56
|
-
(0, chai_1.expect)(JSON.stringify(results)).equals(JSON.stringify(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillyAirportGetFeatureInfoResultRef));
|
|
57
|
-
});
|
|
58
|
-
it("should read FeatureInfo from PBF (philly transportation)", async () => {
|
|
59
|
-
const byteArray = core_common_1.Base64EncodedString.toUint8Array(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillyTransportationGetFeatureInfoQueryEncodedPbf);
|
|
60
|
-
const featureCollection = esriPBuffer_gen_1.esriPBuffer.FeatureCollectionPBuffer.deserialize(byteArray);
|
|
61
|
-
const featurePbf = createFeaturePBF();
|
|
62
|
-
// In some cases, PBF gives more floating-point precision than JSON.
|
|
63
|
-
// Since I want to use the same output reference for both formats, I force a max precision.
|
|
64
|
-
featurePbf.floatPrecision = 2;
|
|
65
|
-
const results = [];
|
|
66
|
-
featurePbf.readFeatureInfo({ data: featureCollection, exceedTransferLimit: false }, results);
|
|
67
|
-
// Make deep comparison by using JSON.stringify
|
|
68
|
-
(0, chai_1.expect)(JSON.stringify(results)).equals(JSON.stringify(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillyTansportationGetFeatureInfoResultRef));
|
|
69
|
-
});
|
|
70
|
-
it("should read all data types from FeatureInfo ", async () => {
|
|
71
|
-
// In this test we use a synthetic PBuffer object to initialize a feature collection object.
|
|
72
|
-
// The is to ensure we cover correctly all possible attribute value types.
|
|
73
|
-
const featureCollection = esriPBuffer_gen_1.esriPBuffer.FeatureCollectionPBuffer.fromObject(PhillyLandmarksDataset_1.PhillyLandmarksDataset.fieldsCoveragePbufferCollection);
|
|
74
|
-
const featurePbf = createFeaturePBF();
|
|
75
|
-
const results = [];
|
|
76
|
-
featurePbf.readFeatureInfo({ data: featureCollection, exceedTransferLimit: false }, results);
|
|
77
|
-
// Make deep comparison by using JSON.stringify
|
|
78
|
-
(0, chai_1.expect)(JSON.stringify(results)).equals(JSON.stringify(PhillyLandmarksDataset_1.PhillyLandmarksDataset.fieldsCoverageGetFeatureInfoResultRef));
|
|
79
|
-
});
|
|
80
|
-
it("should readAndRender single ring polygon feature", async () => {
|
|
81
|
-
const featurePbf = createFeaturePBF();
|
|
82
|
-
const data = esriPBuffer_gen_1.esriPBuffer.FeatureCollectionPBuffer.fromObject(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillySimplePolyQueryPbf);
|
|
83
|
-
const geomType = ArcGisFeaturePBF_1.ArcGisFeaturePBF.getArcGisFeatureGeometryType(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillySimplePolyQueryPbf.queryResult.featureResult.geometryType);
|
|
84
|
-
const symbolRenderer = new ArcGisSymbologyRenderer_1.ArcGisSymbologyRenderer(geomType, PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillySimplePolyDrawingInfo.drawingInfo.renderer);
|
|
85
|
-
const featureRenderer = new ArcGisFeatureRenderer_1.ArcGisFeatureRenderer(Mocks_1.fakeContext, symbolRenderer);
|
|
86
|
-
const renderPathSpy = sinon.spy(featureRenderer, "renderPath");
|
|
87
|
-
featurePbf.readAndRender({ data, exceedTransferLimit: false }, featureRenderer);
|
|
88
|
-
(0, chai_1.expect)(renderPathSpy.calledOnce);
|
|
89
|
-
const firstCall = renderPathSpy.getCalls()[0];
|
|
90
|
-
(0, chai_1.expect)(firstCall.args[0]).to.eql(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillySimplePolyQueryPbf.queryResult.featureResult.features[0].geometry.lengths); // geometryLengths
|
|
91
|
-
(0, chai_1.expect)(firstCall.args[1]).to.eql(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillySimplePolyQueryPbf.queryResult.featureResult.features[0].geometry.coords); // geometryCoords
|
|
92
|
-
(0, chai_1.expect)(firstCall.args[2]).to.eql(true); // fill
|
|
93
|
-
(0, chai_1.expect)(firstCall.args[3]).to.eql(2); // stride
|
|
94
|
-
});
|
|
95
|
-
it("should readAndRender multiple ring polygon feature", async () => {
|
|
96
|
-
const featurePbf = createFeaturePBF();
|
|
97
|
-
const geomType = ArcGisFeaturePBF_1.ArcGisFeaturePBF.getArcGisFeatureGeometryType(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillyDoubleRingPolyQueryPbf.queryResult.featureResult.geometryType);
|
|
98
|
-
const data = esriPBuffer_gen_1.esriPBuffer.FeatureCollectionPBuffer.fromObject(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillyDoubleRingPolyQueryPbf);
|
|
99
|
-
const symbolRenderer = new ArcGisSymbologyRenderer_1.ArcGisSymbologyRenderer(geomType, PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillySimplePolyDrawingInfo.drawingInfo.renderer);
|
|
100
|
-
const featureRenderer = new ArcGisFeatureRenderer_1.ArcGisFeatureRenderer(Mocks_1.fakeContext, symbolRenderer);
|
|
101
|
-
const renderPathSpy = sinon.spy(featureRenderer, "renderPath");
|
|
102
|
-
featurePbf.readAndRender({ data, exceedTransferLimit: false }, featureRenderer);
|
|
103
|
-
(0, chai_1.expect)(renderPathSpy.calledOnce);
|
|
104
|
-
const firstCall = renderPathSpy.getCalls()[0];
|
|
105
|
-
(0, chai_1.expect)(firstCall.args[0]).to.eql(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillyDoubleRingPolyQueryPbf.queryResult.featureResult.features[0].geometry.lengths); // geometryLengths
|
|
106
|
-
(0, chai_1.expect)(firstCall.args[1]).to.eql(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillyDoubleRingPolyQueryPbf.queryResult.featureResult.features[0].geometry.coords); // geometryCoords
|
|
107
|
-
(0, chai_1.expect)(firstCall.args[2]).to.eql(true); // fill
|
|
108
|
-
(0, chai_1.expect)(firstCall.args[3]).to.eql(2); // stride
|
|
109
|
-
});
|
|
110
|
-
it("should readAndRender simple path", async () => {
|
|
111
|
-
const featurePbf = createFeaturePBF();
|
|
112
|
-
const data = esriPBuffer_gen_1.esriPBuffer.FeatureCollectionPBuffer.fromObject(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillySimplePathQueryPbf);
|
|
113
|
-
const symbolRenderer = new ArcGisSymbologyRenderer_1.ArcGisSymbologyRenderer(ArcGisFeaturePBF_1.ArcGisFeaturePBF.getArcGisFeatureGeometryType(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillySimplePathQueryPbf.queryResult.featureResult.geometryType), PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillySimpleLineDrawingInfo.drawingInfo.renderer);
|
|
114
|
-
const featureRenderer = new ArcGisFeatureRenderer_1.ArcGisFeatureRenderer(Mocks_1.fakeContext, symbolRenderer);
|
|
115
|
-
const renderPathSpy = sinon.spy(featureRenderer, "renderPath");
|
|
116
|
-
featurePbf.readAndRender({ data, exceedTransferLimit: false }, featureRenderer);
|
|
117
|
-
(0, chai_1.expect)(renderPathSpy.calledOnce);
|
|
118
|
-
const firstCall = renderPathSpy.getCalls()[0];
|
|
119
|
-
(0, chai_1.expect)(firstCall).to.not.undefined;
|
|
120
|
-
(0, chai_1.expect)(firstCall.args[0]).to.eql(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillySimplePathQueryPbf.queryResult.featureResult.features[0].geometry.lengths); // geometryLengths
|
|
121
|
-
(0, chai_1.expect)(firstCall.args[1]).to.eql(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillySimplePathQueryPbf.queryResult.featureResult.features[0].geometry.coords); // geometryCoords
|
|
122
|
-
(0, chai_1.expect)(firstCall.args[2]).to.eql(false); // fill
|
|
123
|
-
(0, chai_1.expect)(firstCall.args[3]).to.eql(2); // stride
|
|
124
|
-
});
|
|
125
|
-
it("should readAndRender multi path", async () => {
|
|
126
|
-
const featurePbf = createFeaturePBF();
|
|
127
|
-
const data = esriPBuffer_gen_1.esriPBuffer.FeatureCollectionPBuffer.fromObject(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillyMultiPathQueryPbf);
|
|
128
|
-
const geomType = ArcGisFeaturePBF_1.ArcGisFeaturePBF.getArcGisFeatureGeometryType(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillyMultiPathQueryPbf.queryResult.featureResult.geometryType);
|
|
129
|
-
const symbolRenderer = new ArcGisSymbologyRenderer_1.ArcGisSymbologyRenderer(geomType, PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillySimpleLineDrawingInfo.drawingInfo.renderer);
|
|
130
|
-
const featureRenderer = new ArcGisFeatureRenderer_1.ArcGisFeatureRenderer(Mocks_1.fakeContext, symbolRenderer);
|
|
131
|
-
const renderPathSpy = sinon.spy(featureRenderer, "renderPath");
|
|
132
|
-
featurePbf.readAndRender({ data, exceedTransferLimit: false }, featureRenderer);
|
|
133
|
-
(0, chai_1.expect)(renderPathSpy.calledOnce);
|
|
134
|
-
const firstCall = renderPathSpy.getCalls()[0];
|
|
135
|
-
(0, chai_1.expect)(firstCall.args[0]).to.eql(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillyMultiPathQueryPbf.queryResult.featureResult.features[0].geometry.lengths); // geometryLengths
|
|
136
|
-
(0, chai_1.expect)(firstCall.args[1]).to.eql(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillyMultiPathQueryPbf.queryResult.featureResult.features[0].geometry.coords); // geometryCoords
|
|
137
|
-
(0, chai_1.expect)(firstCall.args[2]).to.eql(false); // fill
|
|
138
|
-
(0, chai_1.expect)(firstCall.args[3]).to.eql(2); // stride
|
|
139
|
-
});
|
|
140
|
-
it("should readAndRender simple point", async () => {
|
|
141
|
-
const featurePbf = createFeaturePBF();
|
|
142
|
-
const data = esriPBuffer_gen_1.esriPBuffer.FeatureCollectionPBuffer.fromObject(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillySimplePointQueryPbf);
|
|
143
|
-
const geomType = ArcGisFeaturePBF_1.ArcGisFeaturePBF.getArcGisFeatureGeometryType(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillyMultiPathQueryPbf.queryResult.featureResult.geometryType);
|
|
144
|
-
const symbolRenderer = new ArcGisSymbologyRenderer_1.ArcGisSymbologyRenderer(geomType, PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillySimplePointDrawingInfo.drawingInfo.renderer);
|
|
145
|
-
const featureRenderer = new ArcGisFeatureRenderer_1.ArcGisFeatureRenderer(Mocks_1.fakeContext, symbolRenderer);
|
|
146
|
-
const spy = sinon.spy(featureRenderer, "renderPoint");
|
|
147
|
-
featurePbf.readAndRender({ data, exceedTransferLimit: false }, featureRenderer);
|
|
148
|
-
(0, chai_1.expect)(spy.calledOnce);
|
|
149
|
-
// Pbf contains already the right output format expect, lets rely on that.
|
|
150
|
-
const geometryCoords = PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillySimplePointQueryPbf.queryResult.featureResult.features[0].geometry.coords;
|
|
151
|
-
const firstCall = spy.getCalls()[0];
|
|
152
|
-
(0, chai_1.expect)(firstCall.args[0]).to.eql(PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillySimplePointQueryPbf.queryResult.featureResult.features[0].geometry.lengths); // geometryLengths
|
|
153
|
-
(0, chai_1.expect)(firstCall.args[1]).to.eql(geometryCoords); // geometryCoords
|
|
154
|
-
(0, chai_1.expect)(firstCall.args[2]).to.eql(2); // stride
|
|
155
|
-
});
|
|
156
|
-
it("should log error when readAndRender / readFeatureInfo is called invalid response Data", async () => {
|
|
157
|
-
const featurePbf = createFeaturePBF();
|
|
158
|
-
const symbolRenderer = new ArcGisSymbologyRenderer_1.ArcGisSymbologyRenderer("esriGeometryAny", PhillyLandmarksDataset_1.PhillyLandmarksDataset.phillySimplePointDrawingInfo.drawingInfo.renderer);
|
|
159
|
-
const featureRenderer = new ArcGisFeatureRenderer_1.ArcGisFeatureRenderer(Mocks_1.fakeContext, symbolRenderer);
|
|
160
|
-
const logErrorSpy = sandbox.spy(core_bentley_1.Logger, "logError");
|
|
161
|
-
featurePbf.readAndRender({ data: { test: "test" }, exceedTransferLimit: false }, featureRenderer);
|
|
162
|
-
(0, chai_1.expect)(logErrorSpy.calledOnce);
|
|
163
|
-
logErrorSpy.resetHistory();
|
|
164
|
-
featurePbf.readFeatureInfo({ data: { test: "test" }, exceedTransferLimit: false }, []);
|
|
165
|
-
(0, chai_1.expect)(logErrorSpy.calledOnce);
|
|
166
|
-
});
|
|
167
|
-
});
|
|
168
|
-
//# sourceMappingURL=ArcGisFeaturePBF.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ArcGisFeaturePBF.test.js","sourceRoot":"","sources":["../../../../src/test/ArcGisFeature/ArcGisFeaturePBF.test.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;AAE/F,sDAA6C;AAC7C,oDAAgF;AAEhF,+BAA8B;AAC9B,+BAA+B;AAC/B,2EAAwE;AACxE,qFAAkF;AAClF,yFAAsF;AACtF,yEAAkE;AAClE,mCAA+D;AAC/D,qEAAkE;AAElE,MAAM,gBAAgB,GAAI,GAAG,EAAE;IAC7B,MAAM,QAAQ,GAAG,mCAAqB,CAAC,QAAQ,CAAC,+BAAuB,CAAC,CAAC;IACzE,MAAM,UAAU,GAAG,IAAI,mCAAgB,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,SAAS,CAAC,KAAK,IAAI,EAAE;QACnB,OAAO,CAAC,OAAO,EAAE,CAAC;IACpB,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,gDAAgD,EAAE,KAAK,IAAI,EAAE;QAE9D,IAAA,aAAM,EACJ,mCAAgB,CAAC,4BAA4B,CAAC,6BAAW,CAAC,wBAAwB,CAAC,YAAY,CAAC,0BAA0B,CAAC,CAAC;aAC3H,EAAE,CAAC,MAAM,C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,EAAC,MAAM,EAAC,EAAE,mBAAmB,EAAE,KAAK,EAAC,EAAE,eAAe,CAAC,CAAC;QAC7F,IAAA,aAAM,EAAC,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,IAAA,aAAM,EAAC,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"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ArcGisFeatureProvider.test.d.ts","sourceRoot":"","sources":["../../../../src/test/ArcGisFeature/ArcGisFeatureProvider.test.ts"],"names":[],"mappings":""}
|