chunk-7C23ILQ4.js 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. import {
  2. k
  3. } from "./chunk-P6VVVEX6.js";
  4. import {
  5. j2 as j
  6. } from "./chunk-3Z755LKF.js";
  7. import {
  8. i as i2
  9. } from "./chunk-JOYXMSKE.js";
  10. import {
  11. i
  12. } from "./chunk-ETGAZ7LF.js";
  13. import {
  14. v
  15. } from "./chunk-RMDDCMKS.js";
  16. import {
  17. e,
  18. e4 as e2,
  19. l3 as l,
  20. n5 as n,
  21. y3 as y
  22. } from "./chunk-2Z2TG5CU.js";
  23. import {
  24. r
  25. } from "./chunk-YXWMMD76.js";
  26. // node_modules/@arcgis/core/Graphic.js
  27. function y2(t) {
  28. if (!t)
  29. return null;
  30. const e3 = {};
  31. for (const r2 in t) {
  32. const o = v(t[r2]);
  33. o && (e3[r2] = o);
  34. }
  35. return 0 !== Object.keys(e3).length ? e3 : null;
  36. }
  37. function m(t) {
  38. if (!r(t))
  39. return null;
  40. const e3 = {};
  41. for (const r2 in t) {
  42. const o = t[r2];
  43. o && (e3[r2] = o.toJSON());
  44. }
  45. return 0 !== Object.keys(e3).length ? e3 : null;
  46. }
  47. var h = class extends i2(l) {
  48. constructor(...t) {
  49. super(...t), this.isAggregate = false, this.layer = null, this.popupTemplate = null, this.sourceLayer = null, Object.defineProperty(this, "uid", { value: e2(), configurable: true });
  50. }
  51. normalizeCtorArgs(t, e3, r2, o) {
  52. return t && !t.declaredClass ? t : { geometry: t, symbol: e3, attributes: r2, popupTemplate: o };
  53. }
  54. set aggregateGeometries(t) {
  55. const e3 = this._get("aggregateGeometries");
  56. JSON.stringify(e3) !== JSON.stringify(t) && this._set("aggregateGeometries", t);
  57. }
  58. set attributes(t) {
  59. const e3 = this._get("attributes");
  60. e3 !== t && (this._set("attributes", t), this._notifyLayer("attributes", e3, t));
  61. }
  62. set geometry(t) {
  63. const e3 = this._get("geometry");
  64. e3 !== t && (this._set("geometry", t), this._notifyLayer("geometry", e3, t));
  65. }
  66. set symbol(t) {
  67. const e3 = this._get("symbol");
  68. e3 !== t && (this._set("symbol", t), this._notifyLayer("symbol", e3, t));
  69. }
  70. set visible(t) {
  71. const e3 = this._get("visible");
  72. e3 !== t && (this._set("visible", t), this._notifyLayer("visible", e3, t));
  73. }
  74. getEffectivePopupTemplate(t = false) {
  75. if (this.popupTemplate)
  76. return this.popupTemplate;
  77. for (const e3 of [this.sourceLayer, this.layer])
  78. if (e3) {
  79. if ("popupTemplate" in e3 && e3.popupTemplate)
  80. return e3.popupTemplate;
  81. if (t && "defaultPopupTemplate" in e3 && r(e3.defaultPopupTemplate))
  82. return e3.defaultPopupTemplate;
  83. }
  84. return null;
  85. }
  86. getAttribute(t) {
  87. var _a;
  88. return (_a = this.attributes) == null ? void 0 : _a[t];
  89. }
  90. setAttribute(t, e3) {
  91. if (this.attributes) {
  92. const r2 = this.getAttribute(t);
  93. this.attributes[t] = e3, this._notifyLayer("attributes", r2, e3, t);
  94. } else
  95. this.attributes = { [t]: e3 }, this._notifyLayer("attributes", void 0, e3, t);
  96. }
  97. getObjectId() {
  98. return this.sourceLayer && "objectIdField" in this.sourceLayer && this.sourceLayer.objectIdField ? this.getAttribute(this.sourceLayer.objectIdField) : null;
  99. }
  100. toJSON() {
  101. return { aggregateGeometries: m(this.aggregateGeometries), geometry: r(this.geometry) ? this.geometry.toJSON() : null, symbol: r(this.symbol) ? this.symbol.toJSON() : null, attributes: { ...this.attributes }, popupTemplate: this.popupTemplate && this.popupTemplate.toJSON() };
  102. }
  103. notifyGeometryChanged() {
  104. this._notifyLayer("geometry", this.geometry, this.geometry);
  105. }
  106. notifyMeshTransformChanged() {
  107. r(this.geometry) && "mesh" === this.geometry.type && this._notifyLayer("transform", this.geometry.transform, this.geometry.transform);
  108. }
  109. _notifyLayer(t, e3, r2, o) {
  110. if (!this.layer || !("graphicChanged" in this.layer))
  111. return;
  112. const s = { graphic: this, property: t, oldValue: e3, newValue: r2 };
  113. "attributes" === t && (s.attributeName = o), this.layer.graphicChanged(s);
  114. }
  115. };
  116. e([y({ value: null, json: { read: y2 } })], h.prototype, "aggregateGeometries", null), e([y({ value: null })], h.prototype, "attributes", null), e([y({ value: null, types: i, json: { read: v } })], h.prototype, "geometry", null), e([y({ type: Boolean })], h.prototype, "isAggregate", void 0), e([y({ clonable: "reference" })], h.prototype, "layer", void 0), e([y({ type: k })], h.prototype, "popupTemplate", void 0), e([y({ clonable: "reference" })], h.prototype, "sourceLayer", void 0), e([y({ value: null, types: j })], h.prototype, "symbol", null), e([y({ type: Boolean, value: true })], h.prototype, "visible", null), h = e([n("esri.Graphic")], h), function(t) {
  117. t.generateUID = e2;
  118. }(h || (h = {}));
  119. var g = h;
  120. export {
  121. g
  122. };
  123. //# sourceMappingURL=chunk-7C23ILQ4.js.map