PointCloudLayer-VJULXDN2.js 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326
  1. import {
  2. L,
  3. N
  4. } from "./chunk-DRPR56GA.js";
  5. import {
  6. a,
  7. a2,
  8. a3,
  9. d
  10. } from "./chunk-PFW4FYZV.js";
  11. import "./chunk-LX2NI53X.js";
  12. import "./chunk-IZUZZJS7.js";
  13. import "./chunk-56OWH4DC.js";
  14. import "./chunk-7B57NUGF.js";
  15. import {
  16. s as s3
  17. } from "./chunk-DN6W4TJU.js";
  18. import "./chunk-I4RYNNL6.js";
  19. import {
  20. i as i2
  21. } from "./chunk-WWXZOC2Y.js";
  22. import {
  23. p
  24. } from "./chunk-ZOKNWEG3.js";
  25. import {
  26. p as p2
  27. } from "./chunk-7C2KDOAI.js";
  28. import "./chunk-JPUFJK2B.js";
  29. import "./chunk-HZ2WKB3G.js";
  30. import {
  31. i4 as i,
  32. k
  33. } from "./chunk-P6VVVEX6.js";
  34. import "./chunk-JOYXMSKE.js";
  35. import "./chunk-SZFMKPVM.js";
  36. import "./chunk-JLSNMUQJ.js";
  37. import {
  38. y as y3
  39. } from "./chunk-JGBXYDGB.js";
  40. import "./chunk-QEWF7QPH.js";
  41. import "./chunk-TV3CFJQR.js";
  42. import {
  43. v
  44. } from "./chunk-JUWKPBLS.js";
  45. import {
  46. c as c2
  47. } from "./chunk-WLSB4F4I.js";
  48. import {
  49. c,
  50. d as d2,
  51. p as p3
  52. } from "./chunk-GLSWDDR3.js";
  53. import {
  54. O
  55. } from "./chunk-MIQGEDET.js";
  56. import "./chunk-DUEMJ5XS.js";
  57. import "./chunk-VRLXUHP2.js";
  58. import "./chunk-3LVSQLWJ.js";
  59. import "./chunk-4ONPMX2F.js";
  60. import "./chunk-CRGY2SDS.js";
  61. import "./chunk-4T5ZGMEN.js";
  62. import {
  63. t
  64. } from "./chunk-PLWDAYK7.js";
  65. import "./chunk-3RSFVUKZ.js";
  66. import "./chunk-X4SA4ELJ.js";
  67. import {
  68. r as r3
  69. } from "./chunk-5N7JLUJJ.js";
  70. import "./chunk-P3XKUGLS.js";
  71. import "./chunk-2ZSOO377.js";
  72. import "./chunk-YUA3AHKR.js";
  73. import "./chunk-LU5IJZB4.js";
  74. import "./chunk-7IBV2TRE.js";
  75. import "./chunk-ZLNEXZAN.js";
  76. import "./chunk-5UVJ64RB.js";
  77. import "./chunk-SFEFRQCL.js";
  78. import {
  79. b
  80. } from "./chunk-DXVOOCG4.js";
  81. import "./chunk-3GZSQU56.js";
  82. import "./chunk-ZYRIJWLX.js";
  83. import "./chunk-RYY6632W.js";
  84. import "./chunk-DW42UVIT.js";
  85. import "./chunk-YAEIHDJH.js";
  86. import "./chunk-TJNOJH33.js";
  87. import "./chunk-OSHI574D.js";
  88. import "./chunk-ETGAZ7LF.js";
  89. import "./chunk-75U5LM2V.js";
  90. import "./chunk-RMDDCMKS.js";
  91. import "./chunk-VCH45Q2I.js";
  92. import "./chunk-LBW34VZ2.js";
  93. import "./chunk-GSSTTHIT.js";
  94. import "./chunk-YFSLJIO4.js";
  95. import "./chunk-IM3LVQXV.js";
  96. import "./chunk-55RWC67C.js";
  97. import "./chunk-HZRKBTHJ.js";
  98. import {
  99. U
  100. } from "./chunk-DVUG3KID.js";
  101. import "./chunk-FWSQEIAR.js";
  102. import {
  103. G
  104. } from "./chunk-VEGAOVMY.js";
  105. import {
  106. o as o2
  107. } from "./chunk-6T6G6LCQ.js";
  108. import "./chunk-YEJL5NEF.js";
  109. import {
  110. r as r2
  111. } from "./chunk-PQFTYGF5.js";
  112. import {
  113. e,
  114. l3 as l,
  115. n5 as n,
  116. y3 as y2
  117. } from "./chunk-2Z2TG5CU.js";
  118. import "./chunk-6KZ2LTDA.js";
  119. import "./chunk-U2XHEJM7.js";
  120. import {
  121. T
  122. } from "./chunk-SQOPWYIT.js";
  123. import {
  124. w
  125. } from "./chunk-V6P2MAQQ.js";
  126. import {
  127. s2 as s,
  128. s3 as s2
  129. } from "./chunk-E5O6P5I2.js";
  130. import {
  131. o,
  132. y
  133. } from "./chunk-SPWQ3AWG.js";
  134. import "./chunk-2TIUKVZN.js";
  135. import {
  136. r
  137. } from "./chunk-YXWMMD76.js";
  138. import "./chunk-S5KM4IGW.js";
  139. // node_modules/@arcgis/core/layers/pointCloudFilters/PointCloudFilter.js
  140. var t2 = class extends l {
  141. constructor(r4) {
  142. super(r4), this.field = null, this.type = null;
  143. }
  144. clone() {
  145. return console.warn(".clone() is not implemented for " + this.declaredClass), null;
  146. }
  147. };
  148. e([y2({ type: String, json: { write: { enabled: true, isRequired: true } } })], t2.prototype, "field", void 0), e([y2({ readOnly: true, nonNullable: true, json: { read: false } })], t2.prototype, "type", void 0), t2 = e([n("esri.layers.pointCloudFilters.PointCloudFilter")], t2);
  149. var l2 = t2;
  150. // node_modules/@arcgis/core/layers/pointCloudFilters/PointCloudBitfieldFilter.js
  151. var d3;
  152. var p4 = d3 = class extends l2 {
  153. constructor(e3) {
  154. super(e3), this.requiredClearBits = null, this.requiredSetBits = null, this.type = "bitfield";
  155. }
  156. clone() {
  157. return new d3({ field: this.field, requiredClearBits: y(this.requiredClearBits), requiredSetBits: y(this.requiredSetBits) });
  158. }
  159. };
  160. e([y2({ type: [T], json: { write: { enabled: true, overridePolicy() {
  161. return { enabled: true, isRequired: !this.requiredSetBits };
  162. } } } })], p4.prototype, "requiredClearBits", void 0), e([y2({ type: [T], json: { write: { enabled: true, overridePolicy() {
  163. return { enabled: true, isRequired: !this.requiredClearBits };
  164. } } } })], p4.prototype, "requiredSetBits", void 0), e([r3({ pointCloudBitfieldFilter: "bitfield" })], p4.prototype, "type", void 0), p4 = d3 = e([n("esri.layers.pointCloudFilters.PointCloudBitfieldFilter")], p4);
  165. var u = p4;
  166. // node_modules/@arcgis/core/layers/pointCloudFilters/PointCloudReturnFilter.js
  167. var n2;
  168. var p5 = n2 = class extends l2 {
  169. constructor(r4) {
  170. super(r4), this.includedReturns = [], this.type = "return";
  171. }
  172. clone() {
  173. return new n2({ field: this.field, includedReturns: y(this.includedReturns) });
  174. }
  175. };
  176. e([y2({ type: [["firstOfMany", "last", "lastOfMany", "single"]], json: { write: { enabled: true, isRequired: true } } })], p5.prototype, "includedReturns", void 0), e([r3({ pointCloudReturnFilter: "return" })], p5.prototype, "type", void 0), p5 = n2 = e([n("esri.layers.pointCloudFilters.PointCloudReturnFilter")], p5);
  177. var u2 = p5;
  178. // node_modules/@arcgis/core/layers/pointCloudFilters/PointCloudValueFilter.js
  179. var p6;
  180. var l3 = p6 = class extends l2 {
  181. constructor(e3) {
  182. super(e3), this.mode = "exclude", this.type = "value", this.values = [];
  183. }
  184. clone() {
  185. return new p6({ field: this.field, mode: this.mode, values: y(this.values) });
  186. }
  187. };
  188. e([y2({ type: ["exclude", "include"], json: { write: { enabled: true, isRequired: true } } })], l3.prototype, "mode", void 0), e([r3({ pointCloudValueFilter: "value" })], l3.prototype, "type", void 0), e([y2({ type: [Number], json: { write: { enabled: true, isRequired: true } } })], l3.prototype, "values", void 0), l3 = p6 = e([n("esri.layers.pointCloudFilters.PointCloudValueFilter")], l3);
  189. var u3 = l3;
  190. // node_modules/@arcgis/core/layers/pointCloudFilters/typeUtils.js
  191. var e2 = { key: "type", base: l2, typeMap: { value: u3, bitfield: u, return: u2 } };
  192. // node_modules/@arcgis/core/renderers/PointCloudRGBRenderer.js
  193. var i3;
  194. var c3 = i3 = class extends a {
  195. constructor(r4) {
  196. super(r4), this.type = "point-cloud-rgb", this.field = null;
  197. }
  198. clone() {
  199. return new i3({ ...this.cloneProperties(), field: y(this.field) });
  200. }
  201. };
  202. e([r3({ pointCloudRGBRenderer: "point-cloud-rgb" })], c3.prototype, "type", void 0), e([y2({ type: String, json: { write: true } })], c3.prototype, "field", void 0), c3 = i3 = e([n("esri.renderers.PointCloudRGBRenderer")], c3);
  203. var n3 = c3;
  204. // node_modules/@arcgis/core/renderers/support/pointCloud/typeUtils.js
  205. var i4 = { key: "type", base: a, typeMap: { "point-cloud-class-breaks": d, "point-cloud-rgb": n3, "point-cloud-stretch": a2, "point-cloud-unique-value": a3 }, errorContext: "renderer" };
  206. // node_modules/@arcgis/core/layers/PointCloudLayer.js
  207. var A = s3();
  208. var N2 = class extends N(p(c2(v(t(O(i2(b))))))) {
  209. constructor(...e3) {
  210. 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";
  211. }
  212. normalizeCtorArgs(e3, r4) {
  213. return "string" == typeof e3 ? { url: e3, ...r4 } : e3;
  214. }
  215. get defaultPopupTemplate() {
  216. return this.attributeStorageInfo ? this.createPopupTemplate() : null;
  217. }
  218. getFieldDomain(e3) {
  219. const r4 = this.fieldsIndex.get(e3);
  220. return r4 && r4.domain ? r4.domain : null;
  221. }
  222. readServiceFields(e3, r4, t3) {
  223. return Array.isArray(e3) ? e3.map((e4) => {
  224. const r5 = new y3();
  225. return "FieldTypeInteger" === e4.type && ((e4 = y(e4)).type = "esriFieldTypeInteger"), r5.read(e4, t3), r5;
  226. }) : Array.isArray(r4.attributeStorageInfo) ? r4.attributeStorageInfo.map((e4) => new y3({ name: e4.name, type: "ELEVATION" === e4.name ? "double" : "integer" })) : null;
  227. }
  228. set elevationInfo(e3) {
  229. this._set("elevationInfo", e3), this._validateElevationInfo();
  230. }
  231. writeRenderer(e3, r4, t3, o3) {
  232. o("layerDefinition.drawingInfo.renderer", e3.write({}, o3), r4);
  233. }
  234. load(e3) {
  235. const r4 = r(e3) ? e3.signal : null, t3 = this.loadFromPortal({ supportedTypes: ["Scene Service"] }, e3).catch(w).then(() => this._fetchService(r4));
  236. return this.addResolvingPromise(t3), Promise.resolve(this);
  237. }
  238. createPopupTemplate(e3) {
  239. const r4 = p2(this, e3);
  240. return r4 && (this._formatPopupTemplateReturnsField(r4), this._formatPopupTemplateRGBField(r4)), r4;
  241. }
  242. _formatPopupTemplateReturnsField(e3) {
  243. var _a;
  244. const r4 = this.fieldsIndex.get("RETURNS");
  245. if (!r4)
  246. return;
  247. const t3 = (_a = e3.fieldInfos) == null ? void 0 : _a.find((e4) => e4.fieldName === r4.name);
  248. if (!t3)
  249. return;
  250. const o3 = new i({ name: "pcl-returns-decoded", title: r4.alias || r4.name, expression: `
  251. var returnValue = $feature.${r4.name};
  252. return (returnValue % 16) + " / " + Floor(returnValue / 16);
  253. ` });
  254. e3.expressionInfos = [...e3.expressionInfos || [], o3], t3.fieldName = "expression/pcl-returns-decoded";
  255. }
  256. _formatPopupTemplateRGBField(e3) {
  257. var _a;
  258. const r4 = this.fieldsIndex.get("RGB");
  259. if (!r4)
  260. return;
  261. const t3 = (_a = e3.fieldInfos) == null ? void 0 : _a.find((e4) => e4.fieldName === r4.name);
  262. if (!t3)
  263. return;
  264. const o3 = new i({ name: "pcl-rgb-decoded", title: r4.alias || r4.name, expression: `
  265. var rgb = $feature.${r4.name};
  266. var red = Floor(rgb / 65536, 0);
  267. var green = Floor((rgb - (red * 65536)) / 256,0);
  268. var blue = rgb - (red * 65536) - (green * 256);
  269. return "rgb(" + red + "," + green + "," + blue + ")";
  270. ` });
  271. e3.expressionInfos = [...e3.expressionInfos || [], o3], t3.fieldName = "expression/pcl-rgb-decoded";
  272. }
  273. async queryCachedStatistics(e3, r4) {
  274. if (await this.load(r4), !this.attributeStorageInfo)
  275. throw new s2("scenelayer:no-cached-statistics", "Cached statistics are not available for this layer");
  276. const i5 = this.fieldsIndex.get(e3);
  277. if (!i5)
  278. throw new s2("pointcloudlayer:field-unexisting", `Field '${e3}' does not exist on the layer`);
  279. for (const o3 of this.attributeStorageInfo)
  280. if (o3.name === i5.name) {
  281. const e4 = G(this.parsedUrl.path, `./statistics/${o3.key}`);
  282. return U(e4, { query: { f: "json", token: this.apiKey }, responseType: "json", signal: r4 ? r4.signal : null }).then((e5) => e5.data);
  283. }
  284. throw new s2("pointcloudlayer:no-cached-statistics", "Cached statistics for this attribute are not available");
  285. }
  286. async saveAs(e3, r4) {
  287. return this._debouncedSaveOperations(L.SAVE_AS, { ...r4, getTypeKeywords: () => this._getTypeKeywords(), portalItemLayerType: "point-cloud" }, e3);
  288. }
  289. async save() {
  290. const e3 = { getTypeKeywords: () => this._getTypeKeywords(), portalItemLayerType: "point-cloud" };
  291. return this._debouncedSaveOperations(L.SAVE, e3);
  292. }
  293. validateLayer(e3) {
  294. if (e3.layerType && "PointCloud" !== e3.layerType)
  295. throw new s2("pointcloudlayer:layer-type-not-supported", "PointCloudLayer does not support this layer type", { layerType: e3.layerType });
  296. if (isNaN(this.version.major) || isNaN(this.version.minor))
  297. throw new s2("layer:service-version-not-supported", "Service version is not supported.", { serviceVersion: this.version.versionString, supportedVersions: "1.x-2.x" });
  298. if (this.version.major > 2)
  299. throw new s2("layer:service-version-too-new", "Service version is too new.", { serviceVersion: this.version.versionString, supportedVersions: "1.x-2.x" });
  300. }
  301. hasCachedStatistics(e3) {
  302. return null != this.attributeStorageInfo && this.attributeStorageInfo.some((r4) => r4.name === e3);
  303. }
  304. _getTypeKeywords() {
  305. return ["PointCloud"];
  306. }
  307. _validateElevationInfo() {
  308. const e3 = this.elevationInfo;
  309. e3 && ("absolute-height" !== e3.mode && s.getLogger(this.declaredClass).warn(".elevationInfo=", "Point cloud layers only support absolute-height elevation mode"), e3.featureExpressionInfo && "0" !== e3.featureExpressionInfo.expression && s.getLogger(this.declaredClass).warn(".elevationInfo=", "Point cloud layers do not support featureExpressionInfo"));
  310. }
  311. };
  312. e([y2({ type: ["PointCloudLayer"] })], N2.prototype, "operationalLayerType", void 0), e([y2(p3)], N2.prototype, "popupEnabled", void 0), e([y2({ type: k, json: { name: "popupInfo", write: true } })], N2.prototype, "popupTemplate", void 0), e([y2({ readOnly: true, json: { read: false } })], N2.prototype, "defaultPopupTemplate", null), e([y2({ readOnly: true, json: { write: false, read: false, origins: { "web-document": { write: false, read: false } } } })], N2.prototype, "opacity", void 0), e([y2({ type: ["show", "hide"] })], N2.prototype, "listMode", void 0), e([y2({ types: [e2], json: { origins: { service: { read: { source: "filters" } } }, name: "layerDefinition.filters", write: true } })], N2.prototype, "filters", void 0), e([y2({ type: [y3] })], N2.prototype, "fields", void 0), e([y2(A.fieldsIndex)], N2.prototype, "fieldsIndex", void 0), e([o2("service", "fields", ["fields", "attributeStorageInfo"])], N2.prototype, "readServiceFields", null), e([y2(A.outFields)], N2.prototype, "outFields", void 0), e([y2({ readOnly: true })], N2.prototype, "attributeStorageInfo", void 0), e([y2(d2)], N2.prototype, "elevationInfo", null), e([y2({ type: String, json: { origins: { "web-scene": { read: true, write: true }, "portal-item": { read: true, write: true } }, read: false } })], N2.prototype, "path", void 0), e([y2(c)], N2.prototype, "legendEnabled", void 0), e([y2({ 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 } } } } })], N2.prototype, "renderer", void 0), e([r2("renderer")], N2.prototype, "writeRenderer", null), e([y2({ json: { read: false }, readOnly: true })], N2.prototype, "type", void 0), N2 = e([n("esri.layers.PointCloudLayer")], N2);
  313. var R = N2;
  314. export {
  315. R as default
  316. };
  317. //# sourceMappingURL=PointCloudLayer-VJULXDN2.js.map