chunk-DXVOOCG4.js 4.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. import {
  2. s as s4
  3. } from "./chunk-3GZSQU56.js";
  4. import {
  5. m
  6. } from "./chunk-YFSLJIO4.js";
  7. import {
  8. n as n2
  9. } from "./chunk-IM3LVQXV.js";
  10. import {
  11. U
  12. } from "./chunk-DVUG3KID.js";
  13. import {
  14. j as j2
  15. } from "./chunk-VEGAOVMY.js";
  16. import {
  17. w2 as w
  18. } from "./chunk-6T6G6LCQ.js";
  19. import {
  20. k2 as k
  21. } from "./chunk-PQFTYGF5.js";
  22. import {
  23. e,
  24. n5 as n,
  25. y3 as y
  26. } from "./chunk-2Z2TG5CU.js";
  27. import {
  28. j
  29. } from "./chunk-V6P2MAQQ.js";
  30. import {
  31. s,
  32. s2,
  33. s3
  34. } from "./chunk-E5O6P5I2.js";
  35. // node_modules/@arcgis/core/layers/support/fromPortalItem.js
  36. async function o(o2) {
  37. const a = "portalItem" in o2 ? o2 : { portalItem: o2 }, e2 = await import("./portalLayers-6ZIKNNEM.js");
  38. try {
  39. return await e2.fromItem(a);
  40. } catch (p) {
  41. const o3 = a && a.portalItem, e3 = o3 && o3.id || "unset", l = o3 && o3.portal && o3.portal.url || s.portalUrl;
  42. throw s2.getLogger("esri.layers.support.fromPortalItem").error("#fromPortalItem()", "Failed to create layer from portal item (portal: '" + l + "', id: '" + e3 + "')", p), p;
  43. }
  44. }
  45. // node_modules/@arcgis/core/layers/Layer.js
  46. var m2 = 0;
  47. var h = class extends n2.EventedMixin(s4(m)) {
  48. constructor() {
  49. super(...arguments), this.attributionDataUrl = null, this.fullExtent = new w(-180, -90, 180, 90, k.WGS84), this.id = Date.now().toString(16) + "-layer-" + m2++, this.legendEnabled = true, this.listMode = "show", this.opacity = 1, this.parent = null, this.popupEnabled = true, this.attributionVisible = true, this.spatialReference = k.WGS84, this.title = null, this.type = null, this.url = null, this.visible = true;
  50. }
  51. static async fromArcGISServerUrl(t) {
  52. const e2 = "string" == typeof t ? { url: t } : t;
  53. return (await import("./arcgisLayers-KKAQWTBS.js")).fromUrl(e2);
  54. }
  55. static fromPortalItem(t) {
  56. return o(t);
  57. }
  58. initialize() {
  59. this.when().catch((t) => {
  60. var _a, _b;
  61. j(t) || s2.getLogger(this.declaredClass).error("#load()", `Failed to load layer (title: '${(_a = this.title) != null ? _a : "no title"}', id: '${(_b = this.id) != null ? _b : "no id"}')`, { error: t });
  62. });
  63. }
  64. destroy() {
  65. if (this.parent) {
  66. const t = this, e2 = this.parent;
  67. "layers" in e2 && e2.layers.includes(t) ? e2.layers.remove(t) : "tables" in e2 && e2.tables.includes(t) ? e2.tables.remove(t) : "baseLayers" in e2 && e2.baseLayers.includes(t) ? e2.baseLayers.remove(t) : "baseLayers" in e2 && e2.referenceLayers.includes(t) && e2.referenceLayers.remove(t);
  68. }
  69. }
  70. get hasAttributionData() {
  71. return null != this.attributionDataUrl;
  72. }
  73. get parsedUrl() {
  74. return j2(this.url);
  75. }
  76. async fetchAttributionData() {
  77. const t = this.attributionDataUrl;
  78. if (this.hasAttributionData && t) {
  79. return (await U(t, { query: { f: "json" }, responseType: "json" })).data;
  80. }
  81. throw new s3("layer:no-attribution-data", "Layer does not have attribution data");
  82. }
  83. };
  84. e([y({ type: String })], h.prototype, "attributionDataUrl", void 0), e([y({ type: w })], h.prototype, "fullExtent", void 0), e([y({ readOnly: true })], h.prototype, "hasAttributionData", null), e([y({ type: String, clonable: false })], h.prototype, "id", void 0), e([y({ type: Boolean, nonNullable: true })], h.prototype, "legendEnabled", void 0), e([y({ type: ["show", "hide", "hide-children"] })], h.prototype, "listMode", void 0), e([y({ type: Number, range: { min: 0, max: 1 }, nonNullable: true })], h.prototype, "opacity", void 0), e([y({ clonable: false })], h.prototype, "parent", void 0), e([y({ readOnly: true })], h.prototype, "parsedUrl", null), e([y({ type: Boolean })], h.prototype, "popupEnabled", void 0), e([y({ type: Boolean })], h.prototype, "attributionVisible", void 0), e([y({ type: k })], h.prototype, "spatialReference", void 0), e([y({ type: String })], h.prototype, "title", void 0), e([y({ readOnly: true, json: { read: false } })], h.prototype, "type", void 0), e([y()], h.prototype, "url", void 0), e([y({ type: Boolean, nonNullable: true })], h.prototype, "visible", void 0), h = e([n("esri.layers.Layer")], h);
  85. var b = h;
  86. export {
  87. b
  88. };
  89. //# sourceMappingURL=chunk-DXVOOCG4.js.map