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