ElevationLayer-QUSPD7CU.js 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241
  1. import {
  2. v
  3. } from "./chunk-6SHVYOIM.js";
  4. import {
  5. u
  6. } from "./chunk-7FZX4UI7.js";
  7. import "./chunk-IR3DRB65.js";
  8. import "./chunk-6334AFGG.js";
  9. import "./chunk-FM5OVTDI.js";
  10. import {
  11. s as s3
  12. } from "./chunk-JXDT22MC.js";
  13. import "./chunk-VM66JY35.js";
  14. import "./chunk-OJ2HHY2O.js";
  15. import {
  16. p
  17. } from "./chunk-BFKFNCQC.js";
  18. import "./chunk-SZFMKPVM.js";
  19. import "./chunk-EY2WJSAJ.js";
  20. import "./chunk-RDMCXRET.js";
  21. import "./chunk-73AMYZFU.js";
  22. import "./chunk-TV3CFJQR.js";
  23. import "./chunk-BWATQC2Y.js";
  24. import "./chunk-6URCZZA6.js";
  25. import "./chunk-U2WD23Z5.js";
  26. import {
  27. v as v2
  28. } from "./chunk-2DSTZVND.js";
  29. import {
  30. c
  31. } from "./chunk-VXKIGGM4.js";
  32. import {
  33. f as f2
  34. } from "./chunk-KG45D2XL.js";
  35. import {
  36. O
  37. } from "./chunk-JYRZQPQI.js";
  38. import "./chunk-3HZQM2NK.js";
  39. import "./chunk-AR2YN3E2.js";
  40. import "./chunk-U3LEOWJX.js";
  41. import "./chunk-4ONPMX2F.js";
  42. import "./chunk-47NSA4T4.js";
  43. import "./chunk-FUODOQDM.js";
  44. import "./chunk-SWMSD4RP.js";
  45. import "./chunk-UKEN2UNL.js";
  46. import "./chunk-HWSWTWZD.js";
  47. import "./chunk-P3XKUGLS.js";
  48. import "./chunk-PIFOHNWC.js";
  49. import "./chunk-LLO7GCYU.js";
  50. import "./chunk-U7RKABRB.js";
  51. import "./chunk-X7CNGECX.js";
  52. import "./chunk-PSEI52P3.js";
  53. import "./chunk-ZLNEXZAN.js";
  54. import "./chunk-5UVJ64RB.js";
  55. import {
  56. b
  57. } from "./chunk-O43KLDSX.js";
  58. import "./chunk-AUOH2VSO.js";
  59. import "./chunk-RYY6632W.js";
  60. import "./chunk-DW42UVIT.js";
  61. import "./chunk-TJNOJH33.js";
  62. import "./chunk-YAEIHDJH.js";
  63. import "./chunk-OSHI574D.js";
  64. import "./chunk-44GMIOGP.js";
  65. import "./chunk-75U5LM2V.js";
  66. import "./chunk-ZHRAUKVQ.js";
  67. import "./chunk-RZK6A2GY.js";
  68. import "./chunk-BDA6VH2A.js";
  69. import "./chunk-Z4JTBD7M.js";
  70. import "./chunk-MSBIHK67.js";
  71. import "./chunk-HZRKBTHJ.js";
  72. import {
  73. U
  74. } from "./chunk-5DMBXPN2.js";
  75. import "./chunk-QANZ6BFY.js";
  76. import {
  77. I
  78. } from "./chunk-VEGAOVMY.js";
  79. import {
  80. o
  81. } from "./chunk-CXCDYJ5R.js";
  82. import "./chunk-GAOW3WRZ.js";
  83. import "./chunk-QCKFNSN2.js";
  84. import {
  85. e,
  86. n2 as n,
  87. n5 as n2,
  88. y3 as y
  89. } from "./chunk-6SOHRC7T.js";
  90. import "./chunk-U2XHEJM7.js";
  91. import "./chunk-SQOPWYIT.js";
  92. import "./chunk-6KZ2LTDA.js";
  93. import {
  94. f,
  95. w as w2
  96. } from "./chunk-V6P2MAQQ.js";
  97. import {
  98. s2 as s,
  99. s3 as s2
  100. } from "./chunk-E5O6P5I2.js";
  101. import "./chunk-SPWQ3AWG.js";
  102. import {
  103. C
  104. } from "./chunk-2TIUKVZN.js";
  105. import {
  106. e as e2,
  107. r,
  108. w
  109. } from "./chunk-YXWMMD76.js";
  110. import "./chunk-S5KM4IGW.js";
  111. // node_modules/@arcgis/core/core/workers/WorkerHandle.js
  112. var h = class {
  113. constructor(e3, t, s5, i, h2 = {}) {
  114. this._mainMethod = t, this._transferLists = s5, this._listeners = [], this._promise = u(e3, { ...h2, schedule: i }).then((e4) => {
  115. if (void 0 === this._thread) {
  116. this._thread = e4, this._promise = null, h2.hasInitialize && this.broadcast({}, "initialize");
  117. for (const e5 of this._listeners)
  118. this._connectListener(e5);
  119. } else
  120. e4.close();
  121. }), this._promise.catch((t2) => s.getLogger("esri.core.workers.WorkerHandle").error(`Failed to initialize ${e3} worker: ${t2}`));
  122. }
  123. on(r2, i) {
  124. const o3 = { removed: false, eventName: r2, callback: i, threadHandle: null };
  125. return this._listeners.push(o3), this._connectListener(o3), n(() => {
  126. o3.removed = true, C(this._listeners, o3), this._thread && r(o3.threadHandle) && o3.threadHandle.remove();
  127. });
  128. }
  129. destroy() {
  130. this._thread && (this._thread.close(), this._thread = null), this._promise = null;
  131. }
  132. invoke(e3, t) {
  133. return this.invokeMethod(this._mainMethod, e3, t);
  134. }
  135. invokeMethod(e3, t, r2) {
  136. if (this._thread) {
  137. const s5 = this._transferLists[e3], i = s5 ? s5(t) : [];
  138. return this._thread.invoke(e3, t, { transferList: i, signal: r2 });
  139. }
  140. return this._promise ? this._promise.then(() => (f(r2), this.invokeMethod(e3, t, r2))) : Promise.reject(null);
  141. }
  142. broadcast(e3, t) {
  143. return this._thread ? Promise.all(this._thread.broadcast(t, e3)).then(() => {
  144. }) : this._promise ? this._promise.then(() => this.broadcast(e3, t)) : Promise.reject();
  145. }
  146. get promise() {
  147. return this._promise;
  148. }
  149. _connectListener(e3) {
  150. this._thread && this._thread.on(e3.eventName, e3.callback).then((t) => {
  151. e3.removed || (e3.threadHandle = t);
  152. });
  153. }
  154. };
  155. // node_modules/@arcgis/core/layers/support/LercDecoder.js
  156. var s4 = class extends h {
  157. constructor(e3 = null) {
  158. super("LercWorker", "_decode", { _decode: (e4) => [e4.buffer] }, e3, { strategy: "dedicated" }), this.schedule = e3, this.ref = 0;
  159. }
  160. decode(e3, r2, t) {
  161. return e3 && 0 !== e3.byteLength ? this.invoke({ buffer: e3, options: r2 }, t) : Promise.resolve(null);
  162. }
  163. release() {
  164. --this.ref <= 0 && (o2.forEach((e3, r2) => {
  165. e3 === this && o2.delete(r2);
  166. }), this.destroy());
  167. }
  168. };
  169. var o2 = /* @__PURE__ */ new Map();
  170. function n3(t = null) {
  171. let n4 = o2.get(e2(t));
  172. return n4 || (r(t) ? (n4 = new s4((e3) => t.schedule(e3)), o2.set(t, n4)) : (n4 = new s4(), o2.set(null, n4))), ++n4.ref, n4;
  173. }
  174. // node_modules/@arcgis/core/layers/ElevationLayer.js
  175. var j = class extends s3(p(c(v2(O(b))))) {
  176. constructor(...e3) {
  177. super(...e3), this.copyright = null, this.heightModelInfo = null, this.path = null, this.minScale = void 0, this.maxScale = void 0, this.opacity = 1, this.operationalLayerType = "ArcGISTiledElevationServiceLayer", this.sourceJSON = null, this.type = "elevation", this.url = null, this.version = null, this._lercDecoder = n3();
  178. }
  179. normalizeCtorArgs(e3, r2) {
  180. return "string" == typeof e3 ? { url: e3, ...r2 } : e3;
  181. }
  182. destroy() {
  183. this._lercDecoder = w(this._lercDecoder);
  184. }
  185. readVersion(e3, r2) {
  186. let t = r2.currentVersion;
  187. return t || (t = 9.3), t;
  188. }
  189. load(e3) {
  190. const r2 = r(e3) ? e3.signal : null;
  191. return this.addResolvingPromise(this.loadFromPortal({ supportedTypes: ["Image Service"], supportsData: false, validateItem: (e4) => {
  192. for (let r3 = 0; r3 < e4.typeKeywords.length; r3++)
  193. if ("elevation 3d layer" === e4.typeKeywords[r3].toLowerCase())
  194. return true;
  195. throw new s2("portal:invalid-layer-item-type", "Invalid layer item type '${type}', expected '${expectedType}' ", { type: "Image Service", expectedType: "Image Service Elevation 3D Layer" });
  196. } }, e3).catch(w2).then(() => this._fetchImageService(r2))), Promise.resolve(this);
  197. }
  198. fetchTile(e3, t, o3, s5) {
  199. const a = r((s5 = s5 || { signal: null }).signal) ? s5.signal : s5.signal = new AbortController().signal, l = { responseType: "array-buffer", signal: a }, p2 = { noDataValue: s5.noDataValue, returnFileInfo: true };
  200. return this.load().then(() => this._fetchTileAvailability(e3, t, o3, s5)).then(() => U(this.getTileUrl(e3, t, o3), l)).then((e4) => this._lercDecoder.decode(e4.data, p2, a)).then((e4) => {
  201. var _a;
  202. return { values: e4.pixelData, width: e4.width, height: e4.height, maxZError: (_a = e4.fileInfo) == null ? void 0 : _a.maxZError, noDataValue: e4.noDataValue, minValue: e4.minValue, maxValue: e4.maxValue };
  203. });
  204. }
  205. getTileUrl(e3, r2, t) {
  206. const o3 = !this.tilemapCache && this.supportsBlankTile, i = I({ ...this.parsedUrl.query, blankTile: !o3 && null });
  207. return `${this.parsedUrl.path}/tile/${e3}/${r2}/${t}${i ? "?" + i : ""}`;
  208. }
  209. async queryElevation(e3, r2) {
  210. const { ElevationQuery: t } = await import("./ElevationQuery-BZTDAKT4.js");
  211. f(r2);
  212. return new t().query(this, e3, r2);
  213. }
  214. async createElevationSampler(e3, r2) {
  215. const { ElevationQuery: t } = await import("./ElevationQuery-BZTDAKT4.js");
  216. f(r2);
  217. return new t().createSampler(this, e3, r2);
  218. }
  219. _fetchTileAvailability(e3, r2, t, o3) {
  220. return this.tilemapCache ? this.tilemapCache.fetchAvailability(e3, r2, t, o3) : Promise.resolve("unknown");
  221. }
  222. async _fetchImageService(e3) {
  223. var _a;
  224. if (this.sourceJSON)
  225. return this.sourceJSON;
  226. const t = { query: { f: "json", ...this.parsedUrl.query }, responseType: "json", signal: e3 }, o3 = await U(this.parsedUrl.path, t);
  227. o3.ssl && (this.url = (_a = this.url) == null ? void 0 : _a.replace(/^http:/i, "https:")), this.sourceJSON = o3.data, this.read(o3.data, { origin: "service", url: this.parsedUrl });
  228. }
  229. get hasOverriddenFetchTile() {
  230. return !this.fetchTile.__isDefault__;
  231. }
  232. };
  233. e([y({ json: { read: { source: "copyrightText" } } })], j.prototype, "copyright", void 0), e([y({ readOnly: true, type: v })], j.prototype, "heightModelInfo", void 0), e([y({ type: String, json: { origins: { "web-scene": { read: true, write: true } }, read: false } })], j.prototype, "path", void 0), e([y({ type: ["show", "hide"] })], j.prototype, "listMode", void 0), e([y({ json: { read: false, write: false, origins: { service: { read: false, write: false }, "portal-item": { read: false, write: false }, "web-document": { read: false, write: false } } }, readOnly: true })], j.prototype, "minScale", void 0), e([y({ json: { read: false, write: false, origins: { service: { read: false, write: false }, "portal-item": { read: false, write: false }, "web-document": { read: false, write: false } } }, readOnly: true })], j.prototype, "maxScale", void 0), e([y({ json: { read: false, write: false, origins: { "web-document": { read: false, write: false } } } })], j.prototype, "opacity", void 0), e([y({ type: ["ArcGISTiledElevationServiceLayer"] })], j.prototype, "operationalLayerType", void 0), e([y()], j.prototype, "sourceJSON", void 0), e([y({ json: { read: false }, value: "elevation", readOnly: true })], j.prototype, "type", void 0), e([y(f2)], j.prototype, "url", void 0), e([y()], j.prototype, "version", void 0), e([o("version", ["currentVersion"])], j.prototype, "readVersion", null), j = e([n2("esri.layers.ElevationLayer")], j), j.prototype.fetchTile.__isDefault__ = true;
  234. var w3 = j;
  235. export {
  236. w3 as default
  237. };
  238. //# sourceMappingURL=ElevationLayer-QUSPD7CU.js.map