@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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ArcGisJsonFeatureReader.js","sourceRoot":"","sources":["../../../src/ArcGisFeature/ArcGisJsonFeatureReader.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F,0DAA+F;AAE/F,wDAAuO;AAEvO,+DAAgE;AAGhE,gBAAgB;AAChB,MAAa,uBAAwB,SAAQ,6CAAuB;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,OAAO,CAAC,UAAU,CAAC;oBACnE,IAAI,YAAY,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE;wBAClC,WAAW,CAAC,OAAO,CAAC,GAAG,SAAS,CAAC;qBAClC;gBACH,aAAa,CAAC,0BAA0B,CAAC,WAAW,CAAC,CAAC;aACvD;SACF;IACH,CAAC;IAEM,KAA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AS;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;AA5ID,0DA4IC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\nimport { PrimitiveValue, PropertyValueFormat, StandardTypeNames } from \"@itwin/appui-abstract\";\nimport { ImageMapLayerSettings } from \"@itwin/core-common\";\nimport { ArcGisAttributeDrivenSymbology, ArcGisGeometryReaderJSON, ArcGisGeometryRenderer, ArcGisGraphicsRenderer, MapLayerFeature, MapLayerFeatureAttribute, MapLayerFeatureInfo, MapSubLayerFeatureInfo} from \"@itwin/core-frontend\";\nimport { Transform } from \"@itwin/core-geometry\";\nimport { ArcGisBaseFeatureReader } from \"./ArcGisFeatureReader\";\nimport { ArcGisFieldType, ArcGisResponseData } from \"./ArcGisFeatureResponse\";\n\n/** @internal */\nexport class ArcGisJsonFeatureReader extends ArcGisBaseFeatureReader {\n public transform: Transform | undefined;\n\n public constructor(settings: ImageMapLayerSettings, layerMetadata: any) {\n super(settings, layerMetadata);\n\n }\n\n private applySymbologyAttributes(attrSymbology: ArcGisAttributeDrivenSymbology, feature: any) {\n if (attrSymbology && feature) {\n const symbolFields = attrSymbology.rendererFields;\n if (symbolFields && symbolFields.length > 0 && feature.attributes) {\n const featureAttr: {[key: string]: any} = {};\n for (const [attrKey, attrValue] of Object.entries(feature.attributes))\n if (symbolFields.includes(attrKey)) {\n featureAttr[attrKey] = attrValue;\n }\n attrSymbology.setActiveFeatureAttributes(featureAttr);\n }\n }\n }\n\n public async readAndRender(response: ArcGisResponseData, renderer: ArcGisGeometryRenderer) {\n const responseObj = response.data;\n if (responseObj.geometryType) {\n const attrSymbology = renderer.attributeSymbology;\n\n const geomReader = new ArcGisGeometryReaderJSON(responseObj.geometryType, renderer, renderer.transform === undefined);\n\n for (const feature of responseObj.features) {\n if (attrSymbology) {\n // Read attributes if needed (attribute driven symbology)\n this.applySymbologyAttributes(attrSymbology, feature);\n }\n\n await geomReader.readGeometry(feature.geometry);\n }\n }\n }\n\n public async readFeatureInfo(response: ArcGisResponseData, featureInfos: MapLayerFeatureInfo[], renderer?: ArcGisGraphicsRenderer) {\n const responseObj = response.data;\n if (responseObj === undefined || !Array.isArray(responseObj.features))\n return;\n\n const layerInfo: MapLayerFeatureInfo = { layerName: this._settings.name };\n\n // Create a signature index for every field name / type.\n const fieldsType: { [key: string]: ArcGisFieldType } = {};\n for (const fieldInfo of responseObj.fields) {\n fieldsType[fieldInfo.name] = fieldInfo.type;\n }\n\n const getStandardTypeName = (fieldType: ArcGisFieldType) => {\n switch (fieldType) {\n case \"esriFieldTypeInteger\":\n case \"esriFieldTypeSmallInteger\":\n case \"esriFieldTypeOID\":\n return StandardTypeNames.Integer;\n case \"esriFieldTypeDouble\":\n return StandardTypeNames.Double;\n case \"esriFieldTypeSingle\":\n return StandardTypeNames.Float;\n case \"esriFieldTypeDate\":\n return StandardTypeNames.DateTime;\n default:\n return StandardTypeNames.String;\n }\n };\n\n const getRecordInfo = (fieldName: string, value: any): MapLayerFeatureAttribute => {\n const propertyValue: PrimitiveValue = {valueFormat: PropertyValueFormat.Primitive};\n\n if (value === null) {\n value = undefined;\n }\n\n const strValue = `${value}`;\n const fieldType = fieldsType[fieldName];\n switch (fieldType) {\n case \"esriFieldTypeInteger\":\n case \"esriFieldTypeSmallInteger\":\n case \"esriFieldTypeOID\":\n propertyValue.value = value as number;\n break;\n case \"esriFieldTypeDouble\":\n case \"esriFieldTypeSingle\":\n propertyValue.value = this.toFixedWithoutPadding(value);\n break;\n case \"esriFieldTypeDate\":\n propertyValue.value = new Date(value);\n break;\n default:\n if (value !== undefined)\n propertyValue.value = strValue;\n\n break;\n }\n\n const typename = getStandardTypeName(fieldType);\n propertyValue.displayValue = this.getDisplayValue(typename, propertyValue.value);\n\n return {value: propertyValue, property: { name: fieldName, displayLabel: fieldName, typename }};\n };\n\n let geomReader: ArcGisGeometryReaderJSON|undefined;\n if (renderer && responseObj?.geometryType) {\n geomReader = new ArcGisGeometryReaderJSON(responseObj.geometryType, renderer);\n }\n\n // Each feature response represent a single sub-layer, no need to check for existing entry.\n const subLayerInfo: MapSubLayerFeatureInfo = {\n subLayerName: this._layerMetadata.name,\n displayFieldName: this._layerMetadata.name,\n features: [],\n };\n\n // Read all features attributes / geometries\n for (const responseFeature of responseObj.features) {\n const feature: MapLayerFeature = {attributes: []};\n\n for (const [key, value] of Object.entries(responseFeature.attributes))\n feature.attributes?.push(getRecordInfo(key, value));\n\n if (geomReader) {\n await geomReader.readGeometry(responseFeature.geometry);\n const graphics = renderer!.moveGraphics();\n feature.geometries = graphics.map((graphic) => {\n return {graphic};\n });\n }\n subLayerInfo.features.push(feature);\n }\n\n if (layerInfo.subLayerInfos === undefined)\n layerInfo.subLayerInfos = [];\n layerInfo.subLayerInfos.push(subLayerInfo);\n\n featureInfos.push(layerInfo);\n }\n}\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,249 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ArcGisPbfFeatureReader = void 0;
|
|
4
|
+
/*---------------------------------------------------------------------------------------------
|
|
5
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
6
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
7
|
+
*--------------------------------------------------------------------------------------------*/
|
|
8
|
+
const esriPBuffer_gen_1 = require("../ArcGisFeature/esriPBuffer.gen");
|
|
9
|
+
const appui_abstract_1 = require("@itwin/appui-abstract");
|
|
10
|
+
const ArcGisFeatureReader_1 = require("./ArcGisFeatureReader");
|
|
11
|
+
const core_bentley_1 = require("@itwin/core-bentley");
|
|
12
|
+
const esriGeometryType = esriPBuffer_gen_1.esriPBuffer.FeatureCollectionPBuffer.GeometryType;
|
|
13
|
+
const loggerCategory = "MapLayersFormats.ArcGISFeature";
|
|
14
|
+
/** @internal */
|
|
15
|
+
class ArcGisPbfFeatureReader extends ArcGisFeatureReader_1.ArcGisBaseFeatureReader {
|
|
16
|
+
constructor(settings, layerMetadata) {
|
|
17
|
+
super(settings, layerMetadata);
|
|
18
|
+
}
|
|
19
|
+
static getArcGisFeatureGeometryType(geomType) {
|
|
20
|
+
switch (geomType) {
|
|
21
|
+
case esriPBuffer_gen_1.esriPBuffer.FeatureCollectionPBuffer.GeometryType.esriGeometryTypeMultipatch:
|
|
22
|
+
return "esriGeometryMultiPatch";
|
|
23
|
+
case esriPBuffer_gen_1.esriPBuffer.FeatureCollectionPBuffer.GeometryType.esriGeometryTypeMultipoint:
|
|
24
|
+
return "esriGeometryMultipoint";
|
|
25
|
+
case esriPBuffer_gen_1.esriPBuffer.FeatureCollectionPBuffer.GeometryType.esriGeometryTypePoint:
|
|
26
|
+
return "esriGeometryPoint";
|
|
27
|
+
case esriPBuffer_gen_1.esriPBuffer.FeatureCollectionPBuffer.GeometryType.esriGeometryTypePolygon:
|
|
28
|
+
return "esriGeometryPolygon";
|
|
29
|
+
case esriPBuffer_gen_1.esriPBuffer.FeatureCollectionPBuffer.GeometryType.esriGeometryTypePolyline:
|
|
30
|
+
return "esriGeometryPolyline";
|
|
31
|
+
default:
|
|
32
|
+
return "esriGeometryNull";
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
getNumericValue(attrValue) {
|
|
36
|
+
const propertyValue = { valueFormat: appui_abstract_1.PropertyValueFormat.Primitive };
|
|
37
|
+
let typename = appui_abstract_1.StandardTypeNames.Number;
|
|
38
|
+
if (attrValue.has_double_value) {
|
|
39
|
+
const value = this.toFixedWithoutPadding(attrValue.double_value);
|
|
40
|
+
propertyValue.value = value;
|
|
41
|
+
typename = appui_abstract_1.StandardTypeNames.Double;
|
|
42
|
+
}
|
|
43
|
+
else if (attrValue.has_float_value) {
|
|
44
|
+
const value = this.toFixedWithoutPadding(attrValue.float_value);
|
|
45
|
+
propertyValue.value = value;
|
|
46
|
+
typename = appui_abstract_1.StandardTypeNames.Float;
|
|
47
|
+
}
|
|
48
|
+
else if (attrValue.has_int64_value) {
|
|
49
|
+
propertyValue.value = attrValue.int64_value;
|
|
50
|
+
typename = appui_abstract_1.StandardTypeNames.Integer;
|
|
51
|
+
}
|
|
52
|
+
else if (attrValue.has_sint64_value) {
|
|
53
|
+
propertyValue.value = attrValue.sint64_value;
|
|
54
|
+
typename = appui_abstract_1.StandardTypeNames.Integer;
|
|
55
|
+
}
|
|
56
|
+
else if (attrValue.has_sint_value) {
|
|
57
|
+
propertyValue.value = attrValue.sint_value;
|
|
58
|
+
typename = appui_abstract_1.StandardTypeNames.Integer;
|
|
59
|
+
}
|
|
60
|
+
else if (attrValue.has_uint64_value) {
|
|
61
|
+
propertyValue.value = attrValue.uint64_value;
|
|
62
|
+
typename = appui_abstract_1.StandardTypeNames.Integer;
|
|
63
|
+
}
|
|
64
|
+
else if (attrValue.has_uint_value) {
|
|
65
|
+
propertyValue.value = attrValue.uint_value;
|
|
66
|
+
typename = appui_abstract_1.StandardTypeNames.Integer;
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
propertyValue.value = undefined;
|
|
70
|
+
}
|
|
71
|
+
return { propertyValue, typename };
|
|
72
|
+
}
|
|
73
|
+
getFeatureAttribute(fieldInfo, attrValue) {
|
|
74
|
+
let propertyValue = { valueFormat: appui_abstract_1.PropertyValueFormat.Primitive };
|
|
75
|
+
let typename = appui_abstract_1.StandardTypeNames.String;
|
|
76
|
+
if (fieldInfo.type === esriPBuffer_gen_1.esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeDouble
|
|
77
|
+
|| fieldInfo.type === esriPBuffer_gen_1.esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeInteger
|
|
78
|
+
|| fieldInfo.type === esriPBuffer_gen_1.esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeSmallInteger
|
|
79
|
+
|| fieldInfo.type === esriPBuffer_gen_1.esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeOID
|
|
80
|
+
|| fieldInfo.type === esriPBuffer_gen_1.esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeSingle
|
|
81
|
+
|| fieldInfo.type === esriPBuffer_gen_1.esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeDate) {
|
|
82
|
+
const value = this.getNumericValue(attrValue);
|
|
83
|
+
if (value.propertyValue === undefined) {
|
|
84
|
+
core_bentley_1.Logger.logError(loggerCategory, `Could not read numeric value for field ${fieldInfo.name}`);
|
|
85
|
+
return undefined;
|
|
86
|
+
}
|
|
87
|
+
if (fieldInfo.type === esriPBuffer_gen_1.esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeDate) {
|
|
88
|
+
const test = value.propertyValue.value;
|
|
89
|
+
propertyValue.value = new Date(test);
|
|
90
|
+
typename = appui_abstract_1.StandardTypeNames.DateTime;
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
typename = value.typename;
|
|
94
|
+
propertyValue = value.propertyValue;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
else if (fieldInfo.type === esriPBuffer_gen_1.esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeString) {
|
|
98
|
+
if (attrValue.has_string_value) {
|
|
99
|
+
propertyValue.value = attrValue.string_value;
|
|
100
|
+
typename = appui_abstract_1.StandardTypeNames.String;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
else if (fieldInfo.type === esriPBuffer_gen_1.esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeGlobalID) {
|
|
104
|
+
if (attrValue.has_string_value) {
|
|
105
|
+
propertyValue.value = attrValue.string_value;
|
|
106
|
+
typename = appui_abstract_1.StandardTypeNames.String;
|
|
107
|
+
}
|
|
108
|
+
else {
|
|
109
|
+
const value = this.getNumericValue(attrValue);
|
|
110
|
+
if (value.propertyValue === undefined) {
|
|
111
|
+
core_bentley_1.Logger.logError(loggerCategory, `Could not read GlobalId value for field ${fieldInfo.name}`);
|
|
112
|
+
return undefined;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
else if (attrValue.has_string_value) {
|
|
117
|
+
// If we reach this case that probably mean we don't support the field type, simply try to output string value
|
|
118
|
+
typename = appui_abstract_1.StandardTypeNames.String;
|
|
119
|
+
propertyValue.value = attrValue.string_value;
|
|
120
|
+
}
|
|
121
|
+
else if (attrValue.value_type === "none") {
|
|
122
|
+
// Sometimes fields are just empty, use an empty string
|
|
123
|
+
typename = appui_abstract_1.StandardTypeNames.String;
|
|
124
|
+
propertyValue.value = undefined;
|
|
125
|
+
}
|
|
126
|
+
else {
|
|
127
|
+
core_bentley_1.Logger.logError(loggerCategory, `Could not read value for field ${fieldInfo.name}`);
|
|
128
|
+
return undefined;
|
|
129
|
+
}
|
|
130
|
+
propertyValue.displayValue = this.getDisplayValue(typename, propertyValue.value);
|
|
131
|
+
return { value: propertyValue, property: { name: fieldInfo.name, displayLabel: fieldInfo.name, typename } };
|
|
132
|
+
}
|
|
133
|
+
async readAndRender(response, renderer) {
|
|
134
|
+
if (!(response.data instanceof esriPBuffer_gen_1.esriPBuffer.FeatureCollectionPBuffer)) {
|
|
135
|
+
const msg = "Response was not in PBF format";
|
|
136
|
+
core_bentley_1.Logger.logError(loggerCategory, msg);
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
const collection = response.data;
|
|
140
|
+
if (!collection.has_queryResult || !collection.queryResult.has_featureResult || collection?.queryResult?.featureResult?.features === undefined)
|
|
141
|
+
return;
|
|
142
|
+
const attrSymbology = renderer.attributeSymbology;
|
|
143
|
+
// Fields metadata is stored outside feature results, create dedicated array first
|
|
144
|
+
const fields = [];
|
|
145
|
+
for (const field of collection.queryResult.featureResult.fields)
|
|
146
|
+
fields.push({ name: field.name, type: field.fieldType });
|
|
147
|
+
const geomType = collection.queryResult.featureResult.geometryType;
|
|
148
|
+
const stride = (collection.queryResult.featureResult.hasM || collection.queryResult.featureResult.hasZ) ? 3 : 2;
|
|
149
|
+
const relativeCoords = renderer.transform === undefined;
|
|
150
|
+
for (const feature of collection.queryResult.featureResult.features) {
|
|
151
|
+
// Render geometries
|
|
152
|
+
if (renderer && feature?.has_geometry) {
|
|
153
|
+
if (attrSymbology) {
|
|
154
|
+
// Read attributes if needed (attribute driven symbology)
|
|
155
|
+
this.applySymbologyAttributes(attrSymbology, feature, fields);
|
|
156
|
+
}
|
|
157
|
+
if (geomType === esriGeometryType.esriGeometryTypePoint || geomType === esriGeometryType.esriGeometryTypeMultipoint) {
|
|
158
|
+
await renderer.renderPoint(feature.geometry.lengths, feature.geometry.coords, stride, relativeCoords);
|
|
159
|
+
}
|
|
160
|
+
else if (geomType === esriGeometryType.esriGeometryTypePolyline || geomType === esriGeometryType.esriGeometryTypePolygon) {
|
|
161
|
+
const fill = (geomType === esriGeometryType.esriGeometryTypePolygon);
|
|
162
|
+
await renderer.renderPath(feature.geometry.lengths, feature.geometry.coords, fill, stride, relativeCoords);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
applySymbologyAttributes(attrSymbology, feature, fields) {
|
|
168
|
+
if (attrSymbology) {
|
|
169
|
+
const symbolFields = attrSymbology.rendererFields;
|
|
170
|
+
if (symbolFields && symbolFields.length > 0 && feature.attributes) {
|
|
171
|
+
let fieldIdx = 0;
|
|
172
|
+
const featureAttr = {};
|
|
173
|
+
for (const attrValue of feature.attributes) {
|
|
174
|
+
if (fieldIdx > fields.length) {
|
|
175
|
+
core_bentley_1.Logger.logError(loggerCategory, "Error while read feature info data: fields metadata missing");
|
|
176
|
+
break;
|
|
177
|
+
}
|
|
178
|
+
const fieldInfo = fields[fieldIdx++];
|
|
179
|
+
if (symbolFields.includes(fieldInfo.name)) {
|
|
180
|
+
const attr = this.getFeatureAttribute(fieldInfo, attrValue);
|
|
181
|
+
if (attr) {
|
|
182
|
+
const primitiveValue = attr.value;
|
|
183
|
+
featureAttr[fieldInfo.name] = primitiveValue.value;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
attrSymbology.setActiveFeatureAttributes(featureAttr);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
async readFeatureInfo(response, featureInfos, renderer) {
|
|
192
|
+
if (!(response.data instanceof esriPBuffer_gen_1.esriPBuffer.FeatureCollectionPBuffer)) {
|
|
193
|
+
core_bentley_1.Logger.logError(loggerCategory, "Response was not in PBF format");
|
|
194
|
+
}
|
|
195
|
+
const collection = response.data;
|
|
196
|
+
if (!collection.has_queryResult || !collection.queryResult.has_featureResult || collection?.queryResult?.featureResult?.features === undefined)
|
|
197
|
+
return;
|
|
198
|
+
const layerInfo = { layerName: this._settings.name, subLayerInfos: [] };
|
|
199
|
+
// Fields metadata is stored outside feature results, create dedicated array first
|
|
200
|
+
const fields = [];
|
|
201
|
+
for (const field of collection.queryResult.featureResult.fields)
|
|
202
|
+
fields.push({ name: field.name, type: field.fieldType });
|
|
203
|
+
const geomType = collection.queryResult.featureResult.geometryType;
|
|
204
|
+
const stride = (collection.queryResult.featureResult.hasM || collection.queryResult.featureResult.hasZ) ? 3 : 2;
|
|
205
|
+
const subLayerInfo = {
|
|
206
|
+
subLayerName: this._layerMetadata.name,
|
|
207
|
+
displayFieldName: this._layerMetadata.name,
|
|
208
|
+
features: [],
|
|
209
|
+
};
|
|
210
|
+
// Read feature values
|
|
211
|
+
for (const featureResponse of collection.queryResult.featureResult.features) {
|
|
212
|
+
const feature = { attributes: [] };
|
|
213
|
+
if (renderer && featureResponse?.has_geometry) {
|
|
214
|
+
if (geomType === esriGeometryType.esriGeometryTypePoint || geomType === esriGeometryType.esriGeometryTypeMultipoint) {
|
|
215
|
+
await renderer.renderPoint(featureResponse.geometry.lengths, featureResponse.geometry.coords, stride, true);
|
|
216
|
+
}
|
|
217
|
+
else if (geomType === esriGeometryType.esriGeometryTypePolyline || geomType === esriGeometryType.esriGeometryTypePolygon) {
|
|
218
|
+
const fill = (geomType === esriGeometryType.esriGeometryTypePolygon);
|
|
219
|
+
await renderer.renderPath(featureResponse.geometry.lengths, featureResponse.geometry.coords, fill, stride, true);
|
|
220
|
+
}
|
|
221
|
+
const graphics = renderer.moveGraphics();
|
|
222
|
+
feature.geometries = graphics.map((graphic) => {
|
|
223
|
+
return { graphic };
|
|
224
|
+
});
|
|
225
|
+
}
|
|
226
|
+
let fieldIdx = 0;
|
|
227
|
+
for (const attrValue of featureResponse.attributes) {
|
|
228
|
+
if (fieldIdx > fields.length) {
|
|
229
|
+
core_bentley_1.Logger.logError(loggerCategory, "Error while read feature info data: fields metadata missing");
|
|
230
|
+
break;
|
|
231
|
+
}
|
|
232
|
+
// Convert everything to string for now
|
|
233
|
+
const attr = this.getFeatureAttribute(fields[fieldIdx], attrValue);
|
|
234
|
+
if (attr) {
|
|
235
|
+
feature.attributes?.push(attr);
|
|
236
|
+
}
|
|
237
|
+
fieldIdx++;
|
|
238
|
+
}
|
|
239
|
+
subLayerInfo.features.push(feature);
|
|
240
|
+
}
|
|
241
|
+
if (layerInfo.subLayerInfos === undefined) {
|
|
242
|
+
layerInfo.subLayerInfos = [];
|
|
243
|
+
}
|
|
244
|
+
layerInfo.subLayerInfos.push(subLayerInfo);
|
|
245
|
+
featureInfos.push(layerInfo);
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
exports.ArcGisPbfFeatureReader = ArcGisPbfFeatureReader;
|
|
249
|
+
//# sourceMappingURL=ArcGisPbfFeatureReader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ArcGisPbfFeatureReader.js","sourceRoot":"","sources":["../../../src/ArcGisFeature/ArcGisPbfFeatureReader.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F,sEAA+D;AAE/D,0DAA+F;AAE/F,+DAAgE;AAEhE,sDAA6C;AAG7C,MAAM,gBAAgB,GAAG,6BAAW,CAAC,wBAAwB,CAAC,YAAY,CAAC;AAC3E,MAAM,cAAc,GAAG,gCAAgC,CAAC;AAOxD,gBAAgB;AAChB,MAAa,sBAAuB,SA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AAC,CAAC;gBACnB,CAAC,CAAC,CAAC;aACJ;YAED,IAAI,QAAQ,GAAG,CAAC,CAAC;YACjB,KAAK,MAAM,SAAS,IAAI,eAAe,CAAC,UAAU,EAAE;gBAClD,IAAI,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE;oBAC5B,qBAAM,CAAC,QAAQ,CAAC,cAAc,EAAE,6DAA6D,CAAC,CAAC;oBAC/F,MAAM;iBACP;gBACD,uCAAuC;gBACvC,MAAM,IAAI,GAAG,IAAI,CAAC,mBAAmB,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,SAAS,CAAC,CAAC;gBACnE,IAAI,IAAI,EAAE;oBACR,OAAO,CAAC,UAAU,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;iBAChC;gBAED,QAAQ,EAAE,CAAC;aACZ;YACD,YAAY,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;SACrC;QAED,IAAI,SAAS,CAAC,aAAa,KAAK,SAAS,EAAE;YACzC,SAAS,CAAC,aAAa,GAAG,EAAE,CAAC;SAC9B;QACD,SAAS,CAAC,aAAa,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QAC3C,YAAY,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAC/B,CAAC;CACF;AAxPD,wDAwPC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport { esriPBuffer } from \"../ArcGisFeature/esriPBuffer.gen\";\nimport { ArcGisAttributeDrivenSymbology, ArcGisGeometryRenderer, ArcGisGraphicsRenderer, MapLayerFeature, MapLayerFeatureAttribute, MapLayerFeatureInfo, MapSubLayerFeatureInfo} from \"@itwin/core-frontend\";\nimport { PrimitiveValue, PropertyValueFormat, StandardTypeNames } from \"@itwin/appui-abstract\";\nimport { ImageMapLayerSettings } from \"@itwin/core-common\";\nimport { ArcGisBaseFeatureReader } from \"./ArcGisFeatureReader\";\nimport { ArcGisResponseData } from \"./ArcGisFeatureResponse\";\nimport { Logger } from \"@itwin/core-bentley\";\nimport { ArcGisFeatureGeometryType } from \"./ArcGisFeatureQuery\";\n\nconst esriGeometryType = esriPBuffer.FeatureCollectionPBuffer.GeometryType;\nconst loggerCategory = \"MapLayersFormats.ArcGISFeature\";\n\ninterface PbfFieldInfo {\n name: string;\n type: esriPBuffer.FeatureCollectionPBuffer.FieldType;\n}\n\n/** @internal */\nexport class ArcGisPbfFeatureReader extends ArcGisBaseFeatureReader {\n public constructor(settings: ImageMapLayerSettings, layerMetadata: any) {\n super(settings, layerMetadata);\n }\n\n public static getArcGisFeatureGeometryType(geomType: esriPBuffer.FeatureCollectionPBuffer.GeometryType): ArcGisFeatureGeometryType {\n switch (geomType) {\n case esriPBuffer.FeatureCollectionPBuffer.GeometryType.esriGeometryTypeMultipatch:\n return \"esriGeometryMultiPatch\";\n case esriPBuffer.FeatureCollectionPBuffer.GeometryType.esriGeometryTypeMultipoint:\n return \"esriGeometryMultipoint\";\n case esriPBuffer.FeatureCollectionPBuffer.GeometryType.esriGeometryTypePoint:\n return \"esriGeometryPoint\";\n case esriPBuffer.FeatureCollectionPBuffer.GeometryType.esriGeometryTypePolygon:\n return \"esriGeometryPolygon\";\n case esriPBuffer.FeatureCollectionPBuffer.GeometryType.esriGeometryTypePolyline:\n return \"esriGeometryPolyline\";\n default:\n return \"esriGeometryNull\";\n }\n }\n\n private getNumericValue(attrValue: esriPBuffer.FeatureCollectionPBuffer.Value) {\n const propertyValue: PrimitiveValue = { valueFormat: PropertyValueFormat.Primitive };\n let typename = StandardTypeNames.Number;\n if (attrValue.has_double_value) {\n const value = this.toFixedWithoutPadding(attrValue.double_value);\n propertyValue.value = value;\n typename = StandardTypeNames.Double;\n } else if (attrValue.has_float_value) {\n const value = this.toFixedWithoutPadding(attrValue.float_value);\n propertyValue.value = value;\n typename = StandardTypeNames.Float;\n } else if (attrValue.has_int64_value) {\n propertyValue.value = attrValue.int64_value;\n typename = StandardTypeNames.Integer;\n } else if (attrValue.has_sint64_value) {\n propertyValue.value = attrValue.sint64_value;\n typename = StandardTypeNames.Integer;\n } else if (attrValue.has_sint_value) {\n propertyValue.value = attrValue.sint_value;\n typename = StandardTypeNames.Integer;\n } else if (attrValue.has_uint64_value) {\n propertyValue.value = attrValue.uint64_value;\n typename = StandardTypeNames.Integer;\n } else if (attrValue.has_uint_value) {\n propertyValue.value = attrValue.uint_value;\n typename = StandardTypeNames.Integer;\n } else {\n propertyValue.value = undefined;\n }\n\n return { propertyValue, typename };\n }\n\n public getFeatureAttribute(fieldInfo: PbfFieldInfo, attrValue: esriPBuffer.FeatureCollectionPBuffer.Value): MapLayerFeatureAttribute|undefined {\n let propertyValue: PrimitiveValue = { valueFormat: PropertyValueFormat.Primitive };\n\n let typename = StandardTypeNames.String;\n if (fieldInfo.type === esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeDouble\n || fieldInfo.type === esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeInteger\n || fieldInfo.type === esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeSmallInteger\n || fieldInfo.type === esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeOID\n || fieldInfo.type === esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeSingle\n || fieldInfo.type === esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeDate\n ) {\n const value = this.getNumericValue(attrValue);\n if (value.propertyValue === undefined) {\n Logger.logError(loggerCategory, `Could not read numeric value for field ${fieldInfo.name}`);\n return undefined;\n }\n\n if (fieldInfo.type === esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeDate) {\n const test = (value.propertyValue.value as unknown) as number;\n propertyValue.value = new Date(test);\n typename = StandardTypeNames.DateTime;\n } else {\n typename = value.typename;\n propertyValue = value.propertyValue;\n }\n } else if (fieldInfo.type === esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeString) {\n if (attrValue.has_string_value) {\n propertyValue.value = attrValue.string_value;\n typename = StandardTypeNames.String;\n }\n } else if (fieldInfo.type === esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeGlobalID) {\n if (attrValue.has_string_value) {\n propertyValue.value = attrValue.string_value;\n typename = StandardTypeNames.String;\n } else {\n const value = this.getNumericValue(attrValue);\n if (value.propertyValue === undefined) {\n Logger.logError(loggerCategory, `Could not read GlobalId value for field ${fieldInfo.name}`);\n return undefined;\n }\n }\n } else if (attrValue.has_string_value) {\n // If we reach this case that probably mean we don't support the field type, simply try to output string value\n typename = StandardTypeNames.String;\n propertyValue.value = attrValue.string_value;\n } else if (attrValue.value_type === \"none\") {\n // Sometimes fields are just empty, use an empty string\n typename = StandardTypeNames.String;\n propertyValue.value = undefined;\n } else {\n Logger.logError(loggerCategory, `Could not read value for field ${fieldInfo.name}`);\n return undefined;\n }\n\n propertyValue.displayValue = this.getDisplayValue(typename, propertyValue.value);\n\n return {value: propertyValue, property: { name: fieldInfo.name, displayLabel: fieldInfo.name, typename } };\n }\n\n public async readAndRender(response: ArcGisResponseData, renderer: ArcGisGeometryRenderer) {\n if (!(response.data instanceof esriPBuffer.FeatureCollectionPBuffer)) {\n const msg = \"Response was not in PBF format\";\n Logger.logError(loggerCategory, msg);\n return;\n }\n\n const collection = response.data;\n if (!collection.has_queryResult || !collection.queryResult.has_featureResult || collection?.queryResult?.featureResult?.features === undefined)\n return;\n\n const attrSymbology = renderer.attributeSymbology;\n\n // Fields metadata is stored outside feature results, create dedicated array first\n const fields: PbfFieldInfo[] = [];\n for (const field of collection.queryResult.featureResult.fields)\n fields.push({name: field.name, type:field.fieldType});\n\n const geomType = collection.queryResult.featureResult.geometryType;\n const stride = (collection.queryResult.featureResult.hasM || collection.queryResult.featureResult.hasZ) ? 3 : 2;\n const relativeCoords = renderer.transform === undefined;\n for (const feature of collection.queryResult.featureResult.features) {\n\n // Render geometries\n if (renderer && feature?.has_geometry) {\n\n if (attrSymbology) {\n // Read attributes if needed (attribute driven symbology)\n this.applySymbologyAttributes(attrSymbology, feature, fields);\n }\n\n if (geomType === esriGeometryType.esriGeometryTypePoint || geomType === esriGeometryType.esriGeometryTypeMultipoint) {\n await renderer.renderPoint(feature.geometry.lengths, feature.geometry.coords, stride, relativeCoords);\n } else if (geomType === esriGeometryType.esriGeometryTypePolyline || geomType === esriGeometryType.esriGeometryTypePolygon) {\n const fill = (geomType === esriGeometryType.esriGeometryTypePolygon);\n await renderer.renderPath(feature.geometry.lengths, feature.geometry.coords, fill, stride, relativeCoords);\n }\n }\n\n }\n }\n\n private applySymbologyAttributes(attrSymbology: ArcGisAttributeDrivenSymbology, feature: esriPBuffer.FeatureCollectionPBuffer.Feature, fields: PbfFieldInfo[]) {\n if (attrSymbology) {\n const symbolFields = attrSymbology.rendererFields;\n if (symbolFields && symbolFields.length > 0 && feature.attributes) {\n let fieldIdx = 0;\n const featureAttr: {[key: string]: any} = {};\n for (const attrValue of feature.attributes) {\n if (fieldIdx > fields.length) {\n Logger.logError(loggerCategory, \"Error while read feature info data: fields metadata missing\");\n break;\n }\n const fieldInfo = fields[fieldIdx++];\n if (symbolFields.includes(fieldInfo.name)) {\n const attr = this.getFeatureAttribute(fieldInfo, attrValue);\n if (attr) {\n const primitiveValue = attr.value as PrimitiveValue;\n featureAttr[fieldInfo.name] = primitiveValue.value;\n }\n }\n\n }\n attrSymbology.setActiveFeatureAttributes(featureAttr);\n }\n }\n }\n\n public async readFeatureInfo(response: ArcGisResponseData, featureInfos: MapLayerFeatureInfo[], renderer?: ArcGisGraphicsRenderer) {\n if (!(response.data instanceof esriPBuffer.FeatureCollectionPBuffer)) {\n\n Logger.logError(loggerCategory, \"Response was not in PBF format\");\n }\n\n const collection = response.data as esriPBuffer.FeatureCollectionPBuffer;\n if (!collection.has_queryResult || !collection.queryResult.has_featureResult || collection?.queryResult?.featureResult?.features === undefined)\n return;\n\n const layerInfo: MapLayerFeatureInfo = { layerName: this._settings.name, subLayerInfos: [] };\n\n // Fields metadata is stored outside feature results, create dedicated array first\n const fields: PbfFieldInfo[] = [];\n for (const field of collection.queryResult.featureResult.fields)\n fields.push({name: field.name, type:field.fieldType});\n\n const geomType = collection.queryResult.featureResult.geometryType;\n const stride = (collection.queryResult.featureResult.hasM || collection.queryResult.featureResult.hasZ) ? 3 : 2;\n\n const subLayerInfo: MapSubLayerFeatureInfo = {\n subLayerName: this._layerMetadata.name,\n displayFieldName: this._layerMetadata.name,\n features: [],\n };\n\n // Read feature values\n for (const featureResponse of collection.queryResult.featureResult.features) {\n const feature: MapLayerFeature = { attributes: []};\n\n if (renderer && featureResponse?.has_geometry) {\n if (geomType === esriGeometryType.esriGeometryTypePoint || geomType === esriGeometryType.esriGeometryTypeMultipoint) {\n await renderer.renderPoint(featureResponse.geometry.lengths, featureResponse.geometry.coords, stride, true);\n } else if (geomType === esriGeometryType.esriGeometryTypePolyline || geomType === esriGeometryType.esriGeometryTypePolygon) {\n const fill = (geomType === esriGeometryType.esriGeometryTypePolygon);\n await renderer.renderPath(featureResponse.geometry.lengths, featureResponse.geometry.coords, fill, stride, true);\n }\n const graphics = renderer.moveGraphics();\n feature.geometries = graphics.map((graphic) => {\n return {graphic};\n });\n }\n\n let fieldIdx = 0;\n for (const attrValue of featureResponse.attributes) {\n if (fieldIdx > fields.length) {\n Logger.logError(loggerCategory, \"Error while read feature info data: fields metadata missing\");\n break;\n }\n // Convert everything to string for now\n const attr = this.getFeatureAttribute(fields[fieldIdx], attrValue);\n if (attr) {\n feature.attributes?.push(attr);\n }\n\n fieldIdx++;\n }\n subLayerInfo.features.push(feature);\n }\n\n if (layerInfo.subLayerInfos === undefined) {\n layerInfo.subLayerInfos = [];\n }\n layerInfo.subLayerInfos.push(subLayerInfo);\n featureInfos.push(layerInfo);\n }\n}\n"]}
|
|
@@ -1,86 +1,41 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { EsriRenderer, EsriSymbol, EsriUniqueValueRenderer } from "./EsriSymbology";
|
|
2
|
+
import { ArcGisAttributeDrivenSymbology } from "@itwin/core-frontend";
|
|
3
3
|
/** @internal */
|
|
4
|
-
export type
|
|
5
|
-
interface EsriSymbol {
|
|
6
|
-
type: EsriSymbolType;
|
|
7
|
-
}
|
|
8
|
-
/** @internal */
|
|
9
|
-
export type EsriSLSStyle = "esriSLSDash" | "esriSLSDashDot" | "esriSLSDashDotDot" | "esriSLSDot" | "esriSLSLongDash" | "esriSLSLongDashDot" | "esriSLSNull" | "esriSLSShortDash" | "esriSLSShortDashDot" | "esriSLSShortDashDotDot" | "esriSLSShortDot" | "esriSLSSolid";
|
|
10
|
-
interface EsriSLSProps {
|
|
11
|
-
color: number[];
|
|
12
|
-
type: EsriSymbolType;
|
|
13
|
-
width: number;
|
|
14
|
-
style: EsriSLSStyle;
|
|
15
|
-
}
|
|
16
|
-
/** @internal */
|
|
17
|
-
export declare class EsriSLS implements EsriSymbol {
|
|
18
|
-
readonly props: EsriSLSProps;
|
|
19
|
-
get color(): ColorDef | undefined;
|
|
20
|
-
get type(): EsriSymbolType;
|
|
21
|
-
get width(): number;
|
|
22
|
-
get style(): EsriSLSStyle;
|
|
23
|
-
constructor(json: EsriSLSProps);
|
|
24
|
-
static fromJSON(json: EsriSLSProps): EsriSLS;
|
|
25
|
-
}
|
|
26
|
-
interface EsriPMSProps {
|
|
27
|
-
type: EsriSymbolType;
|
|
28
|
-
url: string;
|
|
29
|
-
imageData: string;
|
|
30
|
-
contentType: string;
|
|
31
|
-
width?: number;
|
|
32
|
-
height?: number;
|
|
33
|
-
xoffset?: number;
|
|
34
|
-
yoffset?: number;
|
|
35
|
-
angle?: number;
|
|
36
|
-
}
|
|
4
|
+
export type ArcGisSymbologyRendererType = "simple" | "attributeDriven";
|
|
37
5
|
/** @internal */
|
|
38
|
-
export declare class
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
get imageUrl(): string;
|
|
45
|
-
get image(): HTMLImageElement;
|
|
46
|
-
get contentType(): string;
|
|
47
|
-
get width(): number | undefined;
|
|
48
|
-
get height(): number | undefined;
|
|
49
|
-
get xoffset(): number | undefined;
|
|
50
|
-
get yoffset(): number | undefined;
|
|
51
|
-
get angle(): number | undefined;
|
|
52
|
-
constructor(json: EsriPMSProps);
|
|
53
|
-
static fromJSON(json: EsriPMSProps): EsriPMS;
|
|
6
|
+
export declare abstract class ArcGisSymbologyRenderer {
|
|
7
|
+
abstract isAttributeDriven(): this is ArcGisAttributeDrivenSymbology;
|
|
8
|
+
abstract applyFillStyle(context: CanvasRenderingContext2D): void;
|
|
9
|
+
abstract applyStrokeStyle(context: CanvasRenderingContext2D): void;
|
|
10
|
+
abstract drawPoint(context: CanvasRenderingContext2D, ptX: number, ptY: number): void;
|
|
11
|
+
static create(renderer: EsriRenderer | undefined, defaultSymbol: EsriSymbol): ArcGisSimpleSymbologyRenderer;
|
|
54
12
|
}
|
|
55
13
|
/** @internal */
|
|
56
|
-
export
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
readonly props: EsriSFSProps;
|
|
66
|
-
private _outline;
|
|
67
|
-
get color(): ColorDef | undefined;
|
|
68
|
-
get type(): EsriSymbolType;
|
|
69
|
-
get style(): EsriSFSStyleProps;
|
|
70
|
-
get outline(): EsriSLS | undefined;
|
|
71
|
-
constructor(json: EsriSFSProps);
|
|
72
|
-
static fromJSON(json: EsriSFSProps): EsriSFS;
|
|
73
|
-
}
|
|
74
|
-
/** @internal */
|
|
75
|
-
export declare class ArcGisSymbologyRenderer {
|
|
76
|
-
private _symbol;
|
|
77
|
-
private static readonly defaultPMS;
|
|
78
|
-
private static readonly defaultSLS;
|
|
79
|
-
private static readonly defaultSFS;
|
|
80
|
-
constructor(geometryType: ArcGisFeatureGeometryType, rendererDefinition: any);
|
|
14
|
+
export declare class ArcGisSimpleSymbologyRenderer extends ArcGisSymbologyRenderer {
|
|
15
|
+
isAttributeDriven(): this is ArcGisAttributeDrivenSymbology;
|
|
16
|
+
lineWidthScaleFactor: number;
|
|
17
|
+
get symbol(): EsriSymbol;
|
|
18
|
+
get defaultSymbol(): EsriSymbol;
|
|
19
|
+
protected _symbol: EsriSymbol;
|
|
20
|
+
protected _defaultSymbol: EsriSymbol;
|
|
21
|
+
readonly renderer?: EsriRenderer;
|
|
22
|
+
constructor(renderer: EsriRenderer | undefined, defaultSymbol: EsriSymbol);
|
|
81
23
|
applyFillStyle(context: CanvasRenderingContext2D): void;
|
|
24
|
+
private getFillColor;
|
|
82
25
|
applyStrokeStyle(context: CanvasRenderingContext2D): void;
|
|
83
26
|
drawPoint(context: CanvasRenderingContext2D, ptX: number, ptY: number): void;
|
|
84
27
|
}
|
|
85
|
-
|
|
28
|
+
/** @internal */
|
|
29
|
+
export declare class ArcGisUniqueValueSymbologyRenderer extends ArcGisSimpleSymbologyRenderer implements ArcGisAttributeDrivenSymbology {
|
|
30
|
+
isAttributeDriven(): this is ArcGisAttributeDrivenSymbology;
|
|
31
|
+
protected _activeFeatureAttributes: {
|
|
32
|
+
[key: string]: any;
|
|
33
|
+
} | undefined;
|
|
34
|
+
protected uvRenderer: EsriUniqueValueRenderer;
|
|
35
|
+
get rendererFields(): string[] | undefined;
|
|
36
|
+
constructor(renderer: EsriUniqueValueRenderer, defaultSymbol: EsriSymbol);
|
|
37
|
+
setActiveFeatureAttributes(attributes: {
|
|
38
|
+
[key: string]: any;
|
|
39
|
+
}): void;
|
|
40
|
+
}
|
|
86
41
|
//# sourceMappingURL=ArcGisSymbologyRenderer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ArcGisSymbologyRenderer.d.ts","sourceRoot":"","sources":["../../../src/ArcGisFeature/ArcGisSymbologyRenderer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ArcGisSymbologyRenderer.d.ts","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