1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- import {
- s as s4
- } from "./chunk-3GZSQU56.js";
- import {
- m
- } from "./chunk-YFSLJIO4.js";
- import {
- n as n2
- } from "./chunk-IM3LVQXV.js";
- import {
- U
- } from "./chunk-DVUG3KID.js";
- import {
- j as j2
- } from "./chunk-VEGAOVMY.js";
- import {
- w2 as w
- } from "./chunk-6T6G6LCQ.js";
- import {
- k2 as k
- } from "./chunk-PQFTYGF5.js";
- import {
- e,
- n5 as n,
- y3 as y
- } from "./chunk-2Z2TG5CU.js";
- import {
- j
- } from "./chunk-V6P2MAQQ.js";
- import {
- s,
- s2,
- s3
- } from "./chunk-E5O6P5I2.js";
- // node_modules/@arcgis/core/layers/support/fromPortalItem.js
- async function o(o2) {
- const a = "portalItem" in o2 ? o2 : { portalItem: o2 }, e2 = await import("./portalLayers-6ZIKNNEM.js");
- try {
- return await e2.fromItem(a);
- } catch (p) {
- const o3 = a && a.portalItem, e3 = o3 && o3.id || "unset", l = o3 && o3.portal && o3.portal.url || s.portalUrl;
- throw s2.getLogger("esri.layers.support.fromPortalItem").error("#fromPortalItem()", "Failed to create layer from portal item (portal: '" + l + "', id: '" + e3 + "')", p), p;
- }
- }
- // node_modules/@arcgis/core/layers/Layer.js
- var m2 = 0;
- var h = class extends n2.EventedMixin(s4(m)) {
- constructor() {
- 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;
- }
- static async fromArcGISServerUrl(t) {
- const e2 = "string" == typeof t ? { url: t } : t;
- return (await import("./arcgisLayers-KKAQWTBS.js")).fromUrl(e2);
- }
- static fromPortalItem(t) {
- return o(t);
- }
- initialize() {
- this.when().catch((t) => {
- var _a, _b;
- 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 });
- });
- }
- destroy() {
- if (this.parent) {
- const t = this, e2 = this.parent;
- "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);
- }
- }
- get hasAttributionData() {
- return null != this.attributionDataUrl;
- }
- get parsedUrl() {
- return j2(this.url);
- }
- async fetchAttributionData() {
- const t = this.attributionDataUrl;
- if (this.hasAttributionData && t) {
- return (await U(t, { query: { f: "json" }, responseType: "json" })).data;
- }
- throw new s3("layer:no-attribution-data", "Layer does not have attribution data");
- }
- };
- 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);
- var b = h;
- export {
- b
- };
- //# sourceMappingURL=chunk-DXVOOCG4.js.map
|