chunk-KUAEOLV3.js 10 KB

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