@itwin/map-layers-formats 4.1.0-dev.8 → 4.1.0-dev.80
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 +74 -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/ArcGisFeatureResponse.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/ArcGisFeature/esriPBuffer.gen.js.map +1 -1
- 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/ArcGisFeatureResponse.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/ArcGisFeature/esriPBuffer.gen.js.map +1 -1
- 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/43b4d4c9-a360-43df-88fe-ecfb97b8832b.json +0 -1
- package/lib/cjs/test/coverage/.nyc_output/5c53bf83-e91a-4706-bc7c-fa9b79502114.json +0 -1
- package/lib/cjs/test/coverage/.nyc_output/processinfo/43b4d4c9-a360-43df-88fe-ecfb97b8832b.json +0 -1
- package/lib/cjs/test/coverage/.nyc_output/processinfo/5c53bf83-e91a-4706-bc7c-fa9b79502114.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,678 +0,0 @@
|
|
|
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 { Base64EncodedString, Cartographic, ImageMapLayerSettings, ImageSourceFormat, ServerError } from "@itwin/core-common";
|
|
6
|
-
import * as chai from "chai";
|
|
7
|
-
import * as chaiAsPromised from "chai-as-promised";
|
|
8
|
-
import { ArcGisFeatureMapLayerFormat } from "../../ArcGisFeature/ArcGisFeatureFormat";
|
|
9
|
-
import { ArcGisFeatureProvider } from "../../map-layers-formats";
|
|
10
|
-
import * as sinon from "sinon";
|
|
11
|
-
import { ArcGISImageryProvider, ArcGisUtilities, MapLayerImageryProviderStatus, QuadId } from "@itwin/core-frontend";
|
|
12
|
-
import { NewYorkDataset } from "./NewYorkDataset";
|
|
13
|
-
import { base64StringToUint8Array, ByteStream, Logger } from "@itwin/core-bentley";
|
|
14
|
-
import { PhillyLandmarksDataset } from "./PhillyLandmarksDataset";
|
|
15
|
-
import { ArcGisFeatureResponse } from "../../ArcGisFeature/ArcGisFeatureResponse";
|
|
16
|
-
import { Point3d } from "@itwin/core-geometry";
|
|
17
|
-
import { ArcGisFeaturePBF } from "../../ArcGisFeature/ArcGisFeaturePBF";
|
|
18
|
-
import { ArcGisFeatureJSON } from "../../ArcGisFeature/ArcGisFeatureJSON";
|
|
19
|
-
const expect = chai.expect;
|
|
20
|
-
chai.use(chaiAsPromised);
|
|
21
|
-
const esriFeatureSampleSource = { name: "dummyFeatureLayer", url: "https://dummy.com", formatId: ArcGisFeatureMapLayerFormat.formatId };
|
|
22
|
-
const pngTransparent1x1 = "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPhfDwAChwGA60e6kgAAAABJRU5ErkJggg==";
|
|
23
|
-
describe("ArcGisFeatureProvider", () => {
|
|
24
|
-
const sandbox = sinon.createSandbox();
|
|
25
|
-
afterEach(async () => {
|
|
26
|
-
sandbox.restore();
|
|
27
|
-
});
|
|
28
|
-
it("should initialize with valid data", async () => {
|
|
29
|
-
sandbox.stub(ArcGisUtilities, "getServiceJson").callsFake(async function _(_url, _formatId, _userName, _password, _ignoreCache, _requireToken) {
|
|
30
|
-
return { accessTokenRequired: false, content: NewYorkDataset.serviceCapabilities };
|
|
31
|
-
});
|
|
32
|
-
sandbox.stub(ArcGisFeatureProvider.prototype, "getLayerMetadata").callsFake(async function _(_layerId) {
|
|
33
|
-
return NewYorkDataset.streetsLayerCapabilities;
|
|
34
|
-
});
|
|
35
|
-
const settings = ImageMapLayerSettings.fromJSON(esriFeatureSampleSource);
|
|
36
|
-
const provider = new ArcGisFeatureProvider(settings);
|
|
37
|
-
await provider.initialize();
|
|
38
|
-
expect(provider._minDepthFromLod).to.equals(11);
|
|
39
|
-
expect(provider._maxDepthFromLod).to.equals(22);
|
|
40
|
-
});
|
|
41
|
-
it("should not initialize with no service metadata", async () => {
|
|
42
|
-
sandbox.stub(ArcGisUtilities, "getServiceJson").callsFake(async function _(_url, _formatId, _userName, _password, _ignoreCache, _requireToken) {
|
|
43
|
-
return undefined;
|
|
44
|
-
});
|
|
45
|
-
const settings = ImageMapLayerSettings.fromJSON(esriFeatureSampleSource);
|
|
46
|
-
const provider = new ArcGisFeatureProvider(settings);
|
|
47
|
-
await expect(provider.initialize()).to.be.rejectedWith(ServerError);
|
|
48
|
-
});
|
|
49
|
-
it("should update status when invalid token error from service", async () => {
|
|
50
|
-
sandbox.stub(ArcGisUtilities, "getServiceJson").callsFake(async function _(_url, _formatId, _userName, _password, _ignoreCache, _requireToken) {
|
|
51
|
-
return { accessTokenRequired: false, content: { error: { code: 499 } } };
|
|
52
|
-
});
|
|
53
|
-
const settings = ImageMapLayerSettings.fromJSON(esriFeatureSampleSource);
|
|
54
|
-
const provider = new ArcGisFeatureProvider(settings);
|
|
55
|
-
const raiseEventSpy = sandbox.spy(provider.onStatusChanged, "raiseEvent");
|
|
56
|
-
await provider.initialize();
|
|
57
|
-
expect(provider.status).to.equals(MapLayerImageryProviderStatus.RequireAuth);
|
|
58
|
-
expect(raiseEventSpy.calledOnceWith(provider)).to.be.true;
|
|
59
|
-
});
|
|
60
|
-
it("should throw query capability not supported", async () => {
|
|
61
|
-
sandbox.stub(ArcGisUtilities, "getServiceJson").callsFake(async function _(_url, _formatId, _userName, _password, _ignoreCache, _requireToken) {
|
|
62
|
-
return { accessTokenRequired: false, content: { capabilities: "Test" } };
|
|
63
|
-
});
|
|
64
|
-
const settings = ImageMapLayerSettings.fromJSON(esriFeatureSampleSource);
|
|
65
|
-
const provider = new ArcGisFeatureProvider(settings);
|
|
66
|
-
await expect(provider.initialize()).to.be.rejectedWith(ServerError);
|
|
67
|
-
});
|
|
68
|
-
it("should pick the first visible sub-layer when multiple visible sub-layers", async () => {
|
|
69
|
-
sandbox.stub(ArcGisUtilities, "getServiceJson").callsFake(async function _(_url, _formatId, _userName, _password, _ignoreCache, _requireToken) {
|
|
70
|
-
return { accessTokenRequired: false, content: { capabilities: "Query" } };
|
|
71
|
-
});
|
|
72
|
-
const settings = ImageMapLayerSettings.fromJSON({
|
|
73
|
-
...esriFeatureSampleSource,
|
|
74
|
-
subLayers: [{ id: 0, name: "layer1", visible: true }, { id: 2, name: "layer2", visible: true }]
|
|
75
|
-
});
|
|
76
|
-
const provider = new ArcGisFeatureProvider(settings);
|
|
77
|
-
provider._format = "JSON";
|
|
78
|
-
await provider.initialize();
|
|
79
|
-
expect(provider._layerId).to.equals(settings.subLayers[0].id);
|
|
80
|
-
});
|
|
81
|
-
it("should pick sub-layers from service metadata if none provided on layer settings", async () => {
|
|
82
|
-
sandbox.stub(ArcGisUtilities, "getServiceJson").callsFake(async function _(_url, _formatId, _userName, _password, _ignoreCache, _requireToken) {
|
|
83
|
-
return { accessTokenRequired: false, content: { capabilities: "Query",
|
|
84
|
-
layers: [
|
|
85
|
-
{
|
|
86
|
-
id: 0,
|
|
87
|
-
},
|
|
88
|
-
{
|
|
89
|
-
id: 1,
|
|
90
|
-
},
|
|
91
|
-
] },
|
|
92
|
-
};
|
|
93
|
-
});
|
|
94
|
-
sandbox.stub(ArcGisFeatureProvider.prototype, "getLayerMetadata").callsFake(async function (id) {
|
|
95
|
-
if (id === 1) {
|
|
96
|
-
return { defaultVisibility: true };
|
|
97
|
-
}
|
|
98
|
-
return undefined;
|
|
99
|
-
});
|
|
100
|
-
const settings = ImageMapLayerSettings.fromJSON(esriFeatureSampleSource);
|
|
101
|
-
const provider = new ArcGisFeatureProvider(settings);
|
|
102
|
-
provider._format = "JSON";
|
|
103
|
-
await provider.initialize();
|
|
104
|
-
expect(provider._layerId).to.equals(1);
|
|
105
|
-
expect(provider._layerMetadata).to.eql({ defaultVisibility: true });
|
|
106
|
-
});
|
|
107
|
-
it("should throw error if no layers in capabilities", async () => {
|
|
108
|
-
sandbox.stub(ArcGisUtilities, "getServiceJson").callsFake(async function _(_url, _formatId, _userName, _password, _ignoreCache, _requireToken) {
|
|
109
|
-
return { accessTokenRequired: false, content: { capabilities: "Query", layers: [] } };
|
|
110
|
-
});
|
|
111
|
-
const settings = ImageMapLayerSettings.fromJSON(esriFeatureSampleSource);
|
|
112
|
-
const provider = new ArcGisFeatureProvider(settings);
|
|
113
|
-
await expect(provider.initialize()).to.be.rejectedWith(ServerError);
|
|
114
|
-
});
|
|
115
|
-
it("should throw if no layer metadata from service", async () => {
|
|
116
|
-
const settings = ImageMapLayerSettings.fromJSON({
|
|
117
|
-
...esriFeatureSampleSource,
|
|
118
|
-
subLayers: [{ id: 0, name: "layer1", visible: true }, { id: 2, name: "layer2", visible: true }]
|
|
119
|
-
});
|
|
120
|
-
sandbox.stub(ArcGisUtilities, "getServiceJson").callsFake(async function _(_url, _formatId, _userName, _password, _ignoreCache, _requireToken) {
|
|
121
|
-
return { accessTokenRequired: false, content: { capabilities: "Query" } };
|
|
122
|
-
});
|
|
123
|
-
sandbox.stub(ArcGisFeatureProvider.prototype, "getLayerMetadata").callsFake(async function (_id) {
|
|
124
|
-
return undefined;
|
|
125
|
-
});
|
|
126
|
-
const provider = new ArcGisFeatureProvider(settings);
|
|
127
|
-
await expect(provider.initialize()).to.be.rejectedWith(ServerError);
|
|
128
|
-
});
|
|
129
|
-
it("should read supported supported format", async () => {
|
|
130
|
-
const settings = ImageMapLayerSettings.fromJSON({
|
|
131
|
-
...esriFeatureSampleSource,
|
|
132
|
-
subLayers: [{ id: 0, name: "layer1", visible: true }, { id: 2, name: "layer2", visible: true }]
|
|
133
|
-
});
|
|
134
|
-
let getLayerMetadataStub = sandbox.stub(ArcGisFeatureProvider.prototype, "getLayerMetadata").callsFake(async function (_id) {
|
|
135
|
-
return { defaultVisibility: true, supportedQueryFormats: "PBF, JSON" };
|
|
136
|
-
});
|
|
137
|
-
const getServiceJsonStub = sandbox.stub(ArcGisUtilities, "getServiceJson").callsFake(async function _(_url, _formatId, _userName, _password, _ignoreCache, _requireToken) {
|
|
138
|
-
return { accessTokenRequired: false, content: { capabilities: "Query" } };
|
|
139
|
-
});
|
|
140
|
-
let provider = new ArcGisFeatureProvider(settings);
|
|
141
|
-
await provider.initialize();
|
|
142
|
-
expect(provider.format).to.equals("JSON");
|
|
143
|
-
// PBF requires 'supportsCoordinatesQuantization'
|
|
144
|
-
getServiceJsonStub.restore();
|
|
145
|
-
sandbox.stub(ArcGisUtilities, "getServiceJson").callsFake(async function _(_url, _formatId, _userName, _password, _ignoreCache, _requireToken) {
|
|
146
|
-
return { accessTokenRequired: false, content: { currentVersion: 11, capabilities: "Query" } };
|
|
147
|
-
});
|
|
148
|
-
getLayerMetadataStub.restore();
|
|
149
|
-
getLayerMetadataStub = sandbox.stub(ArcGisFeatureProvider.prototype, "getLayerMetadata").callsFake(async function (_id) {
|
|
150
|
-
return { defaultVisibility: true, supportsCoordinatesQuantization: true, supportedQueryFormats: "PBF, JSON" };
|
|
151
|
-
});
|
|
152
|
-
provider = new ArcGisFeatureProvider(settings);
|
|
153
|
-
await provider.initialize();
|
|
154
|
-
expect(provider.format).to.equals("PBF");
|
|
155
|
-
getLayerMetadataStub.restore();
|
|
156
|
-
getLayerMetadataStub = sandbox.stub(ArcGisFeatureProvider.prototype, "getLayerMetadata").callsFake(async function (_id) {
|
|
157
|
-
return { defaultVisibility: true, supportedQueryFormats: "JSON" };
|
|
158
|
-
});
|
|
159
|
-
getServiceJsonStub.restore();
|
|
160
|
-
sandbox.stub(ArcGisUtilities, "getServiceJson").callsFake(async function _(_url, _formatId, _userName, _password, _ignoreCache, _requireToken) {
|
|
161
|
-
return { accessTokenRequired: false, content: { currentVersion: 10.91, capabilities: "Query", supportsCoordinatesQuantization: true } };
|
|
162
|
-
});
|
|
163
|
-
provider = new ArcGisFeatureProvider(settings);
|
|
164
|
-
await provider.initialize();
|
|
165
|
-
expect(provider.format).to.equals("JSON");
|
|
166
|
-
getLayerMetadataStub.restore();
|
|
167
|
-
getLayerMetadataStub = sandbox.stub(ArcGisFeatureProvider.prototype, "getLayerMetadata").callsFake(async function (_id) {
|
|
168
|
-
return { defaultVisibility: true, supportedQueryFormats: "JSON" };
|
|
169
|
-
});
|
|
170
|
-
provider = new ArcGisFeatureProvider(settings);
|
|
171
|
-
await provider.initialize();
|
|
172
|
-
expect(provider.format).to.equals("JSON");
|
|
173
|
-
getLayerMetadataStub.restore();
|
|
174
|
-
getLayerMetadataStub = sandbox.stub(ArcGisFeatureProvider.prototype, "getLayerMetadata").callsFake(async function (_id) {
|
|
175
|
-
return { defaultVisibility: true, supportedQueryFormats: "" };
|
|
176
|
-
});
|
|
177
|
-
provider = new ArcGisFeatureProvider(settings);
|
|
178
|
-
await expect(provider.initialize()).to.be.rejectedWith(ServerError);
|
|
179
|
-
});
|
|
180
|
-
it("should compute minLod/maxLod", async () => {
|
|
181
|
-
const settings = ImageMapLayerSettings.fromJSON({
|
|
182
|
-
...esriFeatureSampleSource,
|
|
183
|
-
subLayers: [{ id: 0, name: "layer1", visible: true }, { id: 2, name: "layer2", visible: true }]
|
|
184
|
-
});
|
|
185
|
-
sandbox.stub(ArcGisFeatureProvider.prototype, "getLayerMetadata").callsFake(async function (_id) {
|
|
186
|
-
return {
|
|
187
|
-
defaultVisibility: true,
|
|
188
|
-
supportedQueryFormats: "PBF, JSON",
|
|
189
|
-
minScale: 600000,
|
|
190
|
-
maxScale: 5000,
|
|
191
|
-
};
|
|
192
|
-
});
|
|
193
|
-
sandbox.stub(ArcGisUtilities, "getServiceJson").callsFake(async function _(_url, _formatId, _userName, _password, _ignoreCache, _requireToken) {
|
|
194
|
-
return { accessTokenRequired: false, content: { capabilities: "Query" } };
|
|
195
|
-
});
|
|
196
|
-
const provider = new ArcGisFeatureProvider(settings);
|
|
197
|
-
await provider.initialize();
|
|
198
|
-
expect(provider._minDepthFromLod).to.equals(9);
|
|
199
|
-
expect(provider._maxDepthFromLod).to.equals(15);
|
|
200
|
-
});
|
|
201
|
-
it("should construct empty url", async () => {
|
|
202
|
-
const settings = ImageMapLayerSettings.fromJSON(esriFeatureSampleSource);
|
|
203
|
-
const provider = new ArcGisFeatureProvider(settings);
|
|
204
|
-
const url = await provider.constructUrl(0, 0, 0);
|
|
205
|
-
expect(url).to.equals("");
|
|
206
|
-
});
|
|
207
|
-
it("should construct feature query url", async () => {
|
|
208
|
-
const settings = ImageMapLayerSettings.fromJSON({
|
|
209
|
-
...esriFeatureSampleSource,
|
|
210
|
-
subLayers: [{ id: 0, name: "layer1", visible: true }, { id: 2, name: "layer2", visible: true }]
|
|
211
|
-
});
|
|
212
|
-
let getLayerMetadataStub = sandbox.stub(ArcGisFeatureProvider.prototype, "getLayerMetadata").callsFake(async function (_id) {
|
|
213
|
-
return {
|
|
214
|
-
defaultVisibility: true,
|
|
215
|
-
supportedQueryFormats: "PBF, JSON",
|
|
216
|
-
};
|
|
217
|
-
});
|
|
218
|
-
sandbox.stub(ArcGisUtilities, "getServiceJson").callsFake(async function _(_url, _formatId, _userName, _password, _ignoreCache, _requireToken) {
|
|
219
|
-
return { accessTokenRequired: false, content: { currentVersion: 11, capabilities: "Query" } };
|
|
220
|
-
});
|
|
221
|
-
const provider = new ArcGisFeatureProvider(settings);
|
|
222
|
-
await provider.initialize();
|
|
223
|
-
let url = provider.constructFeatureUrl(0, 0, 0, "PBF");
|
|
224
|
-
const extent = {
|
|
225
|
-
xmin: -20037508.34,
|
|
226
|
-
ymin: -20037508.33,
|
|
227
|
-
xmax: 20037508.34,
|
|
228
|
-
ymax: 20037508.34,
|
|
229
|
-
spatialReference: {
|
|
230
|
-
wkid: 102100,
|
|
231
|
-
latestWkid: 3857,
|
|
232
|
-
},
|
|
233
|
-
};
|
|
234
|
-
expect(url?.url).to.equals(`https://dummy.com/0/query?f=PBF&resultType=tile&maxRecordCountFactor=3&returnExceededLimitFeatures=false&outSR=102100&geometryType=esriGeometryEnvelope&geometry=%7B%22xmin%22%3A-20037508.34%2C%22ymin%22%3A-20037508.339999996%2C%22xmax%22%3A20037508.34%2C%22ymax%22%3A20037508.340000004%2C%22spatialReference%22%3A%7B%22wkid%22%3A102100%2C%22latestWkid%22%3A3857%7D%7D&units=esriSRUnit_Meter&inSR=102100`);
|
|
235
|
-
expect(url?.envelope?.xmin).to.be.closeTo(extent.xmin, 0.01);
|
|
236
|
-
expect(url?.envelope?.ymin).to.be.closeTo(extent.ymin, 0.01);
|
|
237
|
-
expect(url?.envelope?.xmax).to.be.closeTo(extent.xmax, 0.01);
|
|
238
|
-
expect(url?.envelope?.ymax).to.be.closeTo(extent.ymax, 0.01);
|
|
239
|
-
expect(url?.envelope?.spatialReference.wkid).to.be.equal(102100);
|
|
240
|
-
expect(url?.envelope?.spatialReference.latestWkid).to.be.equal(3857);
|
|
241
|
-
// Now turn ON 'supportsCoordinatesQuantization' to ON
|
|
242
|
-
getLayerMetadataStub.restore();
|
|
243
|
-
getLayerMetadataStub = sandbox.stub(ArcGisFeatureProvider.prototype, "getLayerMetadata").callsFake(async function (_id) {
|
|
244
|
-
return {
|
|
245
|
-
defaultVisibility: true,
|
|
246
|
-
supportedQueryFormats: "PBF, JSON",
|
|
247
|
-
supportsCoordinatesQuantization: true,
|
|
248
|
-
};
|
|
249
|
-
});
|
|
250
|
-
const provider2 = new ArcGisFeatureProvider(settings);
|
|
251
|
-
await provider2.initialize();
|
|
252
|
-
url = provider2.constructFeatureUrl(0, 0, 0, "PBF");
|
|
253
|
-
expect(url?.url).to.equals(`https://dummy.com/0/query?f=PBF&resultType=tile&maxRecordCountFactor=3&returnExceededLimitFeatures=false&outSR=102100&geometryType=esriGeometryEnvelope&geometry=%7B%22xmin%22%3A-20037508.34%2C%22ymin%22%3A-20037508.339999996%2C%22xmax%22%3A20037508.34%2C%22ymax%22%3A20037508.340000004%2C%22spatialReference%22%3A%7B%22wkid%22%3A102100%2C%22latestWkid%22%3A3857%7D%7D&units=esriSRUnit_Meter&inSR=102100&quantizationParameters=%7B%22mode%22%3A%22view%22%2C%22originPosition%22%3A%22upperLeft%22%2C%22tolerance%22%3A78271.516953125%2C%22extent%22%3A%7B%22xmin%22%3A-20037508.34%2C%22ymin%22%3A-20037508.339999996%2C%22xmax%22%3A20037508.34%2C%22ymax%22%3A20037508.340000004%2C%22spatialReference%22%3A%7B%22wkid%22%3A102100%2C%22latestWkid%22%3A3857%7D%7D%7D`);
|
|
254
|
-
expect(url?.envelope?.xmin).to.be.closeTo(extent.xmin, 0.01);
|
|
255
|
-
expect(url?.envelope?.ymin).to.be.closeTo(extent.ymin, 0.01);
|
|
256
|
-
expect(url?.envelope?.xmax).to.be.closeTo(extent.xmax, 0.01);
|
|
257
|
-
expect(url?.envelope?.ymax).to.be.closeTo(extent.ymax, 0.01);
|
|
258
|
-
expect(url?.envelope?.spatialReference.wkid).to.be.equal(extent.spatialReference.wkid);
|
|
259
|
-
expect(url?.envelope?.spatialReference.latestWkid).to.be.equal(extent.spatialReference.latestWkid);
|
|
260
|
-
// Test passing an override geometry
|
|
261
|
-
const overrideGeom = {
|
|
262
|
-
type: "esriGeometryEnvelope",
|
|
263
|
-
geom: {
|
|
264
|
-
xmin: -50,
|
|
265
|
-
ymin: -50,
|
|
266
|
-
xmax: 50,
|
|
267
|
-
ymax: 50,
|
|
268
|
-
spatialReference: {
|
|
269
|
-
wkid: 102100,
|
|
270
|
-
latestWkid: 3857,
|
|
271
|
-
},
|
|
272
|
-
},
|
|
273
|
-
};
|
|
274
|
-
const provider3 = new ArcGisFeatureProvider(settings);
|
|
275
|
-
await provider3.initialize();
|
|
276
|
-
url = provider3.constructFeatureUrl(0, 0, 0, "PBF", overrideGeom);
|
|
277
|
-
expect(url?.url).to.equals(`https://dummy.com/0/query?f=PBF&resultType=tile&maxRecordCountFactor=3&returnExceededLimitFeatures=false&outSR=102100&geometryType=esriGeometryEnvelope&geometry=%7B%22xmin%22%3A-50%2C%22ymin%22%3A-50%2C%22xmax%22%3A50%2C%22ymax%22%3A50%2C%22spatialReference%22%3A%7B%22wkid%22%3A102100%2C%22latestWkid%22%3A3857%7D%7D&units=esriSRUnit_Meter&inSR=102100&quantizationParameters=%7B%22mode%22%3A%22view%22%2C%22originPosition%22%3A%22upperLeft%22%2C%22tolerance%22%3A78271.516953125%2C%22extent%22%3A%7B%22xmin%22%3A-20037508.34%2C%22ymin%22%3A-20037508.339999996%2C%22xmax%22%3A20037508.34%2C%22ymax%22%3A20037508.340000004%2C%22spatialReference%22%3A%7B%22wkid%22%3A102100%2C%22latestWkid%22%3A3857%7D%7D%7D`);
|
|
278
|
-
expect(url?.envelope?.xmin).to.be.closeTo(overrideGeom.geom.xmin, 0.01);
|
|
279
|
-
expect(url?.envelope?.ymin).to.be.closeTo(overrideGeom.geom.ymin, 0.01);
|
|
280
|
-
expect(url?.envelope?.xmax).to.be.closeTo(overrideGeom.geom.xmax, 0.01);
|
|
281
|
-
expect(url?.envelope?.ymax).to.be.closeTo(overrideGeom.geom.ymax, 0.01);
|
|
282
|
-
expect(url?.envelope?.spatialReference.wkid).to.be.equal(overrideGeom.geom.spatialReference.wkid);
|
|
283
|
-
expect(url?.envelope?.spatialReference.latestWkid).to.be.equal(overrideGeom.geom.spatialReference.latestWkid);
|
|
284
|
-
// Now test with a different tolerance value
|
|
285
|
-
url = provider3.constructFeatureUrl(0, 0, 0, "PBF", overrideGeom, undefined, 10);
|
|
286
|
-
expect(url?.url).to.equals(`https://dummy.com/0/query?f=PBF&resultType=tile&maxRecordCountFactor=3&returnExceededLimitFeatures=false&outSR=102100&geometryType=esriGeometryEnvelope&geometry=%7B%22xmin%22%3A-50%2C%22ymin%22%3A-50%2C%22xmax%22%3A50%2C%22ymax%22%3A50%2C%22spatialReference%22%3A%7B%22wkid%22%3A102100%2C%22latestWkid%22%3A3857%7D%7D&units=esriSRUnit_Meter&inSR=102100&quantizationParameters=%7B%22mode%22%3A%22view%22%2C%22originPosition%22%3A%22upperLeft%22%2C%22tolerance%22%3A78271.516953125%2C%22extent%22%3A%7B%22xmin%22%3A-20037508.34%2C%22ymin%22%3A-20037508.339999996%2C%22xmax%22%3A20037508.34%2C%22ymax%22%3A20037508.340000004%2C%22spatialReference%22%3A%7B%22wkid%22%3A102100%2C%22latestWkid%22%3A3857%7D%7D%7D&distance=782715.16953125`);
|
|
287
|
-
expect(url?.envelope?.xmin).to.be.closeTo(overrideGeom.geom.xmin, 0.01);
|
|
288
|
-
expect(url?.envelope?.ymin).to.be.closeTo(overrideGeom.geom.ymin, 0.01);
|
|
289
|
-
expect(url?.envelope?.xmax).to.be.closeTo(overrideGeom.geom.xmax, 0.01);
|
|
290
|
-
expect(url?.envelope?.ymax).to.be.closeTo(overrideGeom.geom.ymax, 0.01);
|
|
291
|
-
expect(url?.envelope?.spatialReference.wkid).to.be.equal(overrideGeom.geom.spatialReference.wkid);
|
|
292
|
-
expect(url?.envelope?.spatialReference.latestWkid).to.be.equal(overrideGeom.geom.spatialReference.latestWkid);
|
|
293
|
-
});
|
|
294
|
-
it("should log error when getFeatureInfo cannot be performed", async () => {
|
|
295
|
-
const settings = ImageMapLayerSettings.fromJSON({
|
|
296
|
-
...esriFeatureSampleSource,
|
|
297
|
-
subLayers: [{ id: 0, name: "layer1", visible: true }, { id: 2, name: "layer2", visible: true }]
|
|
298
|
-
});
|
|
299
|
-
sandbox.stub(ArcGisFeatureProvider.prototype, "getLayerMetadata").callsFake(async function (_id) {
|
|
300
|
-
return {
|
|
301
|
-
defaultVisibility: true,
|
|
302
|
-
supportedQueryFormats: "PBF, JSON",
|
|
303
|
-
minScale: 600000,
|
|
304
|
-
maxScale: 5000,
|
|
305
|
-
};
|
|
306
|
-
});
|
|
307
|
-
sandbox.stub(ArcGisUtilities, "getServiceJson").callsFake(async function _(_url, _formatId, _userName, _password, _ignoreCache, _requireToken) {
|
|
308
|
-
return { accessTokenRequired: false, content: { currentVersion: 11, capabilities: "Query" } };
|
|
309
|
-
});
|
|
310
|
-
sandbox.stub(ArcGisFeatureProvider.prototype, "constructFeatureUrl").callsFake(function _(_row, _column, _zoomLevel, _format, _geomOverride, _outFields, _tolerance, _returnGeometry) {
|
|
311
|
-
return undefined;
|
|
312
|
-
});
|
|
313
|
-
const provider = new ArcGisFeatureProvider(settings);
|
|
314
|
-
await provider.initialize();
|
|
315
|
-
const featureInfos = [];
|
|
316
|
-
const logErrorSpy = sandbox.spy(Logger, "logError");
|
|
317
|
-
await provider.getFeatureInfo(featureInfos, new QuadId(0, 0, 0), Cartographic.fromDegrees({ latitude: 46, longitude: -71 }), undefined);
|
|
318
|
-
expect(featureInfos.length).to.equals(0);
|
|
319
|
-
expect(logErrorSpy.called).to.be.true;
|
|
320
|
-
});
|
|
321
|
-
it("should process data in getFeatureInfo", async () => {
|
|
322
|
-
const settings = ImageMapLayerSettings.fromJSON({
|
|
323
|
-
...esriFeatureSampleSource,
|
|
324
|
-
subLayers: [{ id: 0, name: "layer1", visible: true }, { id: 2, name: "layer2", visible: true }]
|
|
325
|
-
});
|
|
326
|
-
sandbox.stub(ArcGisFeatureProvider.prototype, "getLayerMetadata").callsFake(async function (_id) {
|
|
327
|
-
return {
|
|
328
|
-
defaultVisibility: true,
|
|
329
|
-
supportedQueryFormats: "PBF, JSON",
|
|
330
|
-
supportsCoordinatesQuantization: true,
|
|
331
|
-
minScale: 600000,
|
|
332
|
-
maxScale: 5000,
|
|
333
|
-
};
|
|
334
|
-
});
|
|
335
|
-
sandbox.stub(ArcGisUtilities, "getServiceJson").callsFake(async function _(_url, _formatId, _userName, _password, _ignoreCache, _requireToken) {
|
|
336
|
-
return { accessTokenRequired: false, content: { currentVersion: 11, capabilities: "Query" } };
|
|
337
|
-
});
|
|
338
|
-
sandbox.stub(ArcGISImageryProvider.prototype, "fetch").callsFake(async function _(_url, _options) {
|
|
339
|
-
const test = {
|
|
340
|
-
headers: { "content-type": "pbf" },
|
|
341
|
-
arrayBuffer: async () => {
|
|
342
|
-
const byteArray = Base64EncodedString.toUint8Array(PhillyLandmarksDataset.phillyTransportationGetFeatureInfoQueryEncodedPbf);
|
|
343
|
-
return Promise.resolve(byteArray ? ByteStream.fromUint8Array(byteArray).arrayBuffer : undefined);
|
|
344
|
-
},
|
|
345
|
-
status: 200,
|
|
346
|
-
}; // By using unknown type, I can define parts of Response I really need
|
|
347
|
-
return test;
|
|
348
|
-
});
|
|
349
|
-
const provider = new ArcGisFeatureProvider(settings);
|
|
350
|
-
await provider.initialize();
|
|
351
|
-
const featureInfos = [];
|
|
352
|
-
const logErrorSpy = sandbox.spy(Logger, "logError");
|
|
353
|
-
await provider.getFeatureInfo(featureInfos, new QuadId(0, 0, 0), Cartographic.fromDegrees({ latitude: 46, longitude: -71 }), undefined);
|
|
354
|
-
expect(featureInfos.length).to.equals(1);
|
|
355
|
-
expect(logErrorSpy.calledOnce).to.be.false;
|
|
356
|
-
});
|
|
357
|
-
it("should log error when exceed transfert limit", async () => {
|
|
358
|
-
const settings = ImageMapLayerSettings.fromJSON({
|
|
359
|
-
...esriFeatureSampleSource,
|
|
360
|
-
subLayers: [{ id: 0, name: "layer1", visible: true }, { id: 2, name: "layer2", visible: true }]
|
|
361
|
-
});
|
|
362
|
-
sandbox.stub(ArcGisFeatureProvider.prototype, "getLayerMetadata").callsFake(async function (_id) {
|
|
363
|
-
return {
|
|
364
|
-
defaultVisibility: true,
|
|
365
|
-
supportedQueryFormats: "PBF, JSON",
|
|
366
|
-
minScale: 600000,
|
|
367
|
-
maxScale: 5000,
|
|
368
|
-
};
|
|
369
|
-
});
|
|
370
|
-
sandbox.stub(ArcGisUtilities, "getServiceJson").callsFake(async function _(_url, _formatId, _userName, _password, _ignoreCache, _requireToken) {
|
|
371
|
-
return { accessTokenRequired: false, content: { capabilities: "Query" } };
|
|
372
|
-
});
|
|
373
|
-
sandbox.stub(ArcGisFeatureResponse.prototype, "getResponseData").callsFake(async function _() {
|
|
374
|
-
return { exceedTransferLimit: true, data: undefined };
|
|
375
|
-
});
|
|
376
|
-
const provider = new ArcGisFeatureProvider(settings);
|
|
377
|
-
await provider.initialize();
|
|
378
|
-
const featureInfos = [];
|
|
379
|
-
const logErrorSpy = sandbox.spy(Logger, "logError");
|
|
380
|
-
await provider.getFeatureInfo(featureInfos, new QuadId(0, 0, 0), Cartographic.fromDegrees({ latitude: 46, longitude: -71 }), undefined);
|
|
381
|
-
expect(featureInfos.length).to.equals(0);
|
|
382
|
-
expect(logErrorSpy.calledOnce).to.be.true;
|
|
383
|
-
});
|
|
384
|
-
it("should log error when exceed exception thrown limit", async () => {
|
|
385
|
-
const settings = ImageMapLayerSettings.fromJSON({
|
|
386
|
-
...esriFeatureSampleSource,
|
|
387
|
-
subLayers: [{ id: 0, name: "layer1", visible: true }, { id: 2, name: "layer2", visible: true }]
|
|
388
|
-
});
|
|
389
|
-
sandbox.stub(ArcGisFeatureProvider.prototype, "getLayerMetadata").callsFake(async function (_id) {
|
|
390
|
-
return {
|
|
391
|
-
defaultVisibility: true,
|
|
392
|
-
supportedQueryFormats: "PBF, JSON",
|
|
393
|
-
minScale: 600000,
|
|
394
|
-
maxScale: 5000,
|
|
395
|
-
};
|
|
396
|
-
});
|
|
397
|
-
sandbox.stub(ArcGisUtilities, "getServiceJson").callsFake(async function _(_url, _formatId, _userName, _password, _ignoreCache, _requireToken) {
|
|
398
|
-
return { accessTokenRequired: false, content: { capabilities: "Query" } };
|
|
399
|
-
});
|
|
400
|
-
sandbox.stub(ArcGisFeatureResponse.prototype, "getResponseData").callsFake(async function _() {
|
|
401
|
-
throw new Error();
|
|
402
|
-
});
|
|
403
|
-
const provider = new ArcGisFeatureProvider(settings);
|
|
404
|
-
await provider.initialize();
|
|
405
|
-
const featureInfos = [];
|
|
406
|
-
const logErrorSpy = sandbox.spy(Logger, "logError");
|
|
407
|
-
await provider.getFeatureInfo(featureInfos, new QuadId(0, 0, 0), Cartographic.fromDegrees({ latitude: 46, longitude: -71 }), undefined);
|
|
408
|
-
expect(featureInfos.length).to.equals(0);
|
|
409
|
-
expect(logErrorSpy.calledOnce).to.be.true;
|
|
410
|
-
});
|
|
411
|
-
it("should debug Feature Geom", async () => {
|
|
412
|
-
const settings = ImageMapLayerSettings.fromJSON({
|
|
413
|
-
...esriFeatureSampleSource,
|
|
414
|
-
subLayers: [{ id: 0, name: "layer1", visible: true }, { id: 2, name: "layer2", visible: true }]
|
|
415
|
-
});
|
|
416
|
-
sandbox.stub(ArcGisFeatureProvider.prototype, "getLayerMetadata").callsFake(async function (_id) {
|
|
417
|
-
return {
|
|
418
|
-
defaultVisibility: true,
|
|
419
|
-
supportedQueryFormats: "PBF, JSON",
|
|
420
|
-
minScale: 600000,
|
|
421
|
-
maxScale: 5000,
|
|
422
|
-
};
|
|
423
|
-
});
|
|
424
|
-
sandbox.stub(ArcGisUtilities, "getServiceJson").callsFake(async function _(_url, _formatId, _userName, _password, _ignoreCache, _requireToken) {
|
|
425
|
-
return { accessTokenRequired: false, content: { capabilities: "Query" } };
|
|
426
|
-
});
|
|
427
|
-
sandbox.stub(ArcGisFeatureResponse.prototype, "getResponseData").callsFake(async function _() {
|
|
428
|
-
return { data: {
|
|
429
|
-
toObject: () => undefined,
|
|
430
|
-
} };
|
|
431
|
-
});
|
|
432
|
-
const provider = new ArcGisFeatureProvider(settings);
|
|
433
|
-
await provider.initialize();
|
|
434
|
-
provider._debugFeatureGeom = true;
|
|
435
|
-
const featureInfos = [];
|
|
436
|
-
const logInfoSpy = sandbox.spy(Logger, "logInfo");
|
|
437
|
-
await provider.getFeatureInfo(featureInfos, new QuadId(0, 0, 0), Cartographic.fromDegrees({ latitude: 46, longitude: -71 }), undefined);
|
|
438
|
-
expect(featureInfos.length).to.equals(0);
|
|
439
|
-
expect(logInfoSpy.callCount).to.equals(2);
|
|
440
|
-
});
|
|
441
|
-
it("should compute computeTileWorld2CanvasTransform", async () => {
|
|
442
|
-
const settings = ImageMapLayerSettings.fromJSON({
|
|
443
|
-
...esriFeatureSampleSource,
|
|
444
|
-
subLayers: [{ id: 0, name: "layer1", visible: true }, { id: 2, name: "layer2", visible: true }]
|
|
445
|
-
});
|
|
446
|
-
const worldSize = 100;
|
|
447
|
-
const canvasSize = 10;
|
|
448
|
-
const provider = new ArcGisFeatureProvider(settings);
|
|
449
|
-
const getEPSG3857ExtentStub = sandbox.stub(ArcGisFeatureProvider.prototype, "getEPSG3857Extent").callsFake(function (_row, _column, _zoomLevel) {
|
|
450
|
-
return { left: 0, right: worldSize, bottom: 0, top: worldSize };
|
|
451
|
-
});
|
|
452
|
-
sandbox.stub(provider, "tileSize").get(function () {
|
|
453
|
-
return canvasSize; // return a size of 10 to simplicity
|
|
454
|
-
});
|
|
455
|
-
let transform = provider.computeTileWorld2CanvasTransform(0, 0, 0);
|
|
456
|
-
let worldPoint = Point3d.createFrom({ x: worldSize * 0.5, y: worldSize * 0.5, z: 0 });
|
|
457
|
-
let transformedPoint = transform?.multiplyPoint3d(worldPoint);
|
|
458
|
-
// Make sure center point remains in the center
|
|
459
|
-
expect(transformedPoint).to.not.undefined;
|
|
460
|
-
expect(transformedPoint.x).to.equals(canvasSize * 0.5);
|
|
461
|
-
expect(transformedPoint.y).to.equals(canvasSize * 0.5);
|
|
462
|
-
expect(transformedPoint.z).to.equals(0);
|
|
463
|
-
// Check that y-axis get flipped
|
|
464
|
-
worldPoint = Point3d.createFrom({ x: 0, y: 10, z: 0 });
|
|
465
|
-
transformedPoint = transform?.multiplyPoint3d(worldPoint);
|
|
466
|
-
expect(transformedPoint.x).to.equals(0);
|
|
467
|
-
expect(transformedPoint.y).to.equals(9);
|
|
468
|
-
expect(transformedPoint.z).to.equals(0);
|
|
469
|
-
// Now check translation has been applied (origin shift)
|
|
470
|
-
getEPSG3857ExtentStub.restore();
|
|
471
|
-
sandbox.stub(ArcGisFeatureProvider.prototype, "getEPSG3857Extent").callsFake(function (_row, _column, _zoomLevel) {
|
|
472
|
-
return { left: worldSize, right: worldSize * 2, bottom: worldSize, top: worldSize * 2 };
|
|
473
|
-
});
|
|
474
|
-
worldPoint = Point3d.createFrom({ x: worldSize, y: worldSize, z: 0 });
|
|
475
|
-
transform = provider.computeTileWorld2CanvasTransform(0, 0, 0);
|
|
476
|
-
transformedPoint = transform?.multiplyPoint3d(worldPoint);
|
|
477
|
-
expect(transformedPoint).to.not.undefined;
|
|
478
|
-
expect(transformedPoint.x).to.equals(0);
|
|
479
|
-
expect(transformedPoint.y).to.equals(10);
|
|
480
|
-
expect(transformedPoint.z).to.equals(0);
|
|
481
|
-
});
|
|
482
|
-
it("should loadTile from PBF request", async () => {
|
|
483
|
-
const settings = ImageMapLayerSettings.fromJSON({
|
|
484
|
-
...esriFeatureSampleSource,
|
|
485
|
-
subLayers: [{ id: 0, name: "layer1", visible: true }, { id: 2, name: "layer2", visible: true }]
|
|
486
|
-
});
|
|
487
|
-
sandbox.stub(ArcGisFeatureProvider.prototype, "getLayerMetadata").callsFake(async function (_id) {
|
|
488
|
-
return {
|
|
489
|
-
defaultVisibility: true,
|
|
490
|
-
supportedQueryFormats: "PBF",
|
|
491
|
-
supportsCoordinatesQuantization: true,
|
|
492
|
-
};
|
|
493
|
-
});
|
|
494
|
-
sandbox.stub(ArcGisUtilities, "getServiceJson").callsFake(async function _(_url, _formatId, _userName, _password, _ignoreCache, _requireToken) {
|
|
495
|
-
return { accessTokenRequired: false, content: { currentVersion: 11, capabilities: "Query" } };
|
|
496
|
-
});
|
|
497
|
-
sandbox.stub(HTMLCanvasElement.prototype, "getContext").callsFake(function _(_contextId, _options) {
|
|
498
|
-
return {};
|
|
499
|
-
});
|
|
500
|
-
sandbox.stub(HTMLCanvasElement.prototype, "toDataURL").callsFake(function _(_type, _quality) {
|
|
501
|
-
return `data:image/png;base64,${pngTransparent1x1}`;
|
|
502
|
-
});
|
|
503
|
-
const providerStub = sandbox.stub(ArcGisFeatureProvider.prototype, "fetchTile").callsFake(async function _() {
|
|
504
|
-
return new ArcGisFeatureResponse("PBF", Promise.resolve({}));
|
|
505
|
-
});
|
|
506
|
-
sandbox.stub(ArcGisFeatureResponse.prototype, "getResponseData").callsFake(async function _() {
|
|
507
|
-
return {
|
|
508
|
-
exceedTransferLimit: false,
|
|
509
|
-
data: { toObject: () => undefined },
|
|
510
|
-
};
|
|
511
|
-
});
|
|
512
|
-
// toDataURL string;
|
|
513
|
-
const readAndRenderSpy = sandbox.spy(ArcGisFeaturePBF.prototype, "readAndRender");
|
|
514
|
-
const computeTransfoSpy = sandbox.spy(ArcGisFeatureProvider.prototype, "computeTileWorld2CanvasTransform");
|
|
515
|
-
const provider = new ArcGisFeatureProvider(settings);
|
|
516
|
-
await provider.initialize();
|
|
517
|
-
const tileData = await provider.loadTile(0, 0, 0);
|
|
518
|
-
expect(tileData).to.not.undefined;
|
|
519
|
-
expect(tileData?.data instanceof Uint8Array).to.be.true;
|
|
520
|
-
expect(tileData?.data).to.eqls(base64StringToUint8Array(pngTransparent1x1));
|
|
521
|
-
expect(tileData?.format).to.equals(ImageSourceFormat.Png);
|
|
522
|
-
expect(providerStub.calledOnce).to.be.true;
|
|
523
|
-
expect(readAndRenderSpy.calledOnce).to.be.true;
|
|
524
|
-
expect(computeTransfoSpy.calledOnce).to.be.false; // Should not be called since we have supportsCoordinatesQuantization in layer metadata
|
|
525
|
-
});
|
|
526
|
-
it("should loadTile from JSON request", async () => {
|
|
527
|
-
const settings = ImageMapLayerSettings.fromJSON({
|
|
528
|
-
...esriFeatureSampleSource,
|
|
529
|
-
subLayers: [{ id: 0, name: "layer1", visible: true }, { id: 2, name: "layer2", visible: true }]
|
|
530
|
-
});
|
|
531
|
-
sandbox.stub(ArcGisFeatureProvider.prototype, "getLayerMetadata").callsFake(async function (_id) {
|
|
532
|
-
return {
|
|
533
|
-
defaultVisibility: true,
|
|
534
|
-
supportedQueryFormats: "JSON",
|
|
535
|
-
};
|
|
536
|
-
});
|
|
537
|
-
sandbox.stub(ArcGisUtilities, "getServiceJson").callsFake(async function _(_url, _formatId, _userName, _password, _ignoreCache, _requireToken) {
|
|
538
|
-
return { accessTokenRequired: false, content: { capabilities: "Query" } };
|
|
539
|
-
});
|
|
540
|
-
sandbox.stub(HTMLCanvasElement.prototype, "getContext").callsFake(function _(_contextId, _options) {
|
|
541
|
-
return {};
|
|
542
|
-
});
|
|
543
|
-
sandbox.stub(HTMLCanvasElement.prototype, "toDataURL").callsFake(function _(_type, _quality) {
|
|
544
|
-
return `data:image/png;base64,${pngTransparent1x1}`;
|
|
545
|
-
});
|
|
546
|
-
const providerStub = sandbox.stub(ArcGisFeatureProvider.prototype, "fetchTile").callsFake(async function _() {
|
|
547
|
-
return new ArcGisFeatureResponse("JSON", Promise.resolve({}));
|
|
548
|
-
});
|
|
549
|
-
sandbox.stub(ArcGisFeatureResponse.prototype, "getResponseData").callsFake(async function _() {
|
|
550
|
-
return {
|
|
551
|
-
exceedTransferLimit: false,
|
|
552
|
-
data: { toObject: () => undefined },
|
|
553
|
-
};
|
|
554
|
-
});
|
|
555
|
-
const readAndRenderSpy = sandbox.spy(ArcGisFeatureJSON.prototype, "readAndRender");
|
|
556
|
-
const computeTransfoSpy = sandbox.spy(ArcGisFeatureProvider.prototype, "computeTileWorld2CanvasTransform");
|
|
557
|
-
const provider = new ArcGisFeatureProvider(settings);
|
|
558
|
-
await provider.initialize();
|
|
559
|
-
const tileData = await provider.loadTile(0, 0, 0);
|
|
560
|
-
expect(tileData).to.not.undefined;
|
|
561
|
-
expect(tileData?.data instanceof Uint8Array).to.be.true;
|
|
562
|
-
expect(tileData?.data).to.eqls(base64StringToUint8Array(pngTransparent1x1));
|
|
563
|
-
expect(tileData?.format).to.equals(ImageSourceFormat.Png);
|
|
564
|
-
expect(providerStub.calledOnce).to.be.true;
|
|
565
|
-
expect(readAndRenderSpy.calledOnce).to.be.true;
|
|
566
|
-
expect(computeTransfoSpy.calledOnce).to.be.true; // Should be called since we dont have _supportsCoordinatesQuantization in layer metadata
|
|
567
|
-
});
|
|
568
|
-
it("should make sub request if loadtile request return 'exceedTransferLimit'", async () => {
|
|
569
|
-
const settings = ImageMapLayerSettings.fromJSON({
|
|
570
|
-
...esriFeatureSampleSource,
|
|
571
|
-
subLayers: [{ id: 0, name: "layer1", visible: true }, { id: 2, name: "layer2", visible: true }]
|
|
572
|
-
});
|
|
573
|
-
sandbox.stub(ArcGisFeatureProvider.prototype, "getLayerMetadata").callsFake(async function (_id) {
|
|
574
|
-
return {
|
|
575
|
-
defaultVisibility: true,
|
|
576
|
-
supportedQueryFormats: "JSON",
|
|
577
|
-
};
|
|
578
|
-
});
|
|
579
|
-
sandbox.stub(ArcGisUtilities, "getServiceJson").callsFake(async function _(_url, _formatId, _userName, _password, _ignoreCache, _requireToken) {
|
|
580
|
-
return { accessTokenRequired: false, content: { capabilities: "Query" } };
|
|
581
|
-
});
|
|
582
|
-
sandbox.stub(HTMLCanvasElement.prototype, "getContext").callsFake(function _(_contextId, _options) {
|
|
583
|
-
return {};
|
|
584
|
-
});
|
|
585
|
-
sandbox.stub(HTMLCanvasElement.prototype, "toDataURL").callsFake(function _(_type, _quality) {
|
|
586
|
-
return `data:image/png;base64,${pngTransparent1x1}`;
|
|
587
|
-
});
|
|
588
|
-
const extentSize = 100;
|
|
589
|
-
const fetchTileStub = sandbox.stub(ArcGisFeatureProvider.prototype, "fetchTile").callsFake(async function _() {
|
|
590
|
-
const envelope = {
|
|
591
|
-
xmin: 0,
|
|
592
|
-
ymin: 0,
|
|
593
|
-
xmax: extentSize,
|
|
594
|
-
ymax: extentSize,
|
|
595
|
-
spatialReference: {
|
|
596
|
-
wkid: 102100,
|
|
597
|
-
latestWkid: 3857,
|
|
598
|
-
}
|
|
599
|
-
};
|
|
600
|
-
return new ArcGisFeatureResponse("JSON", Promise.resolve({}), envelope);
|
|
601
|
-
});
|
|
602
|
-
let firstCall = true;
|
|
603
|
-
sandbox.stub(ArcGisFeatureResponse.prototype, "getResponseData").callsFake(async function _() {
|
|
604
|
-
const exceed = firstCall === true;
|
|
605
|
-
firstCall = false;
|
|
606
|
-
return {
|
|
607
|
-
exceedTransferLimit: exceed,
|
|
608
|
-
data: { toObject: () => undefined },
|
|
609
|
-
};
|
|
610
|
-
});
|
|
611
|
-
const readAndRenderSpy = sandbox.spy(ArcGisFeatureJSON.prototype, "readAndRender");
|
|
612
|
-
const provider = new ArcGisFeatureProvider(settings);
|
|
613
|
-
await provider.initialize();
|
|
614
|
-
await provider.loadTile(0, 0, 0);
|
|
615
|
-
// We should have 5 calls:
|
|
616
|
-
// Call #1 : initial call for 0,0,0 and it returns 'exceedTransferLimit'
|
|
617
|
-
// Calls #2-5: Four calls which represent a call for each sub-envelope (initial extent divided by 4)
|
|
618
|
-
expect(fetchTileStub.getCalls().length).to.equals(5);
|
|
619
|
-
expect(fetchTileStub.getCalls()[1].args[3]).to.eqls({
|
|
620
|
-
xmin: 0, ymin: 0, xmax: extentSize * 0.5, ymax: extentSize * 0.5,
|
|
621
|
-
spatialReference: { wkid: 102100, latestWkid: 3857,
|
|
622
|
-
}
|
|
623
|
-
});
|
|
624
|
-
expect(fetchTileStub.getCalls()[2].args[3]).to.eqls({
|
|
625
|
-
xmin: 0, ymin: extentSize * 0.5, xmax: extentSize * 0.5, ymax: extentSize,
|
|
626
|
-
spatialReference: { wkid: 102100, latestWkid: 3857,
|
|
627
|
-
}
|
|
628
|
-
});
|
|
629
|
-
expect(fetchTileStub.getCalls()[3].args[3]).to.eqls({
|
|
630
|
-
xmin: extentSize * 0.5, ymin: 0, xmax: extentSize, ymax: extentSize * 0.5,
|
|
631
|
-
spatialReference: { wkid: 102100, latestWkid: 3857,
|
|
632
|
-
}
|
|
633
|
-
});
|
|
634
|
-
expect(fetchTileStub.getCalls()[4].args[3]).to.eqls({
|
|
635
|
-
xmin: extentSize * 0.5, ymin: extentSize * 0.5, xmax: extentSize, ymax: extentSize,
|
|
636
|
-
spatialReference: { wkid: 102100, latestWkid: 3857,
|
|
637
|
-
}
|
|
638
|
-
});
|
|
639
|
-
expect(readAndRenderSpy.getCalls().length).to.equals(4);
|
|
640
|
-
});
|
|
641
|
-
it("fetchTile should return undefined when to format defined", async () => {
|
|
642
|
-
const settings = ImageMapLayerSettings.fromJSON({
|
|
643
|
-
...esriFeatureSampleSource,
|
|
644
|
-
subLayers: [{ id: 0, name: "layer1", visible: true }, { id: 2, name: "layer2", visible: true }]
|
|
645
|
-
});
|
|
646
|
-
const provider = new ArcGisFeatureProvider(settings);
|
|
647
|
-
// make a first request with init, should return undefined because of missing format
|
|
648
|
-
const tileData = await provider.fetchTile(0, 0, 0);
|
|
649
|
-
expect(tileData).to.be.undefined;
|
|
650
|
-
});
|
|
651
|
-
it("fetchTile should call fetch with the proper URL", async () => {
|
|
652
|
-
const settings = ImageMapLayerSettings.fromJSON({
|
|
653
|
-
...esriFeatureSampleSource,
|
|
654
|
-
subLayers: [{ id: 0, name: "layer1", visible: true }, { id: 2, name: "layer2", visible: true }]
|
|
655
|
-
});
|
|
656
|
-
sandbox.stub(ArcGisFeatureProvider.prototype, "getLayerMetadata").callsFake(async function (_id) {
|
|
657
|
-
return {
|
|
658
|
-
defaultVisibility: true,
|
|
659
|
-
supportedQueryFormats: "JSON",
|
|
660
|
-
};
|
|
661
|
-
});
|
|
662
|
-
sandbox.stub(ArcGisUtilities, "getServiceJson").callsFake(async function _(_url, _formatId, _userName, _password, _ignoreCache, _requireToken) {
|
|
663
|
-
return { accessTokenRequired: false, content: { capabilities: "Query" } };
|
|
664
|
-
});
|
|
665
|
-
const fetchStub = sandbox.stub(ArcGISImageryProvider.prototype, "fetch");
|
|
666
|
-
sandbox.stub(ArcGisFeatureProvider.prototype, "constructFeatureUrl").callsFake(function _(_row, _column, _zoomLevel, _format, _geomOverride, _outFields, _tolerance, _returnGeometry) {
|
|
667
|
-
return { url: settings.url };
|
|
668
|
-
});
|
|
669
|
-
const provider = new ArcGisFeatureProvider(settings);
|
|
670
|
-
await provider.initialize();
|
|
671
|
-
const response = await provider.fetchTile(0, 0, 0);
|
|
672
|
-
expect(response).to.not.undefined;
|
|
673
|
-
expect(fetchStub.calledOnce).to.be.true;
|
|
674
|
-
const test1 = fetchStub.getCall(0).firstArg;
|
|
675
|
-
expect(test1.toString()).to.equals(new URL(settings.url).toString());
|
|
676
|
-
});
|
|
677
|
-
});
|
|
678
|
-
//# sourceMappingURL=ArcGisFeatureProvider.test.js.map
|