PointCloudLayer-VRRXFWIB.js 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319
  1. import {
  2. a,
  3. a2,
  4. a3,
  5. d as d4
  6. } from "./chunk-PFG2S2HL.js";
  7. import {
  8. A,
  9. K
  10. } from "./chunk-C62PEMUB.js";
  11. import "./chunk-5ZZSM3DU.js";
  12. import "./chunk-BQ7UE3XL.js";
  13. import "./chunk-UILPRJKY.js";
  14. import "./chunk-524XACB7.js";
  15. import {
  16. l as l2
  17. } from "./chunk-ZRX5UNQH.js";
  18. import "./chunk-QY775BFA.js";
  19. import {
  20. i
  21. } from "./chunk-FMKGHOGD.js";
  22. import {
  23. p as p2
  24. } from "./chunk-6URTNEGN.js";
  25. import {
  26. d as d3
  27. } from "./chunk-MFI6BALW.js";
  28. import "./chunk-MFUAILAT.js";
  29. import "./chunk-HZJYXMI6.js";
  30. import {
  31. B,
  32. i4 as i2
  33. } from "./chunk-PUSPZYFZ.js";
  34. import "./chunk-X7DBH4KK.js";
  35. import "./chunk-KMAHKQ2G.js";
  36. import "./chunk-PIGRDDRG.js";
  37. import {
  38. y
  39. } from "./chunk-BJHM4JNS.js";
  40. import "./chunk-F6A2QQ26.js";
  41. import "./chunk-7XXXCK2A.js";
  42. import {
  43. r as r3
  44. } from "./chunk-7ZIDBK7B.js";
  45. import {
  46. v
  47. } from "./chunk-KHA63LLS.js";
  48. import {
  49. c as c2
  50. } from "./chunk-FGKNEJKJ.js";
  51. import {
  52. c,
  53. d as d2,
  54. p
  55. } from "./chunk-PSV473TI.js";
  56. import {
  57. O
  58. } from "./chunk-I3OBGWNS.js";
  59. import "./chunk-FONIFA5N.js";
  60. import "./chunk-EG5OI4V4.js";
  61. import "./chunk-65BYCSII.js";
  62. import "./chunk-WZQZRKNH.js";
  63. import "./chunk-LRDX4TO7.js";
  64. import "./chunk-6A4U74YA.js";
  65. import {
  66. t
  67. } from "./chunk-W72F6AS3.js";
  68. import "./chunk-O4FY3ITT.js";
  69. import {
  70. b
  71. } from "./chunk-4DDBH2K5.js";
  72. import "./chunk-7N4X6GF3.js";
  73. import "./chunk-JXW4QTJA.js";
  74. import "./chunk-UXF37FQ4.js";
  75. import "./chunk-ZOEK6QHJ.js";
  76. import "./chunk-XNLG7T2T.js";
  77. import "./chunk-IR4PV7VK.js";
  78. import "./chunk-2Z6LERTI.js";
  79. import "./chunk-OWVBLVP3.js";
  80. import "./chunk-EGZW6HC3.js";
  81. import "./chunk-4NKD334K.js";
  82. import "./chunk-65K7LC56.js";
  83. import "./chunk-ATPLLI5W.js";
  84. import "./chunk-WJ3OEUD3.js";
  85. import "./chunk-MXB2XLKV.js";
  86. import "./chunk-XH7RUGVZ.js";
  87. import "./chunk-TBBTRX4O.js";
  88. import "./chunk-YBSUITLL.js";
  89. import "./chunk-ALDCDSPV.js";
  90. import "./chunk-DT6EAZQ5.js";
  91. import "./chunk-HNOZUNJ4.js";
  92. import {
  93. U
  94. } from "./chunk-VNFRAYHO.js";
  95. import "./chunk-R5IG2D6H.js";
  96. import {
  97. G
  98. } from "./chunk-VBRY5KJM.js";
  99. import "./chunk-PDKDCAAD.js";
  100. import {
  101. o as o2
  102. } from "./chunk-ECW2QABR.js";
  103. import "./chunk-GCDJLKH4.js";
  104. import {
  105. r as r2
  106. } from "./chunk-MRJEICT6.js";
  107. import {
  108. d,
  109. e,
  110. l3 as l,
  111. n2 as n
  112. } from "./chunk-Y3WMVFTW.js";
  113. import "./chunk-SAS7RONY.js";
  114. import "./chunk-WSRBH7BF.js";
  115. import {
  116. S
  117. } from "./chunk-IHXECKQQ.js";
  118. import {
  119. w
  120. } from "./chunk-ULGDPLM2.js";
  121. import {
  122. s,
  123. s3 as s2
  124. } from "./chunk-EMJ4ZSM2.js";
  125. import {
  126. m,
  127. o
  128. } from "./chunk-IKP3YN53.js";
  129. import {
  130. r
  131. } from "./chunk-GZT4BVFP.js";
  132. import "./chunk-A5ICIBVI.js";
  133. // node_modules/@arcgis/core/layers/pointCloudFilters/PointCloudFilter.js
  134. var t2 = class extends l {
  135. constructor(r4) {
  136. super(r4), this.field = null, this.type = null;
  137. }
  138. clone() {
  139. return console.warn(".clone() is not implemented for " + this.declaredClass), null;
  140. }
  141. };
  142. e([d({ type: String, json: { write: { enabled: true, isRequired: true } } })], t2.prototype, "field", void 0), e([d({ readOnly: true, nonNullable: true, json: { read: false } })], t2.prototype, "type", void 0), t2 = e([n("esri.layers.pointCloudFilters.PointCloudFilter")], t2);
  143. var l3 = t2;
  144. // node_modules/@arcgis/core/layers/pointCloudFilters/PointCloudBitfieldFilter.js
  145. var d5;
  146. var p3 = d5 = class extends l3 {
  147. constructor(e3) {
  148. super(e3), this.requiredClearBits = null, this.requiredSetBits = null, this.type = "bitfield";
  149. }
  150. clone() {
  151. return new d5({ field: this.field, requiredClearBits: m(this.requiredClearBits), requiredSetBits: m(this.requiredSetBits) });
  152. }
  153. };
  154. e([d({ type: [S], json: { write: { enabled: true, overridePolicy() {
  155. return { enabled: true, isRequired: !this.requiredSetBits };
  156. } } } })], p3.prototype, "requiredClearBits", void 0), e([d({ type: [S], json: { write: { enabled: true, overridePolicy() {
  157. return { enabled: true, isRequired: !this.requiredClearBits };
  158. } } } })], p3.prototype, "requiredSetBits", void 0), e([r3({ pointCloudBitfieldFilter: "bitfield" })], p3.prototype, "type", void 0), p3 = d5 = e([n("esri.layers.pointCloudFilters.PointCloudBitfieldFilter")], p3);
  159. var u = p3;
  160. // node_modules/@arcgis/core/layers/pointCloudFilters/PointCloudReturnFilter.js
  161. var n2;
  162. var p4 = n2 = class extends l3 {
  163. constructor(r4) {
  164. super(r4), this.includedReturns = [], this.type = "return";
  165. }
  166. clone() {
  167. return new n2({ field: this.field, includedReturns: m(this.includedReturns) });
  168. }
  169. };
  170. e([d({ type: [["firstOfMany", "last", "lastOfMany", "single"]], json: { write: { enabled: true, isRequired: true } } })], p4.prototype, "includedReturns", void 0), e([r3({ pointCloudReturnFilter: "return" })], p4.prototype, "type", void 0), p4 = n2 = e([n("esri.layers.pointCloudFilters.PointCloudReturnFilter")], p4);
  171. var u2 = p4;
  172. // node_modules/@arcgis/core/layers/pointCloudFilters/PointCloudValueFilter.js
  173. var p5;
  174. var l4 = p5 = class extends l3 {
  175. constructor(e3) {
  176. super(e3), this.mode = "exclude", this.type = "value", this.values = [];
  177. }
  178. clone() {
  179. return new p5({ field: this.field, mode: this.mode, values: m(this.values) });
  180. }
  181. };
  182. e([d({ type: ["exclude", "include"], json: { write: { enabled: true, isRequired: true } } })], l4.prototype, "mode", void 0), e([r3({ pointCloudValueFilter: "value" })], l4.prototype, "type", void 0), e([d({ type: [Number], json: { write: { enabled: true, isRequired: true } } })], l4.prototype, "values", void 0), l4 = p5 = e([n("esri.layers.pointCloudFilters.PointCloudValueFilter")], l4);
  183. var u3 = l4;
  184. // node_modules/@arcgis/core/layers/pointCloudFilters/typeUtils.js
  185. var e2 = { key: "type", base: l3, typeMap: { value: u3, bitfield: u, return: u2 } };
  186. // node_modules/@arcgis/core/renderers/PointCloudRGBRenderer.js
  187. var i3;
  188. var c3 = i3 = class extends a {
  189. constructor(r4) {
  190. super(r4), this.type = "point-cloud-rgb", this.field = null;
  191. }
  192. clone() {
  193. return new i3({ ...this.cloneProperties(), field: m(this.field) });
  194. }
  195. };
  196. e([r3({ pointCloudRGBRenderer: "point-cloud-rgb" })], c3.prototype, "type", void 0), e([d({ type: String, json: { write: true } })], c3.prototype, "field", void 0), c3 = i3 = e([n("esri.renderers.PointCloudRGBRenderer")], c3);
  197. var n3 = c3;
  198. // node_modules/@arcgis/core/renderers/support/pointCloud/typeUtils.js
  199. var i4 = { key: "type", base: a, typeMap: { "point-cloud-class-breaks": d4, "point-cloud-rgb": n3, "point-cloud-stretch": a2, "point-cloud-unique-value": a3 }, errorContext: "renderer" };
  200. // node_modules/@arcgis/core/layers/PointCloudLayer.js
  201. var A2 = s.getLogger("esri.layers.PointCloudLayer");
  202. var N = l2();
  203. var R = class extends A(p2(c2(v(t(O(i(b))))))) {
  204. constructor(...e3) {
  205. super(...e3), this.operationalLayerType = "PointCloudLayer", this.popupEnabled = true, this.popupTemplate = null, this.opacity = 1, this.filters = [], this.fields = null, this.fieldsIndex = null, this.outFields = null, this.path = null, this.legendEnabled = true, this.renderer = null, this.type = "point-cloud";
  206. }
  207. normalizeCtorArgs(e3, r4) {
  208. return typeof e3 == "string" ? { url: e3, ...r4 } : e3;
  209. }
  210. get defaultPopupTemplate() {
  211. return this.attributeStorageInfo ? this.createPopupTemplate() : null;
  212. }
  213. getFieldDomain(e3) {
  214. const r4 = this.fieldsIndex.get(e3);
  215. return r4 && r4.domain ? r4.domain : null;
  216. }
  217. readServiceFields(e3, r4, t3) {
  218. return Array.isArray(e3) ? e3.map((e4) => {
  219. const r5 = new y();
  220. return e4.type === "FieldTypeInteger" && ((e4 = m(e4)).type = "esriFieldTypeInteger"), r5.read(e4, t3), r5;
  221. }) : Array.isArray(r4.attributeStorageInfo) ? r4.attributeStorageInfo.map((e4) => new y({ name: e4.name, type: e4.name === "ELEVATION" ? "double" : "integer" })) : null;
  222. }
  223. set elevationInfo(e3) {
  224. this._set("elevationInfo", e3), this._validateElevationInfo();
  225. }
  226. writeRenderer(e3, r4, t3, o3) {
  227. o("layerDefinition.drawingInfo.renderer", e3.write({}, o3), r4);
  228. }
  229. load(e3) {
  230. const r4 = r(e3) ? e3.signal : null, t3 = this.loadFromPortal({ supportedTypes: ["Scene Service"] }, e3).catch(w).then(() => this._fetchService(r4));
  231. return this.addResolvingPromise(t3), Promise.resolve(this);
  232. }
  233. createPopupTemplate(e3) {
  234. const r4 = d3(this, e3);
  235. return this._formatPopupTemplateReturnsField(r4), this._formatPopupTemplateRGBField(r4), r4;
  236. }
  237. _formatPopupTemplateReturnsField(e3) {
  238. const r4 = this.fieldsIndex.get("RETURNS");
  239. if (!r4)
  240. return;
  241. const t3 = e3.fieldInfos.find((e4) => e4.fieldName === r4.name);
  242. if (!t3)
  243. return;
  244. const o3 = new i2({ name: "pcl-returns-decoded", title: r4.alias || r4.name, expression: `
  245. var returnValue = $feature.${r4.name};
  246. return (returnValue % 16) + " / " + Floor(returnValue / 16);
  247. ` });
  248. e3.expressionInfos = [...e3.expressionInfos || [], o3], t3.fieldName = "expression/pcl-returns-decoded";
  249. }
  250. _formatPopupTemplateRGBField(e3) {
  251. const r4 = this.fieldsIndex.get("RGB");
  252. if (!r4)
  253. return;
  254. const t3 = e3.fieldInfos.find((e4) => e4.fieldName === r4.name);
  255. if (!t3)
  256. return;
  257. const o3 = new i2({ name: "pcl-rgb-decoded", title: r4.alias || r4.name, expression: `
  258. var rgb = $feature.${r4.name};
  259. var red = Floor(rgb / 65536, 0);
  260. var green = Floor((rgb - (red * 65536)) / 256,0);
  261. var blue = rgb - (red * 65536) - (green * 256);
  262. return "rgb(" + red + "," + green + "," + blue + ")";
  263. ` });
  264. e3.expressionInfos = [...e3.expressionInfos || [], o3], t3.fieldName = "expression/pcl-rgb-decoded";
  265. }
  266. async queryCachedStatistics(e3, r4) {
  267. if (await this.load(r4), !this.attributeStorageInfo)
  268. throw new s2("scenelayer:no-cached-statistics", "Cached statistics are not available for this layer");
  269. const i5 = this.fieldsIndex.get(e3);
  270. if (!i5)
  271. throw new s2("pointcloudlayer:field-unexisting", `Field '${e3}' does not exist on the layer`);
  272. for (const o3 of this.attributeStorageInfo)
  273. if (o3.name === i5.name) {
  274. const e4 = G(this.parsedUrl.path, `./statistics/${o3.key}`);
  275. return U(e4, { query: { f: "json", token: this.apiKey }, responseType: "json", signal: r4 ? r4.signal : null }).then((e5) => e5.data);
  276. }
  277. throw new s2("pointcloudlayer:no-cached-statistics", "Cached statistics for this attribute are not available");
  278. }
  279. async saveAs(e3, r4) {
  280. return this._debouncedSaveOperations(K.SAVE_AS, { ...r4, getTypeKeywords: () => this._getTypeKeywords(), portalItemLayerType: "point-cloud" }, e3);
  281. }
  282. async save() {
  283. const e3 = { getTypeKeywords: () => this._getTypeKeywords(), portalItemLayerType: "point-cloud" };
  284. return this._debouncedSaveOperations(K.SAVE, e3);
  285. }
  286. validateLayer(e3) {
  287. if (e3.layerType && e3.layerType !== "PointCloud")
  288. throw new s2("pointcloudlayer:layer-type-not-supported", "PointCloudLayer does not support this layer type", { layerType: e3.layerType });
  289. if (isNaN(this.version.major) || isNaN(this.version.minor))
  290. throw new s2("layer:service-version-not-supported", "Service version is not supported.", { serviceVersion: this.version.versionString, supportedVersions: "1.x-2.x" });
  291. if (this.version.major > 2)
  292. throw new s2("layer:service-version-too-new", "Service version is too new.", { serviceVersion: this.version.versionString, supportedVersions: "1.x-2.x" });
  293. }
  294. hasCachedStatistics(e3) {
  295. return this.attributeStorageInfo != null && this.attributeStorageInfo.some((r4) => r4.name === e3);
  296. }
  297. _getTypeKeywords() {
  298. return ["PointCloud"];
  299. }
  300. _validateElevationInfo() {
  301. const e3 = this.elevationInfo;
  302. e3 && (e3.mode !== "absolute-height" && A2.warn(".elevationInfo=", "Point cloud layers only support absolute-height elevation mode"), e3.featureExpressionInfo && e3.featureExpressionInfo.expression !== "0" && A2.warn(".elevationInfo=", "Point cloud layers do not support featureExpressionInfo"));
  303. }
  304. };
  305. e([d({ type: ["PointCloudLayer"] })], R.prototype, "operationalLayerType", void 0), e([d(p)], R.prototype, "popupEnabled", void 0), e([d({ type: B, json: { name: "popupInfo", write: true } })], R.prototype, "popupTemplate", void 0), e([d({ readOnly: true, json: { read: false } })], R.prototype, "defaultPopupTemplate", null), e([d({ readOnly: true, json: { write: false, read: false, origins: { "web-document": { write: false, read: false } } } })], R.prototype, "opacity", void 0), e([d({ type: ["show", "hide"] })], R.prototype, "listMode", void 0), e([d({ types: [e2], json: { origins: { service: { read: { source: "filters" } } }, name: "layerDefinition.filters", write: true } })], R.prototype, "filters", void 0), e([d({ type: [y] })], R.prototype, "fields", void 0), e([d(N.fieldsIndex)], R.prototype, "fieldsIndex", void 0), e([o2("service", "fields", ["fields", "attributeStorageInfo"])], R.prototype, "readServiceFields", null), e([d(N.outFields)], R.prototype, "outFields", void 0), e([d({ readOnly: true })], R.prototype, "attributeStorageInfo", void 0), e([d(d2)], R.prototype, "elevationInfo", null), e([d({ type: String, json: { origins: { "web-scene": { read: true, write: true }, "portal-item": { read: true, write: true } }, read: false } })], R.prototype, "path", void 0), e([d(c)], R.prototype, "legendEnabled", void 0), e([d({ types: i4, json: { origins: { service: { read: { source: "drawingInfo.renderer" } } }, name: "layerDefinition.drawingInfo.renderer", write: { target: { "layerDefinition.drawingInfo.renderer": { types: i4 }, "layerDefinition.drawingInfo.transparency": { type: Number } } } } })], R.prototype, "renderer", void 0), e([r2("renderer")], R.prototype, "writeRenderer", null), e([d({ json: { read: false }, readOnly: true })], R.prototype, "type", void 0), R = e([n("esri.layers.PointCloudLayer")], R);
  306. var O2 = R;
  307. export {
  308. O2 as default
  309. };
  310. //# sourceMappingURL=PointCloudLayer-VRRXFWIB.js.map