chunk-35HO4E7G.js 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. import {
  2. c as c2
  3. } from "./chunk-PT5TF6KZ.js";
  4. import {
  5. i as i2
  6. } from "./chunk-3YTO5A3F.js";
  7. import {
  8. e as e2
  9. } from "./chunk-2RHPWGZL.js";
  10. import {
  11. a as a2
  12. } from "./chunk-XEQ4FTFC.js";
  13. import {
  14. E,
  15. y as y2,
  16. z
  17. } from "./chunk-BQSLUIIU.js";
  18. import {
  19. n as n4
  20. } from "./chunk-XO7O5UZJ.js";
  21. import {
  22. i
  23. } from "./chunk-WWXZOC2Y.js";
  24. import {
  25. p as p2
  26. } from "./chunk-ZOKNWEG3.js";
  27. import {
  28. o as o2
  29. } from "./chunk-W6U6FKJ3.js";
  30. import {
  31. a
  32. } from "./chunk-YZVAB3DF.js";
  33. import {
  34. v
  35. } from "./chunk-JUWKPBLS.js";
  36. import {
  37. c
  38. } from "./chunk-WLSB4F4I.js";
  39. import {
  40. f
  41. } from "./chunk-GLSWDDR3.js";
  42. import {
  43. O
  44. } from "./chunk-MIQGEDET.js";
  45. import {
  46. T as T2
  47. } from "./chunk-VRLXUHP2.js";
  48. import {
  49. p
  50. } from "./chunk-GN35O2ZO.js";
  51. import {
  52. n as n3
  53. } from "./chunk-XTVKPAWY.js";
  54. import {
  55. t as t2
  56. } from "./chunk-PLWDAYK7.js";
  57. import {
  58. n as n2
  59. } from "./chunk-FAOWJMTO.js";
  60. import {
  61. b
  62. } from "./chunk-DXVOOCG4.js";
  63. import {
  64. U
  65. } from "./chunk-DVUG3KID.js";
  66. import {
  67. o,
  68. w2
  69. } from "./chunk-6T6G6LCQ.js";
  70. import {
  71. r as r3
  72. } from "./chunk-PQFTYGF5.js";
  73. import {
  74. e,
  75. n5 as n,
  76. r2,
  77. t3 as t,
  78. y3 as y
  79. } from "./chunk-2Z2TG5CU.js";
  80. import {
  81. T
  82. } from "./chunk-SQOPWYIT.js";
  83. import {
  84. j,
  85. w
  86. } from "./chunk-V6P2MAQQ.js";
  87. import {
  88. s3 as s
  89. } from "./chunk-E5O6P5I2.js";
  90. import {
  91. r
  92. } from "./chunk-YXWMMD76.js";
  93. // node_modules/@arcgis/core/layers/MapImageLayer.js
  94. var q = class extends n3(a2(t2(E(y2(p2(c(v(O(p(i(o2(a(b))))))))))))) {
  95. constructor(...e3) {
  96. super(...e3), this.datesInUnknownTimezone = false, this.dpi = 96, this.gdbVersion = null, this.imageFormat = "png24", this.imageMaxHeight = 2048, this.imageMaxWidth = 2048, this.imageTransparency = true, this.isReference = null, this.labelsVisible = false, this.operationalLayerType = "ArcGISMapServiceLayer", this.sourceJSON = null, this.sublayers = null, this.type = "map-image", this.url = null;
  97. }
  98. normalizeCtorArgs(e3, r4) {
  99. return "string" == typeof e3 ? { url: e3, ...r4 } : e3;
  100. }
  101. load(e3) {
  102. const r4 = r(e3) ? e3.signal : null;
  103. return this.addResolvingPromise(this.loadFromPortal({ supportedTypes: ["Map Service"] }, e3).catch(w).then(() => this._fetchService(r4))), Promise.resolve(this);
  104. }
  105. readImageFormat(e3, r4) {
  106. const t3 = r4.supportedImageFormatTypes;
  107. return t3 && t3.includes("PNG32") ? "png32" : "png24";
  108. }
  109. writeSublayers(e3, r4, t3, o3) {
  110. if (!this.loaded || !e3)
  111. return;
  112. const i3 = e3.slice().reverse().flatten(({ sublayers: e4 }) => e4 && e4.toArray().reverse()).toArray();
  113. let s2 = false;
  114. if (this.capabilities && this.capabilities.operations.supportsExportMap && this.capabilities.exportMap.supportsDynamicLayers) {
  115. const e4 = t(o3.origin);
  116. if (e4 === r2.PORTAL_ITEM) {
  117. const e5 = this.createSublayersForOrigin("service").sublayers;
  118. s2 = n4(i3, e5, r2.SERVICE);
  119. } else if (e4 > r2.PORTAL_ITEM) {
  120. const e5 = this.createSublayersForOrigin("portal-item");
  121. s2 = n4(i3, e5.sublayers, t(e5.origin));
  122. }
  123. }
  124. const a3 = [], p3 = { writeSublayerStructure: s2, ...o3 };
  125. let n5 = s2;
  126. i3.forEach((e4) => {
  127. const r5 = e4.write({}, p3);
  128. a3.push(r5), n5 = n5 || "user" === e4.originOf("visible");
  129. });
  130. a3.some((e4) => Object.keys(e4).length > 1) && (r4.layers = a3), n5 && (r4.visibleLayers = i3.filter((e4) => e4.visible).map((e4) => e4.id));
  131. }
  132. createExportImageParameters(e3, r4, t3, o3) {
  133. const i3 = o3 && o3.pixelRatio || 1;
  134. e3 && this.version >= 10 && (e3 = e3.clone().shiftCentralMeridian());
  135. const s2 = new c2({ layer: this, floors: o3 == null ? void 0 : o3.floors, scale: i2({ extent: e3, width: r4 }) * i3 }), a3 = s2.toJSON();
  136. s2.destroy();
  137. const p3 = !o3 || !o3.rotation || this.version < 10.3 ? {} : { rotation: -o3.rotation }, n5 = e3 && e3.spatialReference, m = n5.wkid || JSON.stringify(n5.toJSON());
  138. a3.dpi *= i3;
  139. const l = {};
  140. if (o3 == null ? void 0 : o3.timeExtent) {
  141. const { start: e4, end: r5 } = o3.timeExtent.toJSON();
  142. l.time = e4 && r5 && e4 === r5 ? "" + e4 : `${e4 != null ? e4 : "null"},${r5 != null ? r5 : "null"}`;
  143. } else
  144. this.timeInfo && !this.timeInfo.hasLiveData && (l.time = "null,null");
  145. return { bbox: e3 && e3.xmin + "," + e3.ymin + "," + e3.xmax + "," + e3.ymax, bboxSR: m, imageSR: m, size: r4 + "," + t3, ...a3, ...p3, ...l };
  146. }
  147. async fetchImage(e3, r4, t3, o3) {
  148. return this._fetchImage("image", e3, r4, t3, o3);
  149. }
  150. async fetchImageBitmap(e3, r4, t3, o3) {
  151. const i3 = await this._fetchImage("blob", e3, r4, t3, o3);
  152. return createImageBitmap(i3);
  153. }
  154. async fetchRecomputedExtents(e3 = {}) {
  155. const o3 = { ...e3, query: { returnUpdates: true, f: "json", ...this.customParameters, token: this.apiKey } }, { data: i3 } = await U(this.url, o3), { extent: s2, fullExtent: a3, timeExtent: p3 } = i3, n5 = s2 || a3;
  156. return { fullExtent: n5 && w2.fromJSON(n5), timeExtent: p3 && T2.fromJSON({ start: p3[0], end: p3[1] }) };
  157. }
  158. loadAll() {
  159. return n2(this, (e3) => {
  160. e3(this.allSublayers);
  161. });
  162. }
  163. serviceSupportsSpatialReference(e3) {
  164. return e2(this, e3);
  165. }
  166. async _fetchImage(e3, t3, i3, s2, a3) {
  167. var _a;
  168. const p3 = { responseType: e3, signal: (_a = a3 == null ? void 0 : a3.signal) != null ? _a : null, query: { ...this.parsedUrl.query, ...this.createExportImageParameters(t3, i3, s2, a3), f: "image", ...this.refreshParameters, ...this.customParameters, token: this.apiKey } }, n5 = this.parsedUrl.path + "/export";
  169. if (null != p3.query.dynamicLayers && !this.capabilities.exportMap.supportsDynamicLayers)
  170. throw new s("mapimagelayer:dynamiclayer-not-supported", `service ${this.url} doesn't support dynamic layers, which is required to be able to change the sublayer's order, rendering, labeling or source.`, { query: p3.query });
  171. try {
  172. const { data: e4 } = await U(n5, p3);
  173. return e4;
  174. } catch (l) {
  175. if (j(l))
  176. throw l;
  177. throw new s("mapimagelayer:image-fetch-error", `Unable to load image: ${n5}`, { error: l });
  178. }
  179. }
  180. async _fetchService(e3) {
  181. if (this.sourceJSON)
  182. return void this.read(this.sourceJSON, { origin: "service", url: this.parsedUrl });
  183. const { data: t3, ssl: o3 } = await U(this.parsedUrl.path, { query: { f: "json", ...this.parsedUrl.query, ...this.customParameters, token: this.apiKey }, signal: e3 });
  184. o3 && (this.url = this.url.replace(/^http:/i, "https:")), this.sourceJSON = t3, this.read(t3, { origin: "service", url: this.parsedUrl });
  185. }
  186. };
  187. e([y({ type: Boolean })], q.prototype, "datesInUnknownTimezone", void 0), e([y()], q.prototype, "dpi", void 0), e([y()], q.prototype, "gdbVersion", void 0), e([y()], q.prototype, "imageFormat", void 0), e([o("imageFormat", ["supportedImageFormatTypes"])], q.prototype, "readImageFormat", null), e([y({ json: { origins: { service: { read: { source: "maxImageHeight" } } } } })], q.prototype, "imageMaxHeight", void 0), e([y({ json: { origins: { service: { read: { source: "maxImageWidth" } } } } })], q.prototype, "imageMaxWidth", void 0), e([y()], q.prototype, "imageTransparency", void 0), e([y({ type: Boolean, json: { read: false, write: { enabled: true, overridePolicy: () => ({ enabled: false }) } } })], q.prototype, "isReference", void 0), e([y({ json: { read: false, write: false } })], q.prototype, "labelsVisible", void 0), e([y({ type: ["ArcGISMapServiceLayer"] })], q.prototype, "operationalLayerType", void 0), e([y({ json: { read: false, write: false } })], q.prototype, "popupEnabled", void 0), e([y()], q.prototype, "sourceJSON", void 0), e([y({ json: { write: { ignoreOrigin: true } } })], q.prototype, "sublayers", void 0), e([r3("sublayers", { layers: { type: [z] }, visibleLayers: { type: [T] } })], q.prototype, "writeSublayers", null), e([y({ type: ["show", "hide", "hide-children"] })], q.prototype, "listMode", void 0), e([y({ json: { read: false }, readOnly: true, value: "map-image" })], q.prototype, "type", void 0), e([y(f)], q.prototype, "url", void 0), q = e([n("esri.layers.MapImageLayer")], q);
  188. var F = q;
  189. export {
  190. F
  191. };
  192. //# sourceMappingURL=chunk-35HO4E7G.js.map