@itwin/map-layers-formats 4.1.0-dev.7 → 4.1.0-dev.71
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/ArcGisJsonFeatureReader.d.ts +14 -0
- package/lib/cjs/ArcGisFeature/ArcGisJsonFeatureReader.d.ts.map +1 -0
- package/lib/cjs/ArcGisFeature/{ArcGisFeatureJSON.js → ArcGisJsonFeatureReader.js} +51 -55
- package/lib/cjs/ArcGisFeature/ArcGisJsonFeatureReader.js.map +1 -0
- package/lib/cjs/ArcGisFeature/ArcGisPbfFeatureReader.d.ts +22 -0
- package/lib/cjs/ArcGisFeature/ArcGisPbfFeatureReader.d.ts.map +1 -0
- package/lib/cjs/ArcGisFeature/ArcGisPbfFeatureReader.js +249 -0
- package/lib/cjs/ArcGisFeature/ArcGisPbfFeatureReader.js.map +1 -0
- package/lib/cjs/ArcGisFeature/ArcGisSymbologyRenderer.d.ts +32 -77
- package/lib/cjs/ArcGisFeature/ArcGisSymbologyRenderer.d.ts.map +1 -1
- package/lib/cjs/ArcGisFeature/ArcGisSymbologyRenderer.js +88 -128
- package/lib/cjs/ArcGisFeature/ArcGisSymbologyRenderer.js.map +1 -1
- package/lib/cjs/ArcGisFeature/EsriSymbology.d.ts +152 -0
- package/lib/cjs/ArcGisFeature/EsriSymbology.d.ts.map +1 -0
- package/lib/cjs/ArcGisFeature/EsriSymbology.js +181 -0
- package/lib/cjs/ArcGisFeature/EsriSymbology.js.map +1 -0
- package/lib/cjs/Tools/MapFeatureInfoDecorator.d.ts +34 -0
- package/lib/cjs/Tools/MapFeatureInfoDecorator.d.ts.map +1 -0
- package/lib/cjs/Tools/MapFeatureInfoDecorator.js +281 -0
- package/lib/cjs/Tools/MapFeatureInfoDecorator.js.map +1 -0
- package/lib/cjs/Tools/MapFeatureInfoTool.d.ts +38 -0
- package/lib/cjs/Tools/MapFeatureInfoTool.d.ts.map +1 -0
- package/lib/cjs/Tools/MapFeatureInfoTool.js +113 -0
- package/lib/cjs/Tools/MapFeatureInfoTool.js.map +1 -0
- package/lib/cjs/map-layers-formats.d.ts +1 -0
- package/lib/cjs/map-layers-formats.d.ts.map +1 -1
- package/lib/cjs/map-layers-formats.js +1 -0
- package/lib/cjs/map-layers-formats.js.map +1 -1
- package/lib/cjs/mapLayersFormats.d.ts +12 -1
- package/lib/cjs/mapLayersFormats.d.ts.map +1 -1
- package/lib/cjs/mapLayersFormats.js +11 -1
- package/lib/cjs/mapLayersFormats.js.map +1 -1
- package/lib/esm/ArcGisFeature/ArcGisCanvasRenderer.d.ts +19 -0
- package/lib/esm/ArcGisFeature/ArcGisCanvasRenderer.d.ts.map +1 -0
- package/lib/esm/ArcGisFeature/ArcGisCanvasRenderer.js +42 -0
- package/lib/esm/ArcGisFeature/ArcGisCanvasRenderer.js.map +1 -0
- package/lib/esm/ArcGisFeature/ArcGisFeatureFormat.d.ts.map +1 -1
- package/lib/esm/ArcGisFeature/ArcGisFeatureFormat.js +4 -1
- package/lib/esm/ArcGisFeature/ArcGisFeatureFormat.js.map +1 -1
- package/lib/esm/ArcGisFeature/ArcGisFeatureProvider.d.ts +16 -8
- package/lib/esm/ArcGisFeature/ArcGisFeatureProvider.d.ts.map +1 -1
- package/lib/esm/ArcGisFeature/ArcGisFeatureProvider.js +158 -46
- package/lib/esm/ArcGisFeature/ArcGisFeatureProvider.js.map +1 -1
- package/lib/esm/ArcGisFeature/ArcGisFeatureQuery.d.ts +5 -0
- package/lib/esm/ArcGisFeature/ArcGisFeatureQuery.d.ts.map +1 -1
- package/lib/esm/ArcGisFeature/ArcGisFeatureQuery.js +4 -0
- package/lib/esm/ArcGisFeature/ArcGisFeatureQuery.js.map +1 -1
- package/lib/esm/ArcGisFeature/ArcGisFeatureReader.d.ts +15 -6
- package/lib/esm/ArcGisFeature/ArcGisFeatureReader.d.ts.map +1 -1
- package/lib/esm/ArcGisFeature/ArcGisFeatureReader.js +4 -2
- package/lib/esm/ArcGisFeature/ArcGisFeatureReader.js.map +1 -1
- package/lib/esm/ArcGisFeature/ArcGisJsonFeatureReader.d.ts +14 -0
- package/lib/esm/ArcGisFeature/ArcGisJsonFeatureReader.d.ts.map +1 -0
- package/lib/esm/ArcGisFeature/{ArcGisFeatureJSON.js → ArcGisJsonFeatureReader.js} +51 -55
- package/lib/esm/ArcGisFeature/ArcGisJsonFeatureReader.js.map +1 -0
- package/lib/esm/ArcGisFeature/ArcGisPbfFeatureReader.d.ts +22 -0
- package/lib/esm/ArcGisFeature/ArcGisPbfFeatureReader.d.ts.map +1 -0
- package/lib/esm/ArcGisFeature/ArcGisPbfFeatureReader.js +245 -0
- package/lib/esm/ArcGisFeature/ArcGisPbfFeatureReader.js.map +1 -0
- package/lib/esm/ArcGisFeature/ArcGisSymbologyRenderer.d.ts +32 -77
- package/lib/esm/ArcGisFeature/ArcGisSymbologyRenderer.d.ts.map +1 -1
- package/lib/esm/ArcGisFeature/ArcGisSymbologyRenderer.js +84 -124
- package/lib/esm/ArcGisFeature/ArcGisSymbologyRenderer.js.map +1 -1
- package/lib/esm/ArcGisFeature/EsriSymbology.d.ts +152 -0
- package/lib/esm/ArcGisFeature/EsriSymbology.d.ts.map +1 -0
- package/lib/esm/ArcGisFeature/EsriSymbology.js +170 -0
- package/lib/esm/ArcGisFeature/EsriSymbology.js.map +1 -0
- package/lib/esm/Tools/MapFeatureInfoDecorator.d.ts +34 -0
- package/lib/esm/Tools/MapFeatureInfoDecorator.d.ts.map +1 -0
- package/lib/esm/Tools/MapFeatureInfoDecorator.js +277 -0
- package/lib/esm/Tools/MapFeatureInfoDecorator.js.map +1 -0
- package/lib/esm/Tools/MapFeatureInfoTool.d.ts +38 -0
- package/lib/esm/Tools/MapFeatureInfoTool.d.ts.map +1 -0
- package/lib/esm/Tools/MapFeatureInfoTool.js +110 -0
- package/lib/esm/Tools/MapFeatureInfoTool.js.map +1 -0
- package/lib/esm/map-layers-formats.d.ts +1 -0
- package/lib/esm/map-layers-formats.d.ts.map +1 -1
- package/lib/esm/map-layers-formats.js +1 -0
- package/lib/esm/map-layers-formats.js.map +1 -1
- package/lib/esm/mapLayersFormats.d.ts +12 -1
- package/lib/esm/mapLayersFormats.d.ts.map +1 -1
- package/lib/esm/mapLayersFormats.js +13 -2
- package/lib/esm/mapLayersFormats.js.map +1 -1
- package/lib/public/locales/en/mapLayersFormats.json +12 -0
- package/package.json +19 -22
- package/.nycrc +0 -10
- package/.rush/temp/operation/build/all.log +0 -3
- package/.rush/temp/operation/build/state.json +0 -3
- package/.rush/temp/operation/cover/all.log +0 -98
- package/.rush/temp/operation/cover/state.json +0 -3
- package/.rush/temp/operation/docs/all.log +0 -30
- package/.rush/temp/operation/docs/state.json +0 -3
- package/.rush/temp/package-deps_build.json +0 -36
- package/.rush/temp/package-deps_cover.json +0 -36
- package/.rush/temp/package-deps_docs.json +0 -36
- package/.rush/temp/shrinkwrap-deps.json +0 -505
- package/CHANGELOG.json +0 -119
- package/config/rush-project.json +0 -6
- package/lib/cjs/ArcGisFeature/ArcGisFeatureJSON.d.ts +0 -15
- package/lib/cjs/ArcGisFeature/ArcGisFeatureJSON.d.ts.map +0 -1
- package/lib/cjs/ArcGisFeature/ArcGisFeatureJSON.js.map +0 -1
- package/lib/cjs/ArcGisFeature/ArcGisFeaturePBF.d.ts +0 -15
- package/lib/cjs/ArcGisFeature/ArcGisFeaturePBF.d.ts.map +0 -1
- package/lib/cjs/ArcGisFeature/ArcGisFeaturePBF.js +0 -201
- package/lib/cjs/ArcGisFeature/ArcGisFeaturePBF.js.map +0 -1
- package/lib/cjs/ArcGisFeature/ArcGisFeatureRenderer.d.ts +0 -33
- package/lib/cjs/ArcGisFeature/ArcGisFeatureRenderer.d.ts.map +0 -1
- package/lib/cjs/ArcGisFeature/ArcGisFeatureRenderer.js +0 -143
- package/lib/cjs/ArcGisFeature/ArcGisFeatureRenderer.js.map +0 -1
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureFeatureFormats.test.d.ts +0 -2
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureFeatureFormats.test.d.ts.map +0 -1
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureFeatureFormats.test.js +0 -35
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureFeatureFormats.test.js.map +0 -1
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureJSON.test.d.ts +0 -2
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureJSON.test.d.ts.map +0 -1
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureJSON.test.js +0 -162
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureJSON.test.js.map +0 -1
- package/lib/cjs/test/ArcGisFeature/ArcGisFeaturePBF.test.d.ts +0 -2
- package/lib/cjs/test/ArcGisFeature/ArcGisFeaturePBF.test.d.ts.map +0 -1
- package/lib/cjs/test/ArcGisFeature/ArcGisFeaturePBF.test.js +0 -168
- package/lib/cjs/test/ArcGisFeature/ArcGisFeaturePBF.test.js.map +0 -1
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureProvider.test.d.ts +0 -2
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureProvider.test.d.ts.map +0 -1
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureProvider.test.js +0 -680
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureProvider.test.js.map +0 -1
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureQuery.test.d.ts +0 -2
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureQuery.test.d.ts.map +0 -1
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureQuery.test.js +0 -104
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureQuery.test.js.map +0 -1
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureRenderer.test.d.ts +0 -2
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureRenderer.test.d.ts.map +0 -1
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureRenderer.test.js +0 -215
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureRenderer.test.js.map +0 -1
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureResponse.test.d.ts +0 -2
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureResponse.test.d.ts.map +0 -1
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureResponse.test.js +0 -95
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureResponse.test.js.map +0 -1
- package/lib/cjs/test/ArcGisFeature/ArcGisSymbologyRenderer.test.d.ts +0 -2
- package/lib/cjs/test/ArcGisFeature/ArcGisSymbologyRenderer.test.d.ts.map +0 -1
- package/lib/cjs/test/ArcGisFeature/ArcGisSymbologyRenderer.test.js +0 -60
- package/lib/cjs/test/ArcGisFeature/ArcGisSymbologyRenderer.test.js.map +0 -1
- package/lib/cjs/test/ArcGisFeature/Mocks.d.ts +0 -7
- package/lib/cjs/test/ArcGisFeature/Mocks.d.ts.map +0 -1
- package/lib/cjs/test/ArcGisFeature/Mocks.js +0 -19
- package/lib/cjs/test/ArcGisFeature/Mocks.js.map +0 -1
- package/lib/cjs/test/ArcGisFeature/NewYorkDataset.d.ts +0 -56
- package/lib/cjs/test/ArcGisFeature/NewYorkDataset.d.ts.map +0 -1
- package/lib/cjs/test/ArcGisFeature/NewYorkDataset.js +0 -420
- package/lib/cjs/test/ArcGisFeature/NewYorkDataset.js.map +0 -1
- package/lib/cjs/test/ArcGisFeature/PhillyLandmarksDataset.d.ts +0 -1043
- package/lib/cjs/test/ArcGisFeature/PhillyLandmarksDataset.d.ts.map +0 -1
- package/lib/cjs/test/ArcGisFeature/PhillyLandmarksDataset.js +0 -427
- package/lib/cjs/test/ArcGisFeature/PhillyLandmarksDataset.js.map +0 -1
- package/lib/cjs/test/coverage/.nyc_output/2a6113c3-018f-40b1-ae8f-f3d0cbe030ce.json +0 -1
- package/lib/cjs/test/coverage/.nyc_output/74410d89-cce2-4b2a-89c9-6d56490c73f1.json +0 -1
- package/lib/cjs/test/coverage/.nyc_output/processinfo/2a6113c3-018f-40b1-ae8f-f3d0cbe030ce.json +0 -1
- package/lib/cjs/test/coverage/.nyc_output/processinfo/74410d89-cce2-4b2a-89c9-6d56490c73f1.json +0 -1
- package/lib/cjs/test/coverage/.nyc_output/processinfo/index.json +0 -1
- package/lib/cjs/test/coverage/cobertura-coverage.xml +0 -1169
- package/lib/cjs/test/coverage/lcov-report/base.css +0 -224
- package/lib/cjs/test/coverage/lcov-report/block-navigation.js +0 -87
- package/lib/cjs/test/coverage/lcov-report/favicon.png +0 -0
- package/lib/cjs/test/coverage/lcov-report/index.html +0 -131
- package/lib/cjs/test/coverage/lcov-report/prettify.css +0 -1
- package/lib/cjs/test/coverage/lcov-report/prettify.js +0 -2
- package/lib/cjs/test/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/lib/cjs/test/coverage/lcov-report/sorter.js +0 -196
- package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureFormat.ts.html +0 -133
- package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureJSON.ts.html +0 -550
- package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeaturePBF.ts.html +0 -730
- package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureProvider.ts.html +0 -1546
- package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureQuery.ts.html +0 -763
- package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureReader.ts.html +0 -223
- package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureRenderer.ts.html +0 -598
- package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureResponse.ts.html +0 -301
- package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisSymbologyRenderer.ts.html +0 -832
- package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/index.html +0 -236
- package/lib/cjs/test/coverage/lcov-report/src/index.html +0 -131
- package/lib/cjs/test/coverage/lcov-report/src/map-layers-formats.ts.html +0 -130
- package/lib/cjs/test/coverage/lcov-report/src/mapLayersFormats.ts.html +0 -163
- package/lib/cjs/test/coverage/lcov.info +0 -1358
- package/lib/cjs/tsconfig.tsbuildinfo +0 -1
- package/lib/esm/ArcGisFeature/ArcGisFeatureJSON.d.ts +0 -15
- package/lib/esm/ArcGisFeature/ArcGisFeatureJSON.d.ts.map +0 -1
- package/lib/esm/ArcGisFeature/ArcGisFeatureJSON.js.map +0 -1
- package/lib/esm/ArcGisFeature/ArcGisFeaturePBF.d.ts +0 -15
- package/lib/esm/ArcGisFeature/ArcGisFeaturePBF.d.ts.map +0 -1
- package/lib/esm/ArcGisFeature/ArcGisFeaturePBF.js +0 -197
- package/lib/esm/ArcGisFeature/ArcGisFeaturePBF.js.map +0 -1
- package/lib/esm/ArcGisFeature/ArcGisFeatureRenderer.d.ts +0 -33
- package/lib/esm/ArcGisFeature/ArcGisFeatureRenderer.d.ts.map +0 -1
- package/lib/esm/ArcGisFeature/ArcGisFeatureRenderer.js +0 -139
- package/lib/esm/ArcGisFeature/ArcGisFeatureRenderer.js.map +0 -1
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureFeatureFormats.test.d.ts +0 -2
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureFeatureFormats.test.d.ts.map +0 -1
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureFeatureFormats.test.js +0 -33
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureFeatureFormats.test.js.map +0 -1
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureJSON.test.d.ts +0 -2
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureJSON.test.d.ts.map +0 -1
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureJSON.test.js +0 -160
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureJSON.test.js.map +0 -1
- package/lib/esm/test/ArcGisFeature/ArcGisFeaturePBF.test.d.ts +0 -2
- package/lib/esm/test/ArcGisFeature/ArcGisFeaturePBF.test.d.ts.map +0 -1
- package/lib/esm/test/ArcGisFeature/ArcGisFeaturePBF.test.js +0 -166
- package/lib/esm/test/ArcGisFeature/ArcGisFeaturePBF.test.js.map +0 -1
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureProvider.test.d.ts +0 -2
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureProvider.test.d.ts.map +0 -1
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureProvider.test.js +0 -678
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureProvider.test.js.map +0 -1
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureQuery.test.d.ts +0 -2
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureQuery.test.d.ts.map +0 -1
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureQuery.test.js +0 -102
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureQuery.test.js.map +0 -1
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureRenderer.test.d.ts +0 -2
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureRenderer.test.d.ts.map +0 -1
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureRenderer.test.js +0 -213
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureRenderer.test.js.map +0 -1
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureResponse.test.d.ts +0 -2
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureResponse.test.d.ts.map +0 -1
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureResponse.test.js +0 -93
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureResponse.test.js.map +0 -1
- package/lib/esm/test/ArcGisFeature/ArcGisSymbologyRenderer.test.d.ts +0 -2
- package/lib/esm/test/ArcGisFeature/ArcGisSymbologyRenderer.test.d.ts.map +0 -1
- package/lib/esm/test/ArcGisFeature/ArcGisSymbologyRenderer.test.js +0 -58
- package/lib/esm/test/ArcGisFeature/ArcGisSymbologyRenderer.test.js.map +0 -1
- package/lib/esm/test/ArcGisFeature/Mocks.d.ts +0 -7
- package/lib/esm/test/ArcGisFeature/Mocks.d.ts.map +0 -1
- package/lib/esm/test/ArcGisFeature/Mocks.js +0 -16
- package/lib/esm/test/ArcGisFeature/Mocks.js.map +0 -1
- package/lib/esm/test/ArcGisFeature/NewYorkDataset.d.ts +0 -56
- package/lib/esm/test/ArcGisFeature/NewYorkDataset.d.ts.map +0 -1
- package/lib/esm/test/ArcGisFeature/NewYorkDataset.js +0 -417
- package/lib/esm/test/ArcGisFeature/NewYorkDataset.js.map +0 -1
- package/lib/esm/test/ArcGisFeature/PhillyLandmarksDataset.d.ts +0 -1043
- package/lib/esm/test/ArcGisFeature/PhillyLandmarksDataset.d.ts.map +0 -1
- package/lib/esm/test/ArcGisFeature/PhillyLandmarksDataset.js +0 -424
- package/lib/esm/test/ArcGisFeature/PhillyLandmarksDataset.js.map +0 -1
- package/lib/esm/tsconfig.tsbuildinfo +0 -1
- package/lib/test/junit_results.xml +0 -159
- package/map-layers-formats.build.log +0 -30
- package/src/ArcGisFeature/ArcGisFeatureFormat.ts +0 -16
- package/src/ArcGisFeature/ArcGisFeatureJSON.ts +0 -155
- package/src/ArcGisFeature/ArcGisFeaturePBF.ts +0 -215
- package/src/ArcGisFeature/ArcGisFeatureProvider.ts +0 -487
- package/src/ArcGisFeature/ArcGisFeatureQuery.ts +0 -226
- package/src/ArcGisFeature/ArcGisFeatureReader.ts +0 -46
- package/src/ArcGisFeature/ArcGisFeatureRenderer.ts +0 -171
- package/src/ArcGisFeature/ArcGisFeatureResponse.ts +0 -72
- package/src/ArcGisFeature/ArcGisSymbologyRenderer.ts +0 -249
- package/src/ArcGisFeature/esriPBuffer.gen.ts +0 -2612
- package/src/map-layers-formats.ts +0 -15
- package/src/mapLayersFormats.ts +0 -26
- package/src/test/ArcGisFeature/ArcGisFeatureFeatureFormats.test.ts +0 -46
- package/src/test/ArcGisFeature/ArcGisFeatureJSON.test.ts +0 -202
- package/src/test/ArcGisFeature/ArcGisFeaturePBF.test.ts +0 -227
- package/src/test/ArcGisFeature/ArcGisFeatureProvider.test.ts +0 -805
- package/src/test/ArcGisFeature/ArcGisFeatureQuery.test.ts +0 -117
- package/src/test/ArcGisFeature/ArcGisFeatureRenderer.test.ts +0 -296
- package/src/test/ArcGisFeature/ArcGisFeatureResponse.test.ts +0 -109
- package/src/test/ArcGisFeature/ArcGisSymbologyRenderer.test.ts +0 -77
- package/src/test/ArcGisFeature/Mocks.ts +0 -19
- package/src/test/ArcGisFeature/NewYorkDataset.ts +0 -423
- package/src/test/ArcGisFeature/PhillyLandmarksDataset.ts +0 -455
- package/tsconfig.json +0 -20
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ArcGisFeatureQuery.js","sourceRoot":"","sources":["../../../src/ArcGisFeature/ArcGisFeatureQuery.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AA+G/F,gBAAgB;AAChB,MAAM,OAAO,kBAAkB;IAmB7B,gDAAgD;IAChD,sEAAsE;IACtE,YAAmB,OAAe,EAAE,QAAgB,EAAE,MAA2B,EAAE,KAAa,EAAE,MAAiC;QACjI,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QAEnB,IAAI,MAAM,KAAK,SAAS,EAAE;YACxB,IAAI,CAAC,iBAAiB,GAAG,MAAM,CAAC,iBAAiB,CAAC;YAClD,IAAI,CAAC,YAAY,GAAG,MAAM,CAAC,YAAY,CAAC;YACxC,IAAI,CAAC,cAAc,GAAG,MAAM,CAAC,cAAc,CAAC;YAC5C,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;YAChC,IAAI,CAAC,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;YACpC,IAAI,CAAC,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;YACpC,IAAI,CAAC,oBAAoB,GAAG,MAAM,CAAC,oBAAoB,CAAC;YACxD,IAAI,CAAC,2BAA2B,GAAG,MAAM,CAAC,2BAA2B,CAAC;YACtE,IAAI,CAAC,kBAAkB,GAAG,MAAM,CAAC,sBAAsB,CAAC;YACxD,IAAI,CAAC,SAAS,GAAG,MAAM,CAAC,SAAS,CAAC;YAClC,IAAI,CAAC,QAA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AAE,IAAI,CAAC,SAAS,CAAC,CAAC;SACvD;QAED,IAAI,IAAI,CAAC,QAAQ,EAAE;YACjB,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC,UAAU,EAAE,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;SACzD;QAED,OAAO,GAAG,CAAC,QAAQ,EAAE,CAAC;IACxB,CAAC;CAEF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @internal */\r\nexport type ArcGisFeatureResultType = \"none\" | \"standard\" | \"tile\";\r\n\r\n/** @internal */\r\nexport type ArcGisFeatureGeometryType =\r\n \"esriGeometryNull\"\r\n | \"esriGeometryPoint\"\r\n | \"esriGeometryMultipoint\"\r\n | \"esriGeometryLine\"\r\n | \"esriGeometryCircularArc\"\r\n | \"esriGeometryEllipticArc\"\r\n | \"esriGeometryBezier3Curve\"\r\n | \"esriGeometryPath\"\r\n | \"esriGeometryPolyline\"\r\n | \"esriGeometryRing\"\r\n | \"esriGeometryPolygon\"\r\n | \"esriGeometryEnvelope\"\r\n | \"esriGeometryAny\"\r\n | \"esriGeometryBag\"\r\n | \"esriGeometryMultiPatch\"\r\n | \"esriGeometryTriangleStrip\"\r\n | \"esriGeometryTriangeFan\"\r\n | \"esriGeometryRay\"\r\n | \"esriGeometrySphere\"\r\n | \"esriGeometryTriangles\";\r\n\r\n/** @internal */\r\nexport type ArcGisFeatureSpatialRel = \"esriSpatialRelIntersects\" | \"esriSpatialRelContains\" | \"esriSpatialRelCrosses\" | \"esriSpatialRelEnvelopeIntersects\" | \"esriSpatialRelIndexIntersects\" | \"esriSpatialRelOverlaps\" | \"esriSpatialRelTouches\" | \"esriSpatialRelWithin\";\r\n\r\n/** @internal */\r\nexport interface ArcGisGeometry {\r\n type: ArcGisFeatureGeometryType;\r\n geom: ArcGisExtent | ArcGisPointGeometry;\r\n}\r\n\r\n/** @internal */\r\nexport interface ArcGisSpatialReference {\r\n wkid: number;\r\n latestWkid: number;\r\n}\r\n\r\n/** @internal */\r\nexport interface ArcGisExtent {\r\n xmin: number;\r\n xmax: number;\r\n ymin: number;\r\n ymax: number;\r\n spatialReference: ArcGisSpatialReference;\r\n}\r\n\r\n/** @internal */\r\nexport interface ArcGisPointGeometry {\r\n x: number;\r\n y: number;\r\n spatialReference: ArcGisSpatialReference;\r\n}\r\n\r\n/** @internal */\r\nexport interface FeatureQueryQuantizationParams {\r\n extent: ArcGisExtent;\r\n mode: \"view\" | \"edit\";\r\n originPosition: \"upperLeft\" | \"lowerLeft\";\r\n tolerance: number;\r\n}\r\n\r\n/** @internal */\r\nexport type ArcGisFeatureFormat = \"JSON\" | \"PBF\";\r\n\r\n// Based on official documentation:\r\n// https://developers.arcgis.com/rest/services-reference/query-feature-service-layer-.htm\r\n/** @internal */\r\nexport interface ArcGisFeatureQueryParams {\r\n\r\n /** This option can be used for fetching query results up to the resultRecordCount specified.\r\n * When resultOffset is specified but this parameter is not, the map service defaults it to maxRecordCount.\r\n * The maximum value for this parameter is the value of the layer's maxRecordCount property.\r\n * The minimum value entered for this parameter cannot be below 1.\r\n * This parameter only applies if supportsPagination is true.\r\n * */\r\n resultRecordCount?: number;\r\n\r\n /** This option can be used for fetching query results up to the resultRecordCount specified.\r\n * When resultOffset is specified but this parameter is not, the map service defaults it to maxRecordCount.\r\n * The maximum value for this parameter is the value of the layer's maxRecordCount property.\r\n * The minimum value entered for this parameter cannot be below 1.\r\n * This parameter only applies if supportsPagination is true.\r\n * */\r\n resultOffset?: number;\r\n\r\n /** If true, the result includes the geometry associated with each feature returned. */\r\n returnGeometry?: boolean;\r\n geometry?: ArcGisGeometry;\r\n geometryType?: ArcGisFeatureGeometryType;\r\n spatialRel?: ArcGisFeatureSpatialRel;\r\n resultType?: ArcGisFeatureResultType;\r\n maxRecordCountFactor?: number;\r\n returnExceededLimitFeatures?: boolean;\r\n quantizationParameters?: FeatureQueryQuantizationParams;\r\n\r\n /** The list of fields to be included in the returned result set. This list is a comma-delimited list of field names.\r\n * You can also specify the wildcard \"*\" as the value of this parameter.\r\n * */\r\n outFields?: string;\r\n\r\n /** The buffer distance for the input geometries.\r\n * */\r\n distance?: number;\r\n}\r\n\r\n/** @internal */\r\nexport class ArcGisFeatureQuery {\r\n public baseUrl: string;\r\n public layerIdx: number;\r\n public format: ArcGisFeatureFormat;\r\n public resultRecordCount?: number;\r\n public resultOffset?: number;\r\n public returnGeometry?: boolean;\r\n public geometry?: ArcGisGeometry;\r\n public spatialRel?: ArcGisFeatureSpatialRel;\r\n public resultType?: ArcGisFeatureResultType;\r\n public maxRecordCountFactor?: number;\r\n public returnExceededLimitFeatures?: boolean;\r\n public outSR: number;\r\n public outFields?: string;\r\n public distance?: number;\r\n\r\n // public envelopeFilter?: CartographicRange;\r\n public quantizationParams?: FeatureQueryQuantizationParams;\r\n\r\n // base url is expected ito be in the format of:\r\n // https://<hostname>/arcgis/rest/services/<ServiceName>/FeatureServer\r\n public constructor(baseUrl: string, layerIdx: number, format: ArcGisFeatureFormat, outSR: number, params?: ArcGisFeatureQueryParams) {\r\n this.baseUrl = baseUrl;\r\n this.layerIdx = layerIdx;\r\n this.format = format;\r\n this.outSR = outSR;\r\n\r\n if (params !== undefined) {\r\n this.resultRecordCount = params.resultRecordCount;\r\n this.resultOffset = params.resultOffset;\r\n this.returnGeometry = params.returnGeometry;\r\n this.geometry = params.geometry;\r\n this.spatialRel = params.spatialRel;\r\n this.resultType = params.resultType;\r\n this.maxRecordCountFactor = params.maxRecordCountFactor;\r\n this.returnExceededLimitFeatures = params.returnExceededLimitFeatures;\r\n this.quantizationParams = params.quantizationParameters;\r\n this.outFields = params.outFields;\r\n this.distance = params.distance;\r\n }\r\n\r\n }\r\n\r\n public toString() {\r\n const url = new URL(`${this.baseUrl}/${this.layerIdx}/query`);\r\n\r\n url.searchParams.append(\"f\", this.format);\r\n\r\n if ( this.resultRecordCount !== undefined) {\r\n url.searchParams.append(\"resultRecordCount\", `${this.resultRecordCount}`);\r\n }\r\n\r\n if ( this.resultOffset !== undefined) {\r\n url.searchParams.append( \"resultOffset\", `${this.resultOffset}`);\r\n }\r\n\r\n if ( this.returnGeometry !== undefined) {\r\n url.searchParams.append(\"returnGeometry\", this.returnGeometry?\"true\":\"false\");\r\n }\r\n\r\n if ( this.resultType !== undefined) {\r\n url.searchParams.append(\"resultType\", this.resultType);\r\n }\r\n\r\n if ( this.maxRecordCountFactor !== undefined) {\r\n url.searchParams.append( \"maxRecordCountFactor\", `${this.maxRecordCountFactor}`);\r\n }\r\n\r\n if ( this.returnExceededLimitFeatures !== undefined) {\r\n url.searchParams.append( \"returnExceededLimitFeatures\", this.returnExceededLimitFeatures?\"true\":\"false\");\r\n }\r\n\r\n url.searchParams.append( \"outSR\", `${this.outSR}`);\r\n\r\n if (this.geometry || this.spatialRel) {\r\n\r\n if (this.spatialRel) {\r\n url.searchParams.append( \"spatialRel\", this.spatialRel);\r\n }\r\n\r\n if (this.geometry) {\r\n url.searchParams.append( \"geometryType\", this.geometry.type);\r\n\r\n const geomStr = JSON.stringify(this.geometry.geom);\r\n url.searchParams.append( \"geometry\", geomStr);\r\n url.searchParams.append( \"units\", \"esriSRUnit_Meter\"); // required on older server for get feature info\r\n\r\n url.searchParams.append( \"inSR\", `${this.geometry.geom.spatialReference.wkid}`);\r\n }\r\n } else {\r\n // No custom params, fetch all geometries\r\n url.searchParams.append(\"where\", \"1=1\");\r\n }\r\n\r\n if (this.quantizationParams) {\r\n const quantizationParamsStr = JSON.stringify(this.quantizationParams);\r\n url.searchParams.append(\"quantizationParameters\", quantizationParamsStr);\r\n }\r\n\r\n if (this.outFields) {\r\n url.searchParams.append( \"outFields\", this.outFields);\r\n }\r\n\r\n if (this.distance) {\r\n url.searchParams.append(\"distance\", `${this.distance}`);\r\n }\r\n\r\n return url.toString();\r\n }\r\n\r\n}\r\n"]}
|
|
1
|
+
{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AU,EAAE,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;SACzD;QAED,IAAI,IAAI,CAAC,kBAAkB,EAAE;YAC3B,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC,oBAAoB,EAAE,GAAG,IAAI,CAAC,kBAAkB,EAAE,CAAC,CAAC;SAC7E;QAED,OAAO,GAAG,CAAC,QAAQ,EAAE,CAAC;IACxB,CAAC;CAEF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @internal */\r\nexport type ArcGisFeatureResultType = \"none\" | \"standard\" | \"tile\";\r\n\r\n/** @internal */\r\nexport type ArcGisFeatureGeometryType =\r\n \"esriGeometryNull\"\r\n | \"esriGeometryPoint\"\r\n | \"esriGeometryMultipoint\"\r\n | \"esriGeometryLine\"\r\n | \"esriGeometryCircularArc\"\r\n | \"esriGeometryEllipticArc\"\r\n | \"esriGeometryBezier3Curve\"\r\n | \"esriGeometryPath\"\r\n | \"esriGeometryPolyline\"\r\n | \"esriGeometryRing\"\r\n | \"esriGeometryPolygon\"\r\n | \"esriGeometryEnvelope\"\r\n | \"esriGeometryAny\"\r\n | \"esriGeometryBag\"\r\n | \"esriGeometryMultiPatch\"\r\n | \"esriGeometryTriangleStrip\"\r\n | \"esriGeometryTriangeFan\"\r\n | \"esriGeometryRay\"\r\n | \"esriGeometrySphere\"\r\n | \"esriGeometryTriangles\";\r\n\r\n/** @internal */\r\nexport type ArcGisFeatureSpatialRel = \"esriSpatialRelIntersects\" | \"esriSpatialRelContains\" | \"esriSpatialRelCrosses\" | \"esriSpatialRelEnvelopeIntersects\" | \"esriSpatialRelIndexIntersects\" | \"esriSpatialRelOverlaps\" | \"esriSpatialRelTouches\" | \"esriSpatialRelWithin\";\r\n\r\n/** @internal */\r\nexport interface ArcGisGeometry {\r\n type: ArcGisFeatureGeometryType;\r\n geom: ArcGisExtent | ArcGisPointGeometry;\r\n}\r\n\r\n/** @internal */\r\nexport interface ArcGisSpatialReference {\r\n wkid: number;\r\n latestWkid: number;\r\n}\r\n\r\n/** @internal */\r\nexport interface ArcGisExtent {\r\n xmin: number;\r\n xmax: number;\r\n ymin: number;\r\n ymax: number;\r\n spatialReference: ArcGisSpatialReference;\r\n}\r\n\r\n/** @internal */\r\nexport interface ArcGisPointGeometry {\r\n x: number;\r\n y: number;\r\n spatialReference: ArcGisSpatialReference;\r\n}\r\n\r\n/** @internal */\r\nexport interface FeatureQueryQuantizationParams {\r\n extent: ArcGisExtent;\r\n mode: \"view\" | \"edit\";\r\n originPosition: \"upperLeft\" | \"lowerLeft\";\r\n tolerance: number;\r\n}\r\n\r\n/** @internal */\r\nexport type ArcGisFeatureFormat = \"JSON\" | \"PBF\";\r\n\r\n// Based on official documentation:\r\n// https://developers.arcgis.com/rest/services-reference/query-feature-service-layer-.htm\r\n/** @internal */\r\nexport interface ArcGisFeatureQueryParams {\r\n\r\n /** This option can be used for fetching query results up to the resultRecordCount specified.\r\n * When resultOffset is specified but this parameter is not, the map service defaults it to maxRecordCount.\r\n * The maximum value for this parameter is the value of the layer's maxRecordCount property.\r\n * The minimum value entered for this parameter cannot be below 1.\r\n * This parameter only applies if supportsPagination is true.\r\n * */\r\n resultRecordCount?: number;\r\n\r\n /** This option can be used for fetching query results up to the resultRecordCount specified.\r\n * When resultOffset is specified but this parameter is not, the map service defaults it to maxRecordCount.\r\n * The maximum value for this parameter is the value of the layer's maxRecordCount property.\r\n * The minimum value entered for this parameter cannot be below 1.\r\n * This parameter only applies if supportsPagination is true.\r\n * */\r\n resultOffset?: number;\r\n\r\n /** If true, the result includes the geometry associated with each feature returned. */\r\n returnGeometry?: boolean;\r\n geometry?: ArcGisGeometry;\r\n geometryType?: ArcGisFeatureGeometryType;\r\n spatialRel?: ArcGisFeatureSpatialRel;\r\n resultType?: ArcGisFeatureResultType;\r\n maxRecordCountFactor?: number;\r\n returnExceededLimitFeatures?: boolean;\r\n quantizationParameters?: FeatureQueryQuantizationParams;\r\n\r\n /** Maximum Allowable Offset means the map distance ( usually per pixel) within which two points are considered identical.\r\n * It is used to generalize thus reduce the number of points\r\n* */\r\n maxAllowableOffset?: number;\r\n\r\n /** The list of fields to be included in the returned result set. This list is a comma-delimited list of field names.\r\n * You can also specify the wildcard \"*\" as the value of this parameter.\r\n * */\r\n outFields?: string;\r\n\r\n /** The buffer distance for the input geometries.\r\n * */\r\n distance?: number;\r\n}\r\n\r\n/** @internal */\r\nexport class ArcGisFeatureQuery {\r\n public baseUrl: string;\r\n public layerIdx: number;\r\n public format: ArcGisFeatureFormat;\r\n public resultRecordCount?: number;\r\n public resultOffset?: number;\r\n public returnGeometry?: boolean;\r\n public geometry?: ArcGisGeometry;\r\n public spatialRel?: ArcGisFeatureSpatialRel;\r\n public resultType?: ArcGisFeatureResultType;\r\n public maxRecordCountFactor?: number;\r\n public returnExceededLimitFeatures?: boolean;\r\n public outSR: number;\r\n public outFields?: string;\r\n public distance?: number;\r\n public maxAllowableOffset?: number;\r\n\r\n // public envelopeFilter?: CartographicRange;\r\n public quantizationParams?: FeatureQueryQuantizationParams;\r\n\r\n // base url is expected ito be in the format of:\r\n // https://<hostname>/arcgis/rest/services/<ServiceName>/FeatureServer\r\n public constructor(baseUrl: string, layerIdx: number, format: ArcGisFeatureFormat, outSR: number, params?: ArcGisFeatureQueryParams) {\r\n this.baseUrl = baseUrl;\r\n this.layerIdx = layerIdx;\r\n this.format = format;\r\n this.outSR = outSR;\r\n\r\n if (params !== undefined) {\r\n this.resultRecordCount = params.resultRecordCount;\r\n this.resultOffset = params.resultOffset;\r\n this.returnGeometry = params.returnGeometry;\r\n this.geometry = params.geometry;\r\n this.spatialRel = params.spatialRel;\r\n this.resultType = params.resultType;\r\n this.maxRecordCountFactor = params.maxRecordCountFactor;\r\n this.returnExceededLimitFeatures = params.returnExceededLimitFeatures;\r\n this.quantizationParams = params.quantizationParameters;\r\n this.outFields = params.outFields;\r\n this.distance = params.distance;\r\n this.maxAllowableOffset = params.maxAllowableOffset;\r\n }\r\n\r\n }\r\n\r\n public toString() {\r\n const url = new URL(`${this.baseUrl}/${this.layerIdx}/query`);\r\n\r\n url.searchParams.append(\"f\", this.format);\r\n\r\n if ( this.resultRecordCount !== undefined) {\r\n url.searchParams.append(\"resultRecordCount\", `${this.resultRecordCount}`);\r\n }\r\n\r\n if ( this.resultOffset !== undefined) {\r\n url.searchParams.append( \"resultOffset\", `${this.resultOffset}`);\r\n }\r\n\r\n if ( this.returnGeometry !== undefined) {\r\n url.searchParams.append(\"returnGeometry\", this.returnGeometry?\"true\":\"false\");\r\n }\r\n\r\n if ( this.resultType !== undefined) {\r\n url.searchParams.append(\"resultType\", this.resultType);\r\n }\r\n\r\n if ( this.maxRecordCountFactor !== undefined) {\r\n url.searchParams.append( \"maxRecordCountFactor\", `${this.maxRecordCountFactor}`);\r\n }\r\n\r\n if ( this.returnExceededLimitFeatures !== undefined) {\r\n url.searchParams.append( \"returnExceededLimitFeatures\", this.returnExceededLimitFeatures?\"true\":\"false\");\r\n }\r\n\r\n url.searchParams.append( \"outSR\", `${this.outSR}`);\r\n\r\n if (this.geometry || this.spatialRel) {\r\n\r\n if (this.spatialRel) {\r\n url.searchParams.append( \"spatialRel\", this.spatialRel);\r\n }\r\n\r\n if (this.geometry) {\r\n url.searchParams.append( \"geometryType\", this.geometry.type);\r\n\r\n const geomStr = JSON.stringify(this.geometry.geom);\r\n url.searchParams.append( \"geometry\", geomStr);\r\n url.searchParams.append( \"units\", \"esriSRUnit_Meter\"); // required on older server for get feature info\r\n\r\n url.searchParams.append( \"inSR\", `${this.geometry.geom.spatialReference.wkid}`);\r\n }\r\n } else {\r\n // No custom params, fetch all geometries\r\n url.searchParams.append(\"where\", \"1=1\");\r\n }\r\n\r\n if (this.quantizationParams) {\r\n const quantizationParamsStr = JSON.stringify(this.quantizationParams);\r\n url.searchParams.append(\"quantizationParameters\", quantizationParamsStr);\r\n }\r\n\r\n if (this.outFields) {\r\n url.searchParams.append( \"outFields\", this.outFields);\r\n }\r\n\r\n if (this.distance) {\r\n url.searchParams.append(\"distance\", `${this.distance}`);\r\n }\r\n\r\n if (this.maxAllowableOffset) {\r\n url.searchParams.append(\"maxAllowableOffset\", `${this.maxAllowableOffset}`);\r\n }\r\n\r\n return url.toString();\r\n }\r\n\r\n}\r\n"]}
|
|
@@ -1,17 +1,26 @@
|
|
|
1
1
|
import { Primitives, StandardTypeNames } from "@itwin/appui-abstract";
|
|
2
2
|
import { ImageMapLayerSettings } from "@itwin/core-common";
|
|
3
|
-
import { MapLayerFeatureInfo } from "@itwin/core-frontend";
|
|
4
|
-
import { ArcGisFeatureRenderer } from "./ArcGisFeatureRenderer";
|
|
3
|
+
import { ArcGisGeometryRenderer, ArcGisGraphicsRenderer, MapLayerFeatureInfo } from "@itwin/core-frontend";
|
|
5
4
|
import { ArcGisResponseData } from "./ArcGisFeatureResponse";
|
|
6
|
-
/**
|
|
7
|
-
|
|
5
|
+
/** Interface defining minimal implementation needed to create an ArcGIS geometry reader,
|
|
6
|
+
* needed by the [[ArcGisFeatureProvider]].
|
|
7
|
+
* @internal
|
|
8
|
+
*/
|
|
9
|
+
export interface ArcGisFeatureReader {
|
|
10
|
+
readAndRender: (response: ArcGisResponseData, renderer: ArcGisGeometryRenderer) => Promise<void>;
|
|
11
|
+
readFeatureInfo: (response: ArcGisResponseData, featureInfos: MapLayerFeatureInfo[], renderer: ArcGisGraphicsRenderer) => Promise<void>;
|
|
12
|
+
}
|
|
13
|
+
/** Internal implementation of [[ArcGisFeatureReader]]
|
|
14
|
+
* @internal
|
|
15
|
+
*/
|
|
16
|
+
export declare abstract class ArcGisBaseFeatureReader implements ArcGisFeatureReader {
|
|
8
17
|
floatPrecision: number | undefined;
|
|
9
18
|
forceDateDisplayValueToIso: boolean;
|
|
10
19
|
protected _settings: ImageMapLayerSettings;
|
|
11
20
|
protected _layerMetadata: any;
|
|
12
21
|
constructor(settings: ImageMapLayerSettings, layerMetadata: any);
|
|
13
|
-
abstract readAndRender(response: ArcGisResponseData,
|
|
14
|
-
abstract readFeatureInfo(response: ArcGisResponseData, featureInfos: MapLayerFeatureInfo[]): void
|
|
22
|
+
abstract readAndRender(response: ArcGisResponseData, renderer: ArcGisGeometryRenderer): Promise<void>;
|
|
23
|
+
abstract readFeatureInfo(response: ArcGisResponseData, featureInfos: MapLayerFeatureInfo[], renderer: ArcGisGraphicsRenderer): Promise<void>;
|
|
15
24
|
protected toFixedWithoutPadding: (value: number) => number;
|
|
16
25
|
protected getDisplayValue: (typename: StandardTypeNames, value: Primitives.Value | undefined) => string;
|
|
17
26
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ArcGisFeatureReader.d.ts","sourceRoot":"","sources":["../../../src/ArcGisFeature/ArcGisFeatureReader.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AACtE,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"ArcGisFeatureReader.d.ts","sourceRoot":"","sources":["../../../src/ArcGisFeature/ArcGisFeatureReader.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AACtE,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC3G,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAE7D;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC,aAAa,EAAE,CAAC,QAAQ,EAAE,kBAAkB,EAAE,QAAQ,EAAE,sBAAsB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACjG,eAAe,EAAE,CAAC,QAAQ,EAAE,kBAAkB,EAAE,YAAY,EAAE,mBAAmB,EAAE,EAAE,QAAQ,EAAE,sBAAsB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACzI;AAED;;GAEG;AACH,8BAAsB,uBAAwB,YAAW,mBAAmB;IAEnE,cAAc,EAAE,MAAM,GAAC,SAAS,CAAC;IAIjC,0BAA0B,UAAS;IAE1C,SAAS,CAAC,SAAS,EAAE,qBAAqB,CAAC;IAC3C,SAAS,CAAC,cAAc,EAAE,GAAG,CAAC;gBAEX,QAAQ,EAAE,qBAAqB,EAAE,aAAa,EAAE,GAAG;aAKtD,aAAa,CAAC,QAAQ,EAAE,kBAAkB,EAAE,QAAQ,EAAE,sBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC;aAC5F,eAAe,CAAC,QAAQ,EAAE,kBAAkB,EAAE,YAAY,EAAE,mBAAmB,EAAE,EAAE,QAAQ,EAAE,sBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC;IAEnJ,SAAS,CAAE,qBAAqB,UAAW,MAAM,YAE/C;IAEF,SAAS,CAAC,eAAe,aAAc,iBAAiB,SAAS,WAAW,KAAK,GAAC,SAAS,YAQzF;CACH"}
|
|
@@ -3,8 +3,10 @@
|
|
|
3
3
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
5
|
import { StandardTypeNames } from "@itwin/appui-abstract";
|
|
6
|
-
/**
|
|
7
|
-
|
|
6
|
+
/** Internal implementation of [[ArcGisFeatureReader]]
|
|
7
|
+
* @internal
|
|
8
|
+
*/
|
|
9
|
+
export class ArcGisBaseFeatureReader {
|
|
8
10
|
constructor(settings, layerMetadata) {
|
|
9
11
|
// Force display value of date to ISO 8601 format.
|
|
10
12
|
// Turning this ON, will disable display value in end-user's locale
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ArcGisFeatureReader.js","sourceRoot":"","sources":["../../../src/ArcGisFeature/ArcGisFeatureReader.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F,OAAO,EAAc,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"ArcGisFeatureReader.js","sourceRoot":"","sources":["../../../src/ArcGisFeature/ArcGisFeatureReader.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F,OAAO,EAAc,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AActE;;GAEG;AACH,MAAM,OAAgB,uBAAuB;IAW3C,YAAmB,QAA+B,EAAE,aAAkB;QAPtE,kDAAkD;QAClD,mEAAmE;QAC5D,+BAA0B,GAAG,KAAK,CAAC;QAa/B,0BAAqB,GAAG,CAAC,KAAa,EAAE,EAAE;YACnD,OAAO,CAAC,IAAI,CAAC,cAAc,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;QACtG,CAAC,CAAC;QAEQ,oBAAe,GAAG,CAAC,QAA2B,EAAE,KAAiC,EAAE,EAAE;YAC7F,IAAI,KAAK,KAAK,SAAS,EAAE;gBACvB,OAAQ,EAAE,CAAC;aACZ;iBAAM,IAAK,QAAQ,KAAK,iBAAiB,CAAC,QAAQ,IAAI,IAAI,CAAC,0BAA0B,EAAE;gBACtF,OAAQ,KAAc,CAAC,WAAW,EAAE,CAAC;aACtC;iBAAM;gBACL,OAAO,GAAG,KAAK,EAAE,CAAC;aACnB;QACH,CAAC,CAAC;QAnBA,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,IAAI,CAAC,cAAc,GAAG,aAAa,CAAC;IACtC,CAAC;CAkBF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\nimport { Primitives, StandardTypeNames } from \"@itwin/appui-abstract\";\r\nimport { ImageMapLayerSettings } from \"@itwin/core-common\";\r\nimport { ArcGisGeometryRenderer, ArcGisGraphicsRenderer, MapLayerFeatureInfo } from \"@itwin/core-frontend\";\r\nimport { ArcGisResponseData } from \"./ArcGisFeatureResponse\";\r\n\r\n/** Interface defining minimal implementation needed to create an ArcGIS geometry reader,\r\n * needed by the [[ArcGisFeatureProvider]].\r\n * @internal\r\n */\r\nexport interface ArcGisFeatureReader {\r\n readAndRender: (response: ArcGisResponseData, renderer: ArcGisGeometryRenderer) => Promise<void>;\r\n readFeatureInfo: (response: ArcGisResponseData, featureInfos: MapLayerFeatureInfo[], renderer: ArcGisGraphicsRenderer) => Promise<void>;\r\n}\r\n\r\n/** Internal implementation of [[ArcGisFeatureReader]]\r\n * @internal\r\n */\r\nexport abstract class ArcGisBaseFeatureReader implements ArcGisFeatureReader {\r\n // Optionally you can set the floating precision\r\n public floatPrecision: number|undefined;\r\n\r\n // Force display value of date to ISO 8601 format.\r\n // Turning this ON, will disable display value in end-user's locale\r\n public forceDateDisplayValueToIso = false;\r\n\r\n protected _settings: ImageMapLayerSettings;\r\n protected _layerMetadata: any;\r\n\r\n public constructor(settings: ImageMapLayerSettings, layerMetadata: any) {\r\n this._settings = settings;\r\n this._layerMetadata = layerMetadata;\r\n }\r\n\r\n public abstract readAndRender(response: ArcGisResponseData, renderer: ArcGisGeometryRenderer): Promise<void>;\r\n public abstract readFeatureInfo(response: ArcGisResponseData, featureInfos: MapLayerFeatureInfo[], renderer: ArcGisGraphicsRenderer): Promise<void>;\r\n\r\n protected toFixedWithoutPadding = (value: number) => {\r\n return (this.floatPrecision === undefined ? value : parseFloat(value.toFixed(this.floatPrecision)));\r\n };\r\n\r\n protected getDisplayValue = (typename: StandardTypeNames, value: Primitives.Value|undefined) => {\r\n if (value === undefined) {\r\n return \"\";\r\n } else if ( typename === StandardTypeNames.DateTime && this.forceDateDisplayValueToIso) {\r\n return (value as Date).toISOString();\r\n } else {\r\n return `${value}`;\r\n }\r\n };\r\n}\r\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ImageMapLayerSettings } from "@itwin/core-common";
|
|
2
|
+
import { ArcGisGeometryRenderer, ArcGisGraphicsRenderer, MapLayerFeatureInfo } from "@itwin/core-frontend";
|
|
3
|
+
import { Transform } from "@itwin/core-geometry";
|
|
4
|
+
import { ArcGisBaseFeatureReader } from "./ArcGisFeatureReader";
|
|
5
|
+
import { ArcGisResponseData } from "./ArcGisFeatureResponse";
|
|
6
|
+
/** @internal */
|
|
7
|
+
export declare class ArcGisJsonFeatureReader extends ArcGisBaseFeatureReader {
|
|
8
|
+
transform: Transform | undefined;
|
|
9
|
+
constructor(settings: ImageMapLayerSettings, layerMetadata: any);
|
|
10
|
+
private applySymbologyAttributes;
|
|
11
|
+
readAndRender(response: ArcGisResponseData, renderer: ArcGisGeometryRenderer): Promise<void>;
|
|
12
|
+
readFeatureInfo(response: ArcGisResponseData, featureInfos: MapLayerFeatureInfo[], renderer?: ArcGisGraphicsRenderer): Promise<void>;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=ArcGisJsonFeatureReader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ArcGisJsonFeatureReader.d.ts","sourceRoot":"","sources":["../../../src/ArcGisFeature/ArcGisJsonFeatureReader.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAA4D,sBAAsB,EAAE,sBAAsB,EAA6C,mBAAmB,EAAyB,MAAM,sBAAsB,CAAC;AACvO,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,EAAmB,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAE9E,gBAAgB;AAChB,qBAAa,uBAAwB,SAAQ,uBAAuB;IAC3D,SAAS,EAAE,SAAS,GAAG,SAAS,CAAC;gBAErB,QAAQ,EAAE,qBAAqB,EAAE,aAAa,EAAE,GAAG;IAKtE,OAAO,CAAC,wBAAwB;IAcnB,aAAa,CAAC,QAAQ,EAAE,kBAAkB,EAAE,QAAQ,EAAE,sBAAsB;IAkB5E,eAAe,CAAC,QAAQ,EAAE,kBAAkB,EAAE,YAAY,EAAE,mBAAmB,EAAE,EAAE,QAAQ,CAAC,EAAE,sBAAsB;CAoGlI"}
|
|
@@ -3,59 +3,41 @@
|
|
|
3
3
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
5
|
import { PropertyValueFormat, StandardTypeNames } from "@itwin/appui-abstract";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
6
|
+
import { ArcGisGeometryReaderJSON } from "@itwin/core-frontend";
|
|
7
|
+
import { ArcGisBaseFeatureReader } from "./ArcGisFeatureReader";
|
|
8
8
|
/** @internal */
|
|
9
|
-
export class
|
|
9
|
+
export class ArcGisJsonFeatureReader extends ArcGisBaseFeatureReader {
|
|
10
10
|
constructor(settings, layerMetadata) {
|
|
11
11
|
super(settings, layerMetadata);
|
|
12
12
|
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
if (feature?.geometry?.rings) {
|
|
22
|
-
for (const ring of feature?.geometry?.rings) {
|
|
23
|
-
offset = ArcGisFeatureJSON.deflateCoordinates(ring, coords, 2, offset);
|
|
24
|
-
lengths.push(ring.length);
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
else if (feature?.geometry?.paths) {
|
|
28
|
-
for (const path of feature?.geometry?.paths) {
|
|
29
|
-
offset = ArcGisFeatureJSON.deflateCoordinates(path, coords, 2, offset);
|
|
30
|
-
lengths.push(path.length);
|
|
13
|
+
applySymbologyAttributes(attrSymbology, feature) {
|
|
14
|
+
if (attrSymbology && feature) {
|
|
15
|
+
const symbolFields = attrSymbology.rendererFields;
|
|
16
|
+
if (symbolFields && symbolFields.length > 0 && feature.attributes) {
|
|
17
|
+
const featureAttr = {};
|
|
18
|
+
for (const [attrKey, attrValue] of Object.entries(feature.attributes))
|
|
19
|
+
if (symbolFields.includes(attrKey)) {
|
|
20
|
+
featureAttr[attrKey] = attrValue;
|
|
31
21
|
}
|
|
32
|
-
|
|
33
|
-
renderer.renderPath(lengths, coords, fill, 2, renderer.transform === undefined);
|
|
22
|
+
attrSymbology.setActiveFeatureAttributes(featureAttr);
|
|
34
23
|
}
|
|
35
24
|
}
|
|
36
|
-
|
|
25
|
+
}
|
|
26
|
+
async readAndRender(response, renderer) {
|
|
27
|
+
const responseObj = response.data;
|
|
28
|
+
if (responseObj.geometryType) {
|
|
29
|
+
const attrSymbology = renderer.attributeSymbology;
|
|
30
|
+
const geomReader = new ArcGisGeometryReaderJSON(responseObj.geometryType, renderer, renderer.transform === undefined);
|
|
37
31
|
for (const feature of responseObj.features) {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
const coords = [feature.geometry.x, feature.geometry.y];
|
|
42
|
-
renderer.renderPoint(lengths, coords, 2, renderer.transform === undefined);
|
|
32
|
+
if (attrSymbology) {
|
|
33
|
+
// Read attributes if needed (attribute driven symbology)
|
|
34
|
+
this.applySymbologyAttributes(attrSymbology, feature);
|
|
43
35
|
}
|
|
36
|
+
await geomReader.readGeometry(feature.geometry);
|
|
44
37
|
}
|
|
45
38
|
}
|
|
46
39
|
}
|
|
47
|
-
|
|
48
|
-
// stride is the number of dimensions
|
|
49
|
-
// https://github.com/openlayers/openlayers/blob/7a2f87caca9ddc1912d910f56eb5637445fc11f6/src/ol/geom/flat/deflate.js#L26
|
|
50
|
-
static deflateCoordinates(coordinates, flatCoordinates, stride, offset) {
|
|
51
|
-
for (let i = 0, ii = coordinates.length; i < ii; ++i) {
|
|
52
|
-
const coordinate = coordinates[i];
|
|
53
|
-
for (let j = 0; j < stride; ++j)
|
|
54
|
-
flatCoordinates[offset++] = coordinate[j];
|
|
55
|
-
}
|
|
56
|
-
return offset;
|
|
57
|
-
}
|
|
58
|
-
readFeatureInfo(response, featureInfos) {
|
|
40
|
+
async readFeatureInfo(response, featureInfos, renderer) {
|
|
59
41
|
const responseObj = response.data;
|
|
60
42
|
if (responseObj === undefined || !Array.isArray(responseObj.features))
|
|
61
43
|
return;
|
|
@@ -108,22 +90,36 @@ export class ArcGisFeatureJSON extends ArcGisFeatureReader {
|
|
|
108
90
|
}
|
|
109
91
|
const typename = getStandardTypeName(fieldType);
|
|
110
92
|
propertyValue.displayValue = this.getDisplayValue(typename, propertyValue.value);
|
|
111
|
-
return
|
|
93
|
+
return { value: propertyValue, property: { name: fieldName, displayLabel: fieldName, typename } };
|
|
112
94
|
};
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
95
|
+
let geomReader;
|
|
96
|
+
if (renderer && responseObj?.geometryType) {
|
|
97
|
+
geomReader = new ArcGisGeometryReaderJSON(responseObj.geometryType, renderer);
|
|
98
|
+
}
|
|
99
|
+
// Each feature response represent a single sub-layer, no need to check for existing entry.
|
|
100
|
+
const subLayerInfo = {
|
|
101
|
+
subLayerName: this._layerMetadata.name,
|
|
102
|
+
displayFieldName: this._layerMetadata.name,
|
|
103
|
+
features: [],
|
|
104
|
+
};
|
|
105
|
+
// Read all features attributes / geometries
|
|
106
|
+
for (const responseFeature of responseObj.features) {
|
|
107
|
+
const feature = { attributes: [] };
|
|
108
|
+
for (const [key, value] of Object.entries(responseFeature.attributes))
|
|
109
|
+
feature.attributes?.push(getRecordInfo(key, value));
|
|
110
|
+
if (geomReader) {
|
|
111
|
+
await geomReader.readGeometry(responseFeature.geometry);
|
|
112
|
+
const graphics = renderer.moveGraphics();
|
|
113
|
+
feature.geometries = graphics.map((graphic) => {
|
|
114
|
+
return { graphic };
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
subLayerInfo.features.push(feature);
|
|
125
118
|
}
|
|
119
|
+
if (layerInfo.subLayerInfos === undefined)
|
|
120
|
+
layerInfo.subLayerInfos = [];
|
|
121
|
+
layerInfo.subLayerInfos.push(subLayerInfo);
|
|
126
122
|
featureInfos.push(layerInfo);
|
|
127
123
|
}
|
|
128
124
|
}
|
|
129
|
-
//# sourceMappingURL=
|
|
125
|
+
//# sourceMappingURL=ArcGisJsonFeatureReader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ArcGisJsonFeatureReader.js","sourceRoot":"","sources":["../../../src/ArcGisFeature/ArcGisJsonFeatureReader.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F,OAAO,EAAkB,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE/F,OAAO,EAAkC,wBAAwB,EAAyI,MAAM,sBAAsB,CAAC;AAEvO,OAAO,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAGhE,gBAAgB;AAChB,MAAM,OAAO,uBAAwB,SAAQ,uBAAuB;IAGlE,YAAmB,QAA+B,EAAE,aAAkB;QACpE,KAAK,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC;IAEjC,CAAC;IAEO,wBAAwB,CAAC,aAA6C,EAAE,OAAY;QAC1F,IAAI,aAAa,IAAI,OAAO,EAAE;YAC5B,MAAM,YAAY,GAAG,aAAa,CAAC,cAAc,CAAC;YAClD,IAAI,YAAY,IAAI,YAAY,CAAC,MAAM,GAAG,CAAC,IAAI,OAAO,CAAC,UAAU,EAAE;gBACjE,MAAM,WAAW,GAAyB,EAAE,CAAC;gBAC7C,KAAK,MAAM,CAAC,OAAO,EAAE,SAAS,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,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Q,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE;oBAC5C,OAAO,EAAC,OAAO,EAAC,CAAC;gBACnB,CAAC,CAAC,CAAC;aACJ;YACD,YAAY,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;SACrC;QAED,IAAI,SAAS,CAAC,aAAa,KAAK,SAAS;YACvC,SAAS,CAAC,aAAa,GAAG,EAAE,CAAC;QAC/B,SAAS,CAAC,aAAa,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QAE3C,YAAY,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAC/B,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\nimport { PrimitiveValue, PropertyValueFormat, StandardTypeNames } from \"@itwin/appui-abstract\";\r\nimport { ImageMapLayerSettings } from \"@itwin/core-common\";\r\nimport { ArcGisAttributeDrivenSymbology, ArcGisGeometryReaderJSON, ArcGisGeometryRenderer, ArcGisGraphicsRenderer, MapLayerFeature, MapLayerFeatureAttribute, MapLayerFeatureInfo, MapSubLayerFeatureInfo} from \"@itwin/core-frontend\";\r\nimport { Transform } from \"@itwin/core-geometry\";\r\nimport { ArcGisBaseFeatureReader } from \"./ArcGisFeatureReader\";\r\nimport { ArcGisFieldType, ArcGisResponseData } from \"./ArcGisFeatureResponse\";\r\n\r\n/** @internal */\r\nexport class ArcGisJsonFeatureReader extends ArcGisBaseFeatureReader {\r\n public transform: Transform | undefined;\r\n\r\n public constructor(settings: ImageMapLayerSettings, layerMetadata: any) {\r\n super(settings, layerMetadata);\r\n\r\n }\r\n\r\n private applySymbologyAttributes(attrSymbology: ArcGisAttributeDrivenSymbology, feature: any) {\r\n if (attrSymbology && feature) {\r\n const symbolFields = attrSymbology.rendererFields;\r\n if (symbolFields && symbolFields.length > 0 && feature.attributes) {\r\n const featureAttr: {[key: string]: any} = {};\r\n for (const [attrKey, attrValue] of Object.entries(feature.attributes))\r\n if (symbolFields.includes(attrKey)) {\r\n featureAttr[attrKey] = attrValue;\r\n }\r\n attrSymbology.setActiveFeatureAttributes(featureAttr);\r\n }\r\n }\r\n }\r\n\r\n public async readAndRender(response: ArcGisResponseData, renderer: ArcGisGeometryRenderer) {\r\n const responseObj = response.data;\r\n if (responseObj.geometryType) {\r\n const attrSymbology = renderer.attributeSymbology;\r\n\r\n const geomReader = new ArcGisGeometryReaderJSON(responseObj.geometryType, renderer, renderer.transform === undefined);\r\n\r\n for (const feature of responseObj.features) {\r\n if (attrSymbology) {\r\n // Read attributes if needed (attribute driven symbology)\r\n this.applySymbologyAttributes(attrSymbology, feature);\r\n }\r\n\r\n await geomReader.readGeometry(feature.geometry);\r\n }\r\n }\r\n }\r\n\r\n public async readFeatureInfo(response: ArcGisResponseData, featureInfos: MapLayerFeatureInfo[], renderer?: ArcGisGraphicsRenderer) {\r\n const responseObj = response.data;\r\n if (responseObj === undefined || !Array.isArray(responseObj.features))\r\n return;\r\n\r\n const layerInfo: MapLayerFeatureInfo = { layerName: this._settings.name };\r\n\r\n // Create a signature index for every field name / type.\r\n const fieldsType: { [key: string]: ArcGisFieldType } = {};\r\n for (const fieldInfo of responseObj.fields) {\r\n fieldsType[fieldInfo.name] = fieldInfo.type;\r\n }\r\n\r\n const getStandardTypeName = (fieldType: ArcGisFieldType) => {\r\n switch (fieldType) {\r\n case \"esriFieldTypeInteger\":\r\n case \"esriFieldTypeSmallInteger\":\r\n case \"esriFieldTypeOID\":\r\n return StandardTypeNames.Integer;\r\n case \"esriFieldTypeDouble\":\r\n return StandardTypeNames.Double;\r\n case \"esriFieldTypeSingle\":\r\n return StandardTypeNames.Float;\r\n case \"esriFieldTypeDate\":\r\n return StandardTypeNames.DateTime;\r\n default:\r\n return StandardTypeNames.String;\r\n }\r\n };\r\n\r\n const getRecordInfo = (fieldName: string, value: any): MapLayerFeatureAttribute => {\r\n const propertyValue: PrimitiveValue = {valueFormat: PropertyValueFormat.Primitive};\r\n\r\n if (value === null) {\r\n value = undefined;\r\n }\r\n\r\n const strValue = `${value}`;\r\n const fieldType = fieldsType[fieldName];\r\n switch (fieldType) {\r\n case \"esriFieldTypeInteger\":\r\n case \"esriFieldTypeSmallInteger\":\r\n case \"esriFieldTypeOID\":\r\n propertyValue.value = value as number;\r\n break;\r\n case \"esriFieldTypeDouble\":\r\n case \"esriFieldTypeSingle\":\r\n propertyValue.value = this.toFixedWithoutPadding(value);\r\n break;\r\n case \"esriFieldTypeDate\":\r\n propertyValue.value = new Date(value);\r\n break;\r\n default:\r\n if (value !== undefined)\r\n propertyValue.value = strValue;\r\n\r\n break;\r\n }\r\n\r\n const typename = getStandardTypeName(fieldType);\r\n propertyValue.displayValue = this.getDisplayValue(typename, propertyValue.value);\r\n\r\n return {value: propertyValue, property: { name: fieldName, displayLabel: fieldName, typename }};\r\n };\r\n\r\n let geomReader: ArcGisGeometryReaderJSON|undefined;\r\n if (renderer && responseObj?.geometryType) {\r\n geomReader = new ArcGisGeometryReaderJSON(responseObj.geometryType, renderer);\r\n }\r\n\r\n // Each feature response represent a single sub-layer, no need to check for existing entry.\r\n const subLayerInfo: MapSubLayerFeatureInfo = {\r\n subLayerName: this._layerMetadata.name,\r\n displayFieldName: this._layerMetadata.name,\r\n features: [],\r\n };\r\n\r\n // Read all features attributes / geometries\r\n for (const responseFeature of responseObj.features) {\r\n const feature: MapLayerFeature = {attributes: []};\r\n\r\n for (const [key, value] of Object.entries(responseFeature.attributes))\r\n feature.attributes?.push(getRecordInfo(key, value));\r\n\r\n if (geomReader) {\r\n await geomReader.readGeometry(responseFeature.geometry);\r\n const graphics = renderer!.moveGraphics();\r\n feature.geometries = graphics.map((graphic) => {\r\n return {graphic};\r\n });\r\n }\r\n subLayerInfo.features.push(feature);\r\n }\r\n\r\n if (layerInfo.subLayerInfos === undefined)\r\n layerInfo.subLayerInfos = [];\r\n layerInfo.subLayerInfos.push(subLayerInfo);\r\n\r\n featureInfos.push(layerInfo);\r\n }\r\n}\r\n"]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { esriPBuffer } from "../ArcGisFeature/esriPBuffer.gen";
|
|
2
|
+
import { ArcGisGeometryRenderer, ArcGisGraphicsRenderer, MapLayerFeatureAttribute, MapLayerFeatureInfo } from "@itwin/core-frontend";
|
|
3
|
+
import { ImageMapLayerSettings } from "@itwin/core-common";
|
|
4
|
+
import { ArcGisBaseFeatureReader } from "./ArcGisFeatureReader";
|
|
5
|
+
import { ArcGisResponseData } from "./ArcGisFeatureResponse";
|
|
6
|
+
import { ArcGisFeatureGeometryType } from "./ArcGisFeatureQuery";
|
|
7
|
+
interface PbfFieldInfo {
|
|
8
|
+
name: string;
|
|
9
|
+
type: esriPBuffer.FeatureCollectionPBuffer.FieldType;
|
|
10
|
+
}
|
|
11
|
+
/** @internal */
|
|
12
|
+
export declare class ArcGisPbfFeatureReader extends ArcGisBaseFeatureReader {
|
|
13
|
+
constructor(settings: ImageMapLayerSettings, layerMetadata: any);
|
|
14
|
+
static getArcGisFeatureGeometryType(geomType: esriPBuffer.FeatureCollectionPBuffer.GeometryType): ArcGisFeatureGeometryType;
|
|
15
|
+
private getNumericValue;
|
|
16
|
+
getFeatureAttribute(fieldInfo: PbfFieldInfo, attrValue: esriPBuffer.FeatureCollectionPBuffer.Value): MapLayerFeatureAttribute | undefined;
|
|
17
|
+
readAndRender(response: ArcGisResponseData, renderer: ArcGisGeometryRenderer): Promise<void>;
|
|
18
|
+
private applySymbologyAttributes;
|
|
19
|
+
readFeatureInfo(response: ArcGisResponseData, featureInfos: MapLayerFeatureInfo[], renderer?: ArcGisGraphicsRenderer): Promise<void>;
|
|
20
|
+
}
|
|
21
|
+
export {};
|
|
22
|
+
//# sourceMappingURL=ArcGisPbfFeatureReader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ArcGisPbfFeatureReader.d.ts","sourceRoot":"","sources":["../../../src/ArcGisFeature/ArcGisPbfFeatureReader.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAC/D,OAAO,EAAkC,sBAAsB,EAAE,sBAAsB,EAAmB,wBAAwB,EAAE,mBAAmB,EAAyB,MAAM,sBAAsB,CAAC;AAE7M,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAE7D,OAAO,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AAKjE,UAAU,YAAY;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,WAAW,CAAC,wBAAwB,CAAC,SAAS,CAAC;CACtD;AAED,gBAAgB;AAChB,qBAAa,sBAAuB,SAAQ,uBAAuB;gBAC9C,QAAQ,EAAE,qBAAqB,EAAE,aAAa,EAAE,GAAG;WAIxD,4BAA4B,CAAC,QAAQ,EAAE,WAAW,CAAC,wBAAwB,CAAC,YAAY,GAAG,yBAAyB;IAiBlI,OAAO,CAAC,eAAe;IAiChB,mBAAmB,CAAC,SAAS,EAAE,YAAY,EAAE,SAAS,EAAE,WAAW,CAAC,wBAAwB,CAAC,KAAK,GAAG,wBAAwB,GAAC,SAAS;IA2DjI,aAAa,CAAC,QAAQ,EAAE,kBAAkB,EAAE,QAAQ,EAAE,sBAAsB;IA0CzF,OAAO,CAAC,wBAAwB;IA0BnB,eAAe,CAAC,QAAQ,EAAE,kBAAkB,EAAE,YAAY,EAAE,mBAAmB,EAAE,EAAE,QAAQ,CAAC,EAAE,sBAAsB;CAkElI"}
|
|
@@ -0,0 +1,245 @@
|
|
|
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 { esriPBuffer } from "../ArcGisFeature/esriPBuffer.gen";
|
|
6
|
+
import { PropertyValueFormat, StandardTypeNames } from "@itwin/appui-abstract";
|
|
7
|
+
import { ArcGisBaseFeatureReader } from "./ArcGisFeatureReader";
|
|
8
|
+
import { Logger } from "@itwin/core-bentley";
|
|
9
|
+
const esriGeometryType = esriPBuffer.FeatureCollectionPBuffer.GeometryType;
|
|
10
|
+
const loggerCategory = "MapLayersFormats.ArcGISFeature";
|
|
11
|
+
/** @internal */
|
|
12
|
+
export class ArcGisPbfFeatureReader extends ArcGisBaseFeatureReader {
|
|
13
|
+
constructor(settings, layerMetadata) {
|
|
14
|
+
super(settings, layerMetadata);
|
|
15
|
+
}
|
|
16
|
+
static getArcGisFeatureGeometryType(geomType) {
|
|
17
|
+
switch (geomType) {
|
|
18
|
+
case esriPBuffer.FeatureCollectionPBuffer.GeometryType.esriGeometryTypeMultipatch:
|
|
19
|
+
return "esriGeometryMultiPatch";
|
|
20
|
+
case esriPBuffer.FeatureCollectionPBuffer.GeometryType.esriGeometryTypeMultipoint:
|
|
21
|
+
return "esriGeometryMultipoint";
|
|
22
|
+
case esriPBuffer.FeatureCollectionPBuffer.GeometryType.esriGeometryTypePoint:
|
|
23
|
+
return "esriGeometryPoint";
|
|
24
|
+
case esriPBuffer.FeatureCollectionPBuffer.GeometryType.esriGeometryTypePolygon:
|
|
25
|
+
return "esriGeometryPolygon";
|
|
26
|
+
case esriPBuffer.FeatureCollectionPBuffer.GeometryType.esriGeometryTypePolyline:
|
|
27
|
+
return "esriGeometryPolyline";
|
|
28
|
+
default:
|
|
29
|
+
return "esriGeometryNull";
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
getNumericValue(attrValue) {
|
|
33
|
+
const propertyValue = { valueFormat: PropertyValueFormat.Primitive };
|
|
34
|
+
let typename = StandardTypeNames.Number;
|
|
35
|
+
if (attrValue.has_double_value) {
|
|
36
|
+
const value = this.toFixedWithoutPadding(attrValue.double_value);
|
|
37
|
+
propertyValue.value = value;
|
|
38
|
+
typename = StandardTypeNames.Double;
|
|
39
|
+
}
|
|
40
|
+
else if (attrValue.has_float_value) {
|
|
41
|
+
const value = this.toFixedWithoutPadding(attrValue.float_value);
|
|
42
|
+
propertyValue.value = value;
|
|
43
|
+
typename = StandardTypeNames.Float;
|
|
44
|
+
}
|
|
45
|
+
else if (attrValue.has_int64_value) {
|
|
46
|
+
propertyValue.value = attrValue.int64_value;
|
|
47
|
+
typename = StandardTypeNames.Integer;
|
|
48
|
+
}
|
|
49
|
+
else if (attrValue.has_sint64_value) {
|
|
50
|
+
propertyValue.value = attrValue.sint64_value;
|
|
51
|
+
typename = StandardTypeNames.Integer;
|
|
52
|
+
}
|
|
53
|
+
else if (attrValue.has_sint_value) {
|
|
54
|
+
propertyValue.value = attrValue.sint_value;
|
|
55
|
+
typename = StandardTypeNames.Integer;
|
|
56
|
+
}
|
|
57
|
+
else if (attrValue.has_uint64_value) {
|
|
58
|
+
propertyValue.value = attrValue.uint64_value;
|
|
59
|
+
typename = StandardTypeNames.Integer;
|
|
60
|
+
}
|
|
61
|
+
else if (attrValue.has_uint_value) {
|
|
62
|
+
propertyValue.value = attrValue.uint_value;
|
|
63
|
+
typename = StandardTypeNames.Integer;
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
propertyValue.value = undefined;
|
|
67
|
+
}
|
|
68
|
+
return { propertyValue, typename };
|
|
69
|
+
}
|
|
70
|
+
getFeatureAttribute(fieldInfo, attrValue) {
|
|
71
|
+
let propertyValue = { valueFormat: PropertyValueFormat.Primitive };
|
|
72
|
+
let typename = StandardTypeNames.String;
|
|
73
|
+
if (fieldInfo.type === esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeDouble
|
|
74
|
+
|| fieldInfo.type === esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeInteger
|
|
75
|
+
|| fieldInfo.type === esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeSmallInteger
|
|
76
|
+
|| fieldInfo.type === esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeOID
|
|
77
|
+
|| fieldInfo.type === esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeSingle
|
|
78
|
+
|| fieldInfo.type === esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeDate) {
|
|
79
|
+
const value = this.getNumericValue(attrValue);
|
|
80
|
+
if (value.propertyValue === undefined) {
|
|
81
|
+
Logger.logError(loggerCategory, `Could not read numeric value for field ${fieldInfo.name}`);
|
|
82
|
+
return undefined;
|
|
83
|
+
}
|
|
84
|
+
if (fieldInfo.type === esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeDate) {
|
|
85
|
+
const test = value.propertyValue.value;
|
|
86
|
+
propertyValue.value = new Date(test);
|
|
87
|
+
typename = StandardTypeNames.DateTime;
|
|
88
|
+
}
|
|
89
|
+
else {
|
|
90
|
+
typename = value.typename;
|
|
91
|
+
propertyValue = value.propertyValue;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
else if (fieldInfo.type === esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeString) {
|
|
95
|
+
if (attrValue.has_string_value) {
|
|
96
|
+
propertyValue.value = attrValue.string_value;
|
|
97
|
+
typename = StandardTypeNames.String;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
else if (fieldInfo.type === esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeGlobalID) {
|
|
101
|
+
if (attrValue.has_string_value) {
|
|
102
|
+
propertyValue.value = attrValue.string_value;
|
|
103
|
+
typename = StandardTypeNames.String;
|
|
104
|
+
}
|
|
105
|
+
else {
|
|
106
|
+
const value = this.getNumericValue(attrValue);
|
|
107
|
+
if (value.propertyValue === undefined) {
|
|
108
|
+
Logger.logError(loggerCategory, `Could not read GlobalId value for field ${fieldInfo.name}`);
|
|
109
|
+
return undefined;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
else if (attrValue.has_string_value) {
|
|
114
|
+
// If we reach this case that probably mean we don't support the field type, simply try to output string value
|
|
115
|
+
typename = StandardTypeNames.String;
|
|
116
|
+
propertyValue.value = attrValue.string_value;
|
|
117
|
+
}
|
|
118
|
+
else if (attrValue.value_type === "none") {
|
|
119
|
+
// Sometimes fields are just empty, use an empty string
|
|
120
|
+
typename = StandardTypeNames.String;
|
|
121
|
+
propertyValue.value = undefined;
|
|
122
|
+
}
|
|
123
|
+
else {
|
|
124
|
+
Logger.logError(loggerCategory, `Could not read value for field ${fieldInfo.name}`);
|
|
125
|
+
return undefined;
|
|
126
|
+
}
|
|
127
|
+
propertyValue.displayValue = this.getDisplayValue(typename, propertyValue.value);
|
|
128
|
+
return { value: propertyValue, property: { name: fieldInfo.name, displayLabel: fieldInfo.name, typename } };
|
|
129
|
+
}
|
|
130
|
+
async readAndRender(response, renderer) {
|
|
131
|
+
if (!(response.data instanceof esriPBuffer.FeatureCollectionPBuffer)) {
|
|
132
|
+
const msg = "Response was not in PBF format";
|
|
133
|
+
Logger.logError(loggerCategory, msg);
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
const collection = response.data;
|
|
137
|
+
if (!collection.has_queryResult || !collection.queryResult.has_featureResult || collection?.queryResult?.featureResult?.features === undefined)
|
|
138
|
+
return;
|
|
139
|
+
const attrSymbology = renderer.attributeSymbology;
|
|
140
|
+
// Fields metadata is stored outside feature results, create dedicated array first
|
|
141
|
+
const fields = [];
|
|
142
|
+
for (const field of collection.queryResult.featureResult.fields)
|
|
143
|
+
fields.push({ name: field.name, type: field.fieldType });
|
|
144
|
+
const geomType = collection.queryResult.featureResult.geometryType;
|
|
145
|
+
const stride = (collection.queryResult.featureResult.hasM || collection.queryResult.featureResult.hasZ) ? 3 : 2;
|
|
146
|
+
const relativeCoords = renderer.transform === undefined;
|
|
147
|
+
for (const feature of collection.queryResult.featureResult.features) {
|
|
148
|
+
// Render geometries
|
|
149
|
+
if (renderer && feature?.has_geometry) {
|
|
150
|
+
if (attrSymbology) {
|
|
151
|
+
// Read attributes if needed (attribute driven symbology)
|
|
152
|
+
this.applySymbologyAttributes(attrSymbology, feature, fields);
|
|
153
|
+
}
|
|
154
|
+
if (geomType === esriGeometryType.esriGeometryTypePoint || geomType === esriGeometryType.esriGeometryTypeMultipoint) {
|
|
155
|
+
await renderer.renderPoint(feature.geometry.lengths, feature.geometry.coords, stride, relativeCoords);
|
|
156
|
+
}
|
|
157
|
+
else if (geomType === esriGeometryType.esriGeometryTypePolyline || geomType === esriGeometryType.esriGeometryTypePolygon) {
|
|
158
|
+
const fill = (geomType === esriGeometryType.esriGeometryTypePolygon);
|
|
159
|
+
await renderer.renderPath(feature.geometry.lengths, feature.geometry.coords, fill, stride, relativeCoords);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
applySymbologyAttributes(attrSymbology, feature, fields) {
|
|
165
|
+
if (attrSymbology) {
|
|
166
|
+
const symbolFields = attrSymbology.rendererFields;
|
|
167
|
+
if (symbolFields && symbolFields.length > 0 && feature.attributes) {
|
|
168
|
+
let fieldIdx = 0;
|
|
169
|
+
const featureAttr = {};
|
|
170
|
+
for (const attrValue of feature.attributes) {
|
|
171
|
+
if (fieldIdx > fields.length) {
|
|
172
|
+
Logger.logError(loggerCategory, "Error while read feature info data: fields metadata missing");
|
|
173
|
+
break;
|
|
174
|
+
}
|
|
175
|
+
const fieldInfo = fields[fieldIdx++];
|
|
176
|
+
if (symbolFields.includes(fieldInfo.name)) {
|
|
177
|
+
const attr = this.getFeatureAttribute(fieldInfo, attrValue);
|
|
178
|
+
if (attr) {
|
|
179
|
+
const primitiveValue = attr.value;
|
|
180
|
+
featureAttr[fieldInfo.name] = primitiveValue.value;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
attrSymbology.setActiveFeatureAttributes(featureAttr);
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
async readFeatureInfo(response, featureInfos, renderer) {
|
|
189
|
+
if (!(response.data instanceof esriPBuffer.FeatureCollectionPBuffer)) {
|
|
190
|
+
Logger.logError(loggerCategory, "Response was not in PBF format");
|
|
191
|
+
}
|
|
192
|
+
const collection = response.data;
|
|
193
|
+
if (!collection.has_queryResult || !collection.queryResult.has_featureResult || collection?.queryResult?.featureResult?.features === undefined)
|
|
194
|
+
return;
|
|
195
|
+
const layerInfo = { layerName: this._settings.name, subLayerInfos: [] };
|
|
196
|
+
// Fields metadata is stored outside feature results, create dedicated array first
|
|
197
|
+
const fields = [];
|
|
198
|
+
for (const field of collection.queryResult.featureResult.fields)
|
|
199
|
+
fields.push({ name: field.name, type: field.fieldType });
|
|
200
|
+
const geomType = collection.queryResult.featureResult.geometryType;
|
|
201
|
+
const stride = (collection.queryResult.featureResult.hasM || collection.queryResult.featureResult.hasZ) ? 3 : 2;
|
|
202
|
+
const subLayerInfo = {
|
|
203
|
+
subLayerName: this._layerMetadata.name,
|
|
204
|
+
displayFieldName: this._layerMetadata.name,
|
|
205
|
+
features: [],
|
|
206
|
+
};
|
|
207
|
+
// Read feature values
|
|
208
|
+
for (const featureResponse of collection.queryResult.featureResult.features) {
|
|
209
|
+
const feature = { attributes: [] };
|
|
210
|
+
if (renderer && featureResponse?.has_geometry) {
|
|
211
|
+
if (geomType === esriGeometryType.esriGeometryTypePoint || geomType === esriGeometryType.esriGeometryTypeMultipoint) {
|
|
212
|
+
await renderer.renderPoint(featureResponse.geometry.lengths, featureResponse.geometry.coords, stride, true);
|
|
213
|
+
}
|
|
214
|
+
else if (geomType === esriGeometryType.esriGeometryTypePolyline || geomType === esriGeometryType.esriGeometryTypePolygon) {
|
|
215
|
+
const fill = (geomType === esriGeometryType.esriGeometryTypePolygon);
|
|
216
|
+
await renderer.renderPath(featureResponse.geometry.lengths, featureResponse.geometry.coords, fill, stride, true);
|
|
217
|
+
}
|
|
218
|
+
const graphics = renderer.moveGraphics();
|
|
219
|
+
feature.geometries = graphics.map((graphic) => {
|
|
220
|
+
return { graphic };
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
let fieldIdx = 0;
|
|
224
|
+
for (const attrValue of featureResponse.attributes) {
|
|
225
|
+
if (fieldIdx > fields.length) {
|
|
226
|
+
Logger.logError(loggerCategory, "Error while read feature info data: fields metadata missing");
|
|
227
|
+
break;
|
|
228
|
+
}
|
|
229
|
+
// Convert everything to string for now
|
|
230
|
+
const attr = this.getFeatureAttribute(fields[fieldIdx], attrValue);
|
|
231
|
+
if (attr) {
|
|
232
|
+
feature.attributes?.push(attr);
|
|
233
|
+
}
|
|
234
|
+
fieldIdx++;
|
|
235
|
+
}
|
|
236
|
+
subLayerInfo.features.push(feature);
|
|
237
|
+
}
|
|
238
|
+
if (layerInfo.subLayerInfos === undefined) {
|
|
239
|
+
layerInfo.subLayerInfos = [];
|
|
240
|
+
}
|
|
241
|
+
layerInfo.subLayerInfos.push(subLayerInfo);
|
|
242
|
+
featureInfos.push(layerInfo);
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
//# sourceMappingURL=ArcGisPbfFeatureReader.js.map
|