@itwin/map-layers-formats 3.5.0-dev.33
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/.nycrc +10 -0
- package/.rush/temp/package-deps_build_ci.json +33 -0
- package/.rush/temp/package-deps_cover.json +33 -0
- package/.rush/temp/package-deps_docs.json +33 -0
- package/.rush/temp/shrinkwrap-deps.json +352 -0
- package/README.md +11 -0
- package/lib/cjs/ArcGisFeature/ArcGisFeatureFormat.d.ts +9 -0
- package/lib/cjs/ArcGisFeature/ArcGisFeatureFormat.d.ts.map +1 -0
- package/lib/cjs/ArcGisFeature/ArcGisFeatureFormat.js +15 -0
- package/lib/cjs/ArcGisFeature/ArcGisFeatureFormat.js.map +1 -0
- package/lib/cjs/ArcGisFeature/ArcGisFeatureJSON.d.ts +15 -0
- package/lib/cjs/ArcGisFeature/ArcGisFeatureJSON.d.ts.map +1 -0
- package/lib/cjs/ArcGisFeature/ArcGisFeatureJSON.js +135 -0
- package/lib/cjs/ArcGisFeature/ArcGisFeatureJSON.js.map +1 -0
- package/lib/cjs/ArcGisFeature/ArcGisFeaturePBF.d.ts +15 -0
- package/lib/cjs/ArcGisFeature/ArcGisFeaturePBF.d.ts.map +1 -0
- package/lib/cjs/ArcGisFeature/ArcGisFeaturePBF.js +206 -0
- package/lib/cjs/ArcGisFeature/ArcGisFeaturePBF.js.map +1 -0
- package/lib/cjs/ArcGisFeature/ArcGisFeatureProvider.d.ts +43 -0
- package/lib/cjs/ArcGisFeature/ArcGisFeatureProvider.d.ts.map +1 -0
- package/lib/cjs/ArcGisFeature/ArcGisFeatureProvider.js +412 -0
- package/lib/cjs/ArcGisFeature/ArcGisFeatureProvider.js.map +1 -0
- package/lib/cjs/ArcGisFeature/ArcGisFeatureQuery.d.ts +94 -0
- package/lib/cjs/ArcGisFeature/ArcGisFeatureQuery.d.ts.map +1 -0
- package/lib/cjs/ArcGisFeature/ArcGisFeatureQuery.js +91 -0
- package/lib/cjs/ArcGisFeature/ArcGisFeatureQuery.js.map +1 -0
- package/lib/cjs/ArcGisFeature/ArcGisFeatureReader.d.ts +18 -0
- package/lib/cjs/ArcGisFeature/ArcGisFeatureReader.d.ts.map +1 -0
- package/lib/cjs/ArcGisFeature/ArcGisFeatureReader.js +34 -0
- package/lib/cjs/ArcGisFeature/ArcGisFeatureReader.js.map +1 -0
- package/lib/cjs/ArcGisFeature/ArcGisFeatureRenderer.d.ts +33 -0
- package/lib/cjs/ArcGisFeature/ArcGisFeatureRenderer.d.ts.map +1 -0
- package/lib/cjs/ArcGisFeature/ArcGisFeatureRenderer.js +143 -0
- package/lib/cjs/ArcGisFeature/ArcGisFeatureRenderer.js.map +1 -0
- package/lib/cjs/ArcGisFeature/ArcGisFeatureResponse.d.ts +17 -0
- package/lib/cjs/ArcGisFeature/ArcGisFeatureResponse.d.ts.map +1 -0
- package/lib/cjs/ArcGisFeature/ArcGisFeatureResponse.js +44 -0
- package/lib/cjs/ArcGisFeature/ArcGisFeatureResponse.js.map +1 -0
- package/lib/cjs/ArcGisFeature/ArcGisSymbologyRenderer.d.ts +86 -0
- package/lib/cjs/ArcGisFeature/ArcGisSymbologyRenderer.d.ts.map +1 -0
- package/lib/cjs/ArcGisFeature/ArcGisSymbologyRenderer.js +190 -0
- package/lib/cjs/ArcGisFeature/ArcGisSymbologyRenderer.js.map +1 -0
- package/lib/cjs/ArcGisFeature/esriPBuffer.gen.d.ts +1064 -0
- package/lib/cjs/ArcGisFeature/esriPBuffer.gen.d.ts.map +1 -0
- package/lib/cjs/ArcGisFeature/esriPBuffer.gen.js +2271 -0
- package/lib/cjs/ArcGisFeature/esriPBuffer.gen.js.map +1 -0
- package/lib/cjs/map-layers-formats.d.ts +9 -0
- package/lib/cjs/map-layers-formats.d.ts.map +1 -0
- package/lib/cjs/map-layers-formats.js +25 -0
- package/lib/cjs/map-layers-formats.js.map +1 -0
- package/lib/cjs/mapLayersFormats.d.ts +11 -0
- package/lib/cjs/mapLayersFormats.d.ts.map +1 -0
- package/lib/cjs/mapLayersFormats.js +29 -0
- package/lib/cjs/mapLayersFormats.js.map +1 -0
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureFeatureFormats.test.d.ts +2 -0
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureFeatureFormats.test.d.ts.map +1 -0
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureFeatureFormats.test.js +35 -0
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureFeatureFormats.test.js.map +1 -0
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureJSON.test.d.ts +2 -0
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureJSON.test.d.ts.map +1 -0
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureJSON.test.js +162 -0
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureJSON.test.js.map +1 -0
- package/lib/cjs/test/ArcGisFeature/ArcGisFeaturePBF.test.d.ts +2 -0
- package/lib/cjs/test/ArcGisFeature/ArcGisFeaturePBF.test.d.ts.map +1 -0
- package/lib/cjs/test/ArcGisFeature/ArcGisFeaturePBF.test.js +168 -0
- package/lib/cjs/test/ArcGisFeature/ArcGisFeaturePBF.test.js.map +1 -0
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureProvider.test.d.ts +2 -0
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureProvider.test.d.ts.map +1 -0
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureProvider.test.js +657 -0
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureProvider.test.js.map +1 -0
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureQuery.test.d.ts +2 -0
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureQuery.test.d.ts.map +1 -0
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureQuery.test.js +109 -0
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureQuery.test.js.map +1 -0
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureRenderer.test.d.ts +2 -0
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureRenderer.test.d.ts.map +1 -0
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureRenderer.test.js +215 -0
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureRenderer.test.js.map +1 -0
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureResponse.test.d.ts +2 -0
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureResponse.test.d.ts.map +1 -0
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureResponse.test.js +95 -0
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureResponse.test.js.map +1 -0
- package/lib/cjs/test/ArcGisFeature/ArcGisSymbologyRenderer.test.d.ts +2 -0
- package/lib/cjs/test/ArcGisFeature/ArcGisSymbologyRenderer.test.d.ts.map +1 -0
- package/lib/cjs/test/ArcGisFeature/ArcGisSymbologyRenderer.test.js +60 -0
- package/lib/cjs/test/ArcGisFeature/ArcGisSymbologyRenderer.test.js.map +1 -0
- package/lib/cjs/test/ArcGisFeature/Mocks.d.ts +7 -0
- package/lib/cjs/test/ArcGisFeature/Mocks.d.ts.map +1 -0
- package/lib/cjs/test/ArcGisFeature/Mocks.js +19 -0
- package/lib/cjs/test/ArcGisFeature/Mocks.js.map +1 -0
- package/lib/cjs/test/ArcGisFeature/NewYorkDataset.d.ts +56 -0
- package/lib/cjs/test/ArcGisFeature/NewYorkDataset.d.ts.map +1 -0
- package/lib/cjs/test/ArcGisFeature/NewYorkDataset.js +420 -0
- package/lib/cjs/test/ArcGisFeature/NewYorkDataset.js.map +1 -0
- package/lib/cjs/test/ArcGisFeature/PhillyLandmarksDataset.d.ts +1043 -0
- package/lib/cjs/test/ArcGisFeature/PhillyLandmarksDataset.d.ts.map +1 -0
- package/lib/cjs/test/ArcGisFeature/PhillyLandmarksDataset.js +427 -0
- package/lib/cjs/test/ArcGisFeature/PhillyLandmarksDataset.js.map +1 -0
- package/lib/cjs/test/coverage/.nyc_output/4a4a8f53-a85f-4448-a46a-5812eb4f4c28.json +1 -0
- package/lib/cjs/test/coverage/.nyc_output/c25e0b2e-c348-49c1-990c-2c062e25b38f.json +1 -0
- package/lib/cjs/test/coverage/.nyc_output/processinfo/4a4a8f53-a85f-4448-a46a-5812eb4f4c28.json +1 -0
- package/lib/cjs/test/coverage/.nyc_output/processinfo/c25e0b2e-c348-49c1-990c-2c062e25b38f.json +1 -0
- package/lib/cjs/test/coverage/.nyc_output/processinfo/index.json +1 -0
- package/lib/cjs/test/coverage/cobertura-coverage.xml +1162 -0
- package/lib/cjs/test/coverage/lcov-report/base.css +224 -0
- package/lib/cjs/test/coverage/lcov-report/block-navigation.js +87 -0
- package/lib/cjs/test/coverage/lcov-report/favicon.png +0 -0
- package/lib/cjs/test/coverage/lcov-report/index.html +131 -0
- package/lib/cjs/test/coverage/lcov-report/prettify.css +1 -0
- package/lib/cjs/test/coverage/lcov-report/prettify.js +2 -0
- package/lib/cjs/test/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/lib/cjs/test/coverage/lcov-report/sorter.js +196 -0
- package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureFormat.ts.html +133 -0
- package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureJSON.ts.html +550 -0
- package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeaturePBF.ts.html +736 -0
- package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureProvider.ts.html +1513 -0
- package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureQuery.ts.html +793 -0
- package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureReader.ts.html +223 -0
- package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureRenderer.ts.html +598 -0
- package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureResponse.ts.html +301 -0
- package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisSymbologyRenderer.ts.html +823 -0
- package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/index.html +236 -0
- package/lib/cjs/test/coverage/lcov-report/src/index.html +131 -0
- package/lib/cjs/test/coverage/lcov-report/src/map-layers-formats.ts.html +130 -0
- package/lib/cjs/test/coverage/lcov-report/src/mapLayersFormats.ts.html +163 -0
- package/lib/cjs/test/coverage/lcov.info +1503 -0
- package/lib/cjs/tsconfig.tsbuildinfo +1 -0
- package/lib/esm/ArcGisFeature/ArcGisFeatureFormat.d.ts +9 -0
- package/lib/esm/ArcGisFeature/ArcGisFeatureFormat.d.ts.map +1 -0
- package/lib/esm/ArcGisFeature/ArcGisFeatureFormat.js +11 -0
- package/lib/esm/ArcGisFeature/ArcGisFeatureFormat.js.map +1 -0
- package/lib/esm/ArcGisFeature/ArcGisFeatureJSON.d.ts +15 -0
- package/lib/esm/ArcGisFeature/ArcGisFeatureJSON.d.ts.map +1 -0
- package/lib/esm/ArcGisFeature/ArcGisFeatureJSON.js +131 -0
- package/lib/esm/ArcGisFeature/ArcGisFeatureJSON.js.map +1 -0
- package/lib/esm/ArcGisFeature/ArcGisFeaturePBF.d.ts +15 -0
- package/lib/esm/ArcGisFeature/ArcGisFeaturePBF.d.ts.map +1 -0
- package/lib/esm/ArcGisFeature/ArcGisFeaturePBF.js +202 -0
- package/lib/esm/ArcGisFeature/ArcGisFeaturePBF.js.map +1 -0
- package/lib/esm/ArcGisFeature/ArcGisFeatureProvider.d.ts +43 -0
- package/lib/esm/ArcGisFeature/ArcGisFeatureProvider.d.ts.map +1 -0
- package/lib/esm/ArcGisFeature/ArcGisFeatureProvider.js +408 -0
- package/lib/esm/ArcGisFeature/ArcGisFeatureProvider.js.map +1 -0
- package/lib/esm/ArcGisFeature/ArcGisFeatureQuery.d.ts +94 -0
- package/lib/esm/ArcGisFeature/ArcGisFeatureQuery.d.ts.map +1 -0
- package/lib/esm/ArcGisFeature/ArcGisFeatureQuery.js +87 -0
- package/lib/esm/ArcGisFeature/ArcGisFeatureQuery.js.map +1 -0
- package/lib/esm/ArcGisFeature/ArcGisFeatureReader.d.ts +18 -0
- package/lib/esm/ArcGisFeature/ArcGisFeatureReader.d.ts.map +1 -0
- package/lib/esm/ArcGisFeature/ArcGisFeatureReader.js +30 -0
- package/lib/esm/ArcGisFeature/ArcGisFeatureReader.js.map +1 -0
- package/lib/esm/ArcGisFeature/ArcGisFeatureRenderer.d.ts +33 -0
- package/lib/esm/ArcGisFeature/ArcGisFeatureRenderer.d.ts.map +1 -0
- package/lib/esm/ArcGisFeature/ArcGisFeatureRenderer.js +139 -0
- package/lib/esm/ArcGisFeature/ArcGisFeatureRenderer.js.map +1 -0
- package/lib/esm/ArcGisFeature/ArcGisFeatureResponse.d.ts +17 -0
- package/lib/esm/ArcGisFeature/ArcGisFeatureResponse.d.ts.map +1 -0
- package/lib/esm/ArcGisFeature/ArcGisFeatureResponse.js +40 -0
- package/lib/esm/ArcGisFeature/ArcGisFeatureResponse.js.map +1 -0
- package/lib/esm/ArcGisFeature/ArcGisSymbologyRenderer.d.ts +86 -0
- package/lib/esm/ArcGisFeature/ArcGisSymbologyRenderer.d.ts.map +1 -0
- package/lib/esm/ArcGisFeature/ArcGisSymbologyRenderer.js +183 -0
- package/lib/esm/ArcGisFeature/ArcGisSymbologyRenderer.js.map +1 -0
- package/lib/esm/ArcGisFeature/esriPBuffer.gen.d.ts +1064 -0
- package/lib/esm/ArcGisFeature/esriPBuffer.gen.d.ts.map +1 -0
- package/lib/esm/ArcGisFeature/esriPBuffer.gen.js +2268 -0
- package/lib/esm/ArcGisFeature/esriPBuffer.gen.js.map +1 -0
- package/lib/esm/map-layers-formats.d.ts +9 -0
- package/lib/esm/map-layers-formats.d.ts.map +1 -0
- package/lib/esm/map-layers-formats.js +13 -0
- package/lib/esm/map-layers-formats.js.map +1 -0
- package/lib/esm/mapLayersFormats.d.ts +11 -0
- package/lib/esm/mapLayersFormats.d.ts.map +1 -0
- package/lib/esm/mapLayersFormats.js +25 -0
- package/lib/esm/mapLayersFormats.js.map +1 -0
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureFeatureFormats.test.d.ts +2 -0
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureFeatureFormats.test.d.ts.map +1 -0
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureFeatureFormats.test.js +33 -0
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureFeatureFormats.test.js.map +1 -0
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureJSON.test.d.ts +2 -0
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureJSON.test.d.ts.map +1 -0
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureJSON.test.js +160 -0
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureJSON.test.js.map +1 -0
- package/lib/esm/test/ArcGisFeature/ArcGisFeaturePBF.test.d.ts +2 -0
- package/lib/esm/test/ArcGisFeature/ArcGisFeaturePBF.test.d.ts.map +1 -0
- package/lib/esm/test/ArcGisFeature/ArcGisFeaturePBF.test.js +166 -0
- package/lib/esm/test/ArcGisFeature/ArcGisFeaturePBF.test.js.map +1 -0
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureProvider.test.d.ts +2 -0
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureProvider.test.d.ts.map +1 -0
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureProvider.test.js +655 -0
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureProvider.test.js.map +1 -0
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureQuery.test.d.ts +2 -0
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureQuery.test.d.ts.map +1 -0
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureQuery.test.js +107 -0
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureQuery.test.js.map +1 -0
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureRenderer.test.d.ts +2 -0
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureRenderer.test.d.ts.map +1 -0
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureRenderer.test.js +213 -0
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureRenderer.test.js.map +1 -0
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureResponse.test.d.ts +2 -0
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureResponse.test.d.ts.map +1 -0
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureResponse.test.js +93 -0
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureResponse.test.js.map +1 -0
- package/lib/esm/test/ArcGisFeature/ArcGisSymbologyRenderer.test.d.ts +2 -0
- package/lib/esm/test/ArcGisFeature/ArcGisSymbologyRenderer.test.d.ts.map +1 -0
- package/lib/esm/test/ArcGisFeature/ArcGisSymbologyRenderer.test.js +58 -0
- package/lib/esm/test/ArcGisFeature/ArcGisSymbologyRenderer.test.js.map +1 -0
- package/lib/esm/test/ArcGisFeature/Mocks.d.ts +7 -0
- package/lib/esm/test/ArcGisFeature/Mocks.d.ts.map +1 -0
- package/lib/esm/test/ArcGisFeature/Mocks.js +16 -0
- package/lib/esm/test/ArcGisFeature/Mocks.js.map +1 -0
- package/lib/esm/test/ArcGisFeature/NewYorkDataset.d.ts +56 -0
- package/lib/esm/test/ArcGisFeature/NewYorkDataset.d.ts.map +1 -0
- package/lib/esm/test/ArcGisFeature/NewYorkDataset.js +416 -0
- package/lib/esm/test/ArcGisFeature/NewYorkDataset.js.map +1 -0
- package/lib/esm/test/ArcGisFeature/PhillyLandmarksDataset.d.ts +1043 -0
- package/lib/esm/test/ArcGisFeature/PhillyLandmarksDataset.d.ts.map +1 -0
- package/lib/esm/test/ArcGisFeature/PhillyLandmarksDataset.js +423 -0
- package/lib/esm/test/ArcGisFeature/PhillyLandmarksDataset.js.map +1 -0
- package/lib/esm/tsconfig.tsbuildinfo +1 -0
- package/lib/test/junit_results.xml +161 -0
- package/map-layers-formats.build.log +30 -0
- package/package.json +103 -0
- package/src/ArcGisFeature/ArcGisFeatureFormat.ts +16 -0
- package/src/ArcGisFeature/ArcGisFeatureJSON.ts +155 -0
- package/src/ArcGisFeature/ArcGisFeaturePBF.ts +217 -0
- package/src/ArcGisFeature/ArcGisFeatureProvider.ts +476 -0
- package/src/ArcGisFeature/ArcGisFeatureQuery.ts +236 -0
- package/src/ArcGisFeature/ArcGisFeatureReader.ts +46 -0
- package/src/ArcGisFeature/ArcGisFeatureRenderer.ts +171 -0
- package/src/ArcGisFeature/ArcGisFeatureResponse.ts +72 -0
- package/src/ArcGisFeature/ArcGisSymbologyRenderer.ts +246 -0
- package/src/ArcGisFeature/esriPBuffer.gen.ts +2615 -0
- package/src/map-layers-formats.ts +15 -0
- package/src/mapLayersFormats.ts +26 -0
- package/src/test/ArcGisFeature/ArcGisFeatureFeatureFormats.test.ts +46 -0
- package/src/test/ArcGisFeature/ArcGisFeatureJSON.test.ts +202 -0
- package/src/test/ArcGisFeature/ArcGisFeaturePBF.test.ts +227 -0
- package/src/test/ArcGisFeature/ArcGisFeatureProvider.test.ts +776 -0
- package/src/test/ArcGisFeature/ArcGisFeatureQuery.test.ts +124 -0
- package/src/test/ArcGisFeature/ArcGisFeatureRenderer.test.ts +296 -0
- package/src/test/ArcGisFeature/ArcGisFeatureResponse.test.ts +109 -0
- package/src/test/ArcGisFeature/ArcGisSymbologyRenderer.test.ts +77 -0
- package/src/test/ArcGisFeature/Mocks.ts +19 -0
- package/src/test/ArcGisFeature/NewYorkDataset.ts +423 -0
- package/src/test/ArcGisFeature/PhillyLandmarksDataset.ts +455 -0
- package/tsconfig.json +21 -0
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*---------------------------------------------------------------------------------------------
|
|
3
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
|
+
*--------------------------------------------------------------------------------------------*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.ArcGisFeatureJSON = void 0;
|
|
8
|
+
const appui_abstract_1 = require("@itwin/appui-abstract");
|
|
9
|
+
const core_frontend_1 = require("@itwin/core-frontend");
|
|
10
|
+
const ArcGisFeatureReader_1 = require("./ArcGisFeatureReader");
|
|
11
|
+
/** @internal */
|
|
12
|
+
class ArcGisFeatureJSON extends ArcGisFeatureReader_1.ArcGisFeatureReader {
|
|
13
|
+
constructor(settings, layerMetadata) {
|
|
14
|
+
super(settings, layerMetadata);
|
|
15
|
+
}
|
|
16
|
+
readAndRender(response, renderer) {
|
|
17
|
+
var _a, _b, _c, _d;
|
|
18
|
+
const responseObj = response.data;
|
|
19
|
+
if ((responseObj === null || responseObj === void 0 ? void 0 : responseObj.geometryType) === "esriGeometryPolyline" || (responseObj === null || responseObj === void 0 ? void 0 : responseObj.geometryType) === "esriGeometryPolygon") {
|
|
20
|
+
const fill = (responseObj.geometryType === "esriGeometryPolygon");
|
|
21
|
+
for (const feature of responseObj.features) {
|
|
22
|
+
let offset = 0;
|
|
23
|
+
const lengths = [];
|
|
24
|
+
const coords = [];
|
|
25
|
+
if ((_a = feature === null || feature === void 0 ? void 0 : feature.geometry) === null || _a === void 0 ? void 0 : _a.rings) {
|
|
26
|
+
for (const ring of (_b = feature === null || feature === void 0 ? void 0 : feature.geometry) === null || _b === void 0 ? void 0 : _b.rings) {
|
|
27
|
+
offset = ArcGisFeatureJSON.deflateCoordinates(ring, coords, 2, offset);
|
|
28
|
+
lengths.push(ring.length);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
else if ((_c = feature === null || feature === void 0 ? void 0 : feature.geometry) === null || _c === void 0 ? void 0 : _c.paths) {
|
|
32
|
+
for (const path of (_d = feature === null || feature === void 0 ? void 0 : feature.geometry) === null || _d === void 0 ? void 0 : _d.paths) {
|
|
33
|
+
offset = ArcGisFeatureJSON.deflateCoordinates(path, coords, 2, offset);
|
|
34
|
+
lengths.push(path.length);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
renderer.renderPath(lengths, coords, fill, 2, renderer.transform === undefined);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
else if ((responseObj === null || responseObj === void 0 ? void 0 : responseObj.geometryType) === "esriGeometryPoint" || (responseObj === null || responseObj === void 0 ? void 0 : responseObj.geometryType) === "esriGeometryMultiPoint") {
|
|
41
|
+
for (const feature of responseObj.features) {
|
|
42
|
+
// TODO: Add support for multipoint
|
|
43
|
+
if (feature.geometry) {
|
|
44
|
+
const lengths = [];
|
|
45
|
+
const coords = [feature.geometry.x, feature.geometry.y];
|
|
46
|
+
renderer.renderPoint(lengths, coords, 2, renderer.transform === undefined);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
// Converts an [[x1,y1], [x2,y2], ...] to [x1,y1,x2,y2, ...]
|
|
52
|
+
// stride is the number of dimensions
|
|
53
|
+
// https://github.com/openlayers/openlayers/blob/7a2f87caca9ddc1912d910f56eb5637445fc11f6/src/ol/geom/flat/deflate.js#L26
|
|
54
|
+
static deflateCoordinates(coordinates, flatCoordinates, stride, offset) {
|
|
55
|
+
for (let i = 0, ii = coordinates.length; i < ii; ++i) {
|
|
56
|
+
const coordinate = coordinates[i];
|
|
57
|
+
for (let j = 0; j < stride; ++j)
|
|
58
|
+
flatCoordinates[offset++] = coordinate[j];
|
|
59
|
+
}
|
|
60
|
+
return offset;
|
|
61
|
+
}
|
|
62
|
+
readFeatureInfo(response, featureInfos) {
|
|
63
|
+
var _a;
|
|
64
|
+
const responseObj = response.data;
|
|
65
|
+
if (responseObj === undefined || !Array.isArray(responseObj.features))
|
|
66
|
+
return;
|
|
67
|
+
const layerInfo = { layerName: this._settings.name };
|
|
68
|
+
// Create a signature index for every field name / type.
|
|
69
|
+
const fieldsType = {};
|
|
70
|
+
for (const fieldInfo of responseObj.fields) {
|
|
71
|
+
fieldsType[fieldInfo.name] = fieldInfo.type;
|
|
72
|
+
}
|
|
73
|
+
const getStandardTypeName = (fieldType) => {
|
|
74
|
+
switch (fieldType) {
|
|
75
|
+
case "esriFieldTypeInteger":
|
|
76
|
+
case "esriFieldTypeSmallInteger":
|
|
77
|
+
case "esriFieldTypeOID":
|
|
78
|
+
return appui_abstract_1.StandardTypeNames.Integer;
|
|
79
|
+
case "esriFieldTypeDouble":
|
|
80
|
+
return appui_abstract_1.StandardTypeNames.Double;
|
|
81
|
+
case "esriFieldTypeSingle":
|
|
82
|
+
return appui_abstract_1.StandardTypeNames.Float;
|
|
83
|
+
case "esriFieldTypeDate":
|
|
84
|
+
return appui_abstract_1.StandardTypeNames.DateTime;
|
|
85
|
+
default:
|
|
86
|
+
return appui_abstract_1.StandardTypeNames.String;
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
const getRecordInfo = (fieldName, value) => {
|
|
90
|
+
const propertyValue = { valueFormat: appui_abstract_1.PropertyValueFormat.Primitive };
|
|
91
|
+
if (value === null) {
|
|
92
|
+
value = undefined;
|
|
93
|
+
}
|
|
94
|
+
const strValue = `${value}`;
|
|
95
|
+
const fieldType = fieldsType[fieldName];
|
|
96
|
+
switch (fieldType) {
|
|
97
|
+
case "esriFieldTypeInteger":
|
|
98
|
+
case "esriFieldTypeSmallInteger":
|
|
99
|
+
case "esriFieldTypeOID":
|
|
100
|
+
propertyValue.value = value;
|
|
101
|
+
break;
|
|
102
|
+
case "esriFieldTypeDouble":
|
|
103
|
+
case "esriFieldTypeSingle":
|
|
104
|
+
propertyValue.value = this.toFixedWithoutPadding(value);
|
|
105
|
+
break;
|
|
106
|
+
case "esriFieldTypeDate":
|
|
107
|
+
propertyValue.value = new Date(value);
|
|
108
|
+
break;
|
|
109
|
+
default:
|
|
110
|
+
if (value !== undefined)
|
|
111
|
+
propertyValue.value = strValue;
|
|
112
|
+
break;
|
|
113
|
+
}
|
|
114
|
+
const typename = getStandardTypeName(fieldType);
|
|
115
|
+
propertyValue.displayValue = this.getDisplayValue(typename, propertyValue.value);
|
|
116
|
+
return new core_frontend_1.MapFeatureInfoRecord(propertyValue, { name: fieldName, displayLabel: fieldName, typename });
|
|
117
|
+
};
|
|
118
|
+
for (const feature of responseObj.features) {
|
|
119
|
+
const subLayerInfo = {
|
|
120
|
+
subLayerName: this._layerMetadata.name,
|
|
121
|
+
displayFieldName: this._layerMetadata.name,
|
|
122
|
+
records: [],
|
|
123
|
+
};
|
|
124
|
+
for (const [key, value] of Object.entries(feature.attributes))
|
|
125
|
+
(_a = subLayerInfo.records) === null || _a === void 0 ? void 0 : _a.push(getRecordInfo(key, value));
|
|
126
|
+
if (layerInfo.info === undefined)
|
|
127
|
+
layerInfo.info = [];
|
|
128
|
+
if (!(layerInfo.info instanceof HTMLElement))
|
|
129
|
+
layerInfo.info.push(subLayerInfo);
|
|
130
|
+
}
|
|
131
|
+
featureInfos.push(layerInfo);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
exports.ArcGisFeatureJSON = ArcGisFeatureJSON;
|
|
135
|
+
//# sourceMappingURL=ArcGisFeatureJSON.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ArcGisFeatureJSON.js","sourceRoot":"","sources":["../../../src/ArcGisFeature/ArcGisFeatureJSON.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F,0DAA+F;AAE/F,wDAAyG;AAEzG,+DAA4D;AAI5D,gBAAgB;AAChB,MAAa,iBAAmB,SAAQ,yCAAmB;IAGzD,YAAmB,QAA+B,EAAE,aAAkB;QACpE,KAAK,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC;IACjC,CAAC;IAEM,aAAa,CAAC,QAA4B,EAAE,QAA+B;;QAChF,MAAM,WAAW,GAAG,QAAQ,CAAC,IAAI,CAAC;QAElC,IAAI,CAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,YAAY,MAAK,sBAAsB,IAAI,CAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,YAAY,MAAK,qBAAqB,E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------------------------\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 { MapFeatureInfoRecord, MapLayerFeatureInfo, MapSubLayerFeatureInfo } from \"@itwin/core-frontend\";\r\nimport { Transform } from \"@itwin/core-geometry\";\r\nimport { ArcGisFeatureReader } from \"./ArcGisFeatureReader\";\r\nimport { ArcGisFeatureRenderer } from \"./ArcGisFeatureRenderer\";\r\nimport { ArcGisFieldType, ArcGisResponseData } from \"./ArcGisFeatureResponse\";\r\n\r\n/** @internal */\r\nexport class ArcGisFeatureJSON extends ArcGisFeatureReader {\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 public readAndRender(response: ArcGisResponseData, renderer: ArcGisFeatureRenderer) {\r\n const responseObj = response.data;\r\n\r\n if (responseObj?.geometryType === \"esriGeometryPolyline\" || responseObj?.geometryType === \"esriGeometryPolygon\") {\r\n const fill = (responseObj.geometryType === \"esriGeometryPolygon\");\r\n for (const feature of responseObj.features) {\r\n let offset = 0;\r\n const lengths: number[] = [];\r\n const coords: number[] = [];\r\n\r\n if (feature?.geometry?.rings) {\r\n for (const ring of feature?.geometry?.rings) {\r\n offset = ArcGisFeatureJSON.deflateCoordinates(ring, coords, 2, offset);\r\n lengths.push(ring.length);\r\n }\r\n } else if (feature?.geometry?.paths) {\r\n for (const path of feature?.geometry?.paths) {\r\n offset = ArcGisFeatureJSON.deflateCoordinates(path, coords, 2, offset);\r\n lengths.push(path.length);\r\n }\r\n }\r\n renderer.renderPath(lengths, coords, fill, 2, renderer.transform === undefined);\r\n\r\n }\r\n } else if (responseObj?.geometryType === \"esriGeometryPoint\" || responseObj?.geometryType === \"esriGeometryMultiPoint\") {\r\n for (const feature of responseObj.features) {\r\n // TODO: Add support for multipoint\r\n if (feature.geometry) {\r\n const lengths: number[] = [];\r\n const coords: number[] = [feature.geometry.x, feature.geometry.y];\r\n renderer.renderPoint(lengths, coords, 2, renderer.transform === undefined);\r\n }\r\n }\r\n }\r\n }\r\n\r\n // Converts an [[x1,y1], [x2,y2], ...] to [x1,y1,x2,y2, ...]\r\n // stride is the number of dimensions\r\n // https://github.com/openlayers/openlayers/blob/7a2f87caca9ddc1912d910f56eb5637445fc11f6/src/ol/geom/flat/deflate.js#L26\r\n protected static deflateCoordinates( coordinates: number[][], flatCoordinates: number[], stride: number, offset: number) {\r\n for (let i = 0, ii = coordinates.length; i < ii; ++i) {\r\n const coordinate = coordinates[i];\r\n for (let j = 0; j < stride; ++j)\r\n flatCoordinates[offset++] = coordinate[j];\r\n }\r\n\r\n return offset;\r\n }\r\n\r\n public readFeatureInfo(response: ArcGisResponseData, featureInfos: MapLayerFeatureInfo[]) {\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) => {\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 new MapFeatureInfoRecord (propertyValue, {name: fieldName, displayLabel: fieldName, typename});\r\n };\r\n\r\n for (const feature of responseObj.features) {\r\n const subLayerInfo: MapSubLayerFeatureInfo = {\r\n subLayerName: this._layerMetadata.name,\r\n displayFieldName: this._layerMetadata.name,\r\n records : [],\r\n };\r\n\r\n for (const [key, value] of Object.entries(feature.attributes))\r\n subLayerInfo.records?.push(getRecordInfo(key,value));\r\n\r\n if (layerInfo.info === undefined)\r\n layerInfo.info = [];\r\n\r\n if (!(layerInfo.info instanceof HTMLElement))\r\n layerInfo.info.push(subLayerInfo);\r\n }\r\n\r\n featureInfos.push(layerInfo);\r\n }\r\n}\r\n"]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ArcGisFeatureRenderer } from "./ArcGisFeatureRenderer";
|
|
2
|
+
import { esriPBuffer } from "../ArcGisFeature/esriPBuffer.gen";
|
|
3
|
+
import { MapLayerFeatureInfo } from "@itwin/core-frontend";
|
|
4
|
+
import { ImageMapLayerSettings } from "@itwin/core-common";
|
|
5
|
+
import { ArcGisFeatureReader } from "./ArcGisFeatureReader";
|
|
6
|
+
import { ArcGisResponseData } from "./ArcGisFeatureResponse";
|
|
7
|
+
import { ArcGisFeatureGeometryType } from "./ArcGisFeatureQuery";
|
|
8
|
+
/** @internal */
|
|
9
|
+
export declare class ArcGisFeaturePBF extends ArcGisFeatureReader {
|
|
10
|
+
constructor(settings: ImageMapLayerSettings, layerMetadata: any);
|
|
11
|
+
static getArcGisFeatureGeometryType(geomType: esriPBuffer.FeatureCollectionPBuffer.GeometryType): ArcGisFeatureGeometryType;
|
|
12
|
+
readAndRender(response: ArcGisResponseData, renderer: ArcGisFeatureRenderer): void;
|
|
13
|
+
readFeatureInfo(response: ArcGisResponseData, featureInfos: MapLayerFeatureInfo[]): void;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=ArcGisFeaturePBF.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ArcGisFeaturePBF.d.ts","sourceRoot":"","sources":["../../../src/ArcGisFeature/ArcGisFeaturePBF.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAC/D,OAAO,EAAwB,mBAAmB,EAA0B,MAAM,sBAAsB,CAAC;AAEzG,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAE7D,OAAO,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AAUjE,gBAAgB;AAChB,qBAAa,gBAAiB,SAAQ,mBAAmB;gBACpC,QAAQ,EAAE,qBAAqB,EAAE,aAAa,EAAE,GAAG;WAIxD,4BAA4B,CAAC,QAAQ,EAAE,WAAW,CAAC,wBAAwB,CAAC,YAAY,GAAG,yBAAyB;IAiB3H,aAAa,CAAC,QAAQ,EAAE,kBAAkB,EAAE,QAAQ,EAAE,qBAAqB;IA4B3E,eAAe,CAAC,QAAQ,EAAE,kBAAkB,EAAE,YAAY,EAAE,mBAAmB,EAAE;CA8IzF"}
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*---------------------------------------------------------------------------------------------
|
|
3
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
|
+
*--------------------------------------------------------------------------------------------*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.ArcGisFeaturePBF = void 0;
|
|
8
|
+
const esriPBuffer_gen_1 = require("../ArcGisFeature/esriPBuffer.gen");
|
|
9
|
+
const core_frontend_1 = require("@itwin/core-frontend");
|
|
10
|
+
const appui_abstract_1 = require("@itwin/appui-abstract");
|
|
11
|
+
const ArcGisFeatureReader_1 = require("./ArcGisFeatureReader");
|
|
12
|
+
const core_bentley_1 = require("@itwin/core-bentley");
|
|
13
|
+
const esriGeometryType = esriPBuffer_gen_1.esriPBuffer.FeatureCollectionPBuffer.GeometryType;
|
|
14
|
+
const loggerCategory = "MapLayersFormats.ArcGISFeature";
|
|
15
|
+
/** @internal */
|
|
16
|
+
class ArcGisFeaturePBF extends ArcGisFeatureReader_1.ArcGisFeatureReader {
|
|
17
|
+
constructor(settings, layerMetadata) {
|
|
18
|
+
super(settings, layerMetadata);
|
|
19
|
+
}
|
|
20
|
+
static getArcGisFeatureGeometryType(geomType) {
|
|
21
|
+
switch (geomType) {
|
|
22
|
+
case esriPBuffer_gen_1.esriPBuffer.FeatureCollectionPBuffer.GeometryType.esriGeometryTypeMultipatch:
|
|
23
|
+
return "esriGeometryMultiPatch";
|
|
24
|
+
case esriPBuffer_gen_1.esriPBuffer.FeatureCollectionPBuffer.GeometryType.esriGeometryTypeMultipoint:
|
|
25
|
+
return "esriGeometryMultipoint";
|
|
26
|
+
case esriPBuffer_gen_1.esriPBuffer.FeatureCollectionPBuffer.GeometryType.esriGeometryTypePoint:
|
|
27
|
+
return "esriGeometryPoint";
|
|
28
|
+
case esriPBuffer_gen_1.esriPBuffer.FeatureCollectionPBuffer.GeometryType.esriGeometryTypePolygon:
|
|
29
|
+
return "esriGeometryPolygon";
|
|
30
|
+
case esriPBuffer_gen_1.esriPBuffer.FeatureCollectionPBuffer.GeometryType.esriGeometryTypePolyline:
|
|
31
|
+
return "esriGeometryPolyline";
|
|
32
|
+
default:
|
|
33
|
+
return "esriGeometryNull";
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
readAndRender(response, renderer) {
|
|
37
|
+
var _a, _b;
|
|
38
|
+
if (!(response.data instanceof esriPBuffer_gen_1.esriPBuffer.FeatureCollectionPBuffer)) {
|
|
39
|
+
const msg = "Response was not in PBF format";
|
|
40
|
+
(0, core_bentley_1.assert)(!msg);
|
|
41
|
+
core_bentley_1.Logger.logError(loggerCategory, msg);
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
const collection = response.data;
|
|
45
|
+
if (!collection.has_queryResult || !collection.queryResult.has_featureResult || ((_b = (_a = collection === null || collection === void 0 ? void 0 : collection.queryResult) === null || _a === void 0 ? void 0 : _a.featureResult) === null || _b === void 0 ? void 0 : _b.features) === undefined)
|
|
46
|
+
return;
|
|
47
|
+
const geomType = collection.queryResult.featureResult.geometryType;
|
|
48
|
+
const stride = (collection.queryResult.featureResult.hasM || collection.queryResult.featureResult.hasZ) ? 3 : 2;
|
|
49
|
+
// console.log(`Nb Feature: ${collection.queryResult.featureResult.features.length}`);
|
|
50
|
+
if (geomType === esriGeometryType.esriGeometryTypePoint ||
|
|
51
|
+
geomType === esriGeometryType.esriGeometryTypeMultipoint) {
|
|
52
|
+
for (const feature of collection.queryResult.featureResult.features)
|
|
53
|
+
renderer.renderPoint(feature.geometry.lengths, feature.geometry.coords, stride, renderer.transform === undefined);
|
|
54
|
+
}
|
|
55
|
+
else if (geomType === esriGeometryType.esriGeometryTypePolyline || geomType === esriGeometryType.esriGeometryTypePolygon) {
|
|
56
|
+
const fill = (geomType === esriGeometryType.esriGeometryTypePolygon);
|
|
57
|
+
for (const feature of collection.queryResult.featureResult.features)
|
|
58
|
+
if (feature === null || feature === void 0 ? void 0 : feature.has_geometry)
|
|
59
|
+
renderer.renderPath(feature.geometry.lengths, feature.geometry.coords, fill, stride, renderer.transform === undefined);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
readFeatureInfo(response, featureInfos) {
|
|
63
|
+
var _a, _b, _c;
|
|
64
|
+
if (!(response.data instanceof esriPBuffer_gen_1.esriPBuffer.FeatureCollectionPBuffer)) {
|
|
65
|
+
const msg = "Response was not in PBF format";
|
|
66
|
+
(0, core_bentley_1.assert)(!msg);
|
|
67
|
+
core_bentley_1.Logger.logError(loggerCategory, msg);
|
|
68
|
+
}
|
|
69
|
+
const collection = response.data;
|
|
70
|
+
if (!collection.has_queryResult || !collection.queryResult.has_featureResult || ((_b = (_a = collection === null || collection === void 0 ? void 0 : collection.queryResult) === null || _a === void 0 ? void 0 : _a.featureResult) === null || _b === void 0 ? void 0 : _b.features) === undefined)
|
|
71
|
+
return;
|
|
72
|
+
const layerInfo = { layerName: this._settings.name, info: [] };
|
|
73
|
+
// Fields metadata is stored outside feature results, create dedicated array first
|
|
74
|
+
const fields = [];
|
|
75
|
+
for (const field of collection.queryResult.featureResult.fields)
|
|
76
|
+
fields.push({ name: field.name, type: field.fieldType });
|
|
77
|
+
const getNumericValue = (attrValue) => {
|
|
78
|
+
const propertyValue = { valueFormat: appui_abstract_1.PropertyValueFormat.Primitive };
|
|
79
|
+
let typename = appui_abstract_1.StandardTypeNames.Number;
|
|
80
|
+
if (attrValue.has_double_value) {
|
|
81
|
+
const value = this.toFixedWithoutPadding(attrValue.double_value);
|
|
82
|
+
propertyValue.value = value;
|
|
83
|
+
typename = appui_abstract_1.StandardTypeNames.Double;
|
|
84
|
+
}
|
|
85
|
+
else if (attrValue.has_float_value) {
|
|
86
|
+
const value = this.toFixedWithoutPadding(attrValue.float_value);
|
|
87
|
+
propertyValue.value = value;
|
|
88
|
+
typename = appui_abstract_1.StandardTypeNames.Float;
|
|
89
|
+
}
|
|
90
|
+
else if (attrValue.has_int64_value) {
|
|
91
|
+
propertyValue.value = attrValue.int64_value;
|
|
92
|
+
typename = appui_abstract_1.StandardTypeNames.Integer;
|
|
93
|
+
}
|
|
94
|
+
else if (attrValue.has_sint64_value) {
|
|
95
|
+
propertyValue.value = attrValue.sint64_value;
|
|
96
|
+
typename = appui_abstract_1.StandardTypeNames.Integer;
|
|
97
|
+
}
|
|
98
|
+
else if (attrValue.has_sint_value) {
|
|
99
|
+
propertyValue.value = attrValue.sint_value;
|
|
100
|
+
typename = appui_abstract_1.StandardTypeNames.Integer;
|
|
101
|
+
}
|
|
102
|
+
else if (attrValue.has_uint64_value) {
|
|
103
|
+
propertyValue.value = attrValue.uint64_value;
|
|
104
|
+
typename = appui_abstract_1.StandardTypeNames.Integer;
|
|
105
|
+
}
|
|
106
|
+
else if (attrValue.has_uint_value) {
|
|
107
|
+
propertyValue.value = attrValue.uint_value;
|
|
108
|
+
typename = appui_abstract_1.StandardTypeNames.Integer;
|
|
109
|
+
}
|
|
110
|
+
else {
|
|
111
|
+
propertyValue.value = undefined;
|
|
112
|
+
}
|
|
113
|
+
return { propertyValue, typename };
|
|
114
|
+
};
|
|
115
|
+
const getRecordInfo = (fieldInfo, attrValue) => {
|
|
116
|
+
let propertyValue = { valueFormat: appui_abstract_1.PropertyValueFormat.Primitive };
|
|
117
|
+
let typename = appui_abstract_1.StandardTypeNames.String;
|
|
118
|
+
if (fieldInfo.type === esriPBuffer_gen_1.esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeDouble
|
|
119
|
+
|| fieldInfo.type === esriPBuffer_gen_1.esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeInteger
|
|
120
|
+
|| fieldInfo.type === esriPBuffer_gen_1.esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeSmallInteger
|
|
121
|
+
|| fieldInfo.type === esriPBuffer_gen_1.esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeOID
|
|
122
|
+
|| fieldInfo.type === esriPBuffer_gen_1.esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeSingle
|
|
123
|
+
|| fieldInfo.type === esriPBuffer_gen_1.esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeDate) {
|
|
124
|
+
const value = getNumericValue(attrValue);
|
|
125
|
+
if (value.propertyValue === undefined) {
|
|
126
|
+
core_bentley_1.Logger.logError(loggerCategory, `Could not read numeric value for field ${fieldInfo.name}`);
|
|
127
|
+
return undefined;
|
|
128
|
+
}
|
|
129
|
+
if (fieldInfo.type === esriPBuffer_gen_1.esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeDate) {
|
|
130
|
+
const test = value.propertyValue.value;
|
|
131
|
+
propertyValue.value = new Date(test);
|
|
132
|
+
typename = appui_abstract_1.StandardTypeNames.DateTime;
|
|
133
|
+
}
|
|
134
|
+
else {
|
|
135
|
+
typename = value.typename;
|
|
136
|
+
propertyValue = value.propertyValue;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
else if (fieldInfo.type === esriPBuffer_gen_1.esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeString) {
|
|
140
|
+
if (attrValue.has_string_value) {
|
|
141
|
+
propertyValue.value = attrValue.string_value;
|
|
142
|
+
typename = appui_abstract_1.StandardTypeNames.String;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
else if (fieldInfo.type === esriPBuffer_gen_1.esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeGlobalID) {
|
|
146
|
+
if (attrValue.has_string_value) {
|
|
147
|
+
propertyValue.value = attrValue.string_value;
|
|
148
|
+
typename = appui_abstract_1.StandardTypeNames.String;
|
|
149
|
+
}
|
|
150
|
+
else {
|
|
151
|
+
const value = getNumericValue(attrValue);
|
|
152
|
+
if (value.propertyValue === undefined) {
|
|
153
|
+
core_bentley_1.Logger.logError(loggerCategory, `Could not read GlobalId value for field ${fieldInfo.name}`);
|
|
154
|
+
return undefined;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
else if (attrValue.has_string_value) {
|
|
159
|
+
// If we reach this case that probably mean we don't support the field type, simply try to output string value
|
|
160
|
+
typename = appui_abstract_1.StandardTypeNames.String;
|
|
161
|
+
propertyValue.value = attrValue.string_value;
|
|
162
|
+
}
|
|
163
|
+
else if (attrValue.value_type === "none") {
|
|
164
|
+
// Sometimes fields are just empty, use an empty string
|
|
165
|
+
typename = appui_abstract_1.StandardTypeNames.String;
|
|
166
|
+
propertyValue.value = undefined;
|
|
167
|
+
}
|
|
168
|
+
else {
|
|
169
|
+
core_bentley_1.Logger.logError(loggerCategory, `Could not read value for field ${fieldInfo.name}`);
|
|
170
|
+
return undefined;
|
|
171
|
+
}
|
|
172
|
+
propertyValue.displayValue = this.getDisplayValue(typename, propertyValue.value);
|
|
173
|
+
return new core_frontend_1.MapFeatureInfoRecord(propertyValue, { name: fieldInfo.name, displayLabel: fieldInfo.name, typename });
|
|
174
|
+
};
|
|
175
|
+
// Read feature values
|
|
176
|
+
for (const feature of collection.queryResult.featureResult.features) {
|
|
177
|
+
const subLayerInfo = {
|
|
178
|
+
subLayerName: this._layerMetadata.name,
|
|
179
|
+
displayFieldName: this._layerMetadata.name,
|
|
180
|
+
records: [],
|
|
181
|
+
};
|
|
182
|
+
let i = 0;
|
|
183
|
+
for (const attrValue of feature.attributes) {
|
|
184
|
+
if (i > fields.length) {
|
|
185
|
+
core_bentley_1.Logger.logError(loggerCategory, "Error while read feature info data: fields metadata missing");
|
|
186
|
+
break;
|
|
187
|
+
}
|
|
188
|
+
// Convert everything to string for now
|
|
189
|
+
const info = getRecordInfo(fields[i], attrValue);
|
|
190
|
+
if (info) {
|
|
191
|
+
(_c = subLayerInfo.records) === null || _c === void 0 ? void 0 : _c.push(info);
|
|
192
|
+
}
|
|
193
|
+
i++;
|
|
194
|
+
}
|
|
195
|
+
if (layerInfo.info === undefined) {
|
|
196
|
+
layerInfo.info = [];
|
|
197
|
+
}
|
|
198
|
+
if (!(layerInfo.info instanceof HTMLElement)) {
|
|
199
|
+
layerInfo.info.push(subLayerInfo);
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
featureInfos.push(layerInfo);
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
exports.ArcGisFeaturePBF = ArcGisFeaturePBF;
|
|
206
|
+
//# sourceMappingURL=ArcGisFeaturePBF.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ArcGisFeaturePBF.js","sourceRoot":"","sources":["../../../src/ArcGisFeature/ArcGisFeaturePBF.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAG/F,sEAA+D;AAC/D,wDAAyG;AACzG,0DAA+F;AAE/F,+DAA4D;AAE5D,sDAAqD;AAGrD,MAAM,gBAAgB,GAAG,6BAAW,CAAC,wBAAwB,CAAC,YAAY,CAAC;AAC3E,MAAM,cAAc,GAAI,gCAAgC,CAAC;AAOzD,gBAAgB;AAChB,MAAa,gBAAiB,SAAQ,yCAAmB;IACvD,YAAmB,QAA+B,EAAE,aAAkB;QACpE,KAAK,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC;IACjC,CAAC;IAEM,MAAM,CAAC,4BAA4B,CAAC,QAA2D;QACpG,QAAQ,QAAQ,EAAE;YAChB,KAAK,6BAAW,CAAC,wBAAwB,CAAC,YAAY,CAAC,0BAA0B;gBAC/E,OAAO,wBAAwB,CAAC;YAClC,KAAK,6BAAW,CAAC,wBAAwB,CAAC,YAAY,CAAC,0BAA0B;gBAC/E,OAAO,wBAAwB,CAAC;YAClC,KAAK,6BAAW,CAAC,wBAAwB,CAAC,YAAY,CAAC,qBAAqB;gBAC1E,OAAO,mBAAmB,CAAC;YAC7B,KAAK,6BAAW,CAA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Ac,EAAE,6DAA6D,CAAC,CAAC;oBAC/F,MAAM;iBACP;gBACD,uCAAuC;gBACvC,MAAM,IAAI,GAAG,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC;gBACjD,IAAI,IAAI,EAAE;oBACR,MAAA,YAAY,CAAC,OAAO,0CAAE,IAAI,CAAC,IAAI,CAAC,CAAC;iBAClC;gBAED,CAAC,EAAE,CAAC;aACL;YACD,IAAI,SAAS,CAAC,IAAI,KAAK,SAAS,EAAE;gBAChC,SAAS,CAAC,IAAI,GAAG,EAAE,CAAC;aACrB;YACD,IAAI,CAAC,CAAC,SAAS,CAAC,IAAI,YAAY,WAAW,CAAC,EAAE;gBAC5C,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;aACnC;SACF;QAED,YAAY,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAC/B,CAAC;CACF;AAhMD,4CAgMC","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 { ArcGisFeatureRenderer } from \"./ArcGisFeatureRenderer\";\r\nimport { esriPBuffer } from \"../ArcGisFeature/esriPBuffer.gen\";\r\nimport { MapFeatureInfoRecord, MapLayerFeatureInfo, MapSubLayerFeatureInfo } from \"@itwin/core-frontend\";\r\nimport { PrimitiveValue, PropertyValueFormat, StandardTypeNames } from \"@itwin/appui-abstract\";\r\nimport { ImageMapLayerSettings } from \"@itwin/core-common\";\r\nimport { ArcGisFeatureReader } from \"./ArcGisFeatureReader\";\r\nimport { ArcGisResponseData } from \"./ArcGisFeatureResponse\";\r\nimport { assert, Logger } from \"@itwin/core-bentley\";\r\nimport { ArcGisFeatureGeometryType } from \"./ArcGisFeatureQuery\";\r\n\r\nconst esriGeometryType = esriPBuffer.FeatureCollectionPBuffer.GeometryType;\r\nconst loggerCategory = \"MapLayersFormats.ArcGISFeature\";\r\n\r\ninterface PbfFieldInfo {\r\n name: string;\r\n type: esriPBuffer.FeatureCollectionPBuffer.FieldType;\r\n}\r\n\r\n/** @internal */\r\nexport class ArcGisFeaturePBF extends ArcGisFeatureReader {\r\n public constructor(settings: ImageMapLayerSettings, layerMetadata: any) {\r\n super(settings, layerMetadata);\r\n }\r\n\r\n public static getArcGisFeatureGeometryType(geomType: esriPBuffer.FeatureCollectionPBuffer.GeometryType): ArcGisFeatureGeometryType {\r\n switch (geomType) {\r\n case esriPBuffer.FeatureCollectionPBuffer.GeometryType.esriGeometryTypeMultipatch:\r\n return \"esriGeometryMultiPatch\";\r\n case esriPBuffer.FeatureCollectionPBuffer.GeometryType.esriGeometryTypeMultipoint:\r\n return \"esriGeometryMultipoint\";\r\n case esriPBuffer.FeatureCollectionPBuffer.GeometryType.esriGeometryTypePoint:\r\n return \"esriGeometryPoint\";\r\n case esriPBuffer.FeatureCollectionPBuffer.GeometryType.esriGeometryTypePolygon:\r\n return \"esriGeometryPolygon\";\r\n case esriPBuffer.FeatureCollectionPBuffer.GeometryType.esriGeometryTypePolyline:\r\n return \"esriGeometryPolyline\";\r\n default:\r\n return \"esriGeometryNull\";\r\n }\r\n }\r\n\r\n public readAndRender(response: ArcGisResponseData, renderer: ArcGisFeatureRenderer) {\r\n if (!(response.data instanceof esriPBuffer.FeatureCollectionPBuffer)) {\r\n const msg = \"Response was not in PBF format\";\r\n assert(!msg);\r\n Logger.logError(loggerCategory, msg);\r\n return;\r\n }\r\n\r\n const collection = response.data;\r\n if (!collection.has_queryResult || !collection.queryResult.has_featureResult || collection?.queryResult?.featureResult?.features === undefined)\r\n return;\r\n\r\n const geomType = collection.queryResult.featureResult.geometryType;\r\n const stride = (collection.queryResult.featureResult.hasM || collection.queryResult.featureResult.hasZ) ? 3 : 2;\r\n\r\n // console.log(`Nb Feature: ${collection.queryResult.featureResult.features.length}`);\r\n if (geomType === esriGeometryType.esriGeometryTypePoint ||\r\n geomType === esriGeometryType.esriGeometryTypeMultipoint) {\r\n for (const feature of collection.queryResult.featureResult.features)\r\n renderer.renderPoint(feature.geometry.lengths, feature.geometry.coords, stride, renderer.transform === undefined);\r\n } else if (geomType === esriGeometryType.esriGeometryTypePolyline || geomType === esriGeometryType.esriGeometryTypePolygon) {\r\n const fill = (geomType === esriGeometryType.esriGeometryTypePolygon);\r\n for (const feature of collection.queryResult.featureResult.features)\r\n if (feature?.has_geometry)\r\n renderer.renderPath(feature.geometry.lengths, feature.geometry.coords, fill, stride, renderer.transform === undefined);\r\n }\r\n }\r\n\r\n public readFeatureInfo(response: ArcGisResponseData, featureInfos: MapLayerFeatureInfo[]) {\r\n if (!(response.data instanceof esriPBuffer.FeatureCollectionPBuffer)) {\r\n const msg = \"Response was not in PBF format\";\r\n assert(!msg);\r\n Logger.logError(loggerCategory, msg);\r\n }\r\n\r\n const collection = response.data as esriPBuffer.FeatureCollectionPBuffer;\r\n if (!collection.has_queryResult || !collection.queryResult.has_featureResult || collection?.queryResult?.featureResult?.features === undefined)\r\n return;\r\n\r\n const layerInfo: MapLayerFeatureInfo = { layerName: this._settings.name, info: [] };\r\n\r\n // Fields metadata is stored outside feature results, create dedicated array first\r\n const fields: PbfFieldInfo[] = [];\r\n for (const field of collection.queryResult.featureResult.fields)\r\n fields.push({name: field.name, type:field.fieldType});\r\n\r\n const getNumericValue = (attrValue: esriPBuffer.FeatureCollectionPBuffer.Value) => {\r\n const propertyValue: PrimitiveValue = { valueFormat: PropertyValueFormat.Primitive };\r\n let typename = StandardTypeNames.Number;\r\n if (attrValue.has_double_value) {\r\n const value = this.toFixedWithoutPadding(attrValue.double_value);\r\n propertyValue.value = value;\r\n typename = StandardTypeNames.Double;\r\n } else if (attrValue.has_float_value) {\r\n const value = this.toFixedWithoutPadding(attrValue.float_value);\r\n propertyValue.value = value;\r\n typename = StandardTypeNames.Float;\r\n } else if (attrValue.has_int64_value) {\r\n propertyValue.value = attrValue.int64_value;\r\n typename = StandardTypeNames.Integer;\r\n } else if (attrValue.has_sint64_value) {\r\n propertyValue.value = attrValue.sint64_value;\r\n typename = StandardTypeNames.Integer;\r\n } else if (attrValue.has_sint_value) {\r\n propertyValue.value = attrValue.sint_value;\r\n typename = StandardTypeNames.Integer;\r\n } else if (attrValue.has_uint64_value) {\r\n propertyValue.value = attrValue.uint64_value;\r\n typename = StandardTypeNames.Integer;\r\n } else if (attrValue.has_uint_value) {\r\n propertyValue.value = attrValue.uint_value;\r\n typename = StandardTypeNames.Integer;\r\n } else {\r\n propertyValue.value = undefined;\r\n }\r\n\r\n return { propertyValue, typename };\r\n };\r\n\r\n const getRecordInfo = (fieldInfo: PbfFieldInfo, attrValue: esriPBuffer.FeatureCollectionPBuffer.Value) => {\r\n let propertyValue: PrimitiveValue = { valueFormat: PropertyValueFormat.Primitive };\r\n\r\n let typename = StandardTypeNames.String;\r\n if (fieldInfo.type === esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeDouble\r\n || fieldInfo.type === esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeInteger\r\n || fieldInfo.type === esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeSmallInteger\r\n || fieldInfo.type === esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeOID\r\n || fieldInfo.type === esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeSingle\r\n || fieldInfo.type === esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeDate\r\n ) {\r\n const value = getNumericValue(attrValue);\r\n if (value.propertyValue === undefined) {\r\n Logger.logError(loggerCategory, `Could not read numeric value for field ${fieldInfo.name}`);\r\n return undefined;\r\n }\r\n\r\n if (fieldInfo.type === esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeDate) {\r\n const test = (value.propertyValue.value as unknown) as number;\r\n propertyValue.value = new Date(test);\r\n typename = StandardTypeNames.DateTime;\r\n } else {\r\n typename = value.typename;\r\n propertyValue = value.propertyValue;\r\n }\r\n } else if (fieldInfo.type === esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeString) {\r\n if (attrValue.has_string_value) {\r\n propertyValue.value = attrValue.string_value;\r\n typename = StandardTypeNames.String;\r\n }\r\n } else if (fieldInfo.type === esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeGlobalID) {\r\n if (attrValue.has_string_value) {\r\n propertyValue.value = attrValue.string_value;\r\n typename = StandardTypeNames.String;\r\n } else {\r\n const value = getNumericValue(attrValue);\r\n if (value.propertyValue === undefined) {\r\n Logger.logError(loggerCategory, `Could not read GlobalId value for field ${fieldInfo.name}`);\r\n return undefined;\r\n }\r\n }\r\n } else if (attrValue.has_string_value) {\r\n // If we reach this case that probably mean we don't support the field type, simply try to output string value\r\n typename = StandardTypeNames.String;\r\n propertyValue.value = attrValue.string_value;\r\n } else if (attrValue.value_type === \"none\") {\r\n // Sometimes fields are just empty, use an empty string\r\n typename = StandardTypeNames.String;\r\n propertyValue.value = undefined;\r\n } else {\r\n Logger.logError(loggerCategory, `Could not read value for field ${fieldInfo.name}`);\r\n return undefined;\r\n }\r\n\r\n propertyValue.displayValue = this.getDisplayValue(typename, propertyValue.value);\r\n\r\n return new MapFeatureInfoRecord(propertyValue, { name: fieldInfo.name, displayLabel: fieldInfo.name, typename });\r\n };\r\n\r\n // Read feature values\r\n for (const feature of collection.queryResult.featureResult.features) {\r\n const subLayerInfo: MapSubLayerFeatureInfo = {\r\n subLayerName: this._layerMetadata.name,\r\n displayFieldName: this._layerMetadata.name,\r\n records: [],\r\n };\r\n let i = 0;\r\n\r\n for (const attrValue of feature.attributes) {\r\n if (i > fields.length) {\r\n Logger.logError(loggerCategory, \"Error while read feature info data: fields metadata missing\");\r\n break;\r\n }\r\n // Convert everything to string for now\r\n const info = getRecordInfo(fields[i], attrValue);\r\n if (info) {\r\n subLayerInfo.records?.push(info);\r\n }\r\n\r\n i++;\r\n }\r\n if (layerInfo.info === undefined) {\r\n layerInfo.info = [];\r\n }\r\n if (!(layerInfo.info instanceof HTMLElement)) {\r\n layerInfo.info.push(subLayerInfo);\r\n }\r\n }\r\n\r\n featureInfos.push(layerInfo);\r\n }\r\n}\r\n"]}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { Cartographic, ImageMapLayerSettings, ImageSource } from "@itwin/core-common";
|
|
2
|
+
import { Transform } from "@itwin/core-geometry";
|
|
3
|
+
import { ArcGISImageryProvider, ImageryMapTileTree, MapLayerFeatureInfo, QuadId } from "@itwin/core-frontend";
|
|
4
|
+
import { ArcGisExtent, ArcGisFeatureFormat, ArcGisGeometry } from "./ArcGisFeatureQuery";
|
|
5
|
+
/**
|
|
6
|
+
* @internal
|
|
7
|
+
*/
|
|
8
|
+
interface ArcGisFeatureUrl {
|
|
9
|
+
url: string;
|
|
10
|
+
envelope?: ArcGisExtent;
|
|
11
|
+
}
|
|
12
|
+
/** Provide tiles from a ESRI ArcGIS Feature service
|
|
13
|
+
* @internal
|
|
14
|
+
*/
|
|
15
|
+
export declare class ArcGisFeatureProvider extends ArcGISImageryProvider {
|
|
16
|
+
private _drawDebugInfo;
|
|
17
|
+
private _debugFeatureGeom;
|
|
18
|
+
private _supportsCoordinatesQuantization;
|
|
19
|
+
private _querySupported;
|
|
20
|
+
private _layerId;
|
|
21
|
+
private _layerMetadata;
|
|
22
|
+
private _format;
|
|
23
|
+
serviceJson: any;
|
|
24
|
+
private _symbologyRenderer;
|
|
25
|
+
private static readonly _nbSubTiles;
|
|
26
|
+
private _outSR;
|
|
27
|
+
private _maxDepthFromLod;
|
|
28
|
+
private _minDepthFromLod;
|
|
29
|
+
constructor(settings: ImageMapLayerSettings);
|
|
30
|
+
initialize(): Promise<void>;
|
|
31
|
+
protected getLayerMetadata(layerId: number): Promise<any>;
|
|
32
|
+
get tileSize(): number;
|
|
33
|
+
get format(): ArcGisFeatureFormat | undefined;
|
|
34
|
+
constructUrl(_row: number, _column: number, _zoomLevel: number): Promise<string>;
|
|
35
|
+
constructFeatureUrl(row: number, column: number, zoomLevel: number, format: ArcGisFeatureFormat, geomOverride?: ArcGisGeometry, outFields?: string, tolerance?: number, returnGeometry?: boolean): ArcGisFeatureUrl | undefined;
|
|
36
|
+
getFeatureInfo(featureInfos: MapLayerFeatureInfo[], quadId: QuadId, carto: Cartographic, _tree: ImageryMapTileTree): Promise<void>;
|
|
37
|
+
private fetchTile;
|
|
38
|
+
drawTileDebugInfo(row: number, column: number, zoomLevel: number, context: CanvasRenderingContext2D): void;
|
|
39
|
+
protected computeTileWorld2CanvasTransform(row: number, column: number, zoomLevel: number): Transform | undefined;
|
|
40
|
+
loadTile(row: number, column: number, zoomLevel: number): Promise<ImageSource | undefined>;
|
|
41
|
+
}
|
|
42
|
+
export {};
|
|
43
|
+
//# sourceMappingURL=ArcGisFeatureProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ArcGisFeatureProvider.d.ts","sourceRoot":"","sources":["../../../src/ArcGisFeature/ArcGisFeatureProvider.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,EAAE,qBAAqB,EAAE,WAAW,EAAkC,MAAM,oBAAoB,CAAC;AAEtH,OAAO,EAAqB,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAmB,qBAAqB,EAAmB,kBAAkB,EAAE,mBAAmB,EAAiC,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAE/K,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAsB,cAAc,EAAkC,MAAM,sBAAsB,CAAC;AAO7I;;EAEE;AACF,UAAU,gBAAgB;IACxB,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,YAAY,CAAC;CACzB;AAED;;EAEE;AACF,qBAAa,qBAAsB,SAAQ,qBAAqB;IAE9D,OAAO,CAAC,cAAc,CAAS;IAC/B,OAAO,CAAC,iBAAiB,CAAS;IAElC,OAAO,CAAC,gCAAgC,CAAS;IACjD,OAAO,CAAC,eA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