chunk-MNZXIBJ7.js 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  1. import {
  2. s as s4
  3. } from "./chunk-YJKEIUMW.js";
  4. import {
  5. a as a2
  6. } from "./chunk-RMX2AZ4P.js";
  7. import {
  8. a,
  9. l as l2,
  10. w
  11. } from "./chunk-YIS6BAC3.js";
  12. import {
  13. s as s3
  14. } from "./chunk-7N4X6GF3.js";
  15. import {
  16. d as d2
  17. } from "./chunk-2Z6LERTI.js";
  18. import {
  19. v2 as v
  20. } from "./chunk-OWVBLVP3.js";
  21. import {
  22. n as n3
  23. } from "./chunk-AFZ7XSEW.js";
  24. import {
  25. m
  26. } from "./chunk-YBSUITLL.js";
  27. import {
  28. j
  29. } from "./chunk-ALDCDSPV.js";
  30. import {
  31. n as n2
  32. } from "./chunk-DT6EAZQ5.js";
  33. import {
  34. M2 as M,
  35. p
  36. } from "./chunk-ECW2QABR.js";
  37. import {
  38. d,
  39. e,
  40. l3 as l,
  41. n2 as n,
  42. y3 as y
  43. } from "./chunk-Y3WMVFTW.js";
  44. import {
  45. s,
  46. s3 as s2
  47. } from "./chunk-EMJ4ZSM2.js";
  48. import {
  49. c
  50. } from "./chunk-GZT4BVFP.js";
  51. // node_modules/@arcgis/core/views/layers/support/ClipArea.js
  52. var e2 = class extends l {
  53. };
  54. e2 = e([n("esri.views.layers.support.ClipArea")], e2);
  55. var t = e2;
  56. // node_modules/@arcgis/core/views/layers/support/ClipRect.js
  57. var s5;
  58. var i = s5 = class extends t {
  59. constructor() {
  60. super(...arguments), this.type = "rect", this.left = null, this.right = null, this.top = null, this.bottom = null;
  61. }
  62. clone() {
  63. return new s5({ left: this.left, right: this.right, top: this.top, bottom: this.bottom });
  64. }
  65. get version() {
  66. return (this._get("version") || 0) + 1;
  67. }
  68. };
  69. e([d({ type: [Number, String], json: { write: true } })], i.prototype, "left", void 0), e([d({ type: [Number, String], json: { write: true } })], i.prototype, "right", void 0), e([d({ type: [Number, String], json: { write: true } })], i.prototype, "top", void 0), e([d({ type: [Number, String], json: { write: true } })], i.prototype, "bottom", void 0), e([d({ readOnly: true })], i.prototype, "version", null), i = s5 = e([n("esri.views.layers.support.ClipRect")], i);
  70. var p2 = i;
  71. // node_modules/@arcgis/core/views/layers/support/Geometry.js
  72. var y2;
  73. var n4 = { base: p, key: "type", typeMap: { extent: M, polygon: v } };
  74. var c2 = y2 = class extends t {
  75. constructor() {
  76. super(...arguments), this.type = "geometry", this.geometry = null;
  77. }
  78. get version() {
  79. return (this._get("version") || 0) + 1;
  80. }
  81. clone() {
  82. return new y2({ geometry: this.geometry.clone() });
  83. }
  84. };
  85. e([d({ types: n4, json: { read: d2, write: true } })], c2.prototype, "geometry", void 0), e([d({ readOnly: true })], c2.prototype, "version", null), c2 = y2 = e([n("esri.views.layers.support.Geometry")], c2);
  86. var a3 = c2;
  87. // node_modules/@arcgis/core/views/layers/support/Path.js
  88. var e3 = class extends t {
  89. constructor() {
  90. super(...arguments), this.type = "path", this.path = [];
  91. }
  92. get version() {
  93. return (this._get("version") || 0) + 1;
  94. }
  95. };
  96. e([d({ type: [[[Number]]], json: { write: true } })], e3.prototype, "path", void 0), e([d({ readOnly: true })], e3.prototype, "version", null), e3 = e([n("esri.views.layers.support.Path")], e3);
  97. var p3 = e3;
  98. // node_modules/@arcgis/core/views/2d/layers/LayerView2D.js
  99. var y3 = j.ofType({ key: "type", base: t, typeMap: { rect: p2, path: p3, geometry: a3 } });
  100. var f = (t2) => {
  101. let c3 = class extends t2 {
  102. constructor() {
  103. super(...arguments), this.attached = false, this.clips = new y3(), this.lastUpdateId = -1, this.moving = false, this.updateRequested = false;
  104. }
  105. initialize() {
  106. const e4 = this.view?.spatialReferenceLocked ?? true, t3 = this.view?.spatialReference;
  107. t3 && e4 && !this.spatialReferenceSupported ? this.addResolvingPromise(Promise.reject(new s2("layerview:spatial-reference-incompatible", "The spatial reference of this layer does not meet the requirements of the view", { layer: this.layer }))) : (this.container || (this.container = new s4()), this.container.fadeTransitionEnabled = true, this.container.opacity = 0, this.container.clips = this.clips, this.handles.add([l2(() => this.suspended, (e5) => {
  108. this.container && (this.container.visible = !e5), this.view && !e5 && this.updateRequested && this.view.requestUpdate();
  109. }, w), l2(() => this.layer?.opacity ?? 1, (e5) => {
  110. this.container && (this.container.opacity = e5);
  111. }, w), l2(() => this.layer && "blendMode" in this.layer ? this.layer.blendMode : "normal", (e5) => {
  112. this.container && (this.container.blendMode = e5);
  113. }, w), l2(() => this.layer && "effect" in this.layer ? this.layer.effect : null, (e5) => {
  114. this.container && (this.container.effect = e5);
  115. }, w), a(() => this.clips, "change", () => {
  116. this.container && (this.container.clips = this.clips);
  117. })]), this.view?.whenLayerView ? this.view.whenLayerView(this.layer).then((e5) => {
  118. e5 === this && this.processAttach();
  119. }, () => {
  120. }) : this.when().then(() => {
  121. this.processAttach();
  122. }, () => {
  123. }));
  124. }
  125. destroy() {
  126. this.processDetach(), this.updateRequested = false;
  127. }
  128. get spatialReferenceSupported() {
  129. const e4 = this.view?.spatialReference;
  130. return e4 == null || this.supportsSpatialReference(e4);
  131. }
  132. get updating() {
  133. return this.spatialReferenceSupported && (!this.attached || !this.suspended && (this.updateRequested || this.isUpdating()) || !!this.updatingHandles?.updating);
  134. }
  135. get visibleAtCurrentScale() {
  136. return this.isVisibleAtScale(this.view.scale);
  137. }
  138. processAttach() {
  139. this.isResolved() && !this.attached && !this.destroyed && this.spatialReferenceSupported && (this.attach(), this.attached = true, this.requestUpdate());
  140. }
  141. processDetach() {
  142. this.attached && (this.attached = false, this.detach(), this.updateRequested = false);
  143. }
  144. isVisibleAtScale(e4) {
  145. const t3 = this.layer && "effectiveScaleRange" in this.layer ? this.layer.effectiveScaleRange : null;
  146. if (!t3)
  147. return true;
  148. const { minScale: s6, maxScale: i2 } = t3;
  149. return (s6 === 0 || e4 <= s6) && (i2 === 0 || e4 >= i2);
  150. }
  151. requestUpdate() {
  152. this.destroyed || this.updateRequested || (this.updateRequested = true, this.suspended || this.view.requestUpdate());
  153. }
  154. processUpdate(e4) {
  155. !this.isFulfilled() || this.isResolved() ? (this._set("updateParameters", e4), this.updateRequested && !this.suspended && (this.updateRequested = false, this.update(e4))) : this.updateRequested = false;
  156. }
  157. hitTest(e4, t3) {
  158. return Promise.resolve(null);
  159. }
  160. supportsSpatialReference(e4) {
  161. return true;
  162. }
  163. canResume() {
  164. return !!this.spatialReferenceSupported && (!!super.canResume() && this.visibleAtCurrentScale);
  165. }
  166. getSuspendInfo() {
  167. const e4 = super.getSuspendInfo(), t3 = !this.spatialReferenceSupported, s6 = this.visibleAtCurrentScale;
  168. return t3 && (e4.spatialReferenceNotSupported = t3), s6 && (e4.outsideScaleRange = s6), e4;
  169. }
  170. };
  171. return e([d()], c3.prototype, "attached", void 0), e([d({ type: y3, set(e4) {
  172. const t3 = n3(e4, this._get("clips"), y3);
  173. this._set("clips", t3);
  174. } })], c3.prototype, "clips", void 0), e([d()], c3.prototype, "container", void 0), e([d()], c3.prototype, "moving", void 0), e([d({ readOnly: true })], c3.prototype, "spatialReferenceSupported", null), e([d({ readOnly: true })], c3.prototype, "updateParameters", void 0), e([d()], c3.prototype, "updateRequested", void 0), e([d()], c3.prototype, "updating", null), e([d()], c3.prototype, "view", void 0), e([d({ readOnly: true })], c3.prototype, "visibleAtCurrentScale", null), c3 = e([n("esri.views.2d.layers.LayerView2D")], c3), c3;
  175. };
  176. // node_modules/@arcgis/core/views/layers/LayerView.js
  177. var d3 = class extends a2(s3(m(n2.EventedMixin(y)))) {
  178. constructor(e4) {
  179. super(e4), this.layer = null, this.parent = null;
  180. }
  181. initialize() {
  182. this.when().catch((e4) => {
  183. if (e4.name !== "layerview:create-error") {
  184. const r = this.layer && this.layer.id || "no id", t2 = this.layer && this.layer.title || "no title";
  185. s.getLogger(this.declaredClass).error("#resolve()", `Failed to resolve layer view (layer title: '${t2}', id: '${r}')`, e4);
  186. }
  187. });
  188. }
  189. get fullOpacity() {
  190. return c(this.get("layer.opacity"), 1) * c(this.get("parent.fullOpacity"), 1);
  191. }
  192. get suspended() {
  193. return !this.canResume();
  194. }
  195. get suspendInfo() {
  196. return this.getSuspendInfo();
  197. }
  198. get legendEnabled() {
  199. return !this.suspended && this.layer?.legendEnabled === true;
  200. }
  201. get updating() {
  202. return !(!this.updatingHandles?.updating && !this.isUpdating());
  203. }
  204. get updatingProgress() {
  205. return this.updating ? 0 : 1;
  206. }
  207. get visible() {
  208. return this.layer?.visible === true;
  209. }
  210. set visible(e4) {
  211. e4 !== void 0 ? this._override("visible", e4) : this._clearOverride("visible");
  212. }
  213. canResume() {
  214. return this.visible && this.layer?.loaded && !this.parent?.suspended && this.view?.ready || false;
  215. }
  216. getSuspendInfo() {
  217. const e4 = this.parent && this.parent.suspended ? this.parent.suspendInfo : {}, r = this;
  218. return r.view && r.view.ready || (e4.viewNotReady = true), this.layer && this.layer.loaded || (e4.layerNotLoaded = true), this.visible || (e4.layerInvisible = true), e4;
  219. }
  220. isUpdating() {
  221. return false;
  222. }
  223. };
  224. e([d()], d3.prototype, "fullOpacity", null), e([d()], d3.prototype, "layer", void 0), e([d()], d3.prototype, "parent", void 0), e([d({ readOnly: true })], d3.prototype, "suspended", null), e([d({ readOnly: true })], d3.prototype, "suspendInfo", null), e([d({ readOnly: true })], d3.prototype, "legendEnabled", null), e([d({ type: Boolean, readOnly: true })], d3.prototype, "updating", null), e([d({ readOnly: true })], d3.prototype, "updatingProgress", null), e([d()], d3.prototype, "visible", null), e([d()], d3.prototype, "view", void 0), d3 = e([n("esri.views.layers.LayerView")], d3);
  225. var u = d3;
  226. export {
  227. f,
  228. u
  229. };
  230. //# sourceMappingURL=chunk-MNZXIBJ7.js.map