@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.
Files changed (159) hide show
  1. package/CHANGELOG.md +13 -1
  2. package/lib/cjs/ArcGisFeature/ArcGisFeatureFormat.js +1 -1
  3. package/lib/cjs/ArcGisFeature/ArcGisFeatureFormat.js.map +1 -1
  4. package/lib/cjs/ArcGisFeature/ArcGisFeatureProvider.d.ts +15 -6
  5. package/lib/cjs/ArcGisFeature/ArcGisFeatureProvider.d.ts.map +1 -1
  6. package/lib/cjs/ArcGisFeature/ArcGisFeatureProvider.js +64 -54
  7. package/lib/cjs/ArcGisFeature/ArcGisFeatureProvider.js.map +1 -1
  8. package/lib/cjs/ArcGisFeature/ArcGisFeatureQuery.js.map +1 -1
  9. package/lib/cjs/ArcGisFeature/ArcGisFeatureReader.d.ts +7 -11
  10. package/lib/cjs/ArcGisFeature/ArcGisFeatureReader.d.ts.map +1 -1
  11. package/lib/cjs/ArcGisFeature/ArcGisFeatureReader.js +3 -19
  12. package/lib/cjs/ArcGisFeature/ArcGisFeatureReader.js.map +1 -1
  13. package/lib/cjs/ArcGisFeature/ArcGisFeatureResponse.js.map +1 -1
  14. package/lib/cjs/ArcGisFeature/ArcGisJsonFeatureReader.d.ts +3 -3
  15. package/lib/cjs/ArcGisFeature/ArcGisJsonFeatureReader.d.ts.map +1 -1
  16. package/lib/cjs/ArcGisFeature/ArcGisJsonFeatureReader.js +3 -4
  17. package/lib/cjs/ArcGisFeature/ArcGisJsonFeatureReader.js.map +1 -1
  18. package/lib/cjs/ArcGisFeature/ArcGisPbfFeatureReader.d.ts +3 -3
  19. package/lib/cjs/ArcGisFeature/ArcGisPbfFeatureReader.d.ts.map +1 -1
  20. package/lib/cjs/ArcGisFeature/ArcGisPbfFeatureReader.js +2 -3
  21. package/lib/cjs/ArcGisFeature/ArcGisPbfFeatureReader.js.map +1 -1
  22. package/lib/cjs/ArcGisFeature/ArcGisSymbologyRenderer.d.ts +35 -15
  23. package/lib/cjs/ArcGisFeature/ArcGisSymbologyRenderer.d.ts.map +1 -1
  24. package/lib/cjs/ArcGisFeature/ArcGisSymbologyRenderer.js +54 -48
  25. package/lib/cjs/ArcGisFeature/ArcGisSymbologyRenderer.js.map +1 -1
  26. package/lib/cjs/ArcGisFeature/EsriSymbology.d.ts +2 -1
  27. package/lib/cjs/ArcGisFeature/EsriSymbology.d.ts.map +1 -1
  28. package/lib/cjs/ArcGisFeature/EsriSymbology.js +2 -1
  29. package/lib/cjs/ArcGisFeature/EsriSymbology.js.map +1 -1
  30. package/lib/cjs/ArcGisFeature/esriPBuffer.gen.js +1 -1
  31. package/lib/cjs/ArcGisFeature/esriPBuffer.gen.js.map +1 -1
  32. package/lib/cjs/Feature/DefaultMarkerIcon.d.ts +10 -0
  33. package/lib/cjs/Feature/DefaultMarkerIcon.d.ts.map +1 -0
  34. package/lib/cjs/Feature/DefaultMarkerIcon.js +31 -0
  35. package/lib/cjs/Feature/DefaultMarkerIcon.js.map +1 -0
  36. package/lib/cjs/Feature/FeatureCanvasRenderer.d.ts +20 -0
  37. package/lib/cjs/Feature/FeatureCanvasRenderer.d.ts.map +1 -0
  38. package/lib/cjs/{ArcGisFeature/ArcGisCanvasRenderer.js → Feature/FeatureCanvasRenderer.js} +7 -6
  39. package/lib/cjs/Feature/FeatureCanvasRenderer.js.map +1 -0
  40. package/lib/cjs/Feature/FeatureInfoReader.d.ts +11 -0
  41. package/lib/cjs/Feature/FeatureInfoReader.d.ts.map +1 -0
  42. package/lib/cjs/Feature/FeatureInfoReader.js +35 -0
  43. package/lib/cjs/Feature/FeatureInfoReader.js.map +1 -0
  44. package/lib/cjs/Feature/FeatureSymbology.d.ts +8 -0
  45. package/lib/cjs/Feature/FeatureSymbology.d.ts.map +1 -0
  46. package/lib/cjs/Feature/FeatureSymbology.js +12 -0
  47. package/lib/cjs/Feature/FeatureSymbology.js.map +1 -0
  48. package/lib/cjs/Feature/RandomMapColor.d.ts +8 -0
  49. package/lib/cjs/Feature/RandomMapColor.d.ts.map +1 -0
  50. package/lib/cjs/Feature/RandomMapColor.js +29 -0
  51. package/lib/cjs/Feature/RandomMapColor.js.map +1 -0
  52. package/lib/cjs/GeoJSON/GeoJSONGeometry.d.ts +18 -0
  53. package/lib/cjs/GeoJSON/GeoJSONGeometry.d.ts.map +1 -0
  54. package/lib/cjs/GeoJSON/GeoJSONGeometry.js +11 -0
  55. package/lib/cjs/GeoJSON/GeoJSONGeometry.js.map +1 -0
  56. package/lib/cjs/GeoJSON/GeoJSONGeometryReader.d.ts +11 -0
  57. package/lib/cjs/GeoJSON/GeoJSONGeometryReader.d.ts.map +1 -0
  58. package/lib/cjs/GeoJSON/GeoJSONGeometryReader.js +83 -0
  59. package/lib/cjs/GeoJSON/GeoJSONGeometryReader.js.map +1 -0
  60. package/lib/cjs/OgcApiFeatures/OgcApiFeaturesFormat.d.ts +9 -0
  61. package/lib/cjs/OgcApiFeatures/OgcApiFeaturesFormat.d.ts.map +1 -0
  62. package/lib/cjs/OgcApiFeatures/OgcApiFeaturesFormat.js +94 -0
  63. package/lib/cjs/OgcApiFeatures/OgcApiFeaturesFormat.js.map +1 -0
  64. package/lib/cjs/OgcApiFeatures/OgcApiFeaturesProvider.d.ts +54 -0
  65. package/lib/cjs/OgcApiFeatures/OgcApiFeaturesProvider.d.ts.map +1 -0
  66. package/lib/cjs/OgcApiFeatures/OgcApiFeaturesProvider.js +477 -0
  67. package/lib/cjs/OgcApiFeatures/OgcApiFeaturesProvider.js.map +1 -0
  68. package/lib/cjs/OgcApiFeatures/OgcApiFeaturesReader.d.ts +23 -0
  69. package/lib/cjs/OgcApiFeatures/OgcApiFeaturesReader.d.ts.map +1 -0
  70. package/lib/cjs/OgcApiFeatures/OgcApiFeaturesReader.js +139 -0
  71. package/lib/cjs/OgcApiFeatures/OgcApiFeaturesReader.js.map +1 -0
  72. package/lib/cjs/Tools/MapFeatureInfoDecorator.js.map +1 -1
  73. package/lib/cjs/Tools/MapFeatureInfoTool.js +1 -1
  74. package/lib/cjs/Tools/MapFeatureInfoTool.js.map +1 -1
  75. package/lib/cjs/mapLayersFormats.d.ts.map +1 -1
  76. package/lib/cjs/mapLayersFormats.js +5 -2
  77. package/lib/cjs/mapLayersFormats.js.map +1 -1
  78. package/lib/esm/ArcGisFeature/ArcGisFeatureFormat.js +1 -2
  79. package/lib/esm/ArcGisFeature/ArcGisFeatureFormat.js.map +1 -1
  80. package/lib/esm/ArcGisFeature/ArcGisFeatureProvider.d.ts +15 -6
  81. package/lib/esm/ArcGisFeature/ArcGisFeatureProvider.d.ts.map +1 -1
  82. package/lib/esm/ArcGisFeature/ArcGisFeatureProvider.js +63 -55
  83. package/lib/esm/ArcGisFeature/ArcGisFeatureProvider.js.map +1 -1
  84. package/lib/esm/ArcGisFeature/ArcGisFeatureQuery.js.map +1 -1
  85. package/lib/esm/ArcGisFeature/ArcGisFeatureReader.d.ts +7 -11
  86. package/lib/esm/ArcGisFeature/ArcGisFeatureReader.d.ts.map +1 -1
  87. package/lib/esm/ArcGisFeature/ArcGisFeatureReader.js +3 -19
  88. package/lib/esm/ArcGisFeature/ArcGisFeatureReader.js.map +1 -1
  89. package/lib/esm/ArcGisFeature/ArcGisFeatureResponse.js.map +1 -1
  90. package/lib/esm/ArcGisFeature/ArcGisJsonFeatureReader.d.ts +3 -3
  91. package/lib/esm/ArcGisFeature/ArcGisJsonFeatureReader.d.ts.map +1 -1
  92. package/lib/esm/ArcGisFeature/ArcGisJsonFeatureReader.js +3 -4
  93. package/lib/esm/ArcGisFeature/ArcGisJsonFeatureReader.js.map +1 -1
  94. package/lib/esm/ArcGisFeature/ArcGisPbfFeatureReader.d.ts +3 -3
  95. package/lib/esm/ArcGisFeature/ArcGisPbfFeatureReader.d.ts.map +1 -1
  96. package/lib/esm/ArcGisFeature/ArcGisPbfFeatureReader.js +2 -3
  97. package/lib/esm/ArcGisFeature/ArcGisPbfFeatureReader.js.map +1 -1
  98. package/lib/esm/ArcGisFeature/ArcGisSymbologyRenderer.d.ts +35 -15
  99. package/lib/esm/ArcGisFeature/ArcGisSymbologyRenderer.d.ts.map +1 -1
  100. package/lib/esm/ArcGisFeature/ArcGisSymbologyRenderer.js +52 -47
  101. package/lib/esm/ArcGisFeature/ArcGisSymbologyRenderer.js.map +1 -1
  102. package/lib/esm/ArcGisFeature/EsriSymbology.d.ts +2 -1
  103. package/lib/esm/ArcGisFeature/EsriSymbology.d.ts.map +1 -1
  104. package/lib/esm/ArcGisFeature/EsriSymbology.js +2 -1
  105. package/lib/esm/ArcGisFeature/EsriSymbology.js.map +1 -1
  106. package/lib/esm/ArcGisFeature/esriPBuffer.gen.js.map +1 -1
  107. package/lib/esm/Feature/DefaultMarkerIcon.d.ts +10 -0
  108. package/lib/esm/Feature/DefaultMarkerIcon.d.ts.map +1 -0
  109. package/lib/esm/Feature/DefaultMarkerIcon.js +27 -0
  110. package/lib/esm/Feature/DefaultMarkerIcon.js.map +1 -0
  111. package/lib/esm/Feature/FeatureCanvasRenderer.d.ts +20 -0
  112. package/lib/esm/Feature/FeatureCanvasRenderer.d.ts.map +1 -0
  113. package/lib/esm/{ArcGisFeature/ArcGisCanvasRenderer.js → Feature/FeatureCanvasRenderer.js} +6 -5
  114. package/lib/esm/Feature/FeatureCanvasRenderer.js.map +1 -0
  115. package/lib/esm/Feature/FeatureInfoReader.d.ts +11 -0
  116. package/lib/esm/Feature/FeatureInfoReader.d.ts.map +1 -0
  117. package/lib/esm/Feature/FeatureInfoReader.js +31 -0
  118. package/lib/esm/Feature/FeatureInfoReader.js.map +1 -0
  119. package/lib/esm/Feature/FeatureSymbology.d.ts +8 -0
  120. package/lib/esm/Feature/FeatureSymbology.d.ts.map +1 -0
  121. package/lib/esm/Feature/FeatureSymbology.js +8 -0
  122. package/lib/esm/Feature/FeatureSymbology.js.map +1 -0
  123. package/lib/esm/Feature/RandomMapColor.d.ts +8 -0
  124. package/lib/esm/Feature/RandomMapColor.d.ts.map +1 -0
  125. package/lib/esm/Feature/RandomMapColor.js +25 -0
  126. package/lib/esm/Feature/RandomMapColor.js.map +1 -0
  127. package/lib/esm/GeoJSON/GeoJSONGeometry.d.ts +18 -0
  128. package/lib/esm/GeoJSON/GeoJSONGeometry.d.ts.map +1 -0
  129. package/lib/esm/GeoJSON/GeoJSONGeometry.js +7 -0
  130. package/lib/esm/GeoJSON/GeoJSONGeometry.js.map +1 -0
  131. package/lib/esm/GeoJSON/GeoJSONGeometryReader.d.ts +11 -0
  132. package/lib/esm/GeoJSON/GeoJSONGeometryReader.d.ts.map +1 -0
  133. package/lib/esm/GeoJSON/GeoJSONGeometryReader.js +79 -0
  134. package/lib/esm/GeoJSON/GeoJSONGeometryReader.js.map +1 -0
  135. package/lib/esm/OgcApiFeatures/OgcApiFeaturesFormat.d.ts +9 -0
  136. package/lib/esm/OgcApiFeatures/OgcApiFeaturesFormat.d.ts.map +1 -0
  137. package/lib/esm/OgcApiFeatures/OgcApiFeaturesFormat.js +90 -0
  138. package/lib/esm/OgcApiFeatures/OgcApiFeaturesFormat.js.map +1 -0
  139. package/lib/esm/OgcApiFeatures/OgcApiFeaturesProvider.d.ts +54 -0
  140. package/lib/esm/OgcApiFeatures/OgcApiFeaturesProvider.d.ts.map +1 -0
  141. package/lib/esm/OgcApiFeatures/OgcApiFeaturesProvider.js +472 -0
  142. package/lib/esm/OgcApiFeatures/OgcApiFeaturesProvider.js.map +1 -0
  143. package/lib/esm/OgcApiFeatures/OgcApiFeaturesReader.d.ts +23 -0
  144. package/lib/esm/OgcApiFeatures/OgcApiFeaturesReader.d.ts.map +1 -0
  145. package/lib/esm/OgcApiFeatures/OgcApiFeaturesReader.js +135 -0
  146. package/lib/esm/OgcApiFeatures/OgcApiFeaturesReader.js.map +1 -0
  147. package/lib/esm/Tools/MapFeatureInfoDecorator.js.map +1 -1
  148. package/lib/esm/Tools/MapFeatureInfoTool.js +1 -2
  149. package/lib/esm/Tools/MapFeatureInfoTool.js.map +1 -1
  150. package/lib/esm/mapLayersFormats.d.ts.map +1 -1
  151. package/lib/esm/mapLayersFormats.js +5 -3
  152. package/lib/esm/mapLayersFormats.js.map +1 -1
  153. package/package.json +18 -15
  154. package/lib/cjs/ArcGisFeature/ArcGisCanvasRenderer.d.ts +0 -19
  155. package/lib/cjs/ArcGisFeature/ArcGisCanvasRenderer.d.ts.map +0 -1
  156. package/lib/cjs/ArcGisFeature/ArcGisCanvasRenderer.js.map +0 -1
  157. package/lib/esm/ArcGisFeature/ArcGisCanvasRenderer.d.ts +0 -19
  158. package/lib/esm/ArcGisFeature/ArcGisCanvasRenderer.d.ts.map +0 -1
  159. package/lib/esm/ArcGisFeature/ArcGisCanvasRenderer.js.map +0 -1
@@ -0,0 +1,139 @@
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.OgcApiFeaturesReader = void 0;
8
+ const GeoJSONGeometryReader_1 = require("../GeoJSON/GeoJSONGeometryReader");
9
+ const appui_abstract_1 = require("@itwin/appui-abstract");
10
+ const FeatureInfoReader_1 = require("../Feature/FeatureInfoReader");
11
+ /** @internal */
12
+ class OgcApiFeaturesReader extends FeatureInfoReader_1.FeatureInfoReader {
13
+ constructor() {
14
+ super();
15
+ }
16
+ applySymbologyAttributes(attrSymbology, feature) {
17
+ if (attrSymbology && feature) {
18
+ const symbolFields = attrSymbology.rendererFields;
19
+ if (symbolFields && symbolFields.length > 0 && feature.properties) {
20
+ const featureAttr = {};
21
+ for (const [attrKey, attrValue] of Object.entries(feature.properties))
22
+ if (symbolFields.includes(attrKey)) {
23
+ featureAttr[attrKey] = attrValue;
24
+ }
25
+ attrSymbology.setActiveFeatureAttributes(featureAttr);
26
+ }
27
+ }
28
+ }
29
+ async readAndRender(data, renderer) {
30
+ const responseObj = data;
31
+ if (responseObj.type === "FeatureCollection") {
32
+ const geomReader = new GeoJSONGeometryReader_1.GeoJSONGeometryReader(renderer);
33
+ for (const feature of responseObj.features) {
34
+ // Each feature has potentially a different geometry type, so we need to inform the geometry renderer
35
+ if (renderer.hasSymbologyRenderer()) {
36
+ renderer.symbolRenderer.activeGeometryType = feature.geometry.type;
37
+ // Read attributes if needed (attribute driven symbology)
38
+ if (renderer.symbolRenderer.isAttributeDriven()) {
39
+ this.applySymbologyAttributes(renderer.symbolRenderer, feature);
40
+ }
41
+ }
42
+ await geomReader.readGeometry(feature.geometry);
43
+ }
44
+ }
45
+ }
46
+ async readFeatureInfo(opts, featureInfos) {
47
+ if (!Array.isArray(opts.collection.features))
48
+ return;
49
+ const layerInfo = { layerName: opts.layerSettings.name };
50
+ // Create a signature index for every field name / type.
51
+ let fieldsType;
52
+ if (Array.isArray(opts.queryables?.properties)) {
53
+ fieldsType = {};
54
+ for (const fieldInfo of opts.queryables) {
55
+ fieldsType[fieldInfo.name] = fieldInfo.type;
56
+ }
57
+ }
58
+ const getStandardTypeName = (fieldType) => {
59
+ switch (fieldType) {
60
+ case "number":
61
+ return appui_abstract_1.StandardTypeNames.Double;
62
+ case "integer":
63
+ return appui_abstract_1.StandardTypeNames.Integer;
64
+ case "boolean":
65
+ return appui_abstract_1.StandardTypeNames.Boolean;
66
+ case "datetime":
67
+ return appui_abstract_1.StandardTypeNames.DateTime;
68
+ default:
69
+ return appui_abstract_1.StandardTypeNames.String;
70
+ }
71
+ };
72
+ const getRecordInfo = (fieldName, value) => {
73
+ let typename = appui_abstract_1.StandardTypeNames.String;
74
+ const propertyValue = { valueFormat: appui_abstract_1.PropertyValueFormat.Primitive };
75
+ if (value === null) {
76
+ value = undefined;
77
+ }
78
+ const strValue = `${value}`;
79
+ if (fieldsType) {
80
+ const fieldType = fieldsType[fieldName];
81
+ switch (fieldType) {
82
+ case "integer":
83
+ propertyValue.value = value;
84
+ break;
85
+ case "number":
86
+ propertyValue.value = this.toFixedWithoutPadding(value);
87
+ break;
88
+ case "datetime":
89
+ propertyValue.value = new Date(value);
90
+ break;
91
+ default:
92
+ if (value !== undefined)
93
+ propertyValue.value = strValue;
94
+ break;
95
+ }
96
+ typename = getStandardTypeName(fieldType);
97
+ propertyValue.displayValue = this.getDisplayValue(typename, propertyValue.value);
98
+ }
99
+ else {
100
+ // Queryables are optional with OGC Features, in this case everything is string.
101
+ propertyValue.value = strValue;
102
+ propertyValue.displayValue = strValue;
103
+ }
104
+ return { value: propertyValue, property: { name: fieldName, displayLabel: fieldName, typename } };
105
+ };
106
+ let geomReader;
107
+ if (opts.geomRenderer) {
108
+ geomReader = new GeoJSONGeometryReader_1.GeoJSONGeometryReader(opts.geomRenderer);
109
+ }
110
+ // Each feature response represent a single sub-layer, no need to check for existing entry.
111
+ const subLayerInfo = {
112
+ subLayerName: opts.layerSettings.name,
113
+ displayFieldName: opts.layerSettings.name,
114
+ features: [],
115
+ };
116
+ // Read all features attributes / geometries
117
+ for (const responseFeature of opts.collection.features) {
118
+ const feature = { attributes: [] };
119
+ if (responseFeature.properties) {
120
+ for (const [key, value] of Object.entries(responseFeature.properties))
121
+ feature.attributes?.push(getRecordInfo(key, value));
122
+ }
123
+ if (geomReader && opts.geomRenderer) {
124
+ await geomReader.readGeometry(responseFeature.geometry);
125
+ const graphics = opts.geomRenderer.moveGraphics();
126
+ feature.geometries = graphics.map((graphic) => {
127
+ return { graphic };
128
+ });
129
+ }
130
+ subLayerInfo.features.push(feature);
131
+ }
132
+ if (layerInfo.subLayerInfos === undefined)
133
+ layerInfo.subLayerInfos = [];
134
+ layerInfo.subLayerInfos.push(subLayerInfo);
135
+ featureInfos.push(layerInfo);
136
+ }
137
+ }
138
+ exports.OgcApiFeaturesReader = OgcApiFeaturesReader;
139
+ //# sourceMappingURL=OgcApiFeaturesReader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OgcApiFeaturesReader.js","sourceRoot":"","sources":["../../../src/OgcApiFeatures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AAC,aAAa,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QAE3C,YAAY,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAC/B,CAAC;CAEF;AAnJD,oDAmJC","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 { GeoJSONGeometryReader } from \"../GeoJSON/GeoJSONGeometryReader\";\nimport * as Geojson from \"geojson\";\nimport { PrimitiveValue, PropertyValueFormat, StandardTypeNames } from \"@itwin/appui-abstract\";\nimport { ImageMapLayerSettings } from \"@itwin/core-common\";\nimport { FeatureInfoReader } from \"../Feature/FeatureInfoReader\";\nimport { FeatureAttributeDrivenSymbology, FeatureGeometryRenderer, GraphicPrimitive, GraphicsGeometryRenderer, MapLayerFeature, MapLayerFeatureAttribute, MapLayerFeatureInfo, MapSubLayerFeatureInfo } from \"@itwin/core-frontend\";\n\n/** @internal */\nexport type OgcFeaturePropertyType = \"string\" | \"number\" | \"integer\" | \"datetime\" | \"geometry\" | \"boolean\";\n\n/** @internal */\nexport interface ReadOgcApiFeaturesInfoOptions {\n collection: Geojson.FeatureCollection;\n layerSettings: ImageMapLayerSettings;\n queryables?: any;\n geomRenderer?: GraphicsGeometryRenderer;\n}\n\n/** @internal */\nexport class OgcApiFeaturesReader extends FeatureInfoReader {\n public transform: Transform | undefined;\n\n public constructor() {\n super();\n }\n\n private applySymbologyAttributes(attrSymbology: FeatureAttributeDrivenSymbology, feature: any) {\n if (attrSymbology && feature) {\n const symbolFields = attrSymbology.rendererFields;\n if (symbolFields && symbolFields.length > 0 && feature.properties) {\n const featureAttr: {[key: string]: any} = {};\n for (const [attrKey, attrValue] of Object.entries(feature.properties))\n if (symbolFields.includes(attrKey)) {\n featureAttr[attrKey] = attrValue;\n }\n attrSymbology.setActiveFeatureAttributes(featureAttr);\n }\n }\n }\n\n public async readAndRender(data: Geojson.FeatureCollection, renderer: FeatureGeometryRenderer) {\n const responseObj = data;\n if (responseObj.type === \"FeatureCollection\") {\n\n const geomReader = new GeoJSONGeometryReader(renderer);\n\n for (const feature of responseObj.features) {\n // Each feature has potentially a different geometry type, so we need to inform the geometry renderer\n if (renderer.hasSymbologyRenderer()) {\n renderer.symbolRenderer.activeGeometryType = feature.geometry.type;\n // Read attributes if needed (attribute driven symbology)\n if (renderer.symbolRenderer.isAttributeDriven()) {\n this.applySymbologyAttributes(renderer.symbolRenderer, feature);\n }\n }\n\n await geomReader.readGeometry(feature.geometry);\n }\n }\n }\n\n public async readFeatureInfo(opts: ReadOgcApiFeaturesInfoOptions, featureInfos: MapLayerFeatureInfo[]) {\n if (!Array.isArray(opts.collection.features))\n return;\n\n const layerInfo: MapLayerFeatureInfo = { layerName: opts.layerSettings.name };\n\n // Create a signature index for every field name / type.\n let fieldsType: { [key: string]: OgcFeaturePropertyType } | undefined;\n if (Array.isArray(opts.queryables?.properties)) {\n fieldsType = {};\n for (const fieldInfo of opts.queryables) {\n fieldsType[fieldInfo.name] = fieldInfo.type;\n }\n }\n\n const getStandardTypeName = (fieldType: OgcFeaturePropertyType) => {\n switch (fieldType) {\n case \"number\":\n return StandardTypeNames.Double;\n case \"integer\":\n return StandardTypeNames.Integer;\n case \"boolean\":\n return StandardTypeNames.Boolean;\n case \"datetime\":\n return StandardTypeNames.DateTime;\n default:\n return StandardTypeNames.String;\n }\n };\n\n const getRecordInfo = (fieldName: string, value: any): MapLayerFeatureAttribute => {\n let typename = StandardTypeNames.String;\n const propertyValue: PrimitiveValue = {valueFormat: PropertyValueFormat.Primitive};\n\n if (value === null) {\n value = undefined;\n }\n\n const strValue = `${value}`;\n if (fieldsType) {\n const fieldType = fieldsType[fieldName];\n switch (fieldType) {\n case \"integer\":\n propertyValue.value = value as number;\n break;\n case \"number\":\n propertyValue.value = this.toFixedWithoutPadding(value);\n break;\n case \"datetime\":\n propertyValue.value = new Date(value);\n break;\n default:\n if (value !== undefined)\n propertyValue.value = strValue;\n break;\n }\n typename = getStandardTypeName(fieldType);\n propertyValue.displayValue = this.getDisplayValue(typename, propertyValue.value);\n } else {\n // Queryables are optional with OGC Features, in this case everything is string.\n propertyValue.value = strValue;\n propertyValue.displayValue = strValue;\n }\n\n return {value: propertyValue, property: { name: fieldName, displayLabel: fieldName, typename }};\n };\n\n let geomReader: GeoJSONGeometryReader|undefined;\n if (opts.geomRenderer) {\n geomReader = new GeoJSONGeometryReader(opts.geomRenderer);\n }\n\n // Each feature response represent a single sub-layer, no need to check for existing entry.\n const subLayerInfo: MapSubLayerFeatureInfo = {\n subLayerName: opts.layerSettings.name,\n displayFieldName: opts.layerSettings.name,\n features: [],\n };\n\n // Read all features attributes / geometries\n for (const responseFeature of opts.collection.features) {\n const feature: MapLayerFeature = {attributes: []};\n\n if (responseFeature.properties) {\n for (const [key, value] of Object.entries(responseFeature.properties))\n feature.attributes?.push(getRecordInfo(key, value));\n }\n\n if (geomReader && opts.geomRenderer) {\n await geomReader.readGeometry(responseFeature.geometry as any);\n const graphics = opts.geomRenderer.moveGraphics();\n feature.geometries = graphics.map((graphic: GraphicPrimitive) => {\n return {graphic};\n });\n }\n subLayerInfo.features.push(feature);\n }\n\n if (layerInfo.subLayerInfos === undefined)\n layerInfo.subLayerInfos = [];\n layerInfo.subLayerInfos.push(subLayerInfo);\n\n featureInfos.push(layerInfo);\n }\n\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"MapFeatureInfoDecorator.js","sourceRoot":"","sources":["../../../src/Tools/MapFeatureInfoDecorator.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F,+BAA+B;AAC/B,oDAAmE;AACnE,wDAGmG;AACnG,wDAAwN;AAGxN;;EAEE;AACF,MAAM,wBAAyB,SAAQ,qCAAqB;IAC1D,YAAY,IAAc,EAAE,cAAsB,EAAE,KAAc,EAAE,SAAoB,EAAU,OAAyB;QACzH,KAAK,CAAC,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,IAAI,QAAQ;YACV,OAAO,CAAC,aAAa,CAAC,IAAI,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC;QAErD,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;QACvC,OAAO;IACT,CAAC;CACF;AAnOD,0DAmOC","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/* eslint-disable no-console */\nimport { Base64EncodedString, ColorDef } from \"@itwin/core-common\";\nimport {\n BeButtonEvent, Cluster, CollectTileStatus, DecorateContext, Decorator, DisclosedTileTreeSet,\n GeometryTileTreeReference, GraphicType, IModelApp, MapTileTreeReference, Marker, MarkerImage, MarkerSet,\n Tile, TileGeometryCollector, TileTreeReference, TileUser, Viewport } from \"@itwin/core-frontend\";\nimport { ConvexClipPlaneSet, CurvePrimitive, GrowableXYZArray, LineString3d, Point2d, Point3d, PolyfaceQuery, Range3d, SweepLineStringToFacetsOptions, Transform, Vector3d, XAndY, XYAndZ } from \"@itwin/core-geometry\";\nimport { MapFeatureInfoToolData } from \"./MapFeatureInfoTool\";\n\n/** A TileGeometryCollector that restricts collection to tiles that overlap a line string.\n/* @internal\n*/\nclass DrapeLineStringCollector extends TileGeometryCollector {\n constructor(user: TileUser, chordTolerance: number, range: Range3d, transform: Transform, private _points: GrowableXYZArray) {\n super({ user, chordTolerance, range, transform });\n }\n\n public override collectTile(tile: Tile): CollectTileStatus {\n let status = super.collectTile(tile);\n if (\"reject\" !== status && !this.rangeOverlapsLineString(tile.range))\n status = \"reject\";\n\n return status;\n }\n\n private rangeOverlapsLineString(range: Range3d) {\n let inside = false;\n const clipper = ConvexClipPlaneSet.createRange3dPlanes(range, true, true, true, true, false, false);\n if (this._options.transform)\n clipper.transformInPlace(this._options.transform);\n\n for (let i = 0; i < this._points.length - 1 && !inside; i++)\n inside = clipper.announceClippedSegmentIntervals(0, 1, this._points.getPoint3dAtUncheckedPointIndex(i), this._points.getPoint3dAtUncheckedPointIndex(i + 1));\n\n return inside;\n }\n}\n\n/** @internal */\nclass TerrainDraper implements TileUser {\n public readonly tileUserId: number;\n\n public constructor(public readonly viewport: Viewport, public readonly treeRef: GeometryTileTreeReference) {\n this.tileUserId = TileUser.generateId();\n IModelApp.tileAdmin.registerUser(this);\n }\n\n public dispose(): void {\n IModelApp.tileAdmin.forgetUser(this);\n }\n\n public get iModel() { return this.viewport.iModel; }\n\n public onRequestStateChanged() {\n this.viewport.invalidateDecorations();\n }\n\n public discloseTileTrees(trees: DisclosedTileTreeSet) {\n trees.disclose(this.treeRef);\n }\n\n public drapeLineString(outStrings: CurvePrimitive[], inPoints: GrowableXYZArray, tolerance: number, maxDistance = 1.0E5): \"loading\" | \"complete\" {\n const tree = this.treeRef.treeOwner.load();\n if (!tree)\n return \"loading\";\n\n const range = Range3d.createNull();\n range.extendArray(inPoints);\n range.extendZOnly(-maxDistance); // Expand - but not so much that we get opposite side of globe.\n range.extendZOnly(maxDistance);\n\n const collector = new DrapeLineStringCollector(this, tolerance, range, tree.iModelTransform, inPoints);\n this.treeRef.collectTileGeometry(collector);\n collector.requestMissingTiles();\n\n if (collector.isAllGeometryLoaded && collector.polyfaces.length > 0) {\n for (const polyface of collector.polyfaces)\n outStrings.push(...PolyfaceQuery.sweepLineStringToFacets(inPoints, polyface,\n SweepLineStringToFacetsOptions.create(Vector3d.unitZ(), undefined, true, true, false, false)));\n return \"complete\";\n }\n\n return \"loading\";\n }\n}\n\n/** @internal */\nclass PinMarker extends Marker {\n public constructor(worldLocation: XYAndZ, size: XAndY, image: MarkerImage) {\n super(worldLocation, size);\n this.image = image;\n this.imageOffset = new Point3d(0, Math.floor(size.y * .5));\n }\n}\n\n/** @internal */\nclass PinMarkerCluster extends Marker {\n /** Create a new cluster marker */\n constructor(location: XYAndZ, size: XAndY, cluster: Cluster<PinMarker>, image: MarkerImage | Promise<MarkerImage> | undefined) {\n super(location, size);\n\n this.title = IModelApp.localization.getLocalizedString(\"mapLayersFormats:Messages.MapFeatureInfoDecorator.clusterZoomIn\", { nbInstances: cluster.markers.length});\n\n this.imageOffset = new Point3d(0, size.y * 0.5);\n this.label = cluster.markers.length.toLocaleString();\n this.labelColor = \"black\";\n this.labelFont = \"bold 14px sans-serif\";\n\n if (image)\n this.setImage(image);\n }\n\n /** Show the cluster as a white circle with an outline */\n public override drawFunc(ctx: CanvasRenderingContext2D): void {\n ctx.beginPath();\n ctx.strokeStyle = \"#372528\";\n ctx.fillStyle = \"white\";\n ctx.lineWidth = 5;\n ctx.arc(0, 0, this.size.x * 0.5, 0, Math.PI * 2);\n ctx.fill();\n ctx.stroke();\n }\n\n public override onMouseButton(_ev: BeButtonEvent): boolean { return true; } // Don't allow clicks to be sent to active tool...\n}\n\n/** @internal */\nclass PinMarkerSet extends MarkerSet<PinMarker> {\n protected getClusterMarker(cluster: Cluster<PinMarker>): Marker {\n // No image passed to the cluster, we prefer to have the circle only\n return new PinMarkerCluster(cluster.getClusterLocation(), cluster.markers[0].size, cluster, undefined);\n }\n}\n\n/** @internal */\ninterface DrapePointState {\n count: number;\n collectorState: string;\n}\n\n/** @internal */\nexport class MapFeatureInfoDecorator implements Decorator {\n public hidden = false;\n public readonly useCachedDecorations = true;\n public readonly disableTerrainDraper = true;\n public markerSize = new Point2d(32, 32);\n public lineWidth = 3;\n private _highlightColor = ColorDef.from(0, 255, 255, 127);\n\n public get highlightColor() { return this._highlightColor;}\n public set highlightColor(color: ColorDef) {\n this.updateMarkerImage();\n this._highlightColor = color;\n }\n\n public get defaultMarkerIconSvgXml() { return `<svg class=\"indicator\" viewBox=\"0 0 22 22\" width=\"22\" height=\"22\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"m11 0a7.44506 7.44506 0 0 0 -7.5 7.2875c0 1.65 1.132 4.2625 3.25477 8.1125 1.55652 2.75 4.24523 6.6 4.24523 6.6s2.68865-3.9875 4.24528-6.7375c2.12272-3.85 3.25472-6.4625 3.25472-8.1125a7.4215 7.4215 0 0 0 -7.5-7.15z\" fill=\"black\"/><path d=\"m11 1.01715a6.46476 6.46476 0 0 0 -6.48285 6.27033c0 1.72619 1.67181 4.97973 3.12836 7.62139.97564 1.7237 2.42828 3.92176 3.34118 5.27161.91413-1.39148 2.385-3.673 3.37336-5.41907 1.451-2.63171 3.1228-5.88525 3.1228-7.61139a6.39982 6.39982 0 0 0 -6.48285-6.13287zm.00183 8.98285a3 3 0 1 1 3-3 3 3 0 0 1 -3 3z\" fill=\"${this.highlightColor.toRgbString()}\"/></svg>`; }\n\n private _drapePoints = new GrowableXYZArray();\n private _scratchPoints = new GrowableXYZArray();\n\n private _drapePointsStates: DrapePointState[] = [];\n private _drapedStrings?: LineString3d[];\n private _allGeomDraped = false;\n private _draper?: TerrainDraper;\n private _markerImage: HTMLImageElement;\n private _markerSet = new PinMarkerSet();\n\n // Extra markers can be added outside the normal state\n public extraMarkers: Point3d[]|undefined;\n\n private _state: MapFeatureInfoToolData | undefined;\n\n private readonly _graphicType = GraphicType.WorldOverlay;\n\n public constructor() {\n this._markerImage = new Image();\n this.updateMarkerImage();\n }\n\n private updateMarkerImage() {\n const base64 = Base64EncodedString.encode(this.defaultMarkerIconSvgXml);\n this._markerImage.src = `data:image/svg+xml;base64,${base64}`;\n }\n\n private _computeChordTolerance(viewport: Viewport, applyAspectRatioSkew: boolean, computeRange: () => Range3d) {\n let pixelSize = 1;\n // Compute the horizontal distance in meters between two adjacent pixels at the center of the geometry.\n pixelSize = viewport.getPixelSizeAtPoint(computeRange().center);\n pixelSize = viewport.target.adjustPixelSizeForLOD(pixelSize);\n\n // Aspect ratio skew > 1.0 stretches the view in Y. In that case use the smaller vertical pixel distance for our stroke tolerance.\n const skew = applyAspectRatioSkew ? viewport.view.getAspectRatioSkew() : 0;\n if (skew > 1)\n pixelSize /= skew;\n return pixelSize * 0.25;\n }\n\n public clearState = () => {\n this._state = undefined;\n };\n\n public setState = (state: MapFeatureInfoToolData) => {\n\n this._drapedStrings = undefined;\n this._allGeomDraped = false;\n this.hidden = false;\n\n this._state = state;\n IModelApp.viewManager.invalidateCachedDecorationsAllViews(this);\n\n this._drapePoints.clear();\n this._drapePointsStates = [];\n\n if (!this.disableTerrainDraper && this._state.mapInfo?.layerInfos && state.hit.viewport.displayStyle.displayTerrain) {\n\n if (state.hit?.modelId) {\n const drapeTreeRef = this.getGeometryTreeRef(state.hit.viewport);\n if (drapeTreeRef) {\n this._draper = new TerrainDraper(state.hit.viewport, drapeTreeRef);\n return;\n }\n }\n }\n\n if (this._draper) {\n // Dispose draper every time?\n this._draper.dispose();\n this._draper = undefined;\n }\n };\n\n private getGeometryTreeRef(vp: Viewport): GeometryTileTreeReference | undefined {\n let treeRef: GeometryTileTreeReference | undefined;\n if (vp.backgroundMapSettings.applyTerrain) {\n vp.forEachMapTreeRef((ref: TileTreeReference) => {\n if (!treeRef && ref instanceof MapTileTreeReference) {\n treeRef = ref.createGeometryTreeReference();\n }\n });\n }\n\n return treeRef;\n }\n\n protected renderGraphics(context: DecorateContext) {\n this._markerSet.markers.clear();\n\n if (this._state?.mapInfo?.layerInfos === undefined || this.hidden) {\n return undefined;\n }\n\n let transform: Transform|undefined;\n const groundBias = context.viewport.displayStyle.backgroundMapSettings.groundBias;\n if (groundBias !== 0) {\n transform = Transform.createTranslationXYZ(0, 0 , groundBias);\n }\n const builder = context.createGraphicBuilder(this._graphicType, transform);\n\n if (this._draper) {\n if (this._drapePoints.length === 0 && this._state.mapInfo.layerInfos) {\n\n for (const layerInfo of this._state.mapInfo.layerInfos) {\n if (layerInfo.subLayerInfos) {\n for (const subLayerInfo of layerInfo.subLayerInfos) {\n for (const feature of subLayerInfo.features) {\n if (feature.geometries) {\n for (const geom of feature.geometries) {\n if (geom.graphic.type === \"linestring\") {\n this._drapePointsStates.push({ count: geom.graphic.points.length, collectorState: \"loading\" });\n this._drapePoints.pushAll(geom.graphic.points);\n }\n }\n }\n }\n }\n\n }\n }\n }\n\n if (!this._allGeomDraped) {\n\n let hasMissingLineStrings = false;\n let drapePointsOffset = 0;\n for (const state of this._drapePointsStates) {\n\n if (state.collectorState === \"loading\") {\n this._scratchPoints.clear();\n this._scratchPoints.resize(state.count);\n\n let dstIdx = 0;\n for (let srcIdx = drapePointsOffset; srcIdx < drapePointsOffset + state.count; srcIdx++) {\n this._scratchPoints.transferFromGrowableXYZArray(dstIdx++, this._drapePoints, srcIdx);\n }\n\n const drapeRange = Range3d.createNull();\n drapeRange.extendArray(this._scratchPoints);\n const drapedStrings: LineString3d[] = [];\n const tolerance = this._computeChordTolerance(context.viewport, true, () => drapeRange) * 10; // 10 pixels\n if (\"loading\" === this._draper.drapeLineString(drapedStrings, this._scratchPoints, tolerance)) {\n hasMissingLineStrings = true;\n } else {\n this.addDrapedStrings(drapedStrings);\n state.collectorState = \"complete\";\n }\n }\n drapePointsOffset += state.count;\n }\n this._allGeomDraped = !hasMissingLineStrings;\n }\n\n if (this._drapedStrings) {\n builder.setSymbology(this.highlightColor, this.highlightColor, this.lineWidth);\n this._drapedStrings.forEach((line) => builder.addLineString(line.points));\n }\n\n } else {\n builder.setSymbology(this.highlightColor, this.highlightColor, this.lineWidth);\n for (const layerInfo of this._state.mapInfo.layerInfos) {\n if (layerInfo.subLayerInfos && !(layerInfo.subLayerInfos instanceof HTMLElement)) {\n for (const subLayerInfo of layerInfo.subLayerInfos) {\n for (const feature of subLayerInfo.features) {\n if (feature.geometries) {\n for (const geom of feature.geometries) {\n if (geom.graphic.type === \"pointstring\") {\n for (const point of geom.graphic.points)\n this._markerSet.markers.add(new PinMarker(point, this.markerSize, this._markerImage));\n } else {\n builder.addPrimitive(geom.graphic);\n }\n\n }\n }\n }\n }\n\n }\n\n }\n }\n\n // Add extra markers if any specified\n if ( this.extraMarkers !== undefined) {\n this.extraMarkers.forEach((markerPoint)=> {\n builder.setSymbology(this.highlightColor, this.highlightColor, this.lineWidth);\n this._markerSet.markers.add(new PinMarker(markerPoint, this.markerSize, this._markerImage));\n });\n }\n\n return builder.finish();\n }\n\n public addDrapedStrings(drapedStrings: LineString3d[]) {\n if (!this._drapedStrings) {\n this._drapedStrings = [];\n }\n for (const ds of drapedStrings)\n this._drapedStrings.push(ds);\n }\n\n public decorate(context: DecorateContext): void {\n const graphics = this.renderGraphics(context);\n if (graphics)\n context.addDecoration(this._graphicType, graphics);\n\n this._markerSet.addDecoration(context);\n return;\n }\n}\n"]}
1
+ {"version":3,"file":"MapFeatureInfoDecorator.js","sourceRoot":"","sources":["../../../src/Tools/MapFeatureInfoDecorator.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F,+BAA+B;AAC/B,oDAAmE;AACnE,wDAGmG;AACnG,wDAAwN;AAGxN;;EAEE;AACF,MAAM,wBAAyB,SAAQ,qCAAqB;IAC1D,YAAY,IAAc,EAAE,cAAsB,EAAE,KAAc,EAAE,SAAoB,EAAU,OAAyB;QACzH,KAAK,CAAC,EAAE,IAAI,EAAE,cAAc,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;QAD8C,YAAO,GAAP,OAAO,CAAkB;IAE3H,CAAC;IAEe,WAAW,CAAC,IAAU;QACpC,IAAI,MAAM,GAAG,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;QACrC,IAAI,QAAQ,KAAK,MAAM,IAAI,CAAC,IAAI,CAAC,uBAAuB,CAAC,IAAI,CAAC,KAAK,CAAC;YAClE,MAAM,GAAG,QAAQ,CAAC;QAEpB,OAAO,MAAM,CAAC;IAChB,CAAC;IAEO,uBAAuB,CAAC,KAAc;QAC5C,IAAI,MAAM,GAAG,KAAK,CAAC;QACnB,MAAM,OAAO,GAAG,kCAAkB,CAAC,mBAAmB,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;QACpG,IAAI,IAAI,CAAC,QAAQ,CAAC,SAAS;YACzB,OAAO,CAAC,gBAAgB,CAAC,IA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------------------\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/* eslint-disable no-console */\nimport { Base64EncodedString, ColorDef } from \"@itwin/core-common\";\nimport {\n BeButtonEvent, Cluster, CollectTileStatus, DecorateContext, Decorator, DisclosedTileTreeSet,\n GeometryTileTreeReference, GraphicType, IModelApp, MapTileTreeReference, Marker, MarkerImage, MarkerSet,\n Tile, TileGeometryCollector, TileTreeReference, TileUser, Viewport } from \"@itwin/core-frontend\";\nimport { ConvexClipPlaneSet, CurvePrimitive, GrowableXYZArray, LineString3d, Point2d, Point3d, PolyfaceQuery, Range3d, SweepLineStringToFacetsOptions, Transform, Vector3d, XAndY, XYAndZ } from \"@itwin/core-geometry\";\nimport { MapFeatureInfoToolData } from \"./MapFeatureInfoTool\";\n\n/** A TileGeometryCollector that restricts collection to tiles that overlap a line string.\n/* @internal\n*/\nclass DrapeLineStringCollector extends TileGeometryCollector {\n constructor(user: TileUser, chordTolerance: number, range: Range3d, transform: Transform, private _points: GrowableXYZArray) {\n super({ user, chordTolerance, range, transform });\n }\n\n public override collectTile(tile: Tile): CollectTileStatus {\n let status = super.collectTile(tile);\n if (\"reject\" !== status && !this.rangeOverlapsLineString(tile.range))\n status = \"reject\";\n\n return status;\n }\n\n private rangeOverlapsLineString(range: Range3d) {\n let inside = false;\n const clipper = ConvexClipPlaneSet.createRange3dPlanes(range, true, true, true, true, false, false);\n if (this._options.transform)\n clipper.transformInPlace(this._options.transform);\n\n for (let i = 0; i < this._points.length - 1 && !inside; i++)\n inside = clipper.announceClippedSegmentIntervals(0, 1, this._points.getPoint3dAtUncheckedPointIndex(i), this._points.getPoint3dAtUncheckedPointIndex(i + 1));\n\n return inside;\n }\n}\n\n/** @internal */\nclass TerrainDraper implements TileUser {\n public readonly tileUserId: number;\n\n public constructor(public readonly viewport: Viewport, public readonly treeRef: GeometryTileTreeReference) {\n this.tileUserId = TileUser.generateId();\n IModelApp.tileAdmin.registerUser(this);\n }\n\n public dispose(): void {\n IModelApp.tileAdmin.forgetUser(this);\n }\n\n public get iModel() { return this.viewport.iModel; }\n\n public onRequestStateChanged() {\n this.viewport.invalidateDecorations();\n }\n\n public discloseTileTrees(trees: DisclosedTileTreeSet) {\n trees.disclose(this.treeRef);\n }\n\n public drapeLineString(outStrings: CurvePrimitive[], inPoints: GrowableXYZArray, tolerance: number, maxDistance = 1.0E5): \"loading\" | \"complete\" {\n const tree = this.treeRef.treeOwner.load();\n if (!tree)\n return \"loading\";\n\n const range = Range3d.createNull();\n range.extendArray(inPoints);\n range.extendZOnly(-maxDistance); // Expand - but not so much that we get opposite side of globe.\n range.extendZOnly(maxDistance);\n\n const collector = new DrapeLineStringCollector(this, tolerance, range, tree.iModelTransform, inPoints);\n this.treeRef.collectTileGeometry(collector);\n collector.requestMissingTiles();\n\n if (collector.isAllGeometryLoaded && collector.polyfaces.length > 0) {\n for (const polyface of collector.polyfaces)\n outStrings.push(...PolyfaceQuery.sweepLineStringToFacets(inPoints, polyface,\n SweepLineStringToFacetsOptions.create(Vector3d.unitZ(), undefined, true, true, false, false)));\n return \"complete\";\n }\n\n return \"loading\";\n }\n}\n\n/** @internal */\nclass PinMarker extends Marker {\n public constructor(worldLocation: XYAndZ, size: XAndY, image: MarkerImage) {\n super(worldLocation, size);\n this.image = image;\n this.imageOffset = new Point3d(0, Math.floor(size.y * .5));\n }\n}\n\n/** @internal */\nclass PinMarkerCluster extends Marker {\n /** Create a new cluster marker */\n constructor(location: XYAndZ, size: XAndY, cluster: Cluster<PinMarker>, image: MarkerImage | Promise<MarkerImage> | undefined) {\n super(location, size);\n\n this.title = IModelApp.localization.getLocalizedString(\"mapLayersFormats:Messages.MapFeatureInfoDecorator.clusterZoomIn\", { nbInstances: cluster.markers.length});\n\n this.imageOffset = new Point3d(0, size.y * 0.5);\n this.label = cluster.markers.length.toLocaleString();\n this.labelColor = \"black\";\n this.labelFont = \"bold 14px sans-serif\";\n\n if (image)\n this.setImage(image);\n }\n\n /** Show the cluster as a white circle with an outline */\n public override drawFunc(ctx: CanvasRenderingContext2D): void {\n ctx.beginPath();\n ctx.strokeStyle = \"#372528\";\n ctx.fillStyle = \"white\";\n ctx.lineWidth = 5;\n ctx.arc(0, 0, this.size.x * 0.5, 0, Math.PI * 2);\n ctx.fill();\n ctx.stroke();\n }\n\n public override onMouseButton(_ev: BeButtonEvent): boolean { return true; } // Don't allow clicks to be sent to active tool...\n}\n\n/** @internal */\nclass PinMarkerSet extends MarkerSet<PinMarker> {\n protected getClusterMarker(cluster: Cluster<PinMarker>): Marker {\n // No image passed to the cluster, we prefer to have the circle only\n return new PinMarkerCluster(cluster.getClusterLocation(), cluster.markers[0].size, cluster, undefined);\n }\n}\n\n/** @internal */\ninterface DrapePointState {\n count: number;\n collectorState: string;\n}\n\n/** @internal */\nexport class MapFeatureInfoDecorator implements Decorator {\n public hidden = false;\n public readonly useCachedDecorations = true;\n public readonly disableTerrainDraper = true;\n public markerSize = new Point2d(32, 32);\n public lineWidth = 3;\n private _highlightColor = ColorDef.from(0, 255, 255, 127);\n\n public get highlightColor() { return this._highlightColor;}\n public set highlightColor(color: ColorDef) {\n this.updateMarkerImage();\n this._highlightColor = color;\n }\n\n public get defaultMarkerIconSvgXml() { return `<svg class=\"indicator\" viewBox=\"0 0 22 22\" width=\"22\" height=\"22\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"m11 0a7.44506 7.44506 0 0 0 -7.5 7.2875c0 1.65 1.132 4.2625 3.25477 8.1125 1.55652 2.75 4.24523 6.6 4.24523 6.6s2.68865-3.9875 4.24528-6.7375c2.12272-3.85 3.25472-6.4625 3.25472-8.1125a7.4215 7.4215 0 0 0 -7.5-7.15z\" fill=\"black\"/><path d=\"m11 1.01715a6.46476 6.46476 0 0 0 -6.48285 6.27033c0 1.72619 1.67181 4.97973 3.12836 7.62139.97564 1.7237 2.42828 3.92176 3.34118 5.27161.91413-1.39148 2.385-3.673 3.37336-5.41907 1.451-2.63171 3.1228-5.88525 3.1228-7.61139a6.39982 6.39982 0 0 0 -6.48285-6.13287zm.00183 8.98285a3 3 0 1 1 3-3 3 3 0 0 1 -3 3z\" fill=\"${this.highlightColor.toRgbString()}\"/></svg>`; }\n\n private _drapePoints = new GrowableXYZArray();\n private _scratchPoints = new GrowableXYZArray();\n\n private _drapePointsStates: DrapePointState[] = [];\n private _drapedStrings?: LineString3d[];\n private _allGeomDraped = false;\n private _draper?: TerrainDraper;\n private _markerImage: HTMLImageElement;\n private _markerSet = new PinMarkerSet();\n\n // Extra markers can be added outside the normal state\n public extraMarkers: Point3d[]|undefined;\n\n private _state: MapFeatureInfoToolData | undefined;\n\n private readonly _graphicType = GraphicType.WorldOverlay;\n\n public constructor() {\n this._markerImage = new Image();\n this.updateMarkerImage();\n }\n\n private updateMarkerImage() {\n const base64 = Base64EncodedString.encode(this.defaultMarkerIconSvgXml);\n this._markerImage.src = `data:image/svg+xml;base64,${base64}`;\n }\n\n private _computeChordTolerance(viewport: Viewport, applyAspectRatioSkew: boolean, computeRange: () => Range3d) {\n let pixelSize = 1;\n // Compute the horizontal distance in meters between two adjacent pixels at the center of the geometry.\n pixelSize = viewport.getPixelSizeAtPoint(computeRange().center);\n pixelSize = viewport.target.adjustPixelSizeForLOD(pixelSize);\n\n // Aspect ratio skew > 1.0 stretches the view in Y. In that case use the smaller vertical pixel distance for our stroke tolerance.\n const skew = applyAspectRatioSkew ? viewport.view.getAspectRatioSkew() : 0;\n if (skew > 1)\n pixelSize /= skew;\n return pixelSize * 0.25;\n }\n\n public clearState = () => {\n this._state = undefined;\n };\n\n public setState = (state: MapFeatureInfoToolData) => {\n\n this._drapedStrings = undefined;\n this._allGeomDraped = false;\n this.hidden = false;\n\n this._state = state;\n IModelApp.viewManager.invalidateCachedDecorationsAllViews(this);\n\n this._drapePoints.clear();\n this._drapePointsStates = [];\n\n if (!this.disableTerrainDraper && this._state.mapInfo?.layerInfos && state.hit.viewport.displayStyle.displayTerrain) {\n\n if (state.hit?.modelId) {\n const drapeTreeRef = this.getGeometryTreeRef(state.hit.viewport);\n if (drapeTreeRef) {\n this._draper = new TerrainDraper(state.hit.viewport, drapeTreeRef);\n return;\n }\n }\n }\n\n if (this._draper) {\n // Dispose draper every time?\n this._draper.dispose();\n this._draper = undefined;\n }\n };\n\n private getGeometryTreeRef(vp: Viewport): GeometryTileTreeReference | undefined {\n let treeRef: GeometryTileTreeReference | undefined;\n if (vp.backgroundMapSettings.applyTerrain) {\n vp.forEachMapTreeRef((ref: TileTreeReference) => {\n if (!treeRef && ref instanceof MapTileTreeReference) {\n treeRef = ref.createGeometryTreeReference();\n }\n });\n }\n\n return treeRef;\n }\n\n protected renderGraphics(context: DecorateContext) {\n this._markerSet.markers.clear();\n\n if (this._state?.mapInfo?.layerInfos === undefined || this.hidden) {\n return undefined;\n }\n\n let transform: Transform|undefined;\n const groundBias = context.viewport.displayStyle.backgroundMapSettings.groundBias;\n if (groundBias !== 0) {\n transform = Transform.createTranslationXYZ(0, 0 , groundBias);\n }\n const builder = context.createGraphicBuilder(this._graphicType, transform);\n\n if (this._draper) {\n if (this._drapePoints.length === 0 && this._state.mapInfo.layerInfos) {\n\n for (const layerInfo of this._state.mapInfo.layerInfos) {\n if (layerInfo.subLayerInfos) {\n for (const subLayerInfo of layerInfo.subLayerInfos) {\n for (const feature of subLayerInfo.features) {\n if (feature.geometries) {\n for (const geom of feature.geometries) {\n if (geom.graphic.type === \"linestring\") {\n this._drapePointsStates.push({ count: geom.graphic.points.length, collectorState: \"loading\" });\n this._drapePoints.pushAll(geom.graphic.points);\n }\n }\n }\n }\n }\n\n }\n }\n }\n\n if (!this._allGeomDraped) {\n\n let hasMissingLineStrings = false;\n let drapePointsOffset = 0;\n for (const state of this._drapePointsStates) {\n\n if (state.collectorState === \"loading\") {\n this._scratchPoints.clear();\n this._scratchPoints.resize(state.count);\n\n let dstIdx = 0;\n for (let srcIdx = drapePointsOffset; srcIdx < drapePointsOffset + state.count; srcIdx++) {\n this._scratchPoints.transferFromGrowableXYZArray(dstIdx++, this._drapePoints, srcIdx);\n }\n\n const drapeRange = Range3d.createNull();\n drapeRange.extendArray(this._scratchPoints);\n const drapedStrings: LineString3d[] = [];\n const tolerance = this._computeChordTolerance(context.viewport, true, () => drapeRange) * 10; // 10 pixels\n if (\"loading\" === this._draper.drapeLineString(drapedStrings, this._scratchPoints, tolerance)) {\n hasMissingLineStrings = true;\n } else {\n this.addDrapedStrings(drapedStrings);\n state.collectorState = \"complete\";\n }\n }\n drapePointsOffset += state.count;\n }\n this._allGeomDraped = !hasMissingLineStrings;\n }\n\n if (this._drapedStrings) {\n builder.setSymbology(this.highlightColor, this.highlightColor, this.lineWidth);\n this._drapedStrings.forEach((line) => builder.addLineString(line.points));\n }\n\n } else {\n builder.setSymbology(this.highlightColor, this.highlightColor, this.lineWidth);\n for (const layerInfo of this._state.mapInfo.layerInfos) {\n if (layerInfo.subLayerInfos && !(layerInfo.subLayerInfos instanceof HTMLElement)) {\n for (const subLayerInfo of layerInfo.subLayerInfos) {\n for (const feature of subLayerInfo.features) {\n if (feature.geometries) {\n for (const geom of feature.geometries) {\n if (geom.graphic.type === \"pointstring\") {\n for (const point of geom.graphic.points)\n this._markerSet.markers.add(new PinMarker(point, this.markerSize, this._markerImage));\n } else {\n builder.addPrimitive(geom.graphic);\n }\n\n }\n }\n }\n }\n\n }\n\n }\n }\n\n // Add extra markers if any specified\n if ( this.extraMarkers !== undefined) {\n this.extraMarkers.forEach((markerPoint)=> {\n builder.setSymbology(this.highlightColor, this.highlightColor, this.lineWidth);\n this._markerSet.markers.add(new PinMarker(markerPoint, this.markerSize, this._markerImage));\n });\n }\n\n return builder.finish();\n }\n\n public addDrapedStrings(drapedStrings: LineString3d[]) {\n if (!this._drapedStrings) {\n this._drapedStrings = [];\n }\n for (const ds of drapedStrings)\n this._drapedStrings.push(ds);\n }\n\n public decorate(context: DecorateContext): void {\n const graphics = this.renderGraphics(context);\n if (graphics)\n context.addDecoration(this._graphicType, graphics);\n\n this._markerSet.addDecoration(context);\n return;\n }\n}\n"]}
@@ -245,7 +245,7 @@ class MapFeatureInfoTool extends core_frontend_1.PrimitiveTool {
245
245
  core_frontend_1.IModelApp.notifications.setToolAssistance(instructions);
246
246
  }
247
247
  }
248
+ exports.MapFeatureInfoTool = MapFeatureInfoTool;
248
249
  MapFeatureInfoTool.toolId = "MapFeatureInfoTool";
249
250
  MapFeatureInfoTool.iconSpec = MapInfoIcon_1.mapInfoIcon.dataUri;
250
- exports.MapFeatureInfoTool = MapFeatureInfoTool;
251
251
  //# sourceMappingURL=MapFeatureInfoTool.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"MapFeatureInfoTool.js","sourceRoot":"","sources":["../../../src/Tools/MapFeatureInfoTool.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,wDAkB8B;AAC9B,sDAA8C;AAC9C,oDAA+G;AAC/G,uEAAoE;AACpE,sDAAmD;AAYnD,MAAM,mBAAmB;IAAzB;QAUS,cAAS,GAAY,IAAI,CAAC;QAC1B,cAAS,GAAY,IAAI,CAAC;QAC1B,yBAAoB,GAAY,IAAI,CAAC;IAqD9C,CAAC;IA/DC,IAAW,eAAe,KAAK,OAAO,IAAI,CAAC,gBAAgB,CAAC,CAAA,CAAC;IAC7D,IAAW,eAAe,CAAC,MAA4C;QACrE,IAAI,CAAC,gBAAgB,GAAG,MAAM,CAAC;QAC/B,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;QACtB,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;QACtB,IAAI,CAAC,oBAAoB,GAAG,IAAI,CAAC;IAEnC,CAAC;IAKD,IAAW,YAAY,KAAK,OAAO,CAAC,IAAI,CAAC,eAAe,IAAI,IAAI,CAAC,eAAe,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAA,CAAC;IAEvF,yBAAyB,CAAC,OAAwB;QACvD,MAAM,MAAM,GAAG,EAAC,MAAM,EAAE,KAAK,E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------------------------\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/** @packageDocumentation\n * @module MapLayersFormats\n */\n\nimport {\n BeButtonEvent,\n EventHandled,\n HitDetail,\n IModelApp,\n LocateFilterStatus,\n LocateResponse,\n MapFeatureInfo,\n MapLayerInfoFromTileTree,\n MapLayerScaleRangeVisibility,\n MapTileTreeScaleRangeVisibility,\n PrimitiveTool,\n ToolAssistance,\n ToolAssistanceImage,\n ToolAssistanceInputMethod,\n ToolAssistanceInstruction,\n ToolAssistanceSection,\n Viewport,\n} from \"@itwin/core-frontend\";\nimport { BeEvent } from \"@itwin/core-bentley\";\nimport { ImageMapLayerSettings, MapImageryProps, MapImagerySettings, MapLayerProps } from \"@itwin/core-common\";\nimport { MapFeatureInfoDecorator } from \"./MapFeatureInfoDecorator\";\nimport { mapInfoIcon } from \"../Icons/MapInfoIcon\";\n\n/**\n * Data provided every time [[MapFeatureInfoTool]] retrieves feature information.\n * @see [[MapFeatureInfoToolData]]\n * @beta\n */\nexport interface MapFeatureInfoToolData {\n hit: HitDetail;\n mapInfo?: MapFeatureInfo;\n}\n\nclass ActiveMapLayerState {\n private _activeMapLayers: MapLayerInfoFromTileTree[]|undefined;\n public get activeMapLayers() {return this._activeMapLayers;}\n public set activeMapLayers(active: MapLayerInfoFromTileTree[]|undefined) {\n this._activeMapLayers = active;\n this.isVisible = true;\n this.isInRange = true;\n this.existsInDisplayStyle = true;\n\n }\n public isVisible: boolean = true;\n public isInRange: boolean = true;\n public existsInDisplayStyle: boolean = true;\n\n public get hasMapLayers() { return (this.activeMapLayers && this.activeMapLayers.length > 0);}\n\n public updateWithImagerySettings(imagery: MapImageryProps) {\n const result = {exists: false, hidden: false};\n this.existsInDisplayStyle = false;\n this.isVisible = false;\n if (this.hasMapLayers) {\n const oldMls = this._activeMapLayers![0]; // consider only first layer for now\n\n let newMls: MapLayerProps|undefined;\n if (oldMls.isBaseLayer) {\n if (typeof (imagery.backgroundBase) !== \"number\") {\n newMls = imagery.backgroundBase;\n }\n } else if (oldMls.index?.isOverlay && imagery.overlayLayers && imagery.overlayLayers.length > oldMls.index.index) {\n newMls = imagery.overlayLayers[oldMls.index.index];\n\n } else if ((oldMls.index !== undefined) && imagery.backgroundLayers && imagery.backgroundLayers.length > oldMls.index.index) {\n newMls = imagery.backgroundLayers[oldMls.index.index];\n }\n\n // We want to make sure that newMls and OldMls are the same (but ignoring the 'visible' flag).\n // by using the serialized JSON object\n let tmpNewMls = newMls;\n if (newMls && newMls.visible !== oldMls.settings.visible) {\n tmpNewMls = {...newMls, visible: oldMls.settings.visible};\n }\n const newJson = tmpNewMls ? JSON.stringify(tmpNewMls) : \"\";\n const oldJson = JSON.stringify(oldMls.settings.toJSON());\n\n if (newJson === oldJson ) {\n // We consider newMls and OldMls to be the same mapLayer instance.\n this.existsInDisplayStyle = true;\n this.isVisible = newMls!.visible ? true : false;\n }\n\n }\n return result;\n }\n\n public updateWithScaleRangeVisibility(layerIndexes: MapLayerScaleRangeVisibility[]) {\n if (this.hasMapLayers) {\n const currentMls = this.activeMapLayers![0]; // consider only first layer for now\n for (const scaleRangeVisibility of layerIndexes) {\n if (currentMls.index?.index === scaleRangeVisibility.index) {\n this.isInRange = scaleRangeVisibility.visibility === MapTileTreeScaleRangeVisibility.Visible || scaleRangeVisibility.visibility === MapTileTreeScaleRangeVisibility.Partial;\n }\n }\n }\n\n }\n}\n\n/** Tools that allow extracting feature information from map-layers.\n * Simulate feature highlight by drawing overlay decorations. It also\n * fire an event that provide further feature information meant to be displayed in a UI / Widget.\n * @see [[MapFeatureInfoToolData]]\n * @beta\n */\nexport class MapFeatureInfoTool extends PrimitiveTool {\n public readonly onInfoReady = new BeEvent<(data: MapFeatureInfoToolData) => void>();\n public readonly onInfoCleared = new BeEvent();\n\n public static override toolId = \"MapFeatureInfoTool\";\n public static override iconSpec = mapInfoIcon.dataUri;\n\n private _decorator: MapFeatureInfoDecorator = new MapFeatureInfoDecorator();\n private _layerSettingsCache = new Map<string, MapLayerInfoFromTileTree[]>();\n\n private _state: ActiveMapLayerState = new ActiveMapLayerState();\n private readonly _detachListeners: VoidFunction[] = [];\n private _detachOnMapImageryChanged: VoidFunction|undefined;\n\n public override requireWriteableTarget(): boolean {\n return false;\n }\n\n /** @internal */\n protected setupAndPromptForNextAction(): void {\n this.showPrompt();\n }\n\n private updateDecorator(vp: Viewport) {\n if (this._state.existsInDisplayStyle) {\n if (this._state.isInRange) {\n this._decorator.hidden = !this._state.isVisible;\n }\n } else {\n // Flush existing decorations until a new selection is made\n this.onInfoCleared.raiseEvent();\n this._decorator.clearState();\n }\n vp.invalidateDecorations();\n }\n\n public override async onPostInstall() {\n await super.onPostInstall();\n\n this.setupAndPromptForNextAction();\n\n this.initLocateElements();\n IModelApp.locateManager.options.allowDecorations = true;\n\n this._layerSettingsCache.clear();\n\n // Listen of display style configuration changes, that way we don't have to restart the tool to be up to date.\n const vp = this.targetView;\n if (vp) {\n const mapImageryChangeHandler = (newImagery: Readonly<MapImagerySettings>) => {\n if (this._state.hasMapLayers) {\n this._state.updateWithImagerySettings(newImagery.toJSON());\n this.updateDecorator(vp);\n }\n this._layerSettingsCache.clear();\n };\n\n this._detachListeners.push(vp.onChangeView.addListener((viewport, _previousViewState) => {\n\n // When a saved view is loaded, 'onMapImageryChanged' events are no longer handled, we have to re-attach.\n if (this._detachOnMapImageryChanged) {\n this._detachOnMapImageryChanged();\n }\n this._detachOnMapImageryChanged = viewport.displayStyle.settings.onMapImageryChanged.addListener(mapImageryChangeHandler);\n\n if (this._state.hasMapLayers) {\n this._state.updateWithImagerySettings({\n backgroundBase: viewport.displayStyle.backgroundMapBase.toJSON(),\n backgroundLayers: viewport.displayStyle.getMapLayers(false).map((value) => value.toJSON()),\n overlayLayers: viewport.displayStyle.getMapLayers(true).map((value) => value.toJSON()),\n });\n this.updateDecorator(vp);\n }\n this._layerSettingsCache.clear();\n }));\n\n this._detachOnMapImageryChanged = vp.displayStyle.settings.onMapImageryChanged.addListener(mapImageryChangeHandler);\n\n // Every time a layer goes out of range it, its associated decoration should be hidden (and restore if enter again the range)\n this._detachListeners.push(vp.onMapLayerScaleRangeVisibilityChanged.addListener(((layerIndexes: MapLayerScaleRangeVisibility[]) => {\n if (this._state.hasMapLayers) {\n this._state.updateWithScaleRangeVisibility(layerIndexes);\n if (this._state.existsInDisplayStyle && this._state.isVisible) {\n this._decorator.hidden = !this._state.isInRange;\n vp.invalidateDecorations();\n }\n }\n this._layerSettingsCache.clear();\n })));\n\n }\n\n IModelApp.viewManager.addDecorator(this._decorator);\n\n }\n\n public override async onCleanup() {\n this._detachListeners.forEach((f) => f());\n this._detachListeners.length = 0;\n if (this._detachOnMapImageryChanged) {\n this._detachOnMapImageryChanged();\n }\n\n IModelApp.viewManager.dropDecorator(this._decorator);\n }\n\n /**\n * Get map layer information from a hit.\n * @param hit The hit to get info from.\n * @returns Returns a list of [[MapLayerInfoFromTileTree]]s.\n * @internal\n */\n private getMapLayerInfoFromHit(hit: HitDetail) {\n let mapLayerFromHit: MapLayerInfoFromTileTree[] = [];\n const fromCache = this._layerSettingsCache.get(hit.sourceId);\n if (fromCache) {\n mapLayerFromHit = fromCache;\n } else if (this.targetView) {\n mapLayerFromHit = this.targetView?.mapLayerFromHit(hit).filter(((info) => info.settings instanceof ImageMapLayerSettings && info.provider?.supportsMapFeatureInfo));\n this._layerSettingsCache.set(hit.sourceId, mapLayerFromHit);\n }\n\n return mapLayerFromHit;\n }\n\n public override async getToolTip(hit: HitDetail): Promise<HTMLElement | string> {\n const infos = this.getMapLayerInfoFromHit(hit);\n if (infos.length > 0) {\n const names = infos.map((info) => info.settings.name);\n return `Layer${names.length > 1 ? \"s\" : \"\"}: ${names.join(\", \")}`;\n }\n return \"\";\n }\n\n public override async filterHit(hit: HitDetail, _out?: LocateResponse): Promise<LocateFilterStatus> {\n return this.getMapLayerInfoFromHit(hit).length > 0 ? LocateFilterStatus.Accept : LocateFilterStatus.Reject;\n }\n\n public override async onDataButtonDown(\n ev: BeButtonEvent,\n ): Promise<EventHandled> {\n const hit = await IModelApp.locateManager.doLocate(\n new LocateResponse(),\n true,\n ev.point,\n ev.viewport,\n ev.inputSource,\n );\n if (hit !== undefined) {\n let mapInfo: MapFeatureInfo | undefined;\n\n const mapLayersHit = this.getMapLayerInfoFromHit(hit);\n if (mapLayersHit.length > 0) {\n this._state.activeMapLayers = mapLayersHit;\n IModelApp.toolAdmin.setCursor(\"wait\");\n try {\n const aperture = (hit.viewport.pixelsFromInches(IModelApp.locateManager.apertureInches) / 2.0) + 1.5;\n const pixelRadius = Math.floor(aperture + 0.5);\n mapInfo = await hit.viewport.getMapFeatureInfo(hit, {tolerance: pixelRadius});\n if (mapInfo) {\n this._decorator.setState({ hit, mapInfo });\n }\n } finally {\n IModelApp.toolAdmin.setCursor(undefined);\n }\n }\n\n this.onInfoReady.raiseEvent({ hit, mapInfo });\n return EventHandled.Yes;\n }\n return EventHandled.No;\n }\n\n public override async onResetButtonUp(\n _ev: BeButtonEvent,\n ): Promise<EventHandled> {\n this._state.activeMapLayers = undefined;\n /* Common reset behavior for primitive tools is calling onReinitialize to restart or exitTool to terminate. */\n await this.onReinitialize();\n return EventHandled.No;\n }\n\n public override async onRestartTool() {\n const tool = new MapFeatureInfoTool();\n if (!(await tool.run()))\n return this.exitTool();\n }\n\n /** @internal */\n protected showPrompt(): void {\n\n const promptEnterPoint = IModelApp.localization.getLocalizedString(\"mapLayersFormats:tools.MapFeatureInfoTool.Prompts.EnterPoint\");\n const promptClickIdentify= IModelApp.localization.getLocalizedString(\"mapLayersFormats:tools.MapFeatureInfoTool.Prompts.clickToIdentify\");\n const promptClickClear = IModelApp.localization.getLocalizedString(\"mapLayersFormats:tools.MapFeatureInfoTool.Prompts.clickToClear\");\n\n // Mouse Instructions\n const mouseInstructions: ToolAssistanceInstruction[] = [];\n mouseInstructions.push(ToolAssistance.createInstruction(ToolAssistanceImage.LeftClick, promptClickIdentify, false, ToolAssistanceInputMethod.Mouse));\n mouseInstructions.push(ToolAssistance.createInstruction(ToolAssistanceImage.RightClick, promptClickClear, false, ToolAssistanceInputMethod.Mouse));\n const sections: ToolAssistanceSection[] = [];\n sections.push(ToolAssistance.createSection(mouseInstructions, ToolAssistance.inputsLabel));\n\n // Main Instruction\n const mainInstruction = ToolAssistance.createInstruction(this.iconSpec, promptEnterPoint);\n const instructions = ToolAssistance.createInstructions(mainInstruction, sections);\n\n IModelApp.notifications.setToolAssistance(instructions);\n }\n}\n"]}
1
+ {"version":3,"file":"MapFeatureInfoTool.js","sourceRoot":"","sources":["../../../src/Tools/MapFeatureInfoTool.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,wDAkB8B;AAC9B,sDAA8C;AAC9C,oDAA+G;AAC/G,uEAAoE;AACpE,sDAAmD;AAYnD,MAAM,mBAAmB;IAAzB;QAUS,cAAS,GAAY,IAAI,CAAC;QAC1B,cAAS,GAAY,IAAI,CAAC;QAC1B,yBAAoB,GAAY,IAAI,CAAC;IAqD9C,CAAC;IA/DC,IAAW,eAAe,KAAK,OAAO,IAAI,CAAC,gBAAgB,CAAC,CAAA,CAAC;IAC7D,IAAW,eAAe,CAAC,MAA4C;QACrE,IAAI,CAAC,gBAAgB,GAAG,MAAM,CAAC;QAC/B,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;QACtB,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;QACtB,IAAI,CAAC,oBAAoB,GAAG,IAAI,CAAC;IAEnC,CAAC;IAKD,IAAW,YAAY,KAAK,OAAO,CAAC,IAAI,CAAC,eAAe,IAAI,IAAI,CAAC,eAAe,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAA,CAAC;IAEvF,yBAAyB,CAAC,OAAwB;QACvD,MAAM,MAAM,GAAG,EAAC,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAC,CAAC;QAC9C,IAAI,CAAC,oBAAoB,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Ac,CAAC,kBAAkB,CAAC,eAAe,EAAE,QAAQ,CAAC,CAAC;QAElF,yBAAS,CAAC,aAAa,CAAC,iBAAiB,CAAC,YAAY,CAAC,CAAC;IAC1D,CAAC;;AA/MH,gDAgNC;AA5MwB,yBAAM,GAAG,oBAAoB,AAAvB,CAAwB;AAC9B,2BAAQ,GAAG,yBAAW,CAAC,OAAO,AAAtB,CAAuB","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/** @packageDocumentation\n * @module MapLayersFormats\n */\n\nimport {\n BeButtonEvent,\n EventHandled,\n HitDetail,\n IModelApp,\n LocateFilterStatus,\n LocateResponse,\n MapFeatureInfo,\n MapLayerInfoFromTileTree,\n MapLayerScaleRangeVisibility,\n MapTileTreeScaleRangeVisibility,\n PrimitiveTool,\n ToolAssistance,\n ToolAssistanceImage,\n ToolAssistanceInputMethod,\n ToolAssistanceInstruction,\n ToolAssistanceSection,\n Viewport,\n} from \"@itwin/core-frontend\";\nimport { BeEvent } from \"@itwin/core-bentley\";\nimport { ImageMapLayerSettings, MapImageryProps, MapImagerySettings, MapLayerProps } from \"@itwin/core-common\";\nimport { MapFeatureInfoDecorator } from \"./MapFeatureInfoDecorator\";\nimport { mapInfoIcon } from \"../Icons/MapInfoIcon\";\n\n/**\n * Data provided every time [[MapFeatureInfoTool]] retrieves feature information.\n * @see [[MapFeatureInfoToolData]]\n * @beta\n */\nexport interface MapFeatureInfoToolData {\n hit: HitDetail;\n mapInfo?: MapFeatureInfo;\n}\n\nclass ActiveMapLayerState {\n private _activeMapLayers: MapLayerInfoFromTileTree[]|undefined;\n public get activeMapLayers() {return this._activeMapLayers;}\n public set activeMapLayers(active: MapLayerInfoFromTileTree[]|undefined) {\n this._activeMapLayers = active;\n this.isVisible = true;\n this.isInRange = true;\n this.existsInDisplayStyle = true;\n\n }\n public isVisible: boolean = true;\n public isInRange: boolean = true;\n public existsInDisplayStyle: boolean = true;\n\n public get hasMapLayers() { return (this.activeMapLayers && this.activeMapLayers.length > 0);}\n\n public updateWithImagerySettings(imagery: MapImageryProps) {\n const result = {exists: false, hidden: false};\n this.existsInDisplayStyle = false;\n this.isVisible = false;\n if (this.hasMapLayers) {\n const oldMls = this._activeMapLayers![0]; // consider only first layer for now\n\n let newMls: MapLayerProps|undefined;\n if (oldMls.isBaseLayer) {\n if (typeof (imagery.backgroundBase) !== \"number\") {\n newMls = imagery.backgroundBase;\n }\n } else if (oldMls.index?.isOverlay && imagery.overlayLayers && imagery.overlayLayers.length > oldMls.index.index) {\n newMls = imagery.overlayLayers[oldMls.index.index];\n\n } else if ((oldMls.index !== undefined) && imagery.backgroundLayers && imagery.backgroundLayers.length > oldMls.index.index) {\n newMls = imagery.backgroundLayers[oldMls.index.index];\n }\n\n // We want to make sure that newMls and OldMls are the same (but ignoring the 'visible' flag).\n // by using the serialized JSON object\n let tmpNewMls = newMls;\n if (newMls && newMls.visible !== oldMls.settings.visible) {\n tmpNewMls = {...newMls, visible: oldMls.settings.visible};\n }\n const newJson = tmpNewMls ? JSON.stringify(tmpNewMls) : \"\";\n const oldJson = JSON.stringify(oldMls.settings.toJSON());\n\n if (newJson === oldJson ) {\n // We consider newMls and OldMls to be the same mapLayer instance.\n this.existsInDisplayStyle = true;\n this.isVisible = newMls!.visible ? true : false;\n }\n\n }\n return result;\n }\n\n public updateWithScaleRangeVisibility(layerIndexes: MapLayerScaleRangeVisibility[]) {\n if (this.hasMapLayers) {\n const currentMls = this.activeMapLayers![0]; // consider only first layer for now\n for (const scaleRangeVisibility of layerIndexes) {\n if (currentMls.index?.index === scaleRangeVisibility.index) {\n this.isInRange = scaleRangeVisibility.visibility === MapTileTreeScaleRangeVisibility.Visible || scaleRangeVisibility.visibility === MapTileTreeScaleRangeVisibility.Partial;\n }\n }\n }\n\n }\n}\n\n/** Tools that allow extracting feature information from map-layers.\n * Simulate feature highlight by drawing overlay decorations. It also\n * fire an event that provide further feature information meant to be displayed in a UI / Widget.\n * @see [[MapFeatureInfoToolData]]\n * @beta\n */\nexport class MapFeatureInfoTool extends PrimitiveTool {\n public readonly onInfoReady = new BeEvent<(data: MapFeatureInfoToolData) => void>();\n public readonly onInfoCleared = new BeEvent();\n\n public static override toolId = \"MapFeatureInfoTool\";\n public static override iconSpec = mapInfoIcon.dataUri;\n\n private _decorator: MapFeatureInfoDecorator = new MapFeatureInfoDecorator();\n private _layerSettingsCache = new Map<string, MapLayerInfoFromTileTree[]>();\n\n private _state: ActiveMapLayerState = new ActiveMapLayerState();\n private readonly _detachListeners: VoidFunction[] = [];\n private _detachOnMapImageryChanged: VoidFunction|undefined;\n\n public override requireWriteableTarget(): boolean {\n return false;\n }\n\n /** @internal */\n protected setupAndPromptForNextAction(): void {\n this.showPrompt();\n }\n\n private updateDecorator(vp: Viewport) {\n if (this._state.existsInDisplayStyle) {\n if (this._state.isInRange) {\n this._decorator.hidden = !this._state.isVisible;\n }\n } else {\n // Flush existing decorations until a new selection is made\n this.onInfoCleared.raiseEvent();\n this._decorator.clearState();\n }\n vp.invalidateDecorations();\n }\n\n public override async onPostInstall() {\n await super.onPostInstall();\n\n this.setupAndPromptForNextAction();\n\n this.initLocateElements();\n IModelApp.locateManager.options.allowDecorations = true;\n\n this._layerSettingsCache.clear();\n\n // Listen of display style configuration changes, that way we don't have to restart the tool to be up to date.\n const vp = this.targetView;\n if (vp) {\n const mapImageryChangeHandler = (newImagery: Readonly<MapImagerySettings>) => {\n if (this._state.hasMapLayers) {\n this._state.updateWithImagerySettings(newImagery.toJSON());\n this.updateDecorator(vp);\n }\n this._layerSettingsCache.clear();\n };\n\n this._detachListeners.push(vp.onChangeView.addListener((viewport, _previousViewState) => {\n\n // When a saved view is loaded, 'onMapImageryChanged' events are no longer handled, we have to re-attach.\n if (this._detachOnMapImageryChanged) {\n this._detachOnMapImageryChanged();\n }\n this._detachOnMapImageryChanged = viewport.displayStyle.settings.onMapImageryChanged.addListener(mapImageryChangeHandler);\n\n if (this._state.hasMapLayers) {\n this._state.updateWithImagerySettings({\n backgroundBase: viewport.displayStyle.backgroundMapBase.toJSON(),\n backgroundLayers: viewport.displayStyle.getMapLayers(false).map((value) => value.toJSON()),\n overlayLayers: viewport.displayStyle.getMapLayers(true).map((value) => value.toJSON()),\n });\n this.updateDecorator(vp);\n }\n this._layerSettingsCache.clear();\n }));\n\n this._detachOnMapImageryChanged = vp.displayStyle.settings.onMapImageryChanged.addListener(mapImageryChangeHandler);\n\n // Every time a layer goes out of range it, its associated decoration should be hidden (and restore if enter again the range)\n this._detachListeners.push(vp.onMapLayerScaleRangeVisibilityChanged.addListener(((layerIndexes: MapLayerScaleRangeVisibility[]) => {\n if (this._state.hasMapLayers) {\n this._state.updateWithScaleRangeVisibility(layerIndexes);\n if (this._state.existsInDisplayStyle && this._state.isVisible) {\n this._decorator.hidden = !this._state.isInRange;\n vp.invalidateDecorations();\n }\n }\n this._layerSettingsCache.clear();\n })));\n\n }\n\n IModelApp.viewManager.addDecorator(this._decorator);\n\n }\n\n public override async onCleanup() {\n this._detachListeners.forEach((f) => f());\n this._detachListeners.length = 0;\n if (this._detachOnMapImageryChanged) {\n this._detachOnMapImageryChanged();\n }\n\n IModelApp.viewManager.dropDecorator(this._decorator);\n }\n\n /**\n * Get map layer information from a hit.\n * @param hit The hit to get info from.\n * @returns Returns a list of [[MapLayerInfoFromTileTree]]s.\n * @internal\n */\n private getMapLayerInfoFromHit(hit: HitDetail) {\n let mapLayerFromHit: MapLayerInfoFromTileTree[] = [];\n const fromCache = this._layerSettingsCache.get(hit.sourceId);\n if (fromCache) {\n mapLayerFromHit = fromCache;\n } else if (this.targetView) {\n mapLayerFromHit = this.targetView?.mapLayerFromHit(hit).filter(((info) => info.settings instanceof ImageMapLayerSettings && info.provider?.supportsMapFeatureInfo));\n this._layerSettingsCache.set(hit.sourceId, mapLayerFromHit);\n }\n\n return mapLayerFromHit;\n }\n\n public override async getToolTip(hit: HitDetail): Promise<HTMLElement | string> {\n const infos = this.getMapLayerInfoFromHit(hit);\n if (infos.length > 0) {\n const names = infos.map((info) => info.settings.name);\n return `Layer${names.length > 1 ? \"s\" : \"\"}: ${names.join(\", \")}`;\n }\n return \"\";\n }\n\n public override async filterHit(hit: HitDetail, _out?: LocateResponse): Promise<LocateFilterStatus> {\n return this.getMapLayerInfoFromHit(hit).length > 0 ? LocateFilterStatus.Accept : LocateFilterStatus.Reject;\n }\n\n public override async onDataButtonDown(\n ev: BeButtonEvent,\n ): Promise<EventHandled> {\n const hit = await IModelApp.locateManager.doLocate(\n new LocateResponse(),\n true,\n ev.point,\n ev.viewport,\n ev.inputSource,\n );\n if (hit !== undefined) {\n let mapInfo: MapFeatureInfo | undefined;\n\n const mapLayersHit = this.getMapLayerInfoFromHit(hit);\n if (mapLayersHit.length > 0) {\n this._state.activeMapLayers = mapLayersHit;\n IModelApp.toolAdmin.setCursor(\"wait\");\n try {\n const aperture = (hit.viewport.pixelsFromInches(IModelApp.locateManager.apertureInches) / 2.0) + 1.5;\n const pixelRadius = Math.floor(aperture + 0.5);\n mapInfo = await hit.viewport.getMapFeatureInfo(hit, {tolerance: pixelRadius});\n if (mapInfo) {\n this._decorator.setState({ hit, mapInfo });\n }\n } finally {\n IModelApp.toolAdmin.setCursor(undefined);\n }\n }\n\n this.onInfoReady.raiseEvent({ hit, mapInfo });\n return EventHandled.Yes;\n }\n return EventHandled.No;\n }\n\n public override async onResetButtonUp(\n _ev: BeButtonEvent,\n ): Promise<EventHandled> {\n this._state.activeMapLayers = undefined;\n /* Common reset behavior for primitive tools is calling onReinitialize to restart or exitTool to terminate. */\n await this.onReinitialize();\n return EventHandled.No;\n }\n\n public override async onRestartTool() {\n const tool = new MapFeatureInfoTool();\n if (!(await tool.run()))\n return this.exitTool();\n }\n\n /** @internal */\n protected showPrompt(): void {\n\n const promptEnterPoint = IModelApp.localization.getLocalizedString(\"mapLayersFormats:tools.MapFeatureInfoTool.Prompts.EnterPoint\");\n const promptClickIdentify= IModelApp.localization.getLocalizedString(\"mapLayersFormats:tools.MapFeatureInfoTool.Prompts.clickToIdentify\");\n const promptClickClear = IModelApp.localization.getLocalizedString(\"mapLayersFormats:tools.MapFeatureInfoTool.Prompts.clickToClear\");\n\n // Mouse Instructions\n const mouseInstructions: ToolAssistanceInstruction[] = [];\n mouseInstructions.push(ToolAssistance.createInstruction(ToolAssistanceImage.LeftClick, promptClickIdentify, false, ToolAssistanceInputMethod.Mouse));\n mouseInstructions.push(ToolAssistance.createInstruction(ToolAssistanceImage.RightClick, promptClickClear, false, ToolAssistanceInputMethod.Mouse));\n const sections: ToolAssistanceSection[] = [];\n sections.push(ToolAssistance.createSection(mouseInstructions, ToolAssistance.inputsLabel));\n\n // Main Instruction\n const mainInstruction = ToolAssistance.createInstruction(this.iconSpec, promptEnterPoint);\n const instructions = ToolAssistance.createInstructions(mainInstruction, sections);\n\n IModelApp.notifications.setToolAssistance(instructions);\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"mapLayersFormats.d.ts","sourceRoot":"","sources":["../../src/mapLayersFormats.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,YAAY,CAAC,EAAE,YAAY,CAAC;CAC7B;AAED;;GAEG;AACH,qBAAa,gBAAgB;IAE3B,OAAO,CAAC,MAAM,CAAC,UAAU,CAAsB;IAC/C,OAAc,YAAY,EAAE,YAAY,CAAC;IAEzC;;;OAGG;WACiB,UAAU,CAAC,MAAM,CAAC,EAAE,sBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC;IAc9E,kDAAkD;IAClD,WAAkB,qBAAqB,IAAI,MAAM,CAEhD;CAEF"}
1
+ {"version":3,"file":"mapLayersFormats.d.ts","sourceRoot":"","sources":["../../src/mapLayersFormats.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAGlD;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,YAAY,CAAC,EAAE,YAAY,CAAC;CAC7B;AAED;;GAEG;AACH,qBAAa,gBAAgB;IAE3B,OAAO,CAAC,MAAM,CAAC,UAAU,CAAsB;IAC/C,OAAc,YAAY,EAAE,YAAY,CAAC;IAEzC;;;OAGG;WACiB,UAAU,CAAC,MAAM,CAAC,EAAE,sBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC;IAgB9E,kDAAkD;IAClD,WAAkB,qBAAqB,IAAI,MAAM,CAEhD;CAEF"}
@@ -12,6 +12,7 @@ const core_bentley_1 = require("@itwin/core-bentley");
12
12
  const core_frontend_1 = require("@itwin/core-frontend");
13
13
  const ArcGisFeatureFormat_1 = require("./ArcGisFeature/ArcGisFeatureFormat");
14
14
  const MapFeatureInfoTool_1 = require("./Tools/MapFeatureInfoTool");
15
+ const OgcApiFeaturesFormat_1 = require("./OgcApiFeatures/OgcApiFeaturesFormat");
15
16
  /** The primary API for the `@itwin/map-layers-formats` package. It allows the package's features to be [[initialize]]d.
16
17
  * @beta
17
18
  */
@@ -22,8 +23,10 @@ class MapLayersFormats {
22
23
  */
23
24
  static async initialize(config) {
24
25
  (0, core_bentley_1.assert)(core_frontend_1.IModelApp.initialized, "MapLayersFormats.initialize must be called after IModelApp.startup and before IModelApp.shutdown");
25
- if (core_frontend_1.IModelApp.initialized)
26
+ if (core_frontend_1.IModelApp.initialized) {
26
27
  core_frontend_1.IModelApp.mapLayerFormatRegistry.register(ArcGisFeatureFormat_1.ArcGisFeatureMapLayerFormat);
28
+ core_frontend_1.IModelApp.mapLayerFormatRegistry.register(OgcApiFeaturesFormat_1.OgcApiFeaturesMapLayerFormat);
29
+ }
27
30
  // register namespace containing localized strings for this package
28
31
  MapLayersFormats.localization = config?.localization ?? core_frontend_1.IModelApp.localization;
29
32
  await MapLayersFormats.localization.registerNamespace(MapLayersFormats.localizationNamespace);
@@ -34,6 +37,6 @@ class MapLayersFormats {
34
37
  return MapLayersFormats._defaultNs;
35
38
  }
36
39
  }
37
- MapLayersFormats._defaultNs = "mapLayersFormats";
38
40
  exports.MapLayersFormats = MapLayersFormats;
41
+ MapLayersFormats._defaultNs = "mapLayersFormats";
39
42
  //# sourceMappingURL=mapLayersFormats.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"mapLayersFormats.js","sourceRoot":"","sources":["../../src/mapLayersFormats.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GAEG;AACH,sDAA6C;AAC7C,wDAAiD;AACjD,6EAAkF;AAClF,mEAAgE;AAUhE;;GAEG;AACH,MAAa,gBAAgB;IAK3B;;;OAGG;IACI,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,MAA+B;QAC5D,IAAA,qBAAM,EAAC,yBAAS,CAAC,WAAW,EAAE,kGAAkG,CAAC,CAAC;QAClI,IAAI,yBAAS,CAAC,WAAW;YACvB,yBAAS,CAAC,sBAAsB,CAAC,QAAQ,CAAC,iDAA2B,CAAC,CAAC;QAEzE,mEAAmE;QACnE,gBAAgB,CAAC,YAAY,GAAG,MAAM,EAAE,YAAY,IAAI,yBAAS,CAAC,YAAY,CAAC;QAC/E,MAAM,gBAAgB,CAAC,YAAY,CAAC,iBAAiB,CACnD,gBAAgB,CAAC,qBAAqB,CACvC,CAAC;QAEF,uCAAkB,CAAC,QAAQ,CAAC,gBAAgB,CAAC,qBAAqB,CAAC,CAAC;IACtE,CAAC;IAED,kDAAkD;IAC3C,MAAM,KAAK,qBAAqB;QACrC,OAAO,gBAAgB,CAAC,UAAU,CAAC;IACrC,CAAC;;AAxBc,2BAAU,GAAG,kBAAkB,CAAC;AAFpC,4CAAgB","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/** @packageDocumentation\n * @module MapLayersFormats\n */\nimport { assert } from \"@itwin/core-bentley\";\nimport { IModelApp } from \"@itwin/core-frontend\";\nimport { ArcGisFeatureMapLayerFormat } from \"./ArcGisFeature/ArcGisFeatureFormat\";\nimport { MapFeatureInfoTool } from \"./Tools/MapFeatureInfoTool\";\nimport { Localization } from \"@itwin/core-common\";\n\n/** Configuration options.\n * @beta\n */\nexport interface MapLayersFormatsConfig {\n localization?: Localization;\n}\n\n/** The primary API for the `@itwin/map-layers-formats` package. It allows the package's features to be [[initialize]]d.\n * @beta\n */\nexport class MapLayersFormats {\n\n private static _defaultNs = \"mapLayersFormats\";\n public static localization: Localization;\n\n /** Registers the [MapLayerFormat]($frontend)s provided by this package for use with [IModelApp]($frontend).\n * Typically, an application will call `MapLayersFormats.initialize` immediately after [IModelApp.startup]($frontend).\n * This function has no effect if called **before** [IModelApp.startup]($frontend) or **after** [IModelApp.shutdown]($frontend).\n */\n public static async initialize(config?: MapLayersFormatsConfig): Promise<void> {\n assert(IModelApp.initialized, \"MapLayersFormats.initialize must be called after IModelApp.startup and before IModelApp.shutdown\");\n if (IModelApp.initialized)\n IModelApp.mapLayerFormatRegistry.register(ArcGisFeatureMapLayerFormat);\n\n // register namespace containing localized strings for this package\n MapLayersFormats.localization = config?.localization ?? IModelApp.localization;\n await MapLayersFormats.localization.registerNamespace(\n MapLayersFormats.localizationNamespace,\n );\n\n MapFeatureInfoTool.register(MapLayersFormats.localizationNamespace);\n }\n\n /** The internationalization service namespace. */\n public static get localizationNamespace(): string {\n return MapLayersFormats._defaultNs;\n }\n\n}\n"]}
1
+ {"version":3,"file":"mapLayersFormats.js","sourceRoot":"","sources":["../../src/mapLayersFormats.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GAEG;AACH,sDAA6C;AAC7C,wDAAiD;AACjD,6EAAkF;AAClF,mEAAgE;AAEhE,gFAAqF;AASrF;;GAEG;AACH,MAAa,gBAAgB;IAK3B;;;OAGG;IACI,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,MAA+B;QAC5D,IAAA,qBAAM,EAAC,yBAAS,CAAC,WAAW,EAAE,kGAAkG,CAAC,CAAC;QAClI,IAAI,yBAAS,CAAC,WAAW,EAAE,CAAC;YAC1B,yBAAS,CAAC,sBAAsB,CAAC,QAAQ,CAAC,iDAA2B,CAAC,CAAC;YACvE,yBAAS,CAAC,sBAAsB,CAAC,QAAQ,CAAC,mDAA4B,CAAC,CAAC;QAC1E,CAAC;QAED,mEAAmE;QACnE,gBAAgB,CAAC,YAAY,GAAG,MAAM,EAAE,YAAY,IAAI,yBAAS,CAAC,YAAY,CAAC;QAC/E,MAAM,gBAAgB,CAAC,YAAY,CAAC,iBAAiB,CACnD,gBAAgB,CAAC,qBAAqB,CACvC,CAAC;QAEF,uCAAkB,CAAC,QAAQ,CAAC,gBAAgB,CAAC,qBAAqB,CAAC,CAAC;IACtE,CAAC;IAED,kDAAkD;IAC3C,MAAM,KAAK,qBAAqB;QACrC,OAAO,gBAAgB,CAAC,UAAU,CAAC;IACrC,CAAC;;AA5BH,4CA8BC;AA5BgB,2BAAU,GAAG,kBAAkB,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\n/** @packageDocumentation\n * @module MapLayersFormats\n */\nimport { assert } from \"@itwin/core-bentley\";\nimport { IModelApp } from \"@itwin/core-frontend\";\nimport { ArcGisFeatureMapLayerFormat } from \"./ArcGisFeature/ArcGisFeatureFormat\";\nimport { MapFeatureInfoTool } from \"./Tools/MapFeatureInfoTool\";\nimport { Localization } from \"@itwin/core-common\";\nimport { OgcApiFeaturesMapLayerFormat } from \"./OgcApiFeatures/OgcApiFeaturesFormat\";\n\n/** Configuration options.\n * @beta\n */\nexport interface MapLayersFormatsConfig {\n localization?: Localization;\n}\n\n/** The primary API for the `@itwin/map-layers-formats` package. It allows the package's features to be [[initialize]]d.\n * @beta\n */\nexport class MapLayersFormats {\n\n private static _defaultNs = \"mapLayersFormats\";\n public static localization: Localization;\n\n /** Registers the [MapLayerFormat]($frontend)s provided by this package for use with [IModelApp]($frontend).\n * Typically, an application will call `MapLayersFormats.initialize` immediately after [IModelApp.startup]($frontend).\n * This function has no effect if called **before** [IModelApp.startup]($frontend) or **after** [IModelApp.shutdown]($frontend).\n */\n public static async initialize(config?: MapLayersFormatsConfig): Promise<void> {\n assert(IModelApp.initialized, \"MapLayersFormats.initialize must be called after IModelApp.startup and before IModelApp.shutdown\");\n if (IModelApp.initialized) {\n IModelApp.mapLayerFormatRegistry.register(ArcGisFeatureMapLayerFormat);\n IModelApp.mapLayerFormatRegistry.register(OgcApiFeaturesMapLayerFormat);\n }\n\n // register namespace containing localized strings for this package\n MapLayersFormats.localization = config?.localization ?? IModelApp.localization;\n await MapLayersFormats.localization.registerNamespace(\n MapLayersFormats.localizationNamespace,\n );\n\n MapFeatureInfoTool.register(MapLayersFormats.localizationNamespace);\n }\n\n /** The internationalization service namespace. */\n public static get localizationNamespace(): string {\n return MapLayersFormats._defaultNs;\n }\n\n}\n"]}
@@ -1,7 +1,7 @@
1
1
  import { ArcGisUtilities, ImageryMapLayerFormat, MapLayerSource, MapLayerSourceStatus } from "@itwin/core-frontend";
2
2
  import { ArcGisFeatureProvider } from "./ArcGisFeatureProvider";
3
3
  /** @internal */
4
- class ArcGisFeatureMapLayerFormat extends ImageryMapLayerFormat {
4
+ export class ArcGisFeatureMapLayerFormat extends ImageryMapLayerFormat {
5
5
  static createImageryProvider(settings) { return new ArcGisFeatureProvider(settings); }
6
6
  static async validateSource(url, userName, password, ignoreCache) {
7
7
  const urlValidation = ArcGisUtilities.validateUrl(url, "FeatureServer");
@@ -23,5 +23,4 @@ class ArcGisFeatureMapLayerFormat extends ImageryMapLayerFormat {
23
23
  }
24
24
  }
25
25
  ArcGisFeatureMapLayerFormat.formatId = "ArcGISFeature";
26
- export { ArcGisFeatureMapLayerFormat };
27
26
  //# sourceMappingURL=ArcGisFeatureFormat.js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C,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,eAAe,CAAC,CAAC;QACpF,IAAI,aAAa,KAAK,oBAAoB,CAAC,KAAK;YAC9C,OAAO,EAAC,MAAM,EAAE,aAAa,EAAC,CAAC;QAEjC,gHAAgH;QAChH,OAAO,eAAe,CAAC,cAAc,CAAC,EAAC,GAAG,IAAI,EAAE,kBAAkB,EAAE,CAAC,OAAO,CAAC,EAAC,CAAC,CAAC;IAClF,CAAC;;AAxBsB,oCAAQ,GAAG,eAAe,CAAC;SADvC,2BAA2B","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 } from \"@itwin/core-common\";\nimport { ArcGisUtilities, ImageryMapLayerFormat, MapLayerImageryProvider, MapLayerSource, MapLayerSourceStatus, MapLayerSourceValidation, ValidateSourceArgs } from \"@itwin/core-frontend\";\nimport { ArcGisFeatureProvider } from \"./ArcGisFeatureProvider\";\n\n/** @internal */\nexport class ArcGisFeatureMapLayerFormat extends ImageryMapLayerFormat {\n public static override formatId = \"ArcGISFeature\";\n public static override createImageryProvider(settings: ImageMapLayerSettings): MapLayerImageryProvider | undefined { return new ArcGisFeatureProvider(settings); }\n public static override async validateSource(url: string, userName?: string, password?: string, ignoreCache?: boolean): Promise<MapLayerSourceValidation> {\n const urlValidation = ArcGisUtilities.validateUrl(url, \"FeatureServer\");\n if (urlValidation !== MapLayerSourceStatus.Valid)\n return { status: urlValidation };\n\n const source = MapLayerSource.fromJSON({name: \"\", url, formatId: this.formatId});\n if (!source)\n return {status: MapLayerSourceStatus.InvalidFormat};\n source.userName = userName;\n source.password = password;\n\n return ArcGisUtilities.validateSource({source, capabilitiesFilter: [\"query\"], ignoreCache});\n }\n\n public static override async validate(args: ValidateSourceArgs): Promise<MapLayerSourceValidation> {\n\n const urlValidation = ArcGisUtilities.validateUrl(args.source.url, \"FeatureServer\");\n if (urlValidation !== MapLayerSourceStatus.Valid)\n return {status: urlValidation};\n\n // Some Map service supporting only tiles don't include the 'Map' capabilities, thus we can't make it mandatory.\n return ArcGisUtilities.validateSource({...args, capabilitiesFilter: [\"query\"]});\n }\n}\n"]}
1
+ {"version":3,"file":"ArcGisFeatureFormat.js","sourceRoot":"","sources":["../../../src/ArcGisFeature/ArcGisFeatureFormat.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAA2B,cAAc,EAAE,oBAAoB,EAAgD,MAAM,sBAAsB,CAAC;AAC3L,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAEhE,gBAAgB;AAChB,MAAM,OAAO,2BAA4B,SAAQ,qBAAqB;IAE7D,MAAM,CAAU,qBAAqB,CAAC,QAA+B,IAAyC,OAAO,IAAI,qBAAqB,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IAC3J,MAAM,CAAU,KAAK,CAAC,cAAc,CAAC,GAAW,EAAE,QAAiB,EAAE,QAAiB,EAAE,WAAqB;QAClH,MAAM,aAAa,GAAG,eAAe,CAAC,WAAW,CAAC,GAAG,EAAE,eAAe,CAAC,CAAC;QACxE,IAAI,aAAa,KAAK,oBAAoB,CAAC,KAAK;YAC9C,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,CAAC;QAEnC,MAAM,MAAM,GAAG,cAAc,CAAC,QAAQ,CAAC,EAAC,IAAI,EAAE,EAAE,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAC,CAAC,CAAC;QACjF,IAAI,CAAC,MAAM;YACT,OAAO,EAAC,MAAM,EAAE,oBAAoB,CAAC,aAAa,EAAC,CAAC;QACtD,MAAM,CAAC,QAAQ,GAAG,QAAQ,CAAC;QAC3B,MAAM,CAAC,QAAQ,GAAG,QAAQ,CAAC;QAE3B,OAAO,eAAe,CAAC,cAAc,CAAC,EAAC,MAAM,EAAE,kBAAkB,EAAE,CAAC,OAAO,CAAC,EAAE,WAAW,EAAC,CAAC,CAAC;IAC9F,CAAC;IAEM,MAAM,CAAU,KAAK,CAAC,QAAQ,CAAC,IAAwB;QAE5D,MAAM,aAAa,GAAG,eAAe,CAAC,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,eAAe,CAAC,CAAC;QACpF,IAAI,aAAa,KAAK,oBAAoB,CAAC,KAAK;YAC9C,OAAO,EAAC,MAAM,EAAE,aAAa,EAAC,CAAC;QAEjC,gHAAgH;QAChH,OAAO,eAAe,CAAC,cAAc,CAAC,EAAC,GAAG,IAAI,EAAE,kBAAkB,EAAE,CAAC,OAAO,CAAC,EAAC,CAAC,CAAC;IAClF,CAAC;;AAxBsB,oCAAQ,GAAG,eAAe,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 } from \"@itwin/core-common\";\nimport { ArcGisUtilities, ImageryMapLayerFormat, MapLayerImageryProvider, MapLayerSource, MapLayerSourceStatus, MapLayerSourceValidation, ValidateSourceArgs } from \"@itwin/core-frontend\";\nimport { ArcGisFeatureProvider } from \"./ArcGisFeatureProvider\";\n\n/** @internal */\nexport class ArcGisFeatureMapLayerFormat extends ImageryMapLayerFormat {\n public static override formatId = \"ArcGISFeature\";\n public static override createImageryProvider(settings: ImageMapLayerSettings): MapLayerImageryProvider | undefined { return new ArcGisFeatureProvider(settings); }\n public static override async validateSource(url: string, userName?: string, password?: string, ignoreCache?: boolean): Promise<MapLayerSourceValidation> {\n const urlValidation = ArcGisUtilities.validateUrl(url, \"FeatureServer\");\n if (urlValidation !== MapLayerSourceStatus.Valid)\n return { status: urlValidation };\n\n const source = MapLayerSource.fromJSON({name: \"\", url, formatId: this.formatId});\n if (!source)\n return {status: MapLayerSourceStatus.InvalidFormat};\n source.userName = userName;\n source.password = password;\n\n return ArcGisUtilities.validateSource({source, capabilitiesFilter: [\"query\"], ignoreCache});\n }\n\n public static override async validate(args: ValidateSourceArgs): Promise<MapLayerSourceValidation> {\n\n const urlValidation = ArcGisUtilities.validateUrl(args.source.url, \"FeatureServer\");\n if (urlValidation !== MapLayerSourceStatus.Valid)\n return {status: urlValidation};\n\n // Some Map service supporting only tiles don't include the 'Map' capabilities, thus we can't make it mandatory.\n return ArcGisUtilities.validateSource({...args, capabilitiesFilter: [\"query\"]});\n }\n}\n"]}
@@ -1,8 +1,9 @@
1
1
  import { Cartographic, ImageMapLayerSettings, ImageSource } from "@itwin/core-common";
2
2
  import { Transform } from "@itwin/core-geometry";
3
3
  import { ArcGISImageryProvider, HitDetail, ImageryMapTileTree, MapFeatureInfoOptions, MapLayerFeatureInfo, QuadId } from "@itwin/core-frontend";
4
- import { ArcGisExtent, ArcGisFeatureFormat, ArcGisFeatureGeometryType, ArcGisFeatureResultType, ArcGisGeometry } from "./ArcGisFeatureQuery";
5
- import { EsriPMS, EsriSFS, EsriSLS } from "./EsriSymbology";
4
+ import { ArcGisExtent, ArcGisFeatureFormat, ArcGisFeatureResultType, ArcGisGeometry } from "./ArcGisFeatureQuery";
5
+ import { EsriPMS, EsriSFS, EsriSLS, EsriSLSProps, EsriSymbol } from "./EsriSymbology";
6
+ import { FeatureDefaultSymbology } from "../Feature/FeatureSymbology";
6
7
  /**
7
8
  * @internal
8
9
  */
@@ -10,6 +11,17 @@ interface ArcGisFeatureUrl {
10
11
  url: string;
11
12
  envelope?: ArcGisExtent;
12
13
  }
14
+ /**
15
+ * @internal
16
+ */
17
+ export declare class DefaultArcGiSymbology implements FeatureDefaultSymbology {
18
+ static readonly defaultPMS: EsriPMS;
19
+ static readonly defaultSLSProps: EsriSLSProps;
20
+ static readonly defaultSLS: EsriSLS;
21
+ static readonly defaultSFS: EsriSFS;
22
+ initialize(): Promise<void>;
23
+ getSymbology(geomType: string): EsriSymbol;
24
+ }
13
25
  /** Provide tiles from a ESRI ArcGIS Feature service
14
26
  * @internal
15
27
  */
@@ -25,17 +37,14 @@ export declare class ArcGisFeatureProvider extends ArcGISImageryProvider {
25
37
  private _minDepthFromLod;
26
38
  private _defaultSymbol;
27
39
  private _renderer;
40
+ private _symbologyRenderer;
28
41
  private static readonly _nbSubTiles;
29
42
  serviceJson: any;
30
- private static readonly defaultPMS;
31
- private static readonly defaultSLS;
32
- private static readonly defaultSFS;
33
43
  get minimumZoomLevel(): number;
34
44
  get maximumZoomLevel(): number;
35
45
  private static _extentCache;
36
46
  constructor(settings: ImageMapLayerSettings);
37
47
  initialize(): Promise<void>;
38
- static getDefaultSymbology(geomType: ArcGisFeatureGeometryType): EsriSFS | EsriSLS | EsriPMS | undefined;
39
48
  private fetchLayerExtent;
40
49
  private setCartoRangeFromExtentJson;
41
50
  protected getLayerMetadata(layerId: number): Promise<any>;
@@ -1 +1 @@
1
- {"version":3,"file":"ArcGisFeatureProvider.d.ts","sourceRoot":"","sources":["../../../src/ArcGisFeature/ArcGisFeatureProvider.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,EAAE,qBAAqB,EAAE,WAAW,EAAkC,MAAM,oBAAoB,CAAC;AAEtH,OAAO,EAA8B,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAC7E,OAAO,EAA2C,qBAAqB,EAA0C,SAAS,EAAE,kBAAkB,EAAqB,qBAAqB,EAAE,mBAAmB,EAAiC,MAAM,EAAqB,MAAM,sBAAsB,CAAC;AAEtS,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,yBAAyB,EAAsB,uBAAuB,EAAE,cAAc,EAAkC,MAAM,sBAAsB,CAAC;AAOjM,OAAO,EAAE,OAAO,EAA8B,OAAO,EAAgB,OAAO,EAA4B,MAAM,iBAAiB,CAAC;AAGhI;;EAEE;AACF,UAAU,gBAAgB;IACxB,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,YAAY,CAAC;CACzB;AAED;;EAEE;AACF,qBA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