ElevationLayer-AEMRYKQF.js 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245
  1. import {
  2. v as v2
  3. } from "./chunk-524XACB7.js";
  4. import {
  5. u
  6. } from "./chunk-VEAEIBHK.js";
  7. import "./chunk-6SASJ6IM.js";
  8. import "./chunk-3OHML7FO.js";
  9. import "./chunk-2SJEIKRW.js";
  10. import "./chunk-PHRSJJ3U.js";
  11. import {
  12. s as s3
  13. } from "./chunk-L372ZBYB.js";
  14. import "./chunk-VZFBPND4.js";
  15. import "./chunk-WR32EHFC.js";
  16. import {
  17. p as p2
  18. } from "./chunk-6URTNEGN.js";
  19. import "./chunk-FTI5VP6T.js";
  20. import "./chunk-X7DBH4KK.js";
  21. import "./chunk-522WBHUO.js";
  22. import "./chunk-PIGRDDRG.js";
  23. import "./chunk-RMX2AZ4P.js";
  24. import "./chunk-NE3ESGA6.js";
  25. import "./chunk-YIS6BAC3.js";
  26. import {
  27. v
  28. } from "./chunk-KHA63LLS.js";
  29. import {
  30. c
  31. } from "./chunk-FGKNEJKJ.js";
  32. import {
  33. f as f2
  34. } from "./chunk-PSV473TI.js";
  35. import {
  36. O
  37. } from "./chunk-I3OBGWNS.js";
  38. import "./chunk-FONIFA5N.js";
  39. import "./chunk-EG5OI4V4.js";
  40. import "./chunk-65BYCSII.js";
  41. import "./chunk-WZQZRKNH.js";
  42. import "./chunk-LRDX4TO7.js";
  43. import "./chunk-6A4U74YA.js";
  44. import "./chunk-RBZL6SRZ.js";
  45. import "./chunk-N2663GRX.js";
  46. import "./chunk-O4FY3ITT.js";
  47. import {
  48. b
  49. } from "./chunk-4DDBH2K5.js";
  50. import "./chunk-7N4X6GF3.js";
  51. import "./chunk-UXF37FQ4.js";
  52. import "./chunk-ZOEK6QHJ.js";
  53. import "./chunk-XNLG7T2T.js";
  54. import "./chunk-IR4PV7VK.js";
  55. import "./chunk-2Z6LERTI.js";
  56. import "./chunk-OWVBLVP3.js";
  57. import "./chunk-EGZW6HC3.js";
  58. import "./chunk-4NKD334K.js";
  59. import "./chunk-65K7LC56.js";
  60. import "./chunk-ATPLLI5W.js";
  61. import "./chunk-WJ3OEUD3.js";
  62. import "./chunk-MXB2XLKV.js";
  63. import "./chunk-XH7RUGVZ.js";
  64. import "./chunk-TBBTRX4O.js";
  65. import "./chunk-YBSUITLL.js";
  66. import "./chunk-ALDCDSPV.js";
  67. import "./chunk-DT6EAZQ5.js";
  68. import "./chunk-HNOZUNJ4.js";
  69. import {
  70. U
  71. } from "./chunk-VNFRAYHO.js";
  72. import "./chunk-R5IG2D6H.js";
  73. import {
  74. I
  75. } from "./chunk-VBRY5KJM.js";
  76. import "./chunk-PDKDCAAD.js";
  77. import {
  78. o
  79. } from "./chunk-ECW2QABR.js";
  80. import "./chunk-GCDJLKH4.js";
  81. import "./chunk-MRJEICT6.js";
  82. import {
  83. d,
  84. e,
  85. n,
  86. n2
  87. } from "./chunk-Y3WMVFTW.js";
  88. import "./chunk-SAS7RONY.js";
  89. import "./chunk-WSRBH7BF.js";
  90. import "./chunk-IHXECKQQ.js";
  91. import {
  92. f,
  93. w
  94. } from "./chunk-ULGDPLM2.js";
  95. import {
  96. s,
  97. s3 as s2
  98. } from "./chunk-EMJ4ZSM2.js";
  99. import "./chunk-IKP3YN53.js";
  100. import {
  101. F,
  102. e as e2,
  103. p,
  104. r
  105. } from "./chunk-GZT4BVFP.js";
  106. import "./chunk-A5ICIBVI.js";
  107. // node_modules/@arcgis/core/core/workers/WorkerHandle.js
  108. var h = s.getLogger("esri.core.workers.WorkerHandle");
  109. var n3 = class {
  110. constructor(e3, t, r2, s5, i = {}) {
  111. this._mainMethod = t, this._transferLists = r2, this._listeners = [], this._promise = u(e3, { ...i, schedule: s5 }).then((e4) => {
  112. if (this._thread === void 0) {
  113. this._thread = e4, this._promise = null, i.hasInitialize && this.broadcast({}, "initialize");
  114. for (const e5 of this._listeners)
  115. this._connectListener(e5);
  116. } else
  117. e4.close();
  118. }), this._promise.catch((t2) => h.error(`Failed to initialize ${e3} worker: ${t2}`));
  119. }
  120. on(r2, i) {
  121. const o3 = { removed: false, eventName: r2, callback: i, threadHandle: null };
  122. return this._listeners.push(o3), this._connectListener(o3), n(() => {
  123. o3.removed = true, F(this._listeners, o3), this._thread && r(o3.threadHandle) && o3.threadHandle.remove();
  124. });
  125. }
  126. destroy() {
  127. this._thread && (this._thread.close(), this._thread = null), this._promise = null;
  128. }
  129. invoke(e3, t) {
  130. return this.invokeMethod(this._mainMethod, e3, t);
  131. }
  132. invokeMethod(e3, t, r2) {
  133. if (this._thread) {
  134. const s5 = this._transferLists[e3], i = s5 ? s5(t) : [];
  135. return this._thread.invoke(e3, t, { transferList: i, signal: r2 });
  136. }
  137. return this._promise ? this._promise.then(() => (f(r2), this.invokeMethod(e3, t, r2))) : Promise.reject(null);
  138. }
  139. broadcast(e3, t) {
  140. return this._thread ? Promise.all(this._thread.broadcast(t, e3)).then(() => {
  141. }) : this._promise ? this._promise.then(() => this.broadcast(e3, t)) : Promise.reject();
  142. }
  143. get promise() {
  144. return this._promise;
  145. }
  146. _connectListener(e3) {
  147. this._thread && this._thread.on(e3.eventName, e3.callback).then((t) => {
  148. e3.removed || (e3.threadHandle = t);
  149. });
  150. }
  151. };
  152. // node_modules/@arcgis/core/layers/support/LercDecoder.js
  153. var s4 = class extends n3 {
  154. constructor(e3 = null) {
  155. super("LercWorker", "_decode", { _decode: (e4) => [e4.buffer] }, e3, { strategy: "dedicated" }), this.schedule = e3, this.ref = 0;
  156. }
  157. decode(e3, r2, t) {
  158. return e3 && e3.byteLength !== 0 ? this.invoke({ buffer: e3, options: r2 }, t) : Promise.resolve(null);
  159. }
  160. release() {
  161. --this.ref <= 0 && (o2.forEach((e3, r2) => {
  162. e3 === this && o2.delete(r2);
  163. }), this.destroy());
  164. }
  165. };
  166. var o2 = new Map();
  167. function n4(t = null) {
  168. let n5 = o2.get(e2(t));
  169. return n5 || (r(t) ? (n5 = new s4((e3) => t.schedule(e3)), o2.set(t, n5)) : (n5 = new s4(), o2.set(null, n5))), ++n5.ref, n5;
  170. }
  171. // node_modules/@arcgis/core/layers/ElevationLayer.js
  172. var w2 = s.getLogger("esri.layers.ElevationLayer");
  173. var T = class extends s3(p2(c(v(O(b))))) {
  174. constructor(...e3) {
  175. super(...e3), this.copyright = null, this.heightModelInfo = null, this.path = null, this.opacity = 1, this.operationalLayerType = "ArcGISTiledElevationServiceLayer", this.sourceJSON = null, this.type = "elevation", this.url = null, this.version = null, this._lercDecoder = n4();
  176. }
  177. normalizeCtorArgs(e3, r2) {
  178. return typeof e3 == "string" ? { url: e3, ...r2 } : e3;
  179. }
  180. destroy() {
  181. this._lercDecoder = p(this._lercDecoder);
  182. }
  183. set minScale(e3) {
  184. this.constructed && w2.warn(`${this.declaredClass}.minScale support has been removed (since 4.5)`);
  185. }
  186. get minScale() {
  187. }
  188. set maxScale(e3) {
  189. this.constructed && w2.warn(`${this.declaredClass}.maxScale support has been removed (since 4.5)`);
  190. }
  191. get maxScale() {
  192. }
  193. readVersion(e3, r2) {
  194. let t = r2.currentVersion;
  195. return t || (t = 9.3), t;
  196. }
  197. load(e3) {
  198. const r2 = r(e3) ? e3.signal : null;
  199. return this.addResolvingPromise(this.loadFromPortal({ supportedTypes: ["Image Service"], supportsData: false, validateItem: (e4) => {
  200. for (let r3 = 0; r3 < e4.typeKeywords.length; r3++)
  201. if (e4.typeKeywords[r3].toLowerCase() === "elevation 3d layer")
  202. return true;
  203. throw new s2("portal:invalid-layer-item-type", "Invalid layer item type '${type}', expected '${expectedType}' ", { type: "Image Service", expectedType: "Image Service Elevation 3D Layer" });
  204. } }, e3).catch(w).then(() => this._fetchImageService(r2))), Promise.resolve(this);
  205. }
  206. fetchTile(e3, t, o3, i) {
  207. const a = r((i = i || { signal: null }).signal) ? i.signal : i.signal = new AbortController().signal, l = { responseType: "array-buffer", signal: a }, n5 = { noDataValue: i.noDataValue, returnFileInfo: true };
  208. return this.load().then(() => this._fetchTileAvailability(e3, t, o3, i)).then(() => U(this.getTileUrl(e3, t, o3), l)).then((e4) => this._lercDecoder.decode(e4.data, n5, a)).then((e4) => ({ values: e4.pixelData, width: e4.width, height: e4.height, maxZError: e4.fileInfo.maxZError, noDataValue: e4.noDataValue, minValue: e4.minValue, maxValue: e4.maxValue }));
  209. }
  210. getTileUrl(e3, r2, t) {
  211. const o3 = !this.tilemapCache && this.supportsBlankTile, i = I({ ...this.parsedUrl.query, blankTile: !o3 && null });
  212. return `${this.parsedUrl.path}/tile/${e3}/${r2}/${t}${i ? "?" + i : ""}`;
  213. }
  214. async queryElevation(e3, r2) {
  215. const { ElevationQuery: t } = await import("./ElevationQuery-H57OAGAY.js");
  216. f(r2);
  217. return new t().query(this, e3, r2);
  218. }
  219. async createElevationSampler(e3, r2) {
  220. const { ElevationQuery: t } = await import("./ElevationQuery-H57OAGAY.js");
  221. f(r2);
  222. return new t().createSampler(this, e3, r2);
  223. }
  224. _fetchTileAvailability(e3, r2, t, o3) {
  225. return this.tilemapCache ? this.tilemapCache.fetchAvailability(e3, r2, t, o3) : Promise.resolve("unknown");
  226. }
  227. async _fetchImageService(e3) {
  228. if (this.sourceJSON)
  229. return this.sourceJSON;
  230. const t = { query: { f: "json", ...this.parsedUrl.query }, responseType: "json", signal: e3 }, o3 = await U(this.parsedUrl.path, t);
  231. o3.ssl && (this.url = this.url.replace(/^http:/i, "https:")), this.sourceJSON = o3.data, this.read(o3.data, { origin: "service", url: this.parsedUrl });
  232. }
  233. get hasOverriddenFetchTile() {
  234. return !this.fetchTile.__isDefault__;
  235. }
  236. };
  237. e([d({ json: { read: { source: "copyrightText" } } })], T.prototype, "copyright", void 0), e([d({ readOnly: true, type: v2 })], T.prototype, "heightModelInfo", void 0), e([d({ type: String, json: { origins: { "web-scene": { read: true, write: true } }, read: false } })], T.prototype, "path", void 0), e([d({ type: ["show", "hide"] })], T.prototype, "listMode", void 0), e([d({ json: { read: false, write: false, origins: { service: { read: false, write: false }, "portal-item": { read: false, write: false }, "web-document": { read: false, write: false } } } })], T.prototype, "minScale", null), e([d({ json: { read: false, write: false, origins: { service: { read: false, write: false }, "portal-item": { read: false, write: false }, "web-document": { read: false, write: false } } } })], T.prototype, "maxScale", null), e([d({ json: { read: false, write: false, origins: { "web-document": { read: false, write: false } } } })], T.prototype, "opacity", void 0), e([d({ type: ["ArcGISTiledElevationServiceLayer"] })], T.prototype, "operationalLayerType", void 0), e([d()], T.prototype, "sourceJSON", void 0), e([d({ json: { read: false }, value: "elevation", readOnly: true })], T.prototype, "type", void 0), e([d(f2)], T.prototype, "url", void 0), e([d()], T.prototype, "version", void 0), e([o("version", ["currentVersion"])], T.prototype, "readVersion", null), T = e([n2("esri.layers.ElevationLayer")], T), T.prototype.fetchTile.__isDefault__ = true;
  238. var x = T;
  239. export {
  240. x as default
  241. };
  242. //# sourceMappingURL=ElevationLayer-AEMRYKQF.js.map