@itwin/map-layers-formats 4.6.0-dev.8 → 4.7.0-dev.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -1
- package/lib/cjs/ArcGisFeature/ArcGisFeatureFormat.js +1 -1
- package/lib/cjs/ArcGisFeature/ArcGisFeatureFormat.js.map +1 -1
- package/lib/cjs/ArcGisFeature/ArcGisFeatureProvider.d.ts +15 -6
- package/lib/cjs/ArcGisFeature/ArcGisFeatureProvider.d.ts.map +1 -1
- package/lib/cjs/ArcGisFeature/ArcGisFeatureProvider.js +64 -54
- package/lib/cjs/ArcGisFeature/ArcGisFeatureProvider.js.map +1 -1
- package/lib/cjs/ArcGisFeature/ArcGisFeatureQuery.js.map +1 -1
- package/lib/cjs/ArcGisFeature/ArcGisFeatureReader.d.ts +7 -11
- package/lib/cjs/ArcGisFeature/ArcGisFeatureReader.d.ts.map +1 -1
- package/lib/cjs/ArcGisFeature/ArcGisFeatureReader.js +3 -19
- package/lib/cjs/ArcGisFeature/ArcGisFeatureReader.js.map +1 -1
- package/lib/cjs/ArcGisFeature/ArcGisFeatureResponse.js.map +1 -1
- package/lib/cjs/ArcGisFeature/ArcGisJsonFeatureReader.d.ts +3 -3
- package/lib/cjs/ArcGisFeature/ArcGisJsonFeatureReader.d.ts.map +1 -1
- package/lib/cjs/ArcGisFeature/ArcGisJsonFeatureReader.js +3 -4
- package/lib/cjs/ArcGisFeature/ArcGisJsonFeatureReader.js.map +1 -1
- package/lib/cjs/ArcGisFeature/ArcGisPbfFeatureReader.d.ts +3 -3
- package/lib/cjs/ArcGisFeature/ArcGisPbfFeatureReader.d.ts.map +1 -1
- package/lib/cjs/ArcGisFeature/ArcGisPbfFeatureReader.js +2 -3
- package/lib/cjs/ArcGisFeature/ArcGisPbfFeatureReader.js.map +1 -1
- package/lib/cjs/ArcGisFeature/ArcGisSymbologyRenderer.d.ts +35 -15
- package/lib/cjs/ArcGisFeature/ArcGisSymbologyRenderer.d.ts.map +1 -1
- package/lib/cjs/ArcGisFeature/ArcGisSymbologyRenderer.js +54 -48
- package/lib/cjs/ArcGisFeature/ArcGisSymbologyRenderer.js.map +1 -1
- package/lib/cjs/ArcGisFeature/EsriSymbology.d.ts +2 -1
- package/lib/cjs/ArcGisFeature/EsriSymbology.d.ts.map +1 -1
- package/lib/cjs/ArcGisFeature/EsriSymbology.js +2 -1
- package/lib/cjs/ArcGisFeature/EsriSymbology.js.map +1 -1
- package/lib/cjs/ArcGisFeature/esriPBuffer.gen.js +1 -1
- package/lib/cjs/ArcGisFeature/esriPBuffer.gen.js.map +1 -1
- package/lib/cjs/Feature/DefaultMarkerIcon.d.ts +10 -0
- package/lib/cjs/Feature/DefaultMarkerIcon.d.ts.map +1 -0
- package/lib/cjs/Feature/DefaultMarkerIcon.js +31 -0
- package/lib/cjs/Feature/DefaultMarkerIcon.js.map +1 -0
- package/lib/cjs/Feature/FeatureCanvasRenderer.d.ts +20 -0
- package/lib/cjs/Feature/FeatureCanvasRenderer.d.ts.map +1 -0
- package/lib/cjs/{ArcGisFeature/ArcGisCanvasRenderer.js → Feature/FeatureCanvasRenderer.js} +7 -6
- package/lib/cjs/Feature/FeatureCanvasRenderer.js.map +1 -0
- package/lib/cjs/Feature/FeatureInfoReader.d.ts +11 -0
- package/lib/cjs/Feature/FeatureInfoReader.d.ts.map +1 -0
- package/lib/cjs/Feature/FeatureInfoReader.js +35 -0
- package/lib/cjs/Feature/FeatureInfoReader.js.map +1 -0
- package/lib/cjs/Feature/FeatureSymbology.d.ts +8 -0
- package/lib/cjs/Feature/FeatureSymbology.d.ts.map +1 -0
- package/lib/cjs/Feature/FeatureSymbology.js +12 -0
- package/lib/cjs/Feature/FeatureSymbology.js.map +1 -0
- package/lib/cjs/Feature/RandomMapColor.d.ts +8 -0
- package/lib/cjs/Feature/RandomMapColor.d.ts.map +1 -0
- package/lib/cjs/Feature/RandomMapColor.js +29 -0
- package/lib/cjs/Feature/RandomMapColor.js.map +1 -0
- package/lib/cjs/GeoJSON/GeoJSONGeometry.d.ts +18 -0
- package/lib/cjs/GeoJSON/GeoJSONGeometry.d.ts.map +1 -0
- package/lib/cjs/GeoJSON/GeoJSONGeometry.js +11 -0
- package/lib/cjs/GeoJSON/GeoJSONGeometry.js.map +1 -0
- package/lib/cjs/GeoJSON/GeoJSONGeometryReader.d.ts +11 -0
- package/lib/cjs/GeoJSON/GeoJSONGeometryReader.d.ts.map +1 -0
- package/lib/cjs/GeoJSON/GeoJSONGeometryReader.js +83 -0
- package/lib/cjs/GeoJSON/GeoJSONGeometryReader.js.map +1 -0
- package/lib/cjs/OgcApiFeatures/OgcApiFeaturesFormat.d.ts +9 -0
- package/lib/cjs/OgcApiFeatures/OgcApiFeaturesFormat.d.ts.map +1 -0
- package/lib/cjs/OgcApiFeatures/OgcApiFeaturesFormat.js +94 -0
- package/lib/cjs/OgcApiFeatures/OgcApiFeaturesFormat.js.map +1 -0
- package/lib/cjs/OgcApiFeatures/OgcApiFeaturesProvider.d.ts +54 -0
- package/lib/cjs/OgcApiFeatures/OgcApiFeaturesProvider.d.ts.map +1 -0
- package/lib/cjs/OgcApiFeatures/OgcApiFeaturesProvider.js +477 -0
- package/lib/cjs/OgcApiFeatures/OgcApiFeaturesProvider.js.map +1 -0
- package/lib/cjs/OgcApiFeatures/OgcApiFeaturesReader.d.ts +23 -0
- package/lib/cjs/OgcApiFeatures/OgcApiFeaturesReader.d.ts.map +1 -0
- package/lib/cjs/OgcApiFeatures/OgcApiFeaturesReader.js +139 -0
- package/lib/cjs/OgcApiFeatures/OgcApiFeaturesReader.js.map +1 -0
- package/lib/cjs/Tools/MapFeatureInfoDecorator.js.map +1 -1
- package/lib/cjs/Tools/MapFeatureInfoTool.js +1 -1
- package/lib/cjs/Tools/MapFeatureInfoTool.js.map +1 -1
- package/lib/cjs/mapLayersFormats.d.ts.map +1 -1
- package/lib/cjs/mapLayersFormats.js +5 -2
- package/lib/cjs/mapLayersFormats.js.map +1 -1
- package/lib/esm/ArcGisFeature/ArcGisFeatureFormat.js +1 -2
- package/lib/esm/ArcGisFeature/ArcGisFeatureFormat.js.map +1 -1
- package/lib/esm/ArcGisFeature/ArcGisFeatureProvider.d.ts +15 -6
- package/lib/esm/ArcGisFeature/ArcGisFeatureProvider.d.ts.map +1 -1
- package/lib/esm/ArcGisFeature/ArcGisFeatureProvider.js +63 -55
- package/lib/esm/ArcGisFeature/ArcGisFeatureProvider.js.map +1 -1
- package/lib/esm/ArcGisFeature/ArcGisFeatureQuery.js.map +1 -1
- package/lib/esm/ArcGisFeature/ArcGisFeatureReader.d.ts +7 -11
- package/lib/esm/ArcGisFeature/ArcGisFeatureReader.d.ts.map +1 -1
- package/lib/esm/ArcGisFeature/ArcGisFeatureReader.js +3 -19
- package/lib/esm/ArcGisFeature/ArcGisFeatureReader.js.map +1 -1
- package/lib/esm/ArcGisFeature/ArcGisFeatureResponse.js.map +1 -1
- package/lib/esm/ArcGisFeature/ArcGisJsonFeatureReader.d.ts +3 -3
- package/lib/esm/ArcGisFeature/ArcGisJsonFeatureReader.d.ts.map +1 -1
- package/lib/esm/ArcGisFeature/ArcGisJsonFeatureReader.js +3 -4
- package/lib/esm/ArcGisFeature/ArcGisJsonFeatureReader.js.map +1 -1
- package/lib/esm/ArcGisFeature/ArcGisPbfFeatureReader.d.ts +3 -3
- package/lib/esm/ArcGisFeature/ArcGisPbfFeatureReader.d.ts.map +1 -1
- package/lib/esm/ArcGisFeature/ArcGisPbfFeatureReader.js +2 -3
- package/lib/esm/ArcGisFeature/ArcGisPbfFeatureReader.js.map +1 -1
- package/lib/esm/ArcGisFeature/ArcGisSymbologyRenderer.d.ts +35 -15
- package/lib/esm/ArcGisFeature/ArcGisSymbologyRenderer.d.ts.map +1 -1
- package/lib/esm/ArcGisFeature/ArcGisSymbologyRenderer.js +52 -47
- package/lib/esm/ArcGisFeature/ArcGisSymbologyRenderer.js.map +1 -1
- package/lib/esm/ArcGisFeature/EsriSymbology.d.ts +2 -1
- package/lib/esm/ArcGisFeature/EsriSymbology.d.ts.map +1 -1
- package/lib/esm/ArcGisFeature/EsriSymbology.js +2 -1
- package/lib/esm/ArcGisFeature/EsriSymbology.js.map +1 -1
- package/lib/esm/ArcGisFeature/esriPBuffer.gen.js.map +1 -1
- package/lib/esm/Feature/DefaultMarkerIcon.d.ts +10 -0
- package/lib/esm/Feature/DefaultMarkerIcon.d.ts.map +1 -0
- package/lib/esm/Feature/DefaultMarkerIcon.js +27 -0
- package/lib/esm/Feature/DefaultMarkerIcon.js.map +1 -0
- package/lib/esm/Feature/FeatureCanvasRenderer.d.ts +20 -0
- package/lib/esm/Feature/FeatureCanvasRenderer.d.ts.map +1 -0
- package/lib/esm/{ArcGisFeature/ArcGisCanvasRenderer.js → Feature/FeatureCanvasRenderer.js} +6 -5
- package/lib/esm/Feature/FeatureCanvasRenderer.js.map +1 -0
- package/lib/esm/Feature/FeatureInfoReader.d.ts +11 -0
- package/lib/esm/Feature/FeatureInfoReader.d.ts.map +1 -0
- package/lib/esm/Feature/FeatureInfoReader.js +31 -0
- package/lib/esm/Feature/FeatureInfoReader.js.map +1 -0
- package/lib/esm/Feature/FeatureSymbology.d.ts +8 -0
- package/lib/esm/Feature/FeatureSymbology.d.ts.map +1 -0
- package/lib/esm/Feature/FeatureSymbology.js +8 -0
- package/lib/esm/Feature/FeatureSymbology.js.map +1 -0
- package/lib/esm/Feature/RandomMapColor.d.ts +8 -0
- package/lib/esm/Feature/RandomMapColor.d.ts.map +1 -0
- package/lib/esm/Feature/RandomMapColor.js +25 -0
- package/lib/esm/Feature/RandomMapColor.js.map +1 -0
- package/lib/esm/GeoJSON/GeoJSONGeometry.d.ts +18 -0
- package/lib/esm/GeoJSON/GeoJSONGeometry.d.ts.map +1 -0
- package/lib/esm/GeoJSON/GeoJSONGeometry.js +7 -0
- package/lib/esm/GeoJSON/GeoJSONGeometry.js.map +1 -0
- package/lib/esm/GeoJSON/GeoJSONGeometryReader.d.ts +11 -0
- package/lib/esm/GeoJSON/GeoJSONGeometryReader.d.ts.map +1 -0
- package/lib/esm/GeoJSON/GeoJSONGeometryReader.js +79 -0
- package/lib/esm/GeoJSON/GeoJSONGeometryReader.js.map +1 -0
- package/lib/esm/OgcApiFeatures/OgcApiFeaturesFormat.d.ts +9 -0
- package/lib/esm/OgcApiFeatures/OgcApiFeaturesFormat.d.ts.map +1 -0
- package/lib/esm/OgcApiFeatures/OgcApiFeaturesFormat.js +90 -0
- package/lib/esm/OgcApiFeatures/OgcApiFeaturesFormat.js.map +1 -0
- package/lib/esm/OgcApiFeatures/OgcApiFeaturesProvider.d.ts +54 -0
- package/lib/esm/OgcApiFeatures/OgcApiFeaturesProvider.d.ts.map +1 -0
- package/lib/esm/OgcApiFeatures/OgcApiFeaturesProvider.js +472 -0
- package/lib/esm/OgcApiFeatures/OgcApiFeaturesProvider.js.map +1 -0
- package/lib/esm/OgcApiFeatures/OgcApiFeaturesReader.d.ts +23 -0
- package/lib/esm/OgcApiFeatures/OgcApiFeaturesReader.d.ts.map +1 -0
- package/lib/esm/OgcApiFeatures/OgcApiFeaturesReader.js +135 -0
- package/lib/esm/OgcApiFeatures/OgcApiFeaturesReader.js.map +1 -0
- package/lib/esm/Tools/MapFeatureInfoDecorator.js.map +1 -1
- package/lib/esm/Tools/MapFeatureInfoTool.js +1 -2
- package/lib/esm/Tools/MapFeatureInfoTool.js.map +1 -1
- package/lib/esm/mapLayersFormats.d.ts.map +1 -1
- package/lib/esm/mapLayersFormats.js +5 -3
- package/lib/esm/mapLayersFormats.js.map +1 -1
- package/package.json +18 -15
- package/lib/cjs/ArcGisFeature/ArcGisCanvasRenderer.d.ts +0 -19
- package/lib/cjs/ArcGisFeature/ArcGisCanvasRenderer.d.ts.map +0 -1
- package/lib/cjs/ArcGisFeature/ArcGisCanvasRenderer.js.map +0 -1
- package/lib/esm/ArcGisFeature/ArcGisCanvasRenderer.d.ts +0 -19
- package/lib/esm/ArcGisFeature/ArcGisCanvasRenderer.d.ts.map +0 -1
- package/lib/esm/ArcGisFeature/ArcGisCanvasRenderer.js.map +0 -1
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ColorDef } from "@itwin/core-common";
|
|
2
|
+
/** @internal */
|
|
3
|
+
export declare class DefaultMarkerIcon {
|
|
4
|
+
private static getSvgContent;
|
|
5
|
+
static getContent(color?: ColorDef): {
|
|
6
|
+
contentType: string;
|
|
7
|
+
imageData: string;
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=DefaultMarkerIcon.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DefaultMarkerIcon.d.ts","sourceRoot":"","sources":["../../../src/Feature/DefaultMarkerIcon.ts"],"names":[],"mappings":"AAKA,OAAO,EAAuB,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAEnE,gBAAgB;AAChB,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,MAAM,CAAC,aAAa;WAad,UAAU,CAAC,KAAK,CAAC,EAAE,QAAQ;;;;CAM1C"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { Base64EncodedString, ColorDef } from "@itwin/core-common";
|
|
6
|
+
/** @internal */
|
|
7
|
+
export class DefaultMarkerIcon {
|
|
8
|
+
static getSvgContent(color = ColorDef.fromString("#00AEEF")) {
|
|
9
|
+
return `<?xml version="1.0" encoding="utf-8"?>
|
|
10
|
+
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
|
11
|
+
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
|
12
|
+
viewBox="0 0 365 560" enable-background="new 0 0 365 560" xml:space="preserve">
|
|
13
|
+
<g>
|
|
14
|
+
<path fill="${color.toHexString()}" d="M182.9,551.7c0,0.1,0.2,0.3,0.2,0.3S358.3,283,358.3,194.6c0-130.1-88.8-186.7-175.4-186.9
|
|
15
|
+
C96.3,7.9,7.5,64.5,7.5,194.6c0,88.4,175.3,357.4,175.3,357.4S182.9,551.7,182.9,551.7z M122.2,187.2c0-33.6,27.2-60.8,60.8-60.8
|
|
16
|
+
c33.6,0,60.8,27.2,60.8,60.8S216.5,248,182.9,248C149.4,248,122.2,220.8,122.2,187.2z"/>
|
|
17
|
+
</g>
|
|
18
|
+
</svg>`;
|
|
19
|
+
}
|
|
20
|
+
static getContent(color) {
|
|
21
|
+
return {
|
|
22
|
+
contentType: "image/svg+xml",
|
|
23
|
+
imageData: Base64EncodedString.encode(DefaultMarkerIcon.getSvgContent(color)),
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=DefaultMarkerIcon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DefaultMarkerIcon.js","sourceRoot":"","sources":["../../../src/Feature/DefaultMarkerIcon.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F,OAAO,EAAE,mBAAmB,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAEnE,gBAAgB;AAChB,MAAM,OAAO,iBAAiB;IACpB,MAAM,CAAC,aAAa,CAAC,QAAkB,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC;QAC3E,OAAO;;;;;oBAKS,KAAK,CAAC,WAAW,EAAE;;;;WAI5B,CAAC;IACV,CAAC;IAEM,MAAM,CAAC,UAAU,CAAC,KAAgB;QACvC,OAAO;YACL,WAAW,EAAE,eAAe;YAC5B,SAAS,EAAE,mBAAmB,CAAC,MAAM,CAAC,iBAAiB,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;SAC9E,CAAC;IACJ,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\nimport { Base64EncodedString, ColorDef } from \"@itwin/core-common\";\n\n/** @internal */\nexport class DefaultMarkerIcon {\n private static getSvgContent(color: ColorDef = ColorDef.fromString(\"#00AEEF\")) {\n return `<?xml version=\"1.0\" encoding=\"utf-8\"?>\n <!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n <svg version=\"1.1\" id=\"Layer_1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n viewBox=\"0 0 365 560\" enable-background=\"new 0 0 365 560\" xml:space=\"preserve\">\n <g>\n <path fill=\"${color.toHexString()}\" d=\"M182.9,551.7c0,0.1,0.2,0.3,0.2,0.3S358.3,283,358.3,194.6c0-130.1-88.8-186.7-175.4-186.9\n C96.3,7.9,7.5,64.5,7.5,194.6c0,88.4,175.3,357.4,175.3,357.4S182.9,551.7,182.9,551.7z M122.2,187.2c0-33.6,27.2-60.8,60.8-60.8\n c33.6,0,60.8,27.2,60.8,60.8S216.5,248,182.9,248C149.4,248,122.2,220.8,122.2,187.2z\"/>\n </g>\n </svg>`;\n }\n\n public static getContent(color?: ColorDef) {\n return {\n contentType: \"image/svg+xml\",\n imageData: Base64EncodedString.encode(DefaultMarkerIcon.getSvgContent(color)),\n };\n }\n}\n\n"]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Transform } from "@itwin/core-geometry";
|
|
2
|
+
import { FeatureGeometryBaseRenderer, FeatureSymbolizedRenderer, FeatureSymbologyRenderer } from "@itwin/core-frontend";
|
|
3
|
+
import { ArcGisSymbologyCanvasRenderer } from "../ArcGisFeature/ArcGisSymbologyRenderer";
|
|
4
|
+
/** @internal */
|
|
5
|
+
export declare class FeatureCanvasRenderer extends FeatureGeometryBaseRenderer implements FeatureSymbolizedRenderer {
|
|
6
|
+
private _context;
|
|
7
|
+
private _symbol;
|
|
8
|
+
get symbolRenderer(): FeatureSymbologyRenderer;
|
|
9
|
+
hasSymbologyRenderer(): this is FeatureSymbolizedRenderer;
|
|
10
|
+
constructor(context: CanvasRenderingContext2D, symbol: ArcGisSymbologyCanvasRenderer, world2PixelTransform?: Transform);
|
|
11
|
+
protected beginPath(): void;
|
|
12
|
+
protected closePath(): void;
|
|
13
|
+
protected lineTo(x: number, y: number): void;
|
|
14
|
+
protected moveTo(x: number, y: number): void;
|
|
15
|
+
protected fill(): Promise<void>;
|
|
16
|
+
protected stroke(): Promise<void>;
|
|
17
|
+
protected finishPoints(): Promise<void>;
|
|
18
|
+
protected drawPoint(x: number, y: number): Promise<void>;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=FeatureCanvasRenderer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FeatureCanvasRenderer.d.ts","sourceRoot":"","sources":["../../../src/Feature/FeatureCanvasRenderer.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,2BAA2B,EAAE,yBAAyB,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AACxH,OAAO,EAAE,6BAA6B,EAAE,MAAM,0CAA0C,CAAC;AAEzF,gBAAgB;AAChB,qBAAa,qBAAsB,SAAQ,2BAA4B,YAAW,yBAAyB;IACzG,OAAO,CAAC,QAAQ,CAA2B;IAC3C,OAAO,CAAC,OAAO,CAAgC;IAE/C,IAAY,cAAc,IAAI,wBAAwB,CAErD;IACe,oBAAoB,IAAI,IAAI,IAAI,yBAAyB;gBAE7D,OAAO,EAAE,wBAAwB,EAAE,MAAM,EAAE,6BAA6B,EAAE,oBAAoB,CAAC,EAAE,SAAS;IAMtH,SAAS,CAAC,SAAS;IAInB,SAAS,CAAC,SAAS;IAInB,SAAS,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM;IAIrC,SAAS,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM;cAIrB,IAAI;cAKJ,MAAM;cAKN,YAAY;cAGZ,SAAS,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM;CAG/C"}
|
|
@@ -2,12 +2,13 @@
|
|
|
2
2
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
3
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
|
-
import {
|
|
5
|
+
import { FeatureGeometryBaseRenderer } from "@itwin/core-frontend";
|
|
6
6
|
/** @internal */
|
|
7
|
-
export class
|
|
8
|
-
get
|
|
9
|
-
return this._symbol
|
|
7
|
+
export class FeatureCanvasRenderer extends FeatureGeometryBaseRenderer {
|
|
8
|
+
get symbolRenderer() {
|
|
9
|
+
return this._symbol;
|
|
10
10
|
}
|
|
11
|
+
hasSymbologyRenderer() { return true; }
|
|
11
12
|
constructor(context, symbol, world2PixelTransform) {
|
|
12
13
|
super(world2PixelTransform);
|
|
13
14
|
this._symbol = symbol;
|
|
@@ -39,4 +40,4 @@ export class ArcGisCanvasRenderer extends ArcGisGeometryBaseRenderer {
|
|
|
39
40
|
this._symbol.drawPoint(this._context, x, y);
|
|
40
41
|
}
|
|
41
42
|
}
|
|
42
|
-
//# sourceMappingURL=
|
|
43
|
+
//# sourceMappingURL=FeatureCanvasRenderer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FeatureCanvasRenderer.js","sourceRoot":"","sources":["../../../src/Feature/FeatureCanvasRenderer.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAG/F,OAAO,EAAE,2BAA2B,EAAuD,MAAM,sBAAs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AAC,EAAE,CAAC,CAAC,CAAC;IAC9C,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\nimport { Transform } from \"@itwin/core-geometry\";\nimport { FeatureGeometryBaseRenderer, FeatureSymbolizedRenderer, FeatureSymbologyRenderer } from \"@itwin/core-frontend\";\nimport { ArcGisSymbologyCanvasRenderer } from \"../ArcGisFeature/ArcGisSymbologyRenderer\";\n\n/** @internal */\nexport class FeatureCanvasRenderer extends FeatureGeometryBaseRenderer implements FeatureSymbolizedRenderer {\n private _context: CanvasRenderingContext2D;\n private _symbol: ArcGisSymbologyCanvasRenderer;\n\n public get symbolRenderer(): FeatureSymbologyRenderer {\n return this._symbol;\n }\n public override hasSymbologyRenderer(): this is FeatureSymbolizedRenderer {return true;}\n\n constructor(context: CanvasRenderingContext2D, symbol: ArcGisSymbologyCanvasRenderer, world2PixelTransform?: Transform) {\n super(world2PixelTransform);\n this._symbol = symbol;\n this._context = context;\n }\n\n protected beginPath() {\n this._context.beginPath();\n }\n\n protected closePath() {\n this._context.closePath();\n }\n\n protected lineTo(x: number, y: number) {\n this._context.lineTo(x, y);\n }\n\n protected moveTo(x: number, y: number) {\n this._context.moveTo(x, y);\n }\n\n protected async fill() {\n this._symbol.applyFillStyle(this._context);\n this._context.fill();\n }\n\n protected async stroke() {\n this._symbol.applyStrokeStyle(this._context);\n this._context.stroke();\n }\n\n protected async finishPoints() {\n }\n\n protected async drawPoint(x: number, y: number) {\n this._symbol.drawPoint(this._context, x, y);\n }\n}\n"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Primitives, StandardTypeNames } from "@itwin/appui-abstract";
|
|
2
|
+
/** Base feature infos reader
|
|
3
|
+
* @internal
|
|
4
|
+
*/
|
|
5
|
+
export declare abstract class FeatureInfoReader {
|
|
6
|
+
floatPrecision: number | undefined;
|
|
7
|
+
forceDateDisplayValueToIso: boolean;
|
|
8
|
+
protected toFixedWithoutPadding: (value: number) => number;
|
|
9
|
+
protected getDisplayValue: (typename: StandardTypeNames, value: Primitives.Value | undefined) => string;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=FeatureInfoReader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FeatureInfoReader.d.ts","sourceRoot":"","sources":["../../../src/Feature/FeatureInfoReader.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAEtE;;GAEG;AACH,8BAAsB,iBAAiB;IAG9B,cAAc,EAAE,MAAM,GAAC,SAAS,CAAC;IAIjC,0BAA0B,UAAS;IAE1C,SAAS,CAAC,qBAAqB,UAAW,MAAM,YAE9C;IAEF,SAAS,CAAC,eAAe,aAAc,iBAAiB,SAAS,WAAW,KAAK,GAAC,SAAS,YASzF;CAEH"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { StandardTypeNames } from "@itwin/appui-abstract";
|
|
6
|
+
/** Base feature infos reader
|
|
7
|
+
* @internal
|
|
8
|
+
*/
|
|
9
|
+
export class FeatureInfoReader {
|
|
10
|
+
constructor() {
|
|
11
|
+
// Force display value of date to ISO 8601 format.
|
|
12
|
+
// Turning this ON, will disable display value in end-user's locale
|
|
13
|
+
this.forceDateDisplayValueToIso = false;
|
|
14
|
+
this.toFixedWithoutPadding = (value) => {
|
|
15
|
+
return (this.floatPrecision === undefined ? value : parseFloat(value.toFixed(this.floatPrecision)));
|
|
16
|
+
};
|
|
17
|
+
this.getDisplayValue = (typename, value) => {
|
|
18
|
+
if (value === undefined) {
|
|
19
|
+
return "";
|
|
20
|
+
}
|
|
21
|
+
else if (typename === StandardTypeNames.DateTime && this.forceDateDisplayValueToIso) {
|
|
22
|
+
return value.toISOString();
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
// eslint-disable-next-line @typescript-eslint/no-base-to-string
|
|
26
|
+
return `${value}`;
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=FeatureInfoReader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FeatureInfoReader.js","sourceRoot":"","sources":["../../../src/Feature/FeatureInfoReader.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F,OAAO,EAAc,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAEtE;;GAEG;AACH,MAAM,OAAgB,iBAAiB;IAAvC;QAKE,kDAAkD;QAClD,mEAAmE;QAC5D,+BAA0B,GAAG,KAAK,CAAC;QAEhC,0BAAqB,GAAG,CAAC,KAAa,EAAE,EAAE;YAClD,OAAO,CAAC,IAAI,CAAC,cAAc,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;QACtG,CAAC,CAAC;QAEQ,oBAAe,GAAG,CAAC,QAA2B,EAAE,KAAiC,EAAE,EAAE;YAC7F,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;gBACxB,OAAQ,EAAE,CAAC;YACb,CAAC;iBAAM,IAAK,QAAQ,KAAK,iBAAiB,CAAC,QAAQ,IAAI,IAAI,CAAC,0BAA0B,EAAE,CAAC;gBACvF,OAAQ,KAAc,CAAC,WAAW,EAAE,CAAC;YACvC,CAAC;iBAAM,CAAC;gBACN,gEAAgE;gBAChE,OAAO,GAAG,KAAK,EAAE,CAAC;YACpB,CAAC;QACH,CAAC,CAAC;IAEJ,CAAC;CAAA","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\nimport { Primitives, StandardTypeNames } from \"@itwin/appui-abstract\";\n\n/** Base feature infos reader\n * @internal\n */\nexport abstract class FeatureInfoReader {\n\n // Optionally you can set the floating precision\n public floatPrecision: number|undefined;\n\n // Force display value of date to ISO 8601 format.\n // Turning this ON, will disable display value in end-user's locale\n public forceDateDisplayValueToIso = false;\n\n protected toFixedWithoutPadding = (value: number) => {\n return (this.floatPrecision === undefined ? value : parseFloat(value.toFixed(this.floatPrecision)));\n };\n\n protected getDisplayValue = (typename: StandardTypeNames, value: Primitives.Value|undefined) => {\n if (value === undefined) {\n return \"\";\n } else if ( typename === StandardTypeNames.DateTime && this.forceDateDisplayValueToIso) {\n return (value as Date).toISOString();\n } else {\n // eslint-disable-next-line @typescript-eslint/no-base-to-string\n return `${value}`;\n }\n };\n\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FeatureSymbology.d.ts","sourceRoot":"","sources":["../../../src/Feature/FeatureSymbology.ts"],"names":[],"mappings":"AAKA,gBAAgB;AAChB,8BAAsB,gBAAgB;CAErC;AAED,gBAAgB;AAChB,MAAM,WAAW,uBAAuB;IACtC,YAAY,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,gBAAgB,CAAC;CAC1D"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
/** @internal */
|
|
6
|
+
export class FeatureSymbology {
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=FeatureSymbology.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FeatureSymbology.js","sourceRoot":"","sources":["../../../src/Feature/FeatureSymbology.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F,gBAAgB;AAChB,MAAM,OAAgB,gBAAgB;CAErC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @internal */\nexport abstract class FeatureSymbology {\n\n}\n\n/** @internal */\nexport interface FeatureDefaultSymbology {\n getSymbology: (geometryType: string) => FeatureSymbology;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RandomMapColor.d.ts","sourceRoot":"","sources":["../../../src/Feature/RandomMapColor.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C,gBAAgB;AAChB,qBAAa,cAAc;IACzB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,kBAAkB,CASxC;IAEK,QAAQ;IAIR,WAAW;CAGnB"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { ColorDef } from "@itwin/core-common";
|
|
6
|
+
/** @internal */
|
|
7
|
+
export class RandomMapColor {
|
|
8
|
+
getColor() {
|
|
9
|
+
return RandomMapColor.randomColorPalette[Math.floor(Math.random() * RandomMapColor.randomColorPalette.length)];
|
|
10
|
+
}
|
|
11
|
+
getColorDef() {
|
|
12
|
+
return ColorDef.fromString(this.getColor());
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
RandomMapColor.randomColorPalette = [
|
|
16
|
+
"#8c510a", "#bf812d", "#dfc27d", "#f6e8c3", "#f5f5f5", "#c7eae5", "#80cdc1", "#35978f", "#01665e",
|
|
17
|
+
"#b2182b", "#d6604d", "#f4a582", "#fddbc7", "#f7f7f7", "#d1e5f0", "#92c5de", "#4393c3", "#2166ac",
|
|
18
|
+
"#d73027", "#f46d43", "#fdae61", "#fee090", "#ffffbf", "#e0f3f8", "#abd9e9", "#74add1", "#4575b4",
|
|
19
|
+
"#a6cee3", "#1f78b4", "#b2df8a", "#33a02c", "#fb9a99", "#e31c2c", "#fdbf6f", "#ff7f00", "#cab2d6",
|
|
20
|
+
"#fbb4ae", "#e41a1c", "#377eb8", "#4daf4a", "#984ea3", "#ff2000", "#ffff33", "#a65628", "#999999",
|
|
21
|
+
"#8dd3c7", "#ffffb3", "#bebada", "#fb8072", "#80b1d3", "#fdb462", "#b3de69", "#fccde5", "#ffa07a",
|
|
22
|
+
"#b15928", "#6a3d9a", "#ffed6f", "#9e0142", "#5e4fa2", "#999900", "#1a9850", "#4d4d4d", "#6baed6",
|
|
23
|
+
"#71c671", "#388e8e", "#7d9ec0", "#7171c6", "#8e388e", "#8e8e38", "#00c957", "#cc3333", "#d1dbdd",
|
|
24
|
+
];
|
|
25
|
+
//# sourceMappingURL=RandomMapColor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RandomMapColor.js","sourceRoot":"","sources":["../../../src/Feature/RandomMapColor.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C,gBAAgB;AAChB,MAAM,OAAO,cAAc;IAYlB,QAAQ;QACb,OAAO,cAAc,CAAC,kBAAkB,CAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,cAAc,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAC,CAAC;IAClH,CAAC;IAEM,WAAW;QAChB,OAAO,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;IAC9C,CAAC;;AAjBuB,iCAAkB,GAAG;IAC3C,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS;IACjG,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS;IACjG,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS;IACjG,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS;IACjG,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS;IACjG,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS;IACjG,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS;IACjG,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS;CAClG,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\nimport { ColorDef } from \"@itwin/core-common\";\n\n/** @internal */\nexport class RandomMapColor {\n private static readonly randomColorPalette = [\n \"#8c510a\", \"#bf812d\", \"#dfc27d\", \"#f6e8c3\", \"#f5f5f5\", \"#c7eae5\", \"#80cdc1\", \"#35978f\", \"#01665e\",\n \"#b2182b\", \"#d6604d\", \"#f4a582\", \"#fddbc7\", \"#f7f7f7\", \"#d1e5f0\", \"#92c5de\", \"#4393c3\", \"#2166ac\",\n \"#d73027\", \"#f46d43\", \"#fdae61\", \"#fee090\", \"#ffffbf\", \"#e0f3f8\", \"#abd9e9\", \"#74add1\", \"#4575b4\",\n \"#a6cee3\", \"#1f78b4\", \"#b2df8a\", \"#33a02c\", \"#fb9a99\", \"#e31c2c\", \"#fdbf6f\", \"#ff7f00\", \"#cab2d6\",\n \"#fbb4ae\", \"#e41a1c\", \"#377eb8\", \"#4daf4a\", \"#984ea3\", \"#ff2000\", \"#ffff33\", \"#a65628\", \"#999999\",\n \"#8dd3c7\", \"#ffffb3\", \"#bebada\", \"#fb8072\", \"#80b1d3\", \"#fdb462\", \"#b3de69\", \"#fccde5\", \"#ffa07a\",\n \"#b15928\", \"#6a3d9a\", \"#ffed6f\", \"#9e0142\", \"#5e4fa2\", \"#999900\", \"#1a9850\", \"#4d4d4d\", \"#6baed6\",\n \"#71c671\", \"#388e8e\", \"#7d9ec0\", \"#7171c6\", \"#8e388e\", \"#8e8e38\", \"#00c957\", \"#cc3333\", \"#d1dbdd\",\n ];\n\n public getColor() {\n return RandomMapColor.randomColorPalette[ Math.floor(Math.random() * RandomMapColor.randomColorPalette.length)];\n }\n\n public getColorDef() {\n return ColorDef.fromString(this.getColor());\n }\n}\n\n"]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as GeoJson from "geojson";
|
|
2
|
+
/** @internal */
|
|
3
|
+
export type Coord = number[];
|
|
4
|
+
/** @internal */ export type RingCoords = Coord[];
|
|
5
|
+
/** @internal */
|
|
6
|
+
export type MultiRingCoords = RingCoords[];
|
|
7
|
+
/** @internal */
|
|
8
|
+
export interface MultiPath {
|
|
9
|
+
lengths: number[];
|
|
10
|
+
coords: number[];
|
|
11
|
+
}
|
|
12
|
+
/** @internal */
|
|
13
|
+
export declare class GeoJSONGeometryUtils {
|
|
14
|
+
static isRingOrPath(geom: GeoJson.Geometry): boolean;
|
|
15
|
+
static isFilled(geom: GeoJson.Geometry): boolean;
|
|
16
|
+
static isPoint(geom: GeoJson.Geometry): boolean;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=GeoJSONGeometry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GeoJSONGeometry.d.ts","sourceRoot":"","sources":["../../../src/GeoJSON/GeoJSONGeometry.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC;AAEnC,gBAAgB;AAChB,MAAM,MAAM,KAAK,GAAG,MAAM,EAAE,CAAC;AAE7B,gBAAgB,CAChB,MAAM,MAAM,UAAU,GAAG,KAAK,EAAE,CAAC;AAEjC,gBAAgB;AAChB,MAAM,MAAM,eAAe,GAAG,UAAU,EAAE,CAAC;AAE3C,gBAAgB;AAChB,MAAM,WAAW,SAAS;IACxB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,gBAAgB;AAChB,qBAAa,oBAAoB;WACjB,YAAY,CAAC,IAAI,EAAE,OAAO,CAAC,QAAQ;WACnC,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC,QAAQ;WAC/B,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,QAAQ;CAC7C"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** @internal */
|
|
2
|
+
export class GeoJSONGeometryUtils {
|
|
3
|
+
static isRingOrPath(geom) { return geom.type === "LineString" || geom.type === "MultiLineString" || geom.type === "Polygon" || geom.type === "MultiPolygon"; }
|
|
4
|
+
static isFilled(geom) { return geom.type === "Polygon" || geom.type === "MultiPolygon"; }
|
|
5
|
+
static isPoint(geom) { return geom.type === "Point" || geom.type === "MultiPoint"; }
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=GeoJSONGeometry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GeoJSONGeometry.js","sourceRoot":"","sources":["../../../src/GeoJSON/GeoJSONGeometry.ts"],"names":[],"mappings":"AAqBA,gBAAgB;AAChB,MAAM,OAAO,oBAAoB;IACxB,MAAM,CAAC,YAAY,CAAC,IAAsB,IAAG,OAAO,IAAI,CAAC,IAAI,KAAK,YAAY,IAAI,IAAI,CAAC,IAAI,KAAK,iBAAiB,IAAI,IAAI,CAAC,IAAI,KAAK,SAAS,IAAI,IAAI,CAAC,IAAI,KAAK,cAAc,CAAC,CAAA,CAAC;IAC9K,MAAM,CAAC,QAAQ,CAAC,IAAsB,IAAG,OAAQ,IAAI,CAAC,IAAI,KAAK,SAAS,IAAI,IAAI,CAAC,IAAI,KAAK,cAAc,CAAC,CAAA,CAAC;IAC1G,MAAM,CAAC,OAAO,CAAC,IAAsB,IAAG,OAAO,IAAI,CAAC,IAAI,KAAK,OAAO,IAAI,IAAI,CAAC,IAAI,KAAK,YAAY,CAAC,CAAA,CAAC;CAC5G","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport * as GeoJson from \"geojson\";\n\n/** @internal */\nexport type Coord = number[];\n\n/** @internal */ // Array of 2 or 3 numbers\nexport type RingCoords = Coord[];\n\n/** @internal */\nexport type MultiRingCoords = RingCoords[];\n\n/** @internal */\nexport interface MultiPath {\n lengths: number[];\n coords: number[];\n}\n\n/** @internal */\nexport class GeoJSONGeometryUtils {\n public static isRingOrPath(geom: GeoJson.Geometry) {return geom.type === \"LineString\" || geom.type === \"MultiLineString\" || geom.type === \"Polygon\" || geom.type === \"MultiPolygon\";}\n public static isFilled(geom: GeoJson.Geometry) {return geom.type === \"Polygon\" || geom.type === \"MultiPolygon\";}\n public static isPoint(geom: GeoJson.Geometry) {return geom.type === \"Point\" || geom.type === \"MultiPoint\";}\n}\n"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { FeatureGeometryRenderer } from "@itwin/core-frontend";
|
|
2
|
+
import * as GeoJson from "geojson";
|
|
3
|
+
/** @internal */
|
|
4
|
+
export declare class GeoJSONGeometryReader {
|
|
5
|
+
private _renderer;
|
|
6
|
+
constructor(renderer: FeatureGeometryRenderer);
|
|
7
|
+
readGeometry(geometry: GeoJson.Geometry): Promise<void>;
|
|
8
|
+
private readRingsAndPaths;
|
|
9
|
+
private readPoints;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=GeoJSONGeometryReader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GeoJSONGeometryReader.d.ts","sourceRoot":"","sources":["../../../src/GeoJSON/GeoJSONGeometryReader.ts"],"names":[],"mappings":"AAMA,OAAO,EAAsB,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAEnF,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC;AAInC,gBAAgB;AAChB,qBAAa,qBAAqB;IAChC,OAAO,CAAC,SAAS,CAA0B;gBAExB,QAAQ,EAAE,uBAAuB;IAIvC,YAAY,CAAC,QAAQ,EAAE,OAAO,CAAC,QAAQ;YAWtC,iBAAiB;YAwCjB,UAAU;CAkBzB"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { Logger } from "@itwin/core-bentley";
|
|
6
|
+
import { deflateCoordinates } from "@itwin/core-frontend";
|
|
7
|
+
import { GeoJSONGeometryUtils } from "./GeoJSONGeometry";
|
|
8
|
+
const loggerCategory = "MapLayersFormats.GeoJSONGeometryReader";
|
|
9
|
+
/** @internal */
|
|
10
|
+
export class GeoJSONGeometryReader {
|
|
11
|
+
constructor(renderer) {
|
|
12
|
+
this._renderer = renderer;
|
|
13
|
+
}
|
|
14
|
+
async readGeometry(geometry) {
|
|
15
|
+
if (GeoJSONGeometryUtils.isRingOrPath(geometry)) {
|
|
16
|
+
await this.readRingsAndPaths(geometry, this._renderer, GeoJSONGeometryUtils.isFilled(geometry), false /* relativeCoords*/);
|
|
17
|
+
}
|
|
18
|
+
else if (GeoJSONGeometryUtils.isPoint(geometry)) {
|
|
19
|
+
await this.readPoints(geometry, this._renderer, false /* relativeCoords*/);
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
Logger.logError(loggerCategory, `GeoJSONGeometryReader:readGeometry - Unknown geometry type '${geometry.type}'`);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
async readRingsAndPaths(geometry, renderer, fill, relativeCoords) {
|
|
26
|
+
const multiPath = { coords: [], lengths: [] };
|
|
27
|
+
let polys;
|
|
28
|
+
const readPath = (ring, offset, result) => {
|
|
29
|
+
const newOffset = deflateCoordinates(ring, result.coords, 2, offset);
|
|
30
|
+
result.lengths.push(ring.length);
|
|
31
|
+
return newOffset;
|
|
32
|
+
};
|
|
33
|
+
const readMultiPath = (multiRings, result) => {
|
|
34
|
+
let offset = 0;
|
|
35
|
+
for (const ring of multiRings) {
|
|
36
|
+
offset = readPath(ring, offset, result);
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
if (geometry.type === "LineString") {
|
|
40
|
+
readPath(geometry.coordinates, 0, multiPath);
|
|
41
|
+
}
|
|
42
|
+
else if (geometry.type === "MultiLineString" || geometry.type === "Polygon") {
|
|
43
|
+
readMultiPath(geometry.coordinates, multiPath);
|
|
44
|
+
}
|
|
45
|
+
else if (geometry.type === "MultiPolygon") {
|
|
46
|
+
polys = [];
|
|
47
|
+
for (const poly of geometry.coordinates) {
|
|
48
|
+
const tmpMultiPath = { coords: [], lengths: [] };
|
|
49
|
+
readMultiPath(poly, tmpMultiPath);
|
|
50
|
+
polys.push(tmpMultiPath);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
if (polys) {
|
|
54
|
+
for (const poly of polys) {
|
|
55
|
+
await renderer.renderPath(poly.lengths, poly.coords, fill, 2, relativeCoords);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
await renderer.renderPath(multiPath.lengths, multiPath.coords, fill, 2, relativeCoords);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
async readPoints(geom, renderer, relativeCoords) {
|
|
63
|
+
const lengths = [];
|
|
64
|
+
const coords = [];
|
|
65
|
+
const readPoint = (coord) => {
|
|
66
|
+
lengths.push(1);
|
|
67
|
+
coords.push(coord[0]);
|
|
68
|
+
coords.push(coord[1]);
|
|
69
|
+
};
|
|
70
|
+
if (geom.type === "MultiPoint") {
|
|
71
|
+
geom.coordinates.forEach(readPoint);
|
|
72
|
+
}
|
|
73
|
+
else if (geom.type === "Point") {
|
|
74
|
+
readPoint(geom.coordinates);
|
|
75
|
+
}
|
|
76
|
+
await renderer.renderPoint(lengths, coords, 2, relativeCoords);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
//# sourceMappingURL=GeoJSONGeometryReader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GeoJSONGeometryReader.js","sourceRoot":"","sources":["../../../src/GeoJSON/GeoJSONGeometryReader.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,kBAAkB,EAA2B,MAAM,sBAAsB,CAAC;AACnF,OAAO,EAAS,oBAAoB,EAA0C,MAAM,mBAAmB,CAAC;AAGxG,MAAM,cAAc,GAAG,wCAAwC,CAAC;AAEhE,gBAAgB;AAChB,MAAM,OAAO,qBAAqB;IAGhC,YAAmB,QAAiC;QAClD,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;IAC5B,CAAC;IAEM,KAAK,CAAC,YAAY,CAAC,QAA0B;QAElD,IA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ACzB,MAAM,SAAS,GAAG,CAAC,KAAY,EAAE,EAAE;YACjC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YAChB,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;YACtB,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;QACxB,CAAC,CAAC;QAEF,IAAI,IAAI,CAAC,IAAI,KAAK,YAAY,EAAE,CAAC;YAC/B,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QACtC,CAAC;aAAM,IAAI,IAAI,CAAC,IAAI,KAAK,OAAO,EAAE,CAAC;YACjC,SAAS,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAC9B,CAAC;QAED,MAAM,QAAQ,CAAC,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,CAAC,EAAE,cAAc,CAAC,CAAC;IACjE,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\nimport { Logger } from \"@itwin/core-bentley\";\nimport { deflateCoordinates, FeatureGeometryRenderer } from \"@itwin/core-frontend\";\nimport { Coord, GeoJSONGeometryUtils, MultiPath, MultiRingCoords, RingCoords } from \"./GeoJSONGeometry\";\nimport * as GeoJson from \"geojson\";\n\nconst loggerCategory = \"MapLayersFormats.GeoJSONGeometryReader\";\n\n/** @internal */\nexport class GeoJSONGeometryReader {\n private _renderer: FeatureGeometryRenderer;\n\n public constructor(renderer: FeatureGeometryRenderer) {\n this._renderer = renderer;\n }\n\n public async readGeometry(geometry: GeoJson.Geometry) {\n\n if (GeoJSONGeometryUtils.isRingOrPath(geometry)) {\n await this.readRingsAndPaths(geometry, this._renderer, GeoJSONGeometryUtils.isFilled(geometry), false /* relativeCoords*/);\n } else if (GeoJSONGeometryUtils.isPoint(geometry)) {\n await this.readPoints(geometry, this._renderer, false/* relativeCoords*/);\n } else {\n Logger.logError(loggerCategory, `GeoJSONGeometryReader:readGeometry - Unknown geometry type '${geometry.type}'`);\n }\n }\n\n private async readRingsAndPaths(geometry: GeoJson.Geometry, renderer: FeatureGeometryRenderer, fill: boolean, relativeCoords: boolean) {\n const multiPath: MultiPath = {coords: [], lengths: []};\n let polys: MultiPath[] | undefined;\n\n const readPath = (ring: RingCoords, offset: number, result: MultiPath) => {\n const newOffset = deflateCoordinates(ring, result.coords, 2, offset);\n result.lengths.push(ring.length);\n return newOffset;\n };\n\n const readMultiPath = (multiRings: MultiRingCoords, result: MultiPath) => {\n let offset = 0;\n for (const ring of multiRings) {\n offset = readPath(ring, offset, result);\n }\n };\n\n if (geometry.type === \"LineString\") {\n readPath(geometry.coordinates, 0, multiPath);\n } else if (geometry.type === \"MultiLineString\" || geometry.type === \"Polygon\") {\n readMultiPath(geometry.coordinates, multiPath);\n } else if (geometry.type === \"MultiPolygon\") {\n polys = [];\n for (const poly of geometry.coordinates) {\n const tmpMultiPath: MultiPath = {coords: [], lengths: [] };\n readMultiPath(poly, tmpMultiPath);\n polys.push(tmpMultiPath);\n }\n }\n\n if (polys) {\n for (const poly of polys) {\n await renderer.renderPath(poly.lengths, poly.coords, fill, 2, relativeCoords);\n }\n } else {\n await renderer.renderPath(multiPath.lengths, multiPath.coords, fill, 2, relativeCoords);\n }\n\n }\n\n private async readPoints(geom: GeoJson.Geometry, renderer: FeatureGeometryRenderer, relativeCoords: boolean) {\n\n const lengths: Coord = [];\n const coords: Coord = [];\n const readPoint = (coord: Coord) => {\n lengths.push(1);\n coords.push(coord[0]);\n coords.push(coord[1]);\n };\n\n if (geom.type === \"MultiPoint\") {\n geom.coordinates.forEach(readPoint);\n } else if (geom.type === \"Point\") {\n readPoint(geom.coordinates);\n }\n\n await renderer.renderPoint(lengths, coords, 2, relativeCoords);\n }\n}\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ImageMapLayerSettings } from "@itwin/core-common";
|
|
2
|
+
import { ImageryMapLayerFormat, MapLayerImageryProvider, MapLayerSourceValidation, ValidateSourceArgs } from "@itwin/core-frontend";
|
|
3
|
+
/** @internal */
|
|
4
|
+
export declare class OgcApiFeaturesMapLayerFormat extends ImageryMapLayerFormat {
|
|
5
|
+
static formatId: string;
|
|
6
|
+
static createImageryProvider(settings: ImageMapLayerSettings): MapLayerImageryProvider | undefined;
|
|
7
|
+
static validate(args: ValidateSourceArgs): Promise<MapLayerSourceValidation>;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=OgcApiFeaturesFormat.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OgcApiFeaturesFormat.d.ts","sourceRoot":"","sources":["../../../src/OgcApiFeatures/OgcApiFeaturesFormat.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,qBAAqB,EAAoB,MAAM,oBAAoB,CAAC;AAC7E,OAAO,EAAqB,qBAAqB,EAAE,uBAAuB,EAAwB,wBAAwB,EAAyB,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAGpM,gBAAgB;AAChB,qBAAa,4BAA6B,SAAQ,qBAAqB;IACrE,OAAuB,QAAQ,SAAoB;WAC5B,qBAAqB,CAAC,QAAQ,EAAE,qBAAqB,GAAG,uBAAuB,GAAG,SAAS;WAErF,QAAQ,CAAC,IAAI,EAAE,kBAAkB,GAAG,OAAO,CAAC,wBAAwB,CAAC;CAuFnG"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { appendQueryParams, ImageryMapLayerFormat, MapLayerSourceStatus, setBasicAuthorization } from "@itwin/core-frontend";
|
|
2
|
+
import { OgcApiFeaturesProvider } from "./OgcApiFeaturesProvider";
|
|
3
|
+
/** @internal */
|
|
4
|
+
export class OgcApiFeaturesMapLayerFormat extends ImageryMapLayerFormat {
|
|
5
|
+
static createImageryProvider(settings) { return new OgcApiFeaturesProvider(settings); }
|
|
6
|
+
static async validate(args) {
|
|
7
|
+
const { source } = args;
|
|
8
|
+
const { userName, password } = source;
|
|
9
|
+
let status = MapLayerSourceStatus.InvalidUrl;
|
|
10
|
+
try {
|
|
11
|
+
let headers;
|
|
12
|
+
if (userName && password) {
|
|
13
|
+
headers = new Headers();
|
|
14
|
+
setBasicAuthorization(headers, userName, password);
|
|
15
|
+
}
|
|
16
|
+
const opts = {
|
|
17
|
+
method: "GET",
|
|
18
|
+
headers,
|
|
19
|
+
};
|
|
20
|
+
let url = appendQueryParams(source.url, source.savedQueryParams);
|
|
21
|
+
url = appendQueryParams(url, source.unsavedQueryParams);
|
|
22
|
+
let response = await fetch(url, opts);
|
|
23
|
+
let json = await response.json();
|
|
24
|
+
if (!json) {
|
|
25
|
+
return { status };
|
|
26
|
+
}
|
|
27
|
+
const createCollectionsList = (data) => {
|
|
28
|
+
let array;
|
|
29
|
+
for (const collection of data.collections) {
|
|
30
|
+
if (collection.itemType === "feature") {
|
|
31
|
+
const subLayerProps = {
|
|
32
|
+
id: collection.id,
|
|
33
|
+
name: collection.id,
|
|
34
|
+
title: collection.title,
|
|
35
|
+
visible: true,
|
|
36
|
+
parent: undefined,
|
|
37
|
+
children: undefined,
|
|
38
|
+
};
|
|
39
|
+
if (array)
|
|
40
|
+
array.push(subLayerProps);
|
|
41
|
+
else
|
|
42
|
+
array = [subLayerProps];
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return array;
|
|
46
|
+
};
|
|
47
|
+
let subLayers;
|
|
48
|
+
if (Array.isArray(json.collections)) {
|
|
49
|
+
subLayers = createCollectionsList(json);
|
|
50
|
+
status = MapLayerSourceStatus.Valid;
|
|
51
|
+
}
|
|
52
|
+
else if (json.itemType === "feature" || json.type === "FeatureCollection") {
|
|
53
|
+
// We expect one of the following URL:
|
|
54
|
+
// http://server/collections/<collectionName>
|
|
55
|
+
// http://server/collections/<collectionName>/items
|
|
56
|
+
subLayers = [{
|
|
57
|
+
id: json.id,
|
|
58
|
+
name: json.id,
|
|
59
|
+
title: json.title,
|
|
60
|
+
visible: true,
|
|
61
|
+
parent: undefined,
|
|
62
|
+
children: undefined,
|
|
63
|
+
}];
|
|
64
|
+
status = MapLayerSourceStatus.Valid;
|
|
65
|
+
}
|
|
66
|
+
else if (Array.isArray(json.links)) {
|
|
67
|
+
// This might be the main landing page
|
|
68
|
+
const collectionsLink = json.links.find((link) => link.rel.includes("data") && link.type === "application/json");
|
|
69
|
+
let collectionsUrl = appendQueryParams(collectionsLink.href, source.savedQueryParams);
|
|
70
|
+
collectionsUrl = appendQueryParams(collectionsUrl, source.unsavedQueryParams);
|
|
71
|
+
response = await fetch(collectionsUrl, opts);
|
|
72
|
+
json = await response.json();
|
|
73
|
+
if (Array.isArray(json.collections)) {
|
|
74
|
+
subLayers = createCollectionsList(json);
|
|
75
|
+
status = MapLayerSourceStatus.Valid;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
return { status, subLayers };
|
|
79
|
+
}
|
|
80
|
+
catch (err) {
|
|
81
|
+
status = MapLayerSourceStatus.InvalidUrl;
|
|
82
|
+
if (err?.status === 401) {
|
|
83
|
+
status = ((userName && password) ? MapLayerSourceStatus.InvalidCredentials : MapLayerSourceStatus.RequireAuth);
|
|
84
|
+
}
|
|
85
|
+
return { status };
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
OgcApiFeaturesMapLayerFormat.formatId = "OgcApiFeatures";
|
|
90
|
+
//# sourceMappingURL=OgcApiFeaturesFormat.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OgcApiFeaturesFormat.js","sourceRoot":"","sources":["../../../src/OgcApiFeatures/OgcApiFeaturesFormat.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAA2B,oBAAoB,EAA4B,qBAAqB,EAAsB,MAAM,sBAAsB,CAAC;AACpM,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAElE,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,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,IAAI,CAAC,IAAI,KAAK,kBAAkB,CAAC,CAAC;gBACrH,IAAI,cAAc,GAAG,iBAAiB,CAAC,eAAe,CAAC,IAAI,EAAE,MAAM,CAAC,gBAAgB,CAAC,CAAC;gBACtF,cAAc,GAAG,iBAAiB,CAAC,cAAc,EAAE,MAAM,CAAC,kBAAkB,CAAC,CAAC;gBAC9E,QAAQ,GAAG,MAAM,KAAK,CAAC,cAAc,EAAE,IAAI,CAAC,CAAC;gBAC7C,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;gBAC7B,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC;oBACpC,SAAS,GAAG,qBAAqB,CAAC,IAAI,CAAC,CAAC;oBACxC,MAAM,GAAG,oBAAoB,CAAC,KAAK,CAAC;gBACtC,CAAC;YAEH,CAAC;YAED,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC;QAE/B,CAAC;QAAC,OAAO,GAAQ,EAAE,CAAC;YAClB,MAAM,GAAG,oBAAoB,CAAC,UAAU,CAAC;YACzC,IAAI,GAAG,EAAE,MAAM,KAAK,GAAG,EAAE,CAAC;gBACxB,MAAM,GAAG,CAAC,CAAC,QAAQ,IAAI,QAAQ,CAAC,CAAC,CAAC,CAAC,oBAAoB,CAAC,kBAAkB,CAAC,CAAC,CAAC,oBAAoB,CAAC,WAAW,CAAC,CAAC;YACjH,CAAC;YACD,OAAO,EAAE,MAAM,EAAC,CAAC;QACnB,CAAC;IACH,CAAC;;AAzFsB,qCAAQ,GAAG,gBAAgB,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport { ImageMapLayerSettings, MapSubLayerProps } from \"@itwin/core-common\";\nimport { appendQueryParams, ImageryMapLayerFormat, MapLayerImageryProvider, MapLayerSourceStatus, MapLayerSourceValidation, setBasicAuthorization, ValidateSourceArgs } from \"@itwin/core-frontend\";\nimport { OgcApiFeaturesProvider } from \"./OgcApiFeaturesProvider\";\n\n/** @internal */\nexport class OgcApiFeaturesMapLayerFormat extends ImageryMapLayerFormat {\n public static override formatId = \"OgcApiFeatures\";\n public static override createImageryProvider(settings: ImageMapLayerSettings): MapLayerImageryProvider | undefined { return new OgcApiFeaturesProvider(settings); }\n\n public static override async validate(args: ValidateSourceArgs): Promise<MapLayerSourceValidation> {\n\n const {source} = args;\n const { userName, password } = source;\n let status = MapLayerSourceStatus.InvalidUrl;\n try {\n\n let headers: Headers | undefined;\n if (userName && password) {\n headers = new Headers();\n setBasicAuthorization(headers, userName, password);\n }\n const opts: RequestInit = {\n method: \"GET\",\n headers,\n };\n\n let url = appendQueryParams(source.url, source.savedQueryParams);\n url = appendQueryParams(url, source.unsavedQueryParams);\n let response = await fetch(url, opts);\n let json = await response.json();\n if (!json) {\n return { status };\n }\n\n const createCollectionsList = (data: any) => {\n let array: MapSubLayerProps[] | undefined;\n for (const collection of data.collections) {\n if (collection.itemType === \"feature\") {\n const subLayerProps = {\n id: collection.id,\n name: collection.id,\n title: collection.title,\n visible: true,\n parent: undefined,\n children: undefined,\n };\n if (array)\n array.push(subLayerProps);\n else\n array = [subLayerProps];\n }\n }\n return array;\n };\n\n let subLayers: MapSubLayerProps[] | undefined;\n if (Array.isArray(json.collections)) {\n subLayers = createCollectionsList(json);\n status = MapLayerSourceStatus.Valid;\n } else if (json.itemType === \"feature\" || json.type === \"FeatureCollection\") {\n // We expect one of the following URL:\n // http://server/collections/<collectionName>\n // http://server/collections/<collectionName>/items\n subLayers = [{\n id: json.id,\n name: json.id,\n title: json.title,\n visible: true,\n parent: undefined,\n children: undefined,\n }];\n status = MapLayerSourceStatus.Valid;\n } else if (Array.isArray(json.links)) {\n // This might be the main landing page\n const collectionsLink = json.links.find((link: any)=> link.rel.includes(\"data\") && link.type === \"application/json\");\n let collectionsUrl = appendQueryParams(collectionsLink.href, source.savedQueryParams);\n collectionsUrl = appendQueryParams(collectionsUrl, source.unsavedQueryParams);\n response = await fetch(collectionsUrl, opts);\n json = await response.json();\n if (Array.isArray(json.collections)) {\n subLayers = createCollectionsList(json);\n status = MapLayerSourceStatus.Valid;\n }\n\n }\n\n return { status, subLayers };\n\n } catch (err: any) {\n status = MapLayerSourceStatus.InvalidUrl;\n if (err?.status === 401) {\n status = ((userName && password) ? MapLayerSourceStatus.InvalidCredentials : MapLayerSourceStatus.RequireAuth);\n }\n return { status};\n }\n }\n}\n"]}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { HitDetail, ImageryMapTileTree, MapFeatureInfoOptions, MapLayerFeatureInfo, MapLayerImageryProvider, QuadId } from "@itwin/core-frontend";
|
|
2
|
+
import { EsriSymbol } from "../ArcGisFeature/EsriSymbology";
|
|
3
|
+
import { Cartographic, ImageMapLayerSettings, ImageSource } from "@itwin/core-common";
|
|
4
|
+
import { FeatureDefaultSymbology } from "../Feature/FeatureSymbology";
|
|
5
|
+
import { RandomMapColor } from "../Feature/RandomMapColor";
|
|
6
|
+
/** Provide tiles from a ESRI ArcGIS Feature service
|
|
7
|
+
* @internal
|
|
8
|
+
*/
|
|
9
|
+
export declare class DefaultOgcSymbology implements FeatureDefaultSymbology {
|
|
10
|
+
private static readonly _defaultPMSProps;
|
|
11
|
+
private _defaultPMS;
|
|
12
|
+
private static readonly _defaultSLSProps;
|
|
13
|
+
private _defaultSLS;
|
|
14
|
+
private static readonly _defaultSFSProps;
|
|
15
|
+
private _defaultSFS;
|
|
16
|
+
constructor(randomColor?: RandomMapColor);
|
|
17
|
+
initialize(): Promise<void>;
|
|
18
|
+
getSymbology(geometryType: string): EsriSymbol;
|
|
19
|
+
}
|
|
20
|
+
/** @internal */
|
|
21
|
+
export declare class OgcApiFeaturesProvider extends MapLayerImageryProvider {
|
|
22
|
+
private readonly _drawDebugInfo;
|
|
23
|
+
private readonly _limitParamMaxValue;
|
|
24
|
+
private readonly _tiledModeMinLod;
|
|
25
|
+
private readonly _staticModeFetchTimeout;
|
|
26
|
+
private readonly _tileModeFetchTimeout;
|
|
27
|
+
private readonly _forceTileMode;
|
|
28
|
+
private _spatialIdx;
|
|
29
|
+
private _defaultSymbol;
|
|
30
|
+
private _renderer;
|
|
31
|
+
private _collectionUrl;
|
|
32
|
+
private _itemsUrl;
|
|
33
|
+
private readonly _itemsCrs;
|
|
34
|
+
private _queryables;
|
|
35
|
+
serviceJson: any;
|
|
36
|
+
private _staticData;
|
|
37
|
+
constructor(settings: ImageMapLayerSettings);
|
|
38
|
+
get supportsMapFeatureInfo(): boolean;
|
|
39
|
+
get minimumZoomLevel(): number;
|
|
40
|
+
get staticMode(): boolean;
|
|
41
|
+
initialize(): Promise<void>;
|
|
42
|
+
private fetchMetadata;
|
|
43
|
+
private fetchAllItems;
|
|
44
|
+
private fetchItems;
|
|
45
|
+
private indexStaticData;
|
|
46
|
+
get tileSize(): number;
|
|
47
|
+
constructUrl(_row: number, _column: number, _zoomLevel: number): Promise<string>;
|
|
48
|
+
drawTileDebugInfo(row: number, column: number, zoomLevel: number, context: CanvasRenderingContext2D): void;
|
|
49
|
+
computeTileWorld2CanvasTransform(row: number, column: number, zoomLevel: number): import("@itwin/core-geometry").Transform | undefined;
|
|
50
|
+
loadTile(row: number, column: number, zoomLevel: number): Promise<ImageSource | undefined>;
|
|
51
|
+
private createImageSourceFromDataURL;
|
|
52
|
+
getFeatureInfo(featureInfos: MapLayerFeatureInfo[], quadId: QuadId, carto: Cartographic, _tree: ImageryMapTileTree, hit: HitDetail, options?: MapFeatureInfoOptions): Promise<void>;
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=OgcApiFeaturesProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OgcApiFeaturesProvider.d.ts","sourceRoot":"","sources":["../../../src/OgcApiFeatures/Og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