123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577 |
- import {
- t as t3
- } from "./chunk-XO7O5UZJ.js";
- import {
- r as r5
- } from "./chunk-GGGVIS2U.js";
- import {
- p as p2
- } from "./chunk-S3GK7VUF.js";
- import {
- t as t2
- } from "./chunk-TU7WVKU4.js";
- import {
- n as n4
- } from "./chunk-NQA5XJGK.js";
- import {
- c2 as c3,
- j2 as j3
- } from "./chunk-JAUFBT5U.js";
- import {
- p as p3
- } from "./chunk-7C2KDOAI.js";
- import {
- n as n3,
- p2 as p
- } from "./chunk-RHFU6KWO.js";
- import {
- k as k2
- } from "./chunk-P6VVVEX6.js";
- import {
- c2
- } from "./chunk-3Z755LKF.js";
- import {
- K,
- c,
- x
- } from "./chunk-WD4J43GZ.js";
- import {
- m as m2
- } from "./chunk-SZFMKPVM.js";
- import {
- a
- } from "./chunk-YZVAB3DF.js";
- import {
- r as r4
- } from "./chunk-JLSNMUQJ.js";
- import {
- y as y3
- } from "./chunk-JGBXYDGB.js";
- import {
- U,
- l
- } from "./chunk-TJV6ODRM.js";
- import {
- j as j4,
- p as p4
- } from "./chunk-GLSWDDR3.js";
- import {
- O
- } from "./chunk-MIQGEDET.js";
- import {
- l as l2
- } from "./chunk-CDZENOCQ.js";
- import {
- s as s5
- } from "./chunk-3GZSQU56.js";
- import {
- i
- } from "./chunk-75U5LM2V.js";
- import {
- j
- } from "./chunk-LBW34VZ2.js";
- import {
- m
- } from "./chunk-YFSLJIO4.js";
- import {
- U as U2
- } from "./chunk-DVUG3KID.js";
- import {
- I,
- j as j2
- } from "./chunk-VEGAOVMY.js";
- import {
- o,
- w2 as w
- } from "./chunk-6T6G6LCQ.js";
- import {
- s as s4
- } from "./chunk-YEJL5NEF.js";
- import {
- k2 as k,
- r as r3
- } from "./chunk-PQFTYGF5.js";
- import {
- e,
- e2,
- n3 as n,
- n5 as n2,
- r2,
- t3 as t,
- y3 as y2
- } from "./chunk-2Z2TG5CU.js";
- import {
- T,
- b,
- s as s3,
- v
- } from "./chunk-SQOPWYIT.js";
- import {
- f
- } from "./chunk-V6P2MAQQ.js";
- import {
- s2 as s,
- s3 as s2
- } from "./chunk-E5O6P5I2.js";
- import {
- y
- } from "./chunk-SPWQ3AWG.js";
- import {
- r
- } from "./chunk-YXWMMD76.js";
- // node_modules/@arcgis/core/layers/mixins/ArcGISMapService.js
- var y4 = (y5) => {
- let d = class extends y5 {
- constructor() {
- super(...arguments), this.capabilities = void 0, this.copyright = null, this.fullExtent = null, this.legendEnabled = true, this.spatialReference = null, this.version = void 0, this._allLayersAndTablesPromise = null, this._allLayersAndTablesMap = null;
- }
- readCapabilities(e3, r6) {
- var _a, _b;
- const s6 = r6.capabilities && r6.capabilities.split(",").map((e4) => e4.toLowerCase().trim());
- if (!s6)
- return { operations: { supportsExportMap: false, supportsExportTiles: false, supportsIdentify: false, supportsQuery: false, supportsTileMap: false }, exportMap: null, exportTiles: null };
- const t4 = this.type, i2 = s6.includes("data"), p5 = s6.includes("query"), a2 = s6.includes("map"), l3 = !!r6.exportTilesAllowed, n5 = s6.includes("tilemap"), u = "tile" !== t4 && !!r6.supportsDynamicLayers, c4 = "tile" !== t4 && (!r6.tileInfo || u), y6 = "tile" !== t4 && (!r6.tileInfo || u), d2 = "tile" !== t4, m4 = r6.cimVersion && r5.parse(r6.cimVersion), h2 = (_a = m4 == null ? void 0 : m4.since(1, 4)) != null ? _a : false, b2 = (_b = m4 == null ? void 0 : m4.since(2, 0)) != null ? _b : false;
- return { operations: { supportsExportMap: a2, supportsExportTiles: l3, supportsIdentify: p5, supportsQuery: i2, supportsTileMap: n5 }, exportMap: a2 ? { supportsArcadeExpressionForLabeling: h2, supportsSublayersChanges: d2, supportsDynamicLayers: u, supportsSublayerVisibility: c4, supportsSublayerDefinitionExpression: y6, supportsCIMSymbols: b2 } : null, exportTiles: l3 ? { maxExportTilesCount: +r6.maxExportTilesCount } : null };
- }
- readVersion(e3, r6) {
- let s6 = r6.currentVersion;
- return s6 || (s6 = r6.hasOwnProperty("capabilities") || r6.hasOwnProperty("tables") ? 10 : r6.hasOwnProperty("supportedImageFormatTypes") ? 9.31 : 9.3), s6;
- }
- async fetchSublayerInfo(e3, r6) {
- var _a;
- return await this.fetchAllLayersAndTables(r6), (_a = this._allLayersAndTablesMap) == null ? void 0 : _a.get(e3);
- }
- async fetchAllLayersAndTables(e3) {
- await this.load(e3), this._allLayersAndTablesPromise || (this._allLayersAndTablesPromise = U2(j2(this.url).path + "/layers", { responseType: "json", query: { f: "json", ...this.customParameters, token: this.apiKey } }).then((e4) => {
- this._allLayersAndTablesMap = /* @__PURE__ */ new Map();
- for (const r6 of e4.data.layers)
- this._allLayersAndTablesMap.set(r6.id, r6);
- return { result: e4.data };
- }, (e4) => ({ error: e4 })));
- const o2 = await this._allLayersAndTablesPromise;
- if (f(e3), "result" in o2)
- return o2.result;
- throw o2.error;
- }
- };
- return e([y2({ readOnly: true })], d.prototype, "capabilities", void 0), e([o("service", "capabilities", ["capabilities", "exportTilesAllowed", "maxExportTilesCount", "supportsDynamicLayers", "tileInfo"])], d.prototype, "readCapabilities", null), e([y2({ json: { read: { source: "copyrightText" } } })], d.prototype, "copyright", void 0), e([y2({ type: w })], d.prototype, "fullExtent", void 0), e([y2(j4)], d.prototype, "id", void 0), e([y2({ type: Boolean, json: { origins: { service: { read: { enabled: false } } }, read: { source: "showLegend" }, write: { target: "showLegend" } } })], d.prototype, "legendEnabled", void 0), e([y2(p4)], d.prototype, "popupEnabled", void 0), e([y2({ type: k })], d.prototype, "spatialReference", void 0), e([y2({ readOnly: true })], d.prototype, "version", void 0), e([o("version", ["currentVersion", "capabilities", "tables", "supportedImageFormatTypes"])], d.prototype, "readVersion", null), d = e([n2("esri.layers.mixins.ArcGISMapService")], d), d;
- };
- // node_modules/@arcgis/core/layers/support/Sublayer.js
- var $;
- function J(e3) {
- return e3 && "esriSMS" === e3.type;
- }
- function B(e3, r6, t4) {
- var _a;
- const i2 = this.originIdOf(r6) >= t(t4.origin);
- return { ignoreOrigin: true, allowNull: i2, enabled: !!t4 && ("map-image" === ((_a = t4.layer) == null ? void 0 : _a.type) && (t4.writeSublayerStructure || i2)) };
- }
- function Q(e3, r6, t4) {
- var _a;
- return { enabled: !!t4 && ("tile" === ((_a = t4.layer) == null ? void 0 : _a.type) && this._isOverridden(r6)) };
- }
- function G(e3, r6, t4) {
- return { ignoreOrigin: true, enabled: t4 && t4.writeSublayerStructure || false };
- }
- function H(e3, r6, t4) {
- return { ignoreOrigin: true, enabled: !!t4 && (t4.writeSublayerStructure || this.originIdOf(r6) >= t(t4.origin)) };
- }
- var K2 = 0;
- var W = /* @__PURE__ */ new Set();
- W.add("layer"), W.add("parent"), W.add("loaded"), W.add("loadStatus"), W.add("loadError"), W.add("loadWarnings");
- var X = $ = class extends a(O(s5(m))) {
- constructor(e3) {
- super(e3), this.capabilities = void 0, this.fields = null, this.fullExtent = null, this.geometryType = null, this.globalIdField = null, this.legendEnabled = true, this.objectIdField = null, this.popupEnabled = true, this.popupTemplate = null, this.sourceJSON = null, this.title = null, this.typeIdField = null, this.types = null;
- }
- async load(e3) {
- return this.addResolvingPromise((async () => {
- var _a, _b;
- if (!this.layer && !this.url)
- throw new s2("sublayer:missing-layer", "Sublayer can't be loaded without being part of a layer", { sublayer: this });
- let r6 = null;
- if (!this.layer || this.originIdOf("url") > r2.SERVICE || "data-layer" === ((_a = this.source) == null ? void 0 : _a.type)) {
- r6 = (await U2(this.url, { responseType: "json", query: { f: "json" }, ...e3 })).data;
- } else {
- let t4 = this.id;
- "map-layer" === ((_b = this.source) == null ? void 0 : _b.type) && (t4 = this.source.mapLayerId), r6 = await this.layer.fetchSublayerInfo(t4, e3);
- }
- r6 && (this.sourceJSON = r6, this.read({ layerDefinition: r6 }, { origin: "service" }));
- })()), this;
- }
- readCapabilities(e3, r6) {
- const t4 = (e3 = (r6 = r6.layerDefinition || r6).capabilities || e3) ? e3.toLowerCase().split(",").map((e4) => e4.trim()) : [], i2 = this.url ? m2(this.url) : null, o2 = t4.includes(r(i2) && "MapServer" === i2.serverType ? "data" : "query");
- return { exportMap: { supportsModification: !!r6.canModifyLayer }, operations: { supportsQuery: o2 } };
- }
- set definitionExpression(e3) {
- this._setAndNotifyLayer("definitionExpression", e3);
- }
- get fieldsIndex() {
- return new r4(this.fields || []);
- }
- set floorInfo(e3) {
- this._setAndNotifyLayer("floorInfo", e3);
- }
- readGlobalIdFieldFromService(e3, r6) {
- if ((r6 = r6.layerDefinition || r6).globalIdField)
- return r6.globalIdField;
- if (r6.fields) {
- for (const t4 of r6.fields)
- if ("esriFieldTypeGlobalID" === t4.type)
- return t4.name;
- }
- }
- get id() {
- const e3 = this._get("id");
- return e3 != null ? e3 : K2++;
- }
- set id(e3) {
- this._get("id") !== e3 && (false !== this.get("layer.capabilities.exportMap.supportsDynamicLayers") ? this._set("id", e3) : this._logLockedError("id", "capability not available 'layer.capabilities.exportMap.supportsDynamicLayers'"));
- }
- set labelingInfo(e3) {
- this._setAndNotifyLayer("labelingInfo", e3);
- }
- writeLabelingInfo(e3, r6, t4, i2) {
- e3 && e3.length && (r6.layerDefinition = { drawingInfo: { labelingInfo: e3.map((e4) => e4.write({}, i2)) } });
- }
- set labelsVisible(e3) {
- this._setAndNotifyLayer("labelsVisible", e3);
- }
- set layer(e3) {
- this._set("layer", e3), this.sublayers && this.sublayers.forEach((r6) => r6.layer = e3);
- }
- set listMode(e3) {
- this._set("listMode", e3);
- }
- set minScale(e3) {
- this._setAndNotifyLayer("minScale", e3);
- }
- readMinScale(e3, r6) {
- return r6.minScale || r6.layerDefinition && r6.layerDefinition.minScale || 0;
- }
- set maxScale(e3) {
- this._setAndNotifyLayer("maxScale", e3);
- }
- readMaxScale(e3, r6) {
- return r6.maxScale || r6.layerDefinition && r6.layerDefinition.maxScale || 0;
- }
- get effectiveScaleRange() {
- const { minScale: e3, maxScale: r6 } = this;
- return { minScale: e3, maxScale: r6 };
- }
- readObjectIdFieldFromService(e3, r6) {
- if ((r6 = r6.layerDefinition || r6).objectIdField)
- return r6.objectIdField;
- if (r6.fields) {
- for (const t4 of r6.fields)
- if ("esriFieldTypeOID" === t4.type)
- return t4.name;
- }
- }
- set opacity(e3) {
- this._setAndNotifyLayer("opacity", e3);
- }
- readOpacity(e3, r6) {
- const t4 = r6.layerDefinition;
- return 1 - 0.01 * (null != t4.transparency ? t4.transparency : t4.drawingInfo.transparency);
- }
- writeOpacity(e3, r6, t4, i2) {
- r6.layerDefinition = { drawingInfo: { transparency: 100 - 100 * e3 } };
- }
- writeParent(e3, r6) {
- this.parent && this.parent !== this.layer ? r6.parentLayerId = s3(this.parent.id) : r6.parentLayerId = -1;
- }
- get defaultPopupTemplate() {
- return this.createPopupTemplate();
- }
- set renderer(e3) {
- if (e3) {
- for (const r6 of e3.getSymbols())
- if (c2(r6)) {
- s.getLogger(this.declaredClass).warn("Sublayer renderer should use 2D symbols");
- break;
- }
- }
- this._setAndNotifyLayer("renderer", e3);
- }
- get source() {
- return this._get("source") || new c({ mapLayerId: this.id });
- }
- set source(e3) {
- this._setAndNotifyLayer("source", e3);
- }
- set sublayers(e3) {
- this._handleSublayersChange(e3, this._get("sublayers")), this._set("sublayers", e3);
- }
- castSublayers(e3) {
- return b(j.ofType($), e3);
- }
- writeSublayers(e3, r6, t4) {
- this.get("sublayers.length") && (r6[t4] = this.sublayers.map((e4) => e4.id).toArray().reverse());
- }
- readTypeIdField(e3, r6) {
- let t4 = (r6 = r6.layerDefinition || r6).typeIdField;
- if (t4 && r6.fields) {
- t4 = t4.toLowerCase();
- const e4 = r6.fields.find((e5) => e5.name.toLowerCase() === t4);
- e4 && (t4 = e4.name);
- }
- return t4;
- }
- get url() {
- var _a, _b;
- const e3 = (_b = (_a = this.layer) == null ? void 0 : _a.parsedUrl) != null ? _b : this._lastParsedUrl, r6 = this.source;
- if (!e3)
- return null;
- if (this._lastParsedUrl = e3, "map-layer" === (r6 == null ? void 0 : r6.type))
- return `${e3.path}/${r6.mapLayerId}`;
- const t4 = { layer: JSON.stringify({ source: this.source }) };
- return `${e3.path}/dynamicLayer?${I(t4)}`;
- }
- set url(e3) {
- this._overrideIfSome("url", e3);
- }
- set visible(e3) {
- this._setAndNotifyLayer("visible", e3);
- }
- writeVisible(e3, r6, t4, i2) {
- r6[t4] = this.getAtOrigin("defaultVisibility", "service") || e3;
- }
- clone() {
- const { store: e3 } = e2(this), r6 = new $();
- return e2(r6).store = e3.clone(W), this.commitProperty("url"), r6._lastParsedUrl = this._lastParsedUrl, r6;
- }
- createPopupTemplate(e3) {
- return p3(this, e3);
- }
- createQuery() {
- return new x({ returnGeometry: true, where: this.definitionExpression || "1=1" });
- }
- async createFeatureLayer() {
- var _a, _b;
- if (this.hasOwnProperty("sublayers"))
- return null;
- const e3 = (_a = this.layer) == null ? void 0 : _a.parsedUrl, r6 = new (0, (await import("./FeatureLayer-3WEBJCEM.js")).default)({ url: e3.path });
- return e3 && this.source && ("map-layer" === this.source.type ? r6.layerId = this.source.mapLayerId : r6.dynamicDataSource = this.source), null != this.layer.refreshInterval && (r6.refreshInterval = this.layer.refreshInterval), this.definitionExpression && (r6.definitionExpression = this.definitionExpression), this.floorInfo && (r6.floorInfo = y(this.floorInfo)), this.originIdOf("labelingInfo") > r2.SERVICE && (r6.labelingInfo = y(this.labelingInfo)), this.originIdOf("labelsVisible") > r2.DEFAULTS && (r6.labelsVisible = this.labelsVisible), this.originIdOf("legendEnabled") > r2.DEFAULTS && (r6.legendEnabled = this.legendEnabled), this.originIdOf("visible") > r2.DEFAULTS && (r6.visible = this.visible), this.originIdOf("minScale") > r2.DEFAULTS && (r6.minScale = this.minScale), this.originIdOf("maxScale") > r2.DEFAULTS && (r6.maxScale = this.maxScale), this.originIdOf("opacity") > r2.DEFAULTS && (r6.opacity = this.opacity), this.originIdOf("popupTemplate") > r2.DEFAULTS && (r6.popupTemplate = y(this.popupTemplate)), this.originIdOf("renderer") > r2.SERVICE && (r6.renderer = y(this.renderer)), "data-layer" === ((_b = this.source) == null ? void 0 : _b.type) && (r6.dynamicDataSource = this.source.clone()), this.originIdOf("title") > r2.DEFAULTS && (r6.title = this.title), "map-image" === this.layer.type && this.layer.originIdOf("customParameters") > r2.DEFAULTS && (r6.customParameters = this.layer.customParameters), "tile" === this.layer.type && this.layer.originIdOf("customParameters") > r2.DEFAULTS && (r6.customParameters = this.layer.customParameters), r6;
- }
- getField(e3) {
- return this.fieldsIndex.get(e3);
- }
- getFeatureType(e3) {
- const { typeIdField: r6, types: t4 } = this;
- if (!r6 || !e3)
- return null;
- const i2 = e3.attributes ? e3.attributes[r6] : void 0;
- if (null == i2)
- return null;
- let o2 = null;
- return t4.some((e4) => {
- const { id: r7 } = e4;
- return null != r7 && (r7.toString() === i2.toString() && (o2 = e4), !!o2);
- }), o2;
- }
- getFieldDomain(e3, r6) {
- const t4 = r6 && r6.feature, i2 = this.getFeatureType(t4);
- if (i2) {
- const r7 = i2.domains && i2.domains[e3];
- if (r7 && "inherited" !== r7.type)
- return r7;
- }
- return this._getLayerDomain(e3);
- }
- async queryFeatures(e3 = this.createQuery(), r6) {
- var _a, _b, _c, _d, _e, _f;
- if (await this.load(), !((_b = (_a = this.capabilities) == null ? void 0 : _a.operations) == null ? void 0 : _b.supportsQuery))
- throw new s2("Sublayer.queryFeatures", "this layer doesn't support queries.");
- const [{ executeQuery: t4 }, { default: i2 }] = await Promise.all([import("./query-5UKXMJ3Z.js"), import("./FeatureSet-4LFEUCS7.js")]), o2 = await t4(this.url, x.from(e3), (_d = (_c = this.layer) == null ? void 0 : _c.spatialReference) != null ? _d : null, { ...r6, query: { ...(_e = this.layer) == null ? void 0 : _e.customParameters, token: (_f = this.layer) == null ? void 0 : _f.apiKey } }), a2 = i2.fromJSON(o2.data);
- if (a2 == null ? void 0 : a2.features)
- for (const s6 of a2.features)
- s6.sourceLayer = this;
- return a2;
- }
- toExportImageJSON(e3) {
- var _a;
- const r6 = { id: this.id, source: ((_a = this.source) == null ? void 0 : _a.toJSON()) || { mapLayerId: this.id, type: "mapLayer" } }, t4 = t2(e3, this.definitionExpression);
- r(t4) && (r6.definitionExpression = t4);
- const i2 = ["renderer", "labelingInfo", "opacity", "labelsVisible"].reduce((e4, r7) => (e4[r7] = this.originIdOf(r7), e4), {}), o2 = Object.keys(i2).some((e4) => i2[e4] > r2.SERVICE);
- if (o2) {
- const e4 = r6.drawingInfo = {};
- if (i2.renderer > r2.SERVICE && (e4.renderer = this.renderer ? this.renderer.toJSON() : null), i2.labelsVisible > r2.SERVICE && (e4.showLabels = this.labelsVisible), this.labelsVisible && i2.labelingInfo > r2.SERVICE) {
- !this.loaded && this.labelingInfo.some((e5) => !e5.labelPlacement) && s.getLogger(this.declaredClass).warnOnce(`A Sublayer (title: ${this.title}, id: ${this.id}) has an undefined 'labelPlacement' and so labels cannot be displayed. Either define a valid 'labelPlacement' or call Sublayer.load() to use a default value based on geometry type.`, { sublayer: this });
- let r7 = this.labelingInfo;
- r(this.geometryType) && (r7 = c3(this.labelingInfo, i.toJSON(this.geometryType))), e4.labelingInfo = r7.filter((e5) => e5.labelPlacement).map((e5) => e5.toJSON({ origin: "service", layer: this.layer })), e4.showLabels = true;
- }
- i2.opacity > r2.SERVICE && (e4.transparency = 100 - 100 * this.opacity), this._assignDefaultSymbolColors(e4.renderer);
- }
- return r6;
- }
- _assignDefaultSymbolColors(e3) {
- this._forEachSimpleMarkerSymbols(e3, (e4) => {
- e4.color || "esriSMSX" !== e4.style && "esriSMSCross" !== e4.style || (e4.outline && e4.outline.color ? e4.color = e4.outline.color : e4.color = [0, 0, 0, 0]);
- });
- }
- _forEachSimpleMarkerSymbols(e3, r6) {
- if (e3) {
- const t4 = "uniqueValueInfos" in e3 ? e3.uniqueValueInfos : "classBreakInfos" in e3 ? e3.classBreakInfos : [];
- for (const e4 of t4)
- J(e4.symbol) && r6(e4.symbol);
- "symbol" in e3 && J(e3.symbol) && r6(e3.symbol), "defaultSymbol" in e3 && J(e3.defaultSymbol) && r6(e3.defaultSymbol);
- }
- }
- _setAndNotifyLayer(e3, r6) {
- const t4 = this.layer, i2 = this._get(e3);
- let o2, a2;
- switch (e3) {
- case "definitionExpression":
- case "floorInfo":
- o2 = "supportsSublayerDefinitionExpression";
- case "minScale":
- case "maxScale":
- case "visible":
- o2 = "supportsSublayerVisibility";
- break;
- case "labelingInfo":
- case "labelsVisible":
- case "opacity":
- case "renderer":
- case "source":
- o2 = "supportsDynamicLayers", a2 = "supportsModification";
- }
- const s6 = e2(this).getDefaultOrigin();
- if ("service" !== s6) {
- if (o2 && false === this.get(`layer.capabilities.exportMap.${o2}`))
- return void this._logLockedError(e3, `capability not available 'layer.capabilities.exportMap.${o2}'`);
- if (a2 && false === this.get(`capabilities.exportMap.${a2}`))
- return void this._logLockedError(e3, `capability not available 'capabilities.exportMap.${a2}'`);
- }
- "source" !== e3 || "not-loaded" === this.loadStatus ? (this._set(e3, r6), "service" !== s6 && i2 !== r6 && t4 && t4.emit && t4.emit("sublayer-update", { propertyName: e3, target: this })) : this._logLockedError(e3, "'source' can't be changed after calling sublayer.load()");
- }
- _handleSublayersChange(e3, r6) {
- r6 && (r6.forEach((e4) => {
- e4.parent = null, e4.layer = null;
- }), this.handles.removeAll()), e3 && (e3.forEach((e4) => {
- e4.parent = this, e4.layer = this.layer;
- }), this.handles.add([e3.on("after-add", ({ item: e4 }) => {
- e4.parent = this, e4.layer = this.layer;
- }), e3.on("after-remove", ({ item: e4 }) => {
- e4.parent = null, e4.layer = null;
- }), e3.on("before-changes", (e4) => {
- const r7 = this.get("layer.capabilities.exportMap.supportsSublayersChanges");
- null == r7 || r7 || (s.getLogger(this.declaredClass).error(new s2("sublayer:sublayers-non-modifiable", "Sublayer can't be added, moved, or removed from the layer's sublayers", { sublayer: this, layer: this.layer })), e4.preventDefault());
- })]));
- }
- _logLockedError(e3, r6) {
- s.getLogger(this.declaredClass).error(new s2("sublayer:locked", `Property '${String(e3)}' can't be changed on Sublayer from the layer '${this.layer.id}'`, { reason: r6, sublayer: this, layer: this.layer }));
- }
- _getLayerDomain(e3) {
- const r6 = this.fieldsIndex.get(e3);
- return r6 ? r6.domain : null;
- }
- };
- X.test = { isMapImageLayerOverridePolicy: (e3) => e3 === G || e3 === B, isTileImageLayerOverridePolicy: (e3) => e3 === Q }, e([y2({ readOnly: true })], X.prototype, "capabilities", void 0), e([o("service", "capabilities", ["layerDefinition.canModifyLayer", "layerDefinition.capabilities"])], X.prototype, "readCapabilities", null), e([y2({ type: String, value: null, json: { name: "layerDefinition.definitionExpression", write: { allowNull: true, overridePolicy: B } } })], X.prototype, "definitionExpression", null), e([y2({ type: [y3], json: { origins: { service: { read: { source: "layerDefinition.fields" } } } } })], X.prototype, "fields", void 0), e([y2({ readOnly: true })], X.prototype, "fieldsIndex", null), e([y2({ type: p2, value: null, json: { name: "layerDefinition.floorInfo", read: { source: "layerDefinition.floorInfo" }, write: { target: "layerDefinition.floorInfo", overridePolicy: B }, origins: { "web-scene": { read: false, write: false } } } })], X.prototype, "floorInfo", null), e([y2({ type: w, json: { read: { source: "layerDefinition.extent" } } })], X.prototype, "fullExtent", void 0), e([y2({ type: i.apiValues, json: { origins: { service: { name: "layerDefinition.geometryType", read: { reader: i.read } } } } })], X.prototype, "geometryType", void 0), e([y2({ type: String })], X.prototype, "globalIdField", void 0), e([o("service", "globalIdField", ["layerDefinition.globalIdField", "layerDefinition.fields"])], X.prototype, "readGlobalIdFieldFromService", null), e([y2({ type: T, json: { write: { ignoreOrigin: true } } })], X.prototype, "id", null), e([y2({ value: null, type: [j3], json: { read: { source: "layerDefinition.drawingInfo.labelingInfo" }, write: { target: "layerDefinition.drawingInfo.labelingInfo", overridePolicy: G } } })], X.prototype, "labelingInfo", null), e([r3("labelingInfo")], X.prototype, "writeLabelingInfo", null), e([y2({ type: Boolean, value: true, json: { read: { source: "layerDefinition.drawingInfo.showLabels" }, write: { target: "layerDefinition.drawingInfo.showLabels", overridePolicy: G } } })], X.prototype, "labelsVisible", null), e([y2({ value: null })], X.prototype, "layer", null), e([y2({ type: Boolean, value: true, json: { origins: { service: { read: { enabled: false } } }, read: { source: "showLegend" }, write: { target: "showLegend", overridePolicy: H } } })], X.prototype, "legendEnabled", void 0), e([y2({ type: ["show", "hide", "hide-children"], value: "show", json: { read: false, write: false, origins: { "web-scene": { read: true, write: true } } } })], X.prototype, "listMode", null), e([y2({ type: Number, value: 0, json: { write: { overridePolicy: G } } })], X.prototype, "minScale", null), e([o("minScale", ["minScale", "layerDefinition.minScale"])], X.prototype, "readMinScale", null), e([y2({ type: Number, value: 0, json: { write: { overridePolicy: G } } })], X.prototype, "maxScale", null), e([o("maxScale", ["maxScale", "layerDefinition.maxScale"])], X.prototype, "readMaxScale", null), e([y2({ readOnly: true })], X.prototype, "effectiveScaleRange", null), e([y2({ type: String })], X.prototype, "objectIdField", void 0), e([o("service", "objectIdField", ["layerDefinition.objectIdField", "layerDefinition.fields"])], X.prototype, "readObjectIdFieldFromService", null), e([y2({ type: Number, value: 1, json: { write: { target: "layerDefinition.drawingInfo.transparency", overridePolicy: G } } })], X.prototype, "opacity", null), e([o("opacity", ["layerDefinition.drawingInfo.transparency", "layerDefinition.transparency"])], X.prototype, "readOpacity", null), e([r3("opacity")], X.prototype, "writeOpacity", null), e([y2({ json: { type: T, write: { target: "parentLayerId", writerEnsuresNonNull: true, overridePolicy: G } } })], X.prototype, "parent", void 0), e([r3("parent")], X.prototype, "writeParent", null), e([y2({ type: Boolean, value: true, json: { read: { source: "disablePopup", reader: (e3, r6) => !r6.disablePopup }, write: { target: "disablePopup", overridePolicy: H, writer(e3, r6, t4) {
- r6[t4] = !e3;
- } } } })], X.prototype, "popupEnabled", void 0), e([y2({ type: k2, json: { read: { source: "popupInfo" }, write: { target: "popupInfo", overridePolicy: H } } })], X.prototype, "popupTemplate", void 0), e([y2({ readOnly: true })], X.prototype, "defaultPopupTemplate", null), e([y2({ types: p, value: null, json: { name: "layerDefinition.drawingInfo.renderer", write: { overridePolicy: G }, origins: { "web-scene": { types: n3, name: "layerDefinition.drawingInfo.renderer", write: { overridePolicy: G } } } } })], X.prototype, "renderer", null), e([y2({ types: { key: "type", base: null, typeMap: { "data-layer": K, "map-layer": c } }, cast(e3) {
- if (e3) {
- if ("mapLayerId" in e3)
- return v(c, e3);
- if ("dataSource" in e3)
- return v(K, e3);
- }
- return e3;
- }, json: { name: "layerDefinition.source", write: { overridePolicy: G } } })], X.prototype, "source", null), e([y2()], X.prototype, "sourceJSON", void 0), e([y2({ value: null, json: { type: [T], write: { target: "subLayerIds", allowNull: true, overridePolicy: G } } })], X.prototype, "sublayers", null), e([s4("sublayers")], X.prototype, "castSublayers", null), e([r3("sublayers")], X.prototype, "writeSublayers", null), e([y2({ type: String, json: { name: "name", write: { overridePolicy: H } } })], X.prototype, "title", void 0), e([y2({ type: String })], X.prototype, "typeIdField", void 0), e([o("typeIdField", ["layerDefinition.typeIdField"])], X.prototype, "readTypeIdField", null), e([y2({ type: [n4], json: { origins: { service: { read: { source: "layerDefinition.types" } } } } })], X.prototype, "types", void 0), e([y2({ type: String, json: { read: { source: "layerUrl" }, write: { target: "layerUrl", overridePolicy: Q } } })], X.prototype, "url", null), e([y2({ type: Boolean, value: true, json: { read: { source: "defaultVisibility" }, write: { target: "defaultVisibility", overridePolicy: G } } })], X.prototype, "visible", null), e([r3("visible")], X.prototype, "writeVisible", null), X = $ = e([n2("esri.layers.support.Sublayer")], X);
- var z = X;
- // node_modules/@arcgis/core/layers/mixins/SublayersOwner.js
- var f2 = s.getLogger("esri.layers.TileLayer");
- function S(e3, r6) {
- const s6 = [], t4 = {};
- return e3 ? (e3.forEach((e4) => {
- const o2 = new z();
- if (o2.read(e4, r6), t4[o2.id] = o2, null != e4.parentLayerId && -1 !== e4.parentLayerId) {
- const r7 = t4[e4.parentLayerId];
- r7.sublayers || (r7.sublayers = []), r7.sublayers.unshift(o2);
- } else
- s6.unshift(o2);
- }), s6) : s6;
- }
- var h = j.ofType(z);
- function m3(e3, r6) {
- e3 && e3.forEach((e4) => {
- r6(e4), e4.sublayers && e4.sublayers.length && m3(e4.sublayers, r6);
- });
- }
- var E = (o2) => {
- let E2 = class extends o2 {
- constructor(...e3) {
- super(...e3), this.allSublayers = new l2({ getCollections: () => [this.sublayers], getChildrenFunction: (e4) => e4.sublayers }), this.sublayersSourceJSON = { [r2.SERVICE]: {}, [r2.PORTAL_ITEM]: {}, [r2.WEB_SCENE]: {}, [r2.WEB_MAP]: {} }, this.addHandles(l(() => this.sublayers, (e4, r6) => this._handleSublayersChange(e4, r6), U));
- }
- readSublayers(e3, r6) {
- if (!r6 || !e3)
- return;
- const { sublayersSourceJSON: s6 } = this, t4 = t(r6.origin);
- if (t4 < r2.SERVICE)
- return;
- if (s6[t4] = { context: r6, visibleLayers: e3.visibleLayers || s6[t4].visibleLayers, layers: e3.layers || s6[t4].layers }, t4 > r2.SERVICE)
- return;
- this._set("serviceSublayers", this.createSublayersForOrigin("service").sublayers);
- const { sublayers: o3, origin: a2 } = this.createSublayersForOrigin("web-document"), l3 = e2(this);
- l3.setDefaultOrigin(a2), this._set("sublayers", new h(o3)), l3.setDefaultOrigin("user");
- }
- findSublayerById(e3) {
- return this.allSublayers.find((r6) => r6.id === e3);
- }
- createServiceSublayers() {
- return this.createSublayersForOrigin("service").sublayers;
- }
- createSublayersForOrigin(e3) {
- const r6 = t("web-document" === e3 ? "web-map" : e3);
- let s6 = r2.SERVICE, t4 = this.sublayersSourceJSON[r2.SERVICE].layers, o3 = this.sublayersSourceJSON[r2.SERVICE].context, a2 = null;
- const l3 = [r2.PORTAL_ITEM, r2.WEB_SCENE, r2.WEB_MAP].filter((e4) => e4 <= r6);
- for (const y5 of l3) {
- const e4 = this.sublayersSourceJSON[y5];
- t3(e4.layers) && (s6 = y5, t4 = e4.layers, o3 = e4.context, e4.visibleLayers && (a2 = { visibleLayers: e4.visibleLayers, context: e4.context }));
- }
- const i2 = [r2.PORTAL_ITEM, r2.WEB_SCENE, r2.WEB_MAP].filter((e4) => e4 > s6 && e4 <= r6);
- let n5 = null;
- for (const y5 of i2) {
- const { layers: e4, visibleLayers: r7, context: s7 } = this.sublayersSourceJSON[y5];
- e4 && (n5 = { layers: e4, context: s7 }), r7 && (a2 = { visibleLayers: r7, context: s7 });
- }
- const u = S(t4, o3), p5 = /* @__PURE__ */ new Map(), f3 = /* @__PURE__ */ new Set();
- if (n5)
- for (const y5 of n5.layers)
- p5.set(y5.id, y5);
- if (a2)
- for (const y5 of a2.visibleLayers)
- f3.add(y5);
- return m3(u, (e4) => {
- n5 && e4.read(p5.get(e4.id), n5.context), a2 && e4.read({ defaultVisibility: f3.has(e4.id) }, a2.context);
- }), { origin: n(s6), sublayers: new h({ items: u }) };
- }
- read(e3, r6) {
- super.read(e3, r6), this.readSublayers(e3, r6);
- }
- _handleSublayersChange(e3, r6) {
- r6 && (r6.forEach((e4) => {
- e4.parent = null, e4.layer = null;
- }), this.handles.remove("sublayers-owner")), e3 && (e3.forEach((e4) => {
- e4.parent = this, e4.layer = this;
- }), this.handles.add([e3.on("after-add", ({ item: e4 }) => {
- e4.parent = this, e4.layer = this;
- }), e3.on("after-remove", ({ item: e4 }) => {
- e4.parent = null, e4.layer = null;
- })], "sublayers-owner"), "tile" === this.type && this.handles.add(e3.on("before-changes", (e4) => {
- f2.error(new s2("tilelayer:sublayers-non-modifiable", "ISublayer can't be added, moved, or removed from the layer's sublayers", { layer: this })), e4.preventDefault();
- }), "sublayers-owner"));
- }
- };
- return e([y2({ readOnly: true })], E2.prototype, "allSublayers", void 0), e([y2({ readOnly: true, type: j.ofType(z) })], E2.prototype, "serviceSublayers", void 0), e([y2({ value: null, type: h, json: { read: false, write: { allowNull: true, ignoreOrigin: true } } })], E2.prototype, "sublayers", void 0), e([y2({ readOnly: true })], E2.prototype, "sublayersSourceJSON", void 0), E2 = e([n2("esri.layers.mixins.SublayersOwner")], E2), E2;
- };
- export {
- y4 as y,
- z,
- E
- };
- //# sourceMappingURL=chunk-BQSLUIIU.js.map
|