@itwin/map-layers-formats 4.0.0-dev.8 → 4.0.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/.rush/temp/operation/build/all.log +3 -0
- package/.rush/temp/operation/build/state.json +3 -0
- package/.rush/temp/operation/cover/all.log +98 -0
- package/.rush/temp/operation/cover/state.json +1 -1
- package/.rush/temp/operation/docs/all.log +30 -0
- package/.rush/temp/operation/docs/state.json +1 -1
- package/.rush/temp/{package-deps_build_ci.json → package-deps_build.json} +11 -11
- package/.rush/temp/package-deps_cover.json +10 -10
- package/.rush/temp/package-deps_docs.json +10 -10
- package/.rush/temp/shrinkwrap-deps.json +190 -44
- package/CHANGELOG.json +57 -0
- package/CHANGELOG.md +44 -1
- package/config/rush-project.json +1 -2
- package/lib/cjs/ArcGisFeature/ArcGisFeatureFormat.d.ts +8 -8
- package/lib/cjs/ArcGisFeature/ArcGisFeatureFormat.js +14 -14
- package/lib/cjs/ArcGisFeature/ArcGisFeatureFormat.js.map +1 -1
- package/lib/cjs/ArcGisFeature/ArcGisFeatureJSON.d.ts +14 -14
- package/lib/cjs/ArcGisFeature/ArcGisFeatureJSON.js +132 -134
- package/lib/cjs/ArcGisFeature/ArcGisFeatureJSON.js.map +1 -1
- package/lib/cjs/ArcGisFeature/ArcGisFeaturePBF.d.ts +14 -14
- package/lib/cjs/ArcGisFeature/ArcGisFeaturePBF.js +200 -202
- package/lib/cjs/ArcGisFeature/ArcGisFeaturePBF.js.map +1 -1
- package/lib/cjs/ArcGisFeature/ArcGisFeatureProvider.d.ts +44 -44
- package/lib/cjs/ArcGisFeature/ArcGisFeatureProvider.js +421 -422
- package/lib/cjs/ArcGisFeature/ArcGisFeatureProvider.js.map +1 -1
- package/lib/cjs/ArcGisFeature/ArcGisFeatureQuery.d.ts +92 -92
- package/lib/cjs/ArcGisFeature/ArcGisFeatureQuery.d.ts.map +1 -1
- package/lib/cjs/ArcGisFeature/ArcGisFeatureQuery.js +82 -82
- package/lib/cjs/ArcGisFeature/ArcGisFeatureReader.d.ts +17 -17
- package/lib/cjs/ArcGisFeature/ArcGisFeatureReader.js +33 -33
- package/lib/cjs/ArcGisFeature/ArcGisFeatureRenderer.d.ts +32 -32
- package/lib/cjs/ArcGisFeature/ArcGisFeatureRenderer.js +142 -142
- package/lib/cjs/ArcGisFeature/ArcGisFeatureResponse.d.ts +16 -16
- package/lib/cjs/ArcGisFeature/ArcGisFeatureResponse.d.ts.map +1 -1
- package/lib/cjs/ArcGisFeature/ArcGisFeatureResponse.js +42 -43
- package/lib/cjs/ArcGisFeature/ArcGisFeatureResponse.js.map +1 -1
- package/lib/cjs/ArcGisFeature/ArcGisSymbologyRenderer.d.ts +85 -85
- package/lib/cjs/ArcGisFeature/ArcGisSymbologyRenderer.d.ts.map +1 -1
- package/lib/cjs/ArcGisFeature/ArcGisSymbologyRenderer.js +189 -192
- package/lib/cjs/ArcGisFeature/ArcGisSymbologyRenderer.js.map +1 -1
- package/lib/cjs/ArcGisFeature/esriPBuffer.gen.d.ts +1063 -1063
- package/lib/cjs/ArcGisFeature/esriPBuffer.gen.d.ts.map +1 -1
- package/lib/cjs/ArcGisFeature/esriPBuffer.gen.js +2267 -2270
- package/lib/cjs/ArcGisFeature/esriPBuffer.gen.js.map +1 -1
- package/lib/cjs/map-layers-formats.d.ts +8 -8
- package/lib/cjs/map-layers-formats.js +28 -24
- package/lib/cjs/map-layers-formats.js.map +1 -1
- package/lib/cjs/mapLayersFormats.d.ts +10 -10
- package/lib/cjs/mapLayersFormats.js +28 -28
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureFeatureFormats.test.d.ts +1 -1
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureFeatureFormats.test.js +34 -34
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureJSON.test.d.ts +1 -1
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureJSON.test.js +161 -161
- package/lib/cjs/test/ArcGisFeature/ArcGisFeaturePBF.test.d.ts +1 -1
- package/lib/cjs/test/ArcGisFeature/ArcGisFeaturePBF.test.js +167 -167
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureProvider.test.d.ts +1 -1
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureProvider.test.js +679 -680
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureProvider.test.js.map +1 -1
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureQuery.test.d.ts +1 -1
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureQuery.test.js +103 -103
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureRenderer.test.d.ts +1 -1
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureRenderer.test.js +214 -214
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureResponse.test.d.ts +1 -1
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureResponse.test.js +94 -94
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureResponse.test.js.map +1 -1
- package/lib/cjs/test/ArcGisFeature/ArcGisSymbologyRenderer.test.d.ts +1 -1
- package/lib/cjs/test/ArcGisFeature/ArcGisSymbologyRenderer.test.js +59 -59
- package/lib/cjs/test/ArcGisFeature/Mocks.d.ts +6 -6
- package/lib/cjs/test/ArcGisFeature/Mocks.js +18 -18
- package/lib/cjs/test/ArcGisFeature/NewYorkDataset.d.ts +55 -55
- package/lib/cjs/test/ArcGisFeature/NewYorkDataset.d.ts.map +1 -1
- package/lib/cjs/test/ArcGisFeature/NewYorkDataset.js +419 -419
- package/lib/cjs/test/ArcGisFeature/NewYorkDataset.js.map +1 -1
- package/lib/cjs/test/ArcGisFeature/PhillyLandmarksDataset.d.ts +1042 -1042
- package/lib/cjs/test/ArcGisFeature/PhillyLandmarksDataset.d.ts.map +1 -1
- package/lib/cjs/test/ArcGisFeature/PhillyLandmarksDataset.js +426 -426
- package/lib/cjs/test/ArcGisFeature/PhillyLandmarksDataset.js.map +1 -1
- package/lib/cjs/test/coverage/.nyc_output/965fc94c-e7e4-4e85-bf72-aecce4f5ac8c.json +1 -0
- package/lib/cjs/test/coverage/.nyc_output/processinfo/4935e330-732e-4dc9-9cc7-6639c02bf614.json +1 -0
- package/lib/cjs/test/coverage/.nyc_output/processinfo/965fc94c-e7e4-4e85-bf72-aecce4f5ac8c.json +1 -0
- package/lib/cjs/test/coverage/.nyc_output/processinfo/index.json +1 -1
- package/lib/cjs/test/coverage/cobertura-coverage.xml +72 -72
- package/lib/cjs/test/coverage/lcov-report/index.html +5 -5
- package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureFormat.ts.html +1 -1
- package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureJSON.ts.html +10 -10
- package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeaturePBF.ts.html +7 -7
- package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureProvider.ts.html +10 -10
- package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureQuery.ts.html +1 -1
- package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureReader.ts.html +1 -1
- package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureRenderer.ts.html +1 -1
- package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureResponse.ts.html +4 -4
- package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisSymbologyRenderer.ts.html +8 -8
- package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/index.html +13 -13
- package/lib/cjs/test/coverage/lcov-report/src/index.html +1 -1
- package/lib/cjs/test/coverage/lcov-report/src/map-layers-formats.ts.html +1 -1
- package/lib/cjs/test/coverage/lcov-report/src/mapLayersFormats.ts.html +1 -1
- package/lib/cjs/test/coverage/lcov.info +355 -531
- package/lib/cjs/tsconfig.tsbuildinfo +1 -1
- package/lib/esm/ArcGisFeature/ArcGisFeatureFormat.d.ts +8 -8
- package/lib/esm/ArcGisFeature/ArcGisFeatureFormat.js +11 -10
- package/lib/esm/ArcGisFeature/ArcGisFeatureFormat.js.map +1 -1
- package/lib/esm/ArcGisFeature/ArcGisFeatureJSON.d.ts +14 -14
- package/lib/esm/ArcGisFeature/ArcGisFeatureJSON.js +128 -130
- package/lib/esm/ArcGisFeature/ArcGisFeatureJSON.js.map +1 -1
- package/lib/esm/ArcGisFeature/ArcGisFeaturePBF.d.ts +14 -14
- package/lib/esm/ArcGisFeature/ArcGisFeaturePBF.js +196 -198
- package/lib/esm/ArcGisFeature/ArcGisFeaturePBF.js.map +1 -1
- package/lib/esm/ArcGisFeature/ArcGisFeatureProvider.d.ts +44 -44
- package/lib/esm/ArcGisFeature/ArcGisFeatureProvider.js +418 -418
- package/lib/esm/ArcGisFeature/ArcGisFeatureProvider.js.map +1 -1
- package/lib/esm/ArcGisFeature/ArcGisFeatureQuery.d.ts +92 -92
- package/lib/esm/ArcGisFeature/ArcGisFeatureQuery.d.ts.map +1 -1
- package/lib/esm/ArcGisFeature/ArcGisFeatureQuery.js +78 -78
- package/lib/esm/ArcGisFeature/ArcGisFeatureReader.d.ts +17 -17
- package/lib/esm/ArcGisFeature/ArcGisFeatureReader.js +29 -29
- package/lib/esm/ArcGisFeature/ArcGisFeatureRenderer.d.ts +32 -32
- package/lib/esm/ArcGisFeature/ArcGisFeatureRenderer.js +138 -138
- package/lib/esm/ArcGisFeature/ArcGisFeatureResponse.d.ts +16 -16
- package/lib/esm/ArcGisFeature/ArcGisFeatureResponse.d.ts.map +1 -1
- package/lib/esm/ArcGisFeature/ArcGisFeatureResponse.js +38 -39
- package/lib/esm/ArcGisFeature/ArcGisFeatureResponse.js.map +1 -1
- package/lib/esm/ArcGisFeature/ArcGisSymbologyRenderer.d.ts +85 -85
- package/lib/esm/ArcGisFeature/ArcGisSymbologyRenderer.d.ts.map +1 -1
- package/lib/esm/ArcGisFeature/ArcGisSymbologyRenderer.js +183 -185
- package/lib/esm/ArcGisFeature/ArcGisSymbologyRenderer.js.map +1 -1
- package/lib/esm/ArcGisFeature/esriPBuffer.gen.d.ts +1063 -1063
- package/lib/esm/ArcGisFeature/esriPBuffer.gen.d.ts.map +1 -1
- package/lib/esm/ArcGisFeature/esriPBuffer.gen.js +2264 -2267
- package/lib/esm/ArcGisFeature/esriPBuffer.gen.js.map +1 -1
- package/lib/esm/map-layers-formats.d.ts +8 -8
- package/lib/esm/map-layers-formats.js +12 -12
- package/lib/esm/mapLayersFormats.d.ts +10 -10
- package/lib/esm/mapLayersFormats.js +24 -24
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureFeatureFormats.test.d.ts +1 -1
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureFeatureFormats.test.js +32 -32
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureJSON.test.d.ts +1 -1
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureJSON.test.js +159 -159
- package/lib/esm/test/ArcGisFeature/ArcGisFeaturePBF.test.d.ts +1 -1
- package/lib/esm/test/ArcGisFeature/ArcGisFeaturePBF.test.js +165 -165
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureProvider.test.d.ts +1 -1
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureProvider.test.js +677 -678
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureProvider.test.js.map +1 -1
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureQuery.test.d.ts +1 -1
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureQuery.test.js +101 -101
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureRenderer.test.d.ts +1 -1
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureRenderer.test.js +212 -212
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureResponse.test.d.ts +1 -1
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureResponse.test.js +92 -92
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureResponse.test.js.map +1 -1
- package/lib/esm/test/ArcGisFeature/ArcGisSymbologyRenderer.test.d.ts +1 -1
- package/lib/esm/test/ArcGisFeature/ArcGisSymbologyRenderer.test.js +57 -57
- package/lib/esm/test/ArcGisFeature/Mocks.d.ts +6 -6
- package/lib/esm/test/ArcGisFeature/Mocks.js +15 -15
- package/lib/esm/test/ArcGisFeature/NewYorkDataset.d.ts +55 -55
- package/lib/esm/test/ArcGisFeature/NewYorkDataset.d.ts.map +1 -1
- package/lib/esm/test/ArcGisFeature/NewYorkDataset.js +416 -415
- package/lib/esm/test/ArcGisFeature/NewYorkDataset.js.map +1 -1
- package/lib/esm/test/ArcGisFeature/PhillyLandmarksDataset.d.ts +1042 -1042
- package/lib/esm/test/ArcGisFeature/PhillyLandmarksDataset.d.ts.map +1 -1
- package/lib/esm/test/ArcGisFeature/PhillyLandmarksDataset.js +423 -422
- package/lib/esm/test/ArcGisFeature/PhillyLandmarksDataset.js.map +1 -1
- package/lib/esm/tsconfig.tsbuildinfo +1 -1
- package/lib/test/junit_results.xml +48 -48
- package/map-layers-formats.build.log +2 -2
- package/package.json +17 -17
- package/src/ArcGisFeature/esriPBuffer.gen.ts +1 -4
- package/src/test/ArcGisFeature/ArcGisFeatureProvider.test.ts +21 -21
- package/src/test/ArcGisFeature/NewYorkDataset.ts +187 -187
- package/src/test/ArcGisFeature/PhillyLandmarksDataset.ts +4 -4
- package/tsconfig.json +1 -2
- package/.rush/temp/operation/build_ci/state.json +0 -3
- package/lib/cjs/test/coverage/.nyc_output/bb9e12be-ea3c-4cee-99d0-c7a34bd2c47a.json +0 -1
- package/lib/cjs/test/coverage/.nyc_output/processinfo/5901bdfe-760d-4ca3-9674-876be7ed11b1.json +0 -1
- package/lib/cjs/test/coverage/.nyc_output/processinfo/bb9e12be-ea3c-4cee-99d0-c7a34bd2c47a.json +0 -1
- /package/lib/cjs/test/coverage/.nyc_output/{5901bdfe-760d-4ca3-9674-876be7ed11b1.json → 4935e330-732e-4dc9-9cc7-6639c02bf614.json} +0 -0
|
@@ -1,34 +1,34 @@
|
|
|
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.ArcGisFeatureReader = void 0;
|
|
8
|
-
const appui_abstract_1 = require("@itwin/appui-abstract");
|
|
9
|
-
/** @internal */
|
|
10
|
-
class ArcGisFeatureReader {
|
|
11
|
-
constructor(settings, layerMetadata) {
|
|
12
|
-
// Force display value of date to ISO 8601 format.
|
|
13
|
-
// Turning this ON, will disable display value in end-user's locale
|
|
14
|
-
this.forceDateDisplayValueToIso = false;
|
|
15
|
-
this.toFixedWithoutPadding = (value) => {
|
|
16
|
-
return (this.floatPrecision === undefined ? value : parseFloat(value.toFixed(this.floatPrecision)));
|
|
17
|
-
};
|
|
18
|
-
this.getDisplayValue = (typename, value) => {
|
|
19
|
-
if (value === undefined) {
|
|
20
|
-
return "";
|
|
21
|
-
}
|
|
22
|
-
else if (typename === appui_abstract_1.StandardTypeNames.DateTime && this.forceDateDisplayValueToIso) {
|
|
23
|
-
return value.toISOString();
|
|
24
|
-
}
|
|
25
|
-
else {
|
|
26
|
-
return `${value}`;
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
this._settings = settings;
|
|
30
|
-
this._layerMetadata = layerMetadata;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
exports.ArcGisFeatureReader = ArcGisFeatureReader;
|
|
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.ArcGisFeatureReader = void 0;
|
|
8
|
+
const appui_abstract_1 = require("@itwin/appui-abstract");
|
|
9
|
+
/** @internal */
|
|
10
|
+
class ArcGisFeatureReader {
|
|
11
|
+
constructor(settings, layerMetadata) {
|
|
12
|
+
// Force display value of date to ISO 8601 format.
|
|
13
|
+
// Turning this ON, will disable display value in end-user's locale
|
|
14
|
+
this.forceDateDisplayValueToIso = false;
|
|
15
|
+
this.toFixedWithoutPadding = (value) => {
|
|
16
|
+
return (this.floatPrecision === undefined ? value : parseFloat(value.toFixed(this.floatPrecision)));
|
|
17
|
+
};
|
|
18
|
+
this.getDisplayValue = (typename, value) => {
|
|
19
|
+
if (value === undefined) {
|
|
20
|
+
return "";
|
|
21
|
+
}
|
|
22
|
+
else if (typename === appui_abstract_1.StandardTypeNames.DateTime && this.forceDateDisplayValueToIso) {
|
|
23
|
+
return value.toISOString();
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
return `${value}`;
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
this._settings = settings;
|
|
30
|
+
this._layerMetadata = layerMetadata;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
exports.ArcGisFeatureReader = ArcGisFeatureReader;
|
|
34
34
|
//# sourceMappingURL=ArcGisFeatureReader.js.map
|
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import { Transform } from "@itwin/core-geometry";
|
|
2
|
-
import { ArcGisSymbologyRenderer } from "./ArcGisSymbologyRenderer";
|
|
3
|
-
/** @internal */
|
|
4
|
-
export declare class ArcGisFeatureRenderer {
|
|
5
|
-
private _symbol;
|
|
6
|
-
private _transform;
|
|
7
|
-
private _context;
|
|
8
|
-
constructor(context: CanvasRenderingContext2D, symbol: ArcGisSymbologyRenderer, world2PixelTransform?: Transform);
|
|
9
|
-
get transform(): Transform | undefined;
|
|
10
|
-
private closePath;
|
|
11
|
-
private lineTo;
|
|
12
|
-
private moveTo;
|
|
13
|
-
private fill;
|
|
14
|
-
private stroke;
|
|
15
|
-
/**
|
|
16
|
-
* Render a path on the renderer's context.
|
|
17
|
-
* Note: Inputs are designed based on the PBF format, to avoid any data transformation.
|
|
18
|
-
* @param geometryLengths Array be used to determine the start and end of each sub-path / rings. (i.e. [5,5] = two rings of 5 vertices)
|
|
19
|
-
* @param geometryCoords Array that linearly encodes the vertices of each sub-path of a polyline / ring of a polygon
|
|
20
|
-
* @param fill Indicates if the path should be filled or not.
|
|
21
|
-
* @param stride Dimension of each vertices (i.e. 2 or 3. 3 could be X,Y,Z, X,YM) Currently 3rd dimension is ignored.
|
|
22
|
-
*/
|
|
23
|
-
renderPath(geometryLengths: number[], geometryCoords: number[], fill: boolean, stride: number, relativeCoords: boolean): void;
|
|
24
|
-
/**
|
|
25
|
-
* Render a point on the renderer's context.
|
|
26
|
-
* Note: Inputs are designed based on the PBF format, to avoid any data transformation.
|
|
27
|
-
* @param geometryLengths Array be used to determine the start and end of each multi-point array, empty for single point.
|
|
28
|
-
* @param geometryCoords Array that linearly encodes vertices.
|
|
29
|
-
* @param stride Dimension of each vertices (i.e. 2 or 3. 3 could be X,Y,Z, X,YM) Currently 3rd dimension is ignored.
|
|
30
|
-
*/
|
|
31
|
-
renderPoint(geometryLengths: number[], geometryCoords: number[], stride: number, relativeCoords: boolean): void;
|
|
32
|
-
}
|
|
1
|
+
import { Transform } from "@itwin/core-geometry";
|
|
2
|
+
import { ArcGisSymbologyRenderer } from "./ArcGisSymbologyRenderer";
|
|
3
|
+
/** @internal */
|
|
4
|
+
export declare class ArcGisFeatureRenderer {
|
|
5
|
+
private _symbol;
|
|
6
|
+
private _transform;
|
|
7
|
+
private _context;
|
|
8
|
+
constructor(context: CanvasRenderingContext2D, symbol: ArcGisSymbologyRenderer, world2PixelTransform?: Transform);
|
|
9
|
+
get transform(): Transform | undefined;
|
|
10
|
+
private closePath;
|
|
11
|
+
private lineTo;
|
|
12
|
+
private moveTo;
|
|
13
|
+
private fill;
|
|
14
|
+
private stroke;
|
|
15
|
+
/**
|
|
16
|
+
* Render a path on the renderer's context.
|
|
17
|
+
* Note: Inputs are designed based on the PBF format, to avoid any data transformation.
|
|
18
|
+
* @param geometryLengths Array be used to determine the start and end of each sub-path / rings. (i.e. [5,5] = two rings of 5 vertices)
|
|
19
|
+
* @param geometryCoords Array that linearly encodes the vertices of each sub-path of a polyline / ring of a polygon
|
|
20
|
+
* @param fill Indicates if the path should be filled or not.
|
|
21
|
+
* @param stride Dimension of each vertices (i.e. 2 or 3. 3 could be X,Y,Z, X,YM) Currently 3rd dimension is ignored.
|
|
22
|
+
*/
|
|
23
|
+
renderPath(geometryLengths: number[], geometryCoords: number[], fill: boolean, stride: number, relativeCoords: boolean): void;
|
|
24
|
+
/**
|
|
25
|
+
* Render a point on the renderer's context.
|
|
26
|
+
* Note: Inputs are designed based on the PBF format, to avoid any data transformation.
|
|
27
|
+
* @param geometryLengths Array be used to determine the start and end of each multi-point array, empty for single point.
|
|
28
|
+
* @param geometryCoords Array that linearly encodes vertices.
|
|
29
|
+
* @param stride Dimension of each vertices (i.e. 2 or 3. 3 could be X,Y,Z, X,YM) Currently 3rd dimension is ignored.
|
|
30
|
+
*/
|
|
31
|
+
renderPoint(geometryLengths: number[], geometryCoords: number[], stride: number, relativeCoords: boolean): void;
|
|
32
|
+
}
|
|
33
33
|
//# sourceMappingURL=ArcGisFeatureRenderer.d.ts.map
|
|
@@ -1,143 +1,143 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ArcGisFeatureRenderer = void 0;
|
|
4
|
-
/** @internal */
|
|
5
|
-
class ArcGisFeatureRenderer {
|
|
6
|
-
constructor(context, symbol, world2PixelTransform) {
|
|
7
|
-
this._symbol = symbol;
|
|
8
|
-
this._context = context;
|
|
9
|
-
this._transform = world2PixelTransform;
|
|
10
|
-
}
|
|
11
|
-
get transform() { return this._transform; }
|
|
12
|
-
// Utility functions to make ease testing.
|
|
13
|
-
closePath() {
|
|
14
|
-
this._context.closePath();
|
|
15
|
-
}
|
|
16
|
-
lineTo(x, y) {
|
|
17
|
-
this._context.lineTo(x, y);
|
|
18
|
-
}
|
|
19
|
-
moveTo(x, y) {
|
|
20
|
-
this._context.moveTo(x, y);
|
|
21
|
-
}
|
|
22
|
-
fill() {
|
|
23
|
-
this._context.fill();
|
|
24
|
-
}
|
|
25
|
-
stroke() {
|
|
26
|
-
this._context.stroke();
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Render a path on the renderer's context.
|
|
30
|
-
* Note: Inputs are designed based on the PBF format, to avoid any data transformation.
|
|
31
|
-
* @param geometryLengths Array be used to determine the start and end of each sub-path / rings. (i.e. [5,5] = two rings of 5 vertices)
|
|
32
|
-
* @param geometryCoords Array that linearly encodes the vertices of each sub-path of a polyline / ring of a polygon
|
|
33
|
-
* @param fill Indicates if the path should be filled or not.
|
|
34
|
-
* @param stride Dimension of each vertices (i.e. 2 or 3. 3 could be X,Y,Z, X,YM) Currently 3rd dimension is ignored.
|
|
35
|
-
*/
|
|
36
|
-
renderPath(geometryLengths, geometryCoords, fill, stride, relativeCoords) {
|
|
37
|
-
if (stride < 2 || stride > 3) {
|
|
38
|
-
return;
|
|
39
|
-
}
|
|
40
|
-
// Keep track of our position in the in the 'coords' array:
|
|
41
|
-
// Every time we loop on the 'lengths' array, the position
|
|
42
|
-
// to start reading vertices in the 'coords' must be the sum of all previously read vertices.
|
|
43
|
-
let coordsOffset = 0;
|
|
44
|
-
// Begin the path here.
|
|
45
|
-
// Note: Even though path is closed inside the 'geometryLengths' loop,
|
|
46
|
-
// it's import to begin the path only once.
|
|
47
|
-
this._context.beginPath();
|
|
48
|
-
for (const vertexCount of geometryLengths) {
|
|
49
|
-
let lastPtX = 0, lastPtY = 0;
|
|
50
|
-
for (let vertexIdx = 0; vertexIdx < vertexCount; vertexIdx++) {
|
|
51
|
-
let pX = geometryCoords[coordsOffset + (vertexIdx * stride)];
|
|
52
|
-
let pY = geometryCoords[coordsOffset + (vertexIdx * stride) + 1];
|
|
53
|
-
if (vertexIdx === 0) {
|
|
54
|
-
// first vertex is always "absolute" and must be drawn as 'moveTo' (i.e. not lineTo)
|
|
55
|
-
if (relativeCoords) {
|
|
56
|
-
lastPtX = pX;
|
|
57
|
-
lastPtY = pY;
|
|
58
|
-
}
|
|
59
|
-
if (this._transform) {
|
|
60
|
-
const transformedPoint = this._transform.multiplyPoint2d({ x: pX, y: pY });
|
|
61
|
-
pX = transformedPoint.x;
|
|
62
|
-
pY = transformedPoint.y;
|
|
63
|
-
}
|
|
64
|
-
this.moveTo(pX, pY);
|
|
65
|
-
}
|
|
66
|
-
else {
|
|
67
|
-
// Following vertices are relative to the previous one (sadly not really well documented by ESRI)
|
|
68
|
-
// typically this happens when 'coordinates quantization' is active (i.e. no client side transformation is needed)
|
|
69
|
-
if (relativeCoords) {
|
|
70
|
-
pX = lastPtX = lastPtX + pX;
|
|
71
|
-
pY = lastPtY = lastPtY + pY;
|
|
72
|
-
}
|
|
73
|
-
if (this._transform) {
|
|
74
|
-
const transformedPoint = this._transform.multiplyPoint2d({ x: pX, y: pY });
|
|
75
|
-
pX = transformedPoint.x;
|
|
76
|
-
pY = transformedPoint.y;
|
|
77
|
-
}
|
|
78
|
-
this.lineTo(pX, pY);
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
coordsOffset += stride * vertexCount;
|
|
82
|
-
if (fill) {
|
|
83
|
-
// ClosePath but do not 'fill' here, only at the very end (otherwise it will mess up holes)
|
|
84
|
-
this.closePath();
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
if (fill) {
|
|
88
|
-
this._symbol.applyFillStyle(this._context);
|
|
89
|
-
this.fill();
|
|
90
|
-
}
|
|
91
|
-
this._symbol.applyStrokeStyle(this._context);
|
|
92
|
-
this.stroke(); // draw line path or polygon outline
|
|
93
|
-
}
|
|
94
|
-
/**
|
|
95
|
-
* Render a point on the renderer's context.
|
|
96
|
-
* Note: Inputs are designed based on the PBF format, to avoid any data transformation.
|
|
97
|
-
* @param geometryLengths Array be used to determine the start and end of each multi-point array, empty for single point.
|
|
98
|
-
* @param geometryCoords Array that linearly encodes vertices.
|
|
99
|
-
* @param stride Dimension of each vertices (i.e. 2 or 3. 3 could be X,Y,Z, X,YM) Currently 3rd dimension is ignored.
|
|
100
|
-
*/
|
|
101
|
-
renderPoint(geometryLengths, geometryCoords, stride, relativeCoords) {
|
|
102
|
-
if (stride < 2 || stride > 3) {
|
|
103
|
-
return;
|
|
104
|
-
}
|
|
105
|
-
let coordsOffset = 0;
|
|
106
|
-
if (geometryLengths.length === 0) {
|
|
107
|
-
// Strangely, for points, 'lengths' array is empty, so we assume there is a single vertex in 'coords' array.
|
|
108
|
-
if (geometryCoords.length >= stride) {
|
|
109
|
-
if (this._transform) {
|
|
110
|
-
const transformedPoint = this._transform.multiplyPoint2d({ x: geometryCoords[0], y: geometryCoords[1] });
|
|
111
|
-
this._symbol.drawPoint(this._context, transformedPoint.x, transformedPoint.y);
|
|
112
|
-
}
|
|
113
|
-
else {
|
|
114
|
-
this._symbol.drawPoint(this._context, geometryCoords[0], geometryCoords[1]);
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
else {
|
|
119
|
-
// MULTI-POINTS: Needs testing
|
|
120
|
-
// I assume 'lengths' array will get populated and 'coords' array will look similar to line/polygons.
|
|
121
|
-
for (const vertexCount of geometryLengths) {
|
|
122
|
-
let lastPtX = 0, lastPtY = 0;
|
|
123
|
-
for (let vertexIdx = 0; vertexIdx < vertexCount; vertexIdx++) {
|
|
124
|
-
let pX = geometryCoords[coordsOffset + (vertexIdx * stride)];
|
|
125
|
-
let pY = geometryCoords[coordsOffset + (vertexIdx * stride) + 1];
|
|
126
|
-
if (relativeCoords) {
|
|
127
|
-
pX = lastPtX = lastPtX + pX;
|
|
128
|
-
pY = lastPtY = lastPtY + pY;
|
|
129
|
-
}
|
|
130
|
-
if (this._transform) {
|
|
131
|
-
const transformedPoint = this._transform.multiplyPoint2d({ x: pX, y: pY });
|
|
132
|
-
pX = transformedPoint.x;
|
|
133
|
-
pY = transformedPoint.y;
|
|
134
|
-
}
|
|
135
|
-
this._symbol.drawPoint(this._context, pX, pY);
|
|
136
|
-
}
|
|
137
|
-
coordsOffset += stride * vertexCount;
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
exports.ArcGisFeatureRenderer = ArcGisFeatureRenderer;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ArcGisFeatureRenderer = void 0;
|
|
4
|
+
/** @internal */
|
|
5
|
+
class ArcGisFeatureRenderer {
|
|
6
|
+
constructor(context, symbol, world2PixelTransform) {
|
|
7
|
+
this._symbol = symbol;
|
|
8
|
+
this._context = context;
|
|
9
|
+
this._transform = world2PixelTransform;
|
|
10
|
+
}
|
|
11
|
+
get transform() { return this._transform; }
|
|
12
|
+
// Utility functions to make ease testing.
|
|
13
|
+
closePath() {
|
|
14
|
+
this._context.closePath();
|
|
15
|
+
}
|
|
16
|
+
lineTo(x, y) {
|
|
17
|
+
this._context.lineTo(x, y);
|
|
18
|
+
}
|
|
19
|
+
moveTo(x, y) {
|
|
20
|
+
this._context.moveTo(x, y);
|
|
21
|
+
}
|
|
22
|
+
fill() {
|
|
23
|
+
this._context.fill();
|
|
24
|
+
}
|
|
25
|
+
stroke() {
|
|
26
|
+
this._context.stroke();
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Render a path on the renderer's context.
|
|
30
|
+
* Note: Inputs are designed based on the PBF format, to avoid any data transformation.
|
|
31
|
+
* @param geometryLengths Array be used to determine the start and end of each sub-path / rings. (i.e. [5,5] = two rings of 5 vertices)
|
|
32
|
+
* @param geometryCoords Array that linearly encodes the vertices of each sub-path of a polyline / ring of a polygon
|
|
33
|
+
* @param fill Indicates if the path should be filled or not.
|
|
34
|
+
* @param stride Dimension of each vertices (i.e. 2 or 3. 3 could be X,Y,Z, X,YM) Currently 3rd dimension is ignored.
|
|
35
|
+
*/
|
|
36
|
+
renderPath(geometryLengths, geometryCoords, fill, stride, relativeCoords) {
|
|
37
|
+
if (stride < 2 || stride > 3) {
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
// Keep track of our position in the in the 'coords' array:
|
|
41
|
+
// Every time we loop on the 'lengths' array, the position
|
|
42
|
+
// to start reading vertices in the 'coords' must be the sum of all previously read vertices.
|
|
43
|
+
let coordsOffset = 0;
|
|
44
|
+
// Begin the path here.
|
|
45
|
+
// Note: Even though path is closed inside the 'geometryLengths' loop,
|
|
46
|
+
// it's import to begin the path only once.
|
|
47
|
+
this._context.beginPath();
|
|
48
|
+
for (const vertexCount of geometryLengths) {
|
|
49
|
+
let lastPtX = 0, lastPtY = 0;
|
|
50
|
+
for (let vertexIdx = 0; vertexIdx < vertexCount; vertexIdx++) {
|
|
51
|
+
let pX = geometryCoords[coordsOffset + (vertexIdx * stride)];
|
|
52
|
+
let pY = geometryCoords[coordsOffset + (vertexIdx * stride) + 1];
|
|
53
|
+
if (vertexIdx === 0) {
|
|
54
|
+
// first vertex is always "absolute" and must be drawn as 'moveTo' (i.e. not lineTo)
|
|
55
|
+
if (relativeCoords) {
|
|
56
|
+
lastPtX = pX;
|
|
57
|
+
lastPtY = pY;
|
|
58
|
+
}
|
|
59
|
+
if (this._transform) {
|
|
60
|
+
const transformedPoint = this._transform.multiplyPoint2d({ x: pX, y: pY });
|
|
61
|
+
pX = transformedPoint.x;
|
|
62
|
+
pY = transformedPoint.y;
|
|
63
|
+
}
|
|
64
|
+
this.moveTo(pX, pY);
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
// Following vertices are relative to the previous one (sadly not really well documented by ESRI)
|
|
68
|
+
// typically this happens when 'coordinates quantization' is active (i.e. no client side transformation is needed)
|
|
69
|
+
if (relativeCoords) {
|
|
70
|
+
pX = lastPtX = lastPtX + pX;
|
|
71
|
+
pY = lastPtY = lastPtY + pY;
|
|
72
|
+
}
|
|
73
|
+
if (this._transform) {
|
|
74
|
+
const transformedPoint = this._transform.multiplyPoint2d({ x: pX, y: pY });
|
|
75
|
+
pX = transformedPoint.x;
|
|
76
|
+
pY = transformedPoint.y;
|
|
77
|
+
}
|
|
78
|
+
this.lineTo(pX, pY);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
coordsOffset += stride * vertexCount;
|
|
82
|
+
if (fill) {
|
|
83
|
+
// ClosePath but do not 'fill' here, only at the very end (otherwise it will mess up holes)
|
|
84
|
+
this.closePath();
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
if (fill) {
|
|
88
|
+
this._symbol.applyFillStyle(this._context);
|
|
89
|
+
this.fill();
|
|
90
|
+
}
|
|
91
|
+
this._symbol.applyStrokeStyle(this._context);
|
|
92
|
+
this.stroke(); // draw line path or polygon outline
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Render a point on the renderer's context.
|
|
96
|
+
* Note: Inputs are designed based on the PBF format, to avoid any data transformation.
|
|
97
|
+
* @param geometryLengths Array be used to determine the start and end of each multi-point array, empty for single point.
|
|
98
|
+
* @param geometryCoords Array that linearly encodes vertices.
|
|
99
|
+
* @param stride Dimension of each vertices (i.e. 2 or 3. 3 could be X,Y,Z, X,YM) Currently 3rd dimension is ignored.
|
|
100
|
+
*/
|
|
101
|
+
renderPoint(geometryLengths, geometryCoords, stride, relativeCoords) {
|
|
102
|
+
if (stride < 2 || stride > 3) {
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
let coordsOffset = 0;
|
|
106
|
+
if (geometryLengths.length === 0) {
|
|
107
|
+
// Strangely, for points, 'lengths' array is empty, so we assume there is a single vertex in 'coords' array.
|
|
108
|
+
if (geometryCoords.length >= stride) {
|
|
109
|
+
if (this._transform) {
|
|
110
|
+
const transformedPoint = this._transform.multiplyPoint2d({ x: geometryCoords[0], y: geometryCoords[1] });
|
|
111
|
+
this._symbol.drawPoint(this._context, transformedPoint.x, transformedPoint.y);
|
|
112
|
+
}
|
|
113
|
+
else {
|
|
114
|
+
this._symbol.drawPoint(this._context, geometryCoords[0], geometryCoords[1]);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
else {
|
|
119
|
+
// MULTI-POINTS: Needs testing
|
|
120
|
+
// I assume 'lengths' array will get populated and 'coords' array will look similar to line/polygons.
|
|
121
|
+
for (const vertexCount of geometryLengths) {
|
|
122
|
+
let lastPtX = 0, lastPtY = 0;
|
|
123
|
+
for (let vertexIdx = 0; vertexIdx < vertexCount; vertexIdx++) {
|
|
124
|
+
let pX = geometryCoords[coordsOffset + (vertexIdx * stride)];
|
|
125
|
+
let pY = geometryCoords[coordsOffset + (vertexIdx * stride) + 1];
|
|
126
|
+
if (relativeCoords) {
|
|
127
|
+
pX = lastPtX = lastPtX + pX;
|
|
128
|
+
pY = lastPtY = lastPtY + pY;
|
|
129
|
+
}
|
|
130
|
+
if (this._transform) {
|
|
131
|
+
const transformedPoint = this._transform.multiplyPoint2d({ x: pX, y: pY });
|
|
132
|
+
pX = transformedPoint.x;
|
|
133
|
+
pY = transformedPoint.y;
|
|
134
|
+
}
|
|
135
|
+
this._symbol.drawPoint(this._context, pX, pY);
|
|
136
|
+
}
|
|
137
|
+
coordsOffset += stride * vertexCount;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
exports.ArcGisFeatureRenderer = ArcGisFeatureRenderer;
|
|
143
143
|
//# sourceMappingURL=ArcGisFeatureRenderer.js.map
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { ArcGisExtent, ArcGisFeatureFormat } from "./ArcGisFeatureQuery";
|
|
2
|
-
/** @internal */
|
|
3
|
-
export interface ArcGisResponseData {
|
|
4
|
-
data: any;
|
|
5
|
-
exceedTransferLimit: boolean;
|
|
6
|
-
}
|
|
7
|
-
/** @internal */
|
|
8
|
-
export
|
|
9
|
-
/** @internal */
|
|
10
|
-
export declare class ArcGisFeatureResponse {
|
|
11
|
-
readonly format: ArcGisFeatureFormat;
|
|
12
|
-
readonly envelope: ArcGisExtent | undefined;
|
|
13
|
-
private _response;
|
|
14
|
-
constructor(format: ArcGisFeatureFormat, response: Promise<Response>, envelope?: ArcGisExtent);
|
|
15
|
-
getResponseData(): Promise<ArcGisResponseData | undefined>;
|
|
16
|
-
}
|
|
1
|
+
import { ArcGisExtent, ArcGisFeatureFormat } from "./ArcGisFeatureQuery";
|
|
2
|
+
/** @internal */
|
|
3
|
+
export interface ArcGisResponseData {
|
|
4
|
+
data: any;
|
|
5
|
+
exceedTransferLimit: boolean;
|
|
6
|
+
}
|
|
7
|
+
/** @internal */
|
|
8
|
+
export type ArcGisFieldType = "esriFieldTypeInteger" | "esriFieldTypeSmallInteger" | "esriFieldTypeDouble" | "esriFieldTypeSingle" | "esriFieldTypeString" | "esriFieldTypeDate" | "esriFieldTypeGeometry" | "esriFieldTypeOID" | "esriFieldTypeBlob" | "esriFieldTypeGlobalID" | "esriFieldTypeRaster" | "esriFieldTypeGUID" | "esriFieldTypeXML";
|
|
9
|
+
/** @internal */
|
|
10
|
+
export declare class ArcGisFeatureResponse {
|
|
11
|
+
readonly format: ArcGisFeatureFormat;
|
|
12
|
+
readonly envelope: ArcGisExtent | undefined;
|
|
13
|
+
private _response;
|
|
14
|
+
constructor(format: ArcGisFeatureFormat, response: Promise<Response>, envelope?: ArcGisExtent);
|
|
15
|
+
getResponseData(): Promise<ArcGisResponseData | undefined>;
|
|
16
|
+
}
|
|
17
17
|
//# sourceMappingURL=ArcGisFeatureResponse.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ArcGisFeatureResponse.d.ts","sourceRoot":"","sources":["../../../src/ArcGisFeature/ArcGisFeatureResponse.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAGzE,gBAAgB;AAChB,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,GAAG,CAAC;IACV,mBAAmB,EAAE,OAAO,CAAC;CAC9B;AAED,gBAAgB;AAChB,
|
|
1
|
+
{"version":3,"file":"ArcGisFeatureResponse.d.ts","sourceRoot":"","sources":["../../../src/ArcGisFeature/ArcGisFeatureResponse.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAGzE,gBAAgB;AAChB,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,GAAG,CAAC;IACV,mBAAmB,EAAE,OAAO,CAAC;CAC9B;AAED,gBAAgB;AAChB,MAAM,MAAM,eAAe,GACzB,sBAAsB,GACpB,2BAA2B,GAC3B,qBAAqB,GACrB,qBAAqB,GACrB,qBAAqB,GACrB,mBAAmB,GACnB,uBAAuB,GACvB,kBAAkB,GAClB,mBAAmB,GACnB,uBAAuB,GACvB,qBAAqB,GACrB,mBAAmB,GACnB,kBAAkB,CAAC;AAEvB,gBAAgB;AAChB,qBAAa,qBAAqB;IAChC,SAAgB,MAAM,EAAE,mBAAmB,CAAC;IAC5C,SAAgB,QAAQ,EAAE,YAAY,GAAG,SAAS,CAAC;IAEnD,OAAO,CAAC,SAAS,CAAoB;gBAEzB,MAAM,EAAE,mBAAmB,EAAG,QAAQ,EAAE,OAAO,CAAC,QAAQ,CAAC,EAAE,QAAQ,CAAC,EAAE,YAAY;IAMjF,eAAe,IAAI,OAAO,CAAC,kBAAkB,GAAC,SAAS,CAAC;CA4BtE"}
|
|
@@ -1,44 +1,43 @@
|
|
|
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.ArcGisFeatureResponse = void 0;
|
|
8
|
-
const esriPBuffer_gen_1 = require("./esriPBuffer.gen");
|
|
9
|
-
/** @internal */
|
|
10
|
-
class ArcGisFeatureResponse {
|
|
11
|
-
constructor(format, response, envelope) {
|
|
12
|
-
this.format = format;
|
|
13
|
-
this._response = response;
|
|
14
|
-
this.envelope = envelope;
|
|
15
|
-
}
|
|
16
|
-
async getResponseData() {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
data
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
exports.ArcGisFeatureResponse = ArcGisFeatureResponse;
|
|
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.ArcGisFeatureResponse = void 0;
|
|
8
|
+
const esriPBuffer_gen_1 = require("./esriPBuffer.gen");
|
|
9
|
+
/** @internal */
|
|
10
|
+
class ArcGisFeatureResponse {
|
|
11
|
+
constructor(format, response, envelope) {
|
|
12
|
+
this.format = format;
|
|
13
|
+
this._response = response;
|
|
14
|
+
this.envelope = envelope;
|
|
15
|
+
}
|
|
16
|
+
async getResponseData() {
|
|
17
|
+
let data;
|
|
18
|
+
try {
|
|
19
|
+
const tileResponse = await this._response;
|
|
20
|
+
if (tileResponse === undefined || tileResponse.status !== 200)
|
|
21
|
+
return undefined;
|
|
22
|
+
if (this.format === "PBF") {
|
|
23
|
+
const byteArray = new Uint8Array(await tileResponse.arrayBuffer());
|
|
24
|
+
if (!byteArray || (byteArray.length === 0))
|
|
25
|
+
return undefined;
|
|
26
|
+
data = esriPBuffer_gen_1.esriPBuffer.FeatureCollectionPBuffer.deserialize(byteArray);
|
|
27
|
+
const collection = data;
|
|
28
|
+
return { data, exceedTransferLimit: collection?.queryResult?.featureResult?.exceededTransferLimit };
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
data = await tileResponse.json();
|
|
32
|
+
if (data === undefined || data == null)
|
|
33
|
+
return undefined;
|
|
34
|
+
return { data, exceedTransferLimit: data.exceededTransferLimit };
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
catch (_e) {
|
|
38
|
+
return undefined;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
exports.ArcGisFeatureResponse = ArcGisFeatureResponse;
|
|
44
43
|
//# sourceMappingURL=ArcGisFeatureResponse.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ArcGisFeatureResponse.js","sourceRoot":"","sources":["../../../src/ArcGisFeature/ArcGisFeatureResponse.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAG/F,uDAAgD;AAwBhD,gBAAgB;AAChB,MAAa,qBAAqB;IAMhC,YAAY,MAA2B,EAAG,QAA2B,EAAE,QAAuB;QAC5F,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;IAEM,KAAK,CAAC,eAAe
|
|
1
|
+
{"version":3,"file":"ArcGisFeatureResponse.js","sourceRoot":"","sources":["../../../src/ArcGisFeature/ArcGisFeatureResponse.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAG/F,uDAAgD;AAwBhD,gBAAgB;AAChB,MAAa,qBAAqB;IAMhC,YAAY,MAA2B,EAAG,QAA2B,EAAE,QAAuB;QAC5F,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;IAEM,KAAK,CAAC,eAAe;QAC1B,IAAI,IAAmB,CAAC;QACxB,IAAI;YACF,MAAM,YAAY,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC;YAC1C,IAAI,YAAY,KAAK,SAAS,IAAI,YAAY,CAAC,MAAM,KAAK,GAAG;gBAC3D,OAAO,SAAS,CAAC;YAEnB,IAAI,IAAI,CAAC,MAAM,KAAK,KAAK,EAAE;gBACzB,MAAM,SAAS,GAAe,IAAI,UAAU,CAAC,MAAM,YAAY,CAAC,WAAW,EAAE,CAAC,CAAC;gBAC/E,IAAI,CAAC,SAAS,IAAI,CAAC,SAAS,CAAC,MAAM,KAAK,CAAC,CAAC;oBACxC,OAAO,SAAS,CAAC;gBAEnB,IAAI,GAAG,6BAAW,CAAC,wBAAwB,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;gBACnE,MAAM,UAAU,GAAG,IAA4C,CAAC;gBAChE,OAAO,EAAC,IAAI,EAAE,mBAAmB,EAAE,UAAU,EAAE,WAAW,EAAE,aAAa,EAAE,qBAAqB,EAAC,CAAC;aAEnG;iBAAM;gBACL,IAAI,GAAG,MAAM,YAAY,CAAC,IAAI,EAAE,CAAC;gBACjC,IAAI,IAAI,KAAK,SAAS,IAAI,IAAI,IAAI,IAAI;oBACpC,OAAO,SAAS,CAAC;gBAEnB,OAAO,EAAC,IAAI,EAAE,mBAAmB,EAAE,IAAI,CAAC,qBAAqB,EAAC,CAAC;aAChE;SAEF;QAAC,OAAM,EAAE,EAAE;YACV,OAAO,SAAS,CAAC;SAClB;IACH,CAAC;CACF;AAxCD,sDAwCC","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 { ArcGisExtent, ArcGisFeatureFormat } from \"./ArcGisFeatureQuery\";\r\nimport { esriPBuffer } from \"./esriPBuffer.gen\";\r\n\r\n/** @internal */\r\nexport interface ArcGisResponseData {\r\n data: any;\r\n exceedTransferLimit: boolean;\r\n}\r\n\r\n/** @internal */\r\nexport type ArcGisFieldType =\r\n \"esriFieldTypeInteger\"\r\n | \"esriFieldTypeSmallInteger\"\r\n | \"esriFieldTypeDouble\"\r\n | \"esriFieldTypeSingle\"\r\n | \"esriFieldTypeString\"\r\n | \"esriFieldTypeDate\"\r\n | \"esriFieldTypeGeometry\"\r\n | \"esriFieldTypeOID\"\r\n | \"esriFieldTypeBlob\"\r\n | \"esriFieldTypeGlobalID\"\r\n | \"esriFieldTypeRaster\"\r\n | \"esriFieldTypeGUID\"\r\n | \"esriFieldTypeXML\";\r\n\r\n/** @internal */\r\nexport class ArcGisFeatureResponse {\r\n public readonly format: ArcGisFeatureFormat;\r\n public readonly envelope: ArcGisExtent | undefined;\r\n\r\n private _response: Promise<Response>;\r\n\r\n constructor(format: ArcGisFeatureFormat, response: Promise<Response>, envelope?: ArcGisExtent) {\r\n this.format = format;\r\n this._response = response;\r\n this.envelope = envelope;\r\n }\r\n\r\n public async getResponseData(): Promise<ArcGisResponseData|undefined> {\r\n let data: any|undefined;\r\n try {\r\n const tileResponse = await this._response;\r\n if (tileResponse === undefined || tileResponse.status !== 200 )\r\n return undefined;\r\n\r\n if (this.format === \"PBF\") {\r\n const byteArray: Uint8Array = new Uint8Array(await tileResponse.arrayBuffer());\r\n if (!byteArray || (byteArray.length === 0))\r\n return undefined;\r\n\r\n data = esriPBuffer.FeatureCollectionPBuffer.deserialize(byteArray);\r\n const collection = data as esriPBuffer.FeatureCollectionPBuffer;\r\n return {data, exceedTransferLimit: collection?.queryResult?.featureResult?.exceededTransferLimit};\r\n\r\n } else {\r\n data = await tileResponse.json();\r\n if (data === undefined || data == null)\r\n return undefined;\r\n\r\n return {data, exceedTransferLimit: data.exceededTransferLimit};\r\n }\r\n\r\n } catch(_e) {\r\n return undefined;\r\n }\r\n }\r\n}\r\n"]}
|