123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260 |
- import {
- p as p2,
- t as t2,
- y as y2
- } from "./chunk-77N52HSV.js";
- import {
- s as s4,
- x
- } from "./chunk-Q2XBTNPG.js";
- import {
- n as n4
- } from "./chunk-5MVUZO4F.js";
- import {
- p
- } from "./chunk-V7H6CJ37.js";
- import {
- o
- } from "./chunk-H2KDMZTR.js";
- import {
- l as l2
- } from "./chunk-7XXXCK2A.js";
- import {
- r as r3
- } from "./chunk-7ZIDBK7B.js";
- import {
- n as n5,
- r as r4
- } from "./chunk-6A4U74YA.js";
- import {
- n as n3
- } from "./chunk-AFZ7XSEW.js";
- import {
- m as m2
- } from "./chunk-TBBTRX4O.js";
- import {
- j
- } from "./chunk-ALDCDSPV.js";
- import {
- n as n2
- } from "./chunk-DT6EAZQ5.js";
- import {
- s as s3
- } from "./chunk-GCDJLKH4.js";
- import {
- r as r2
- } from "./chunk-MRJEICT6.js";
- import {
- d,
- e,
- l3 as l,
- n2 as n,
- u2 as u,
- y3 as y
- } from "./chunk-Y3WMVFTW.js";
- import {
- S,
- b
- } from "./chunk-IHXECKQQ.js";
- import {
- E,
- f
- } from "./chunk-ULGDPLM2.js";
- import {
- r,
- s,
- s3 as s2
- } from "./chunk-EMJ4ZSM2.js";
- import {
- m
- } from "./chunk-IKP3YN53.js";
- import {
- t
- } from "./chunk-GZT4BVFP.js";
- // node_modules/@arcgis/core/ground/NavigationConstraint.js
- var t3;
- var p3 = t3 = class extends l {
- constructor(o2) {
- super(o2), this.type = "none";
- }
- clone() {
- return new t3({ type: this.type });
- }
- };
- e([r3({ none: "none", stayAbove: "stay-above" })], p3.prototype, "type", void 0), p3 = t3 = e([n("esri.ground.NavigationConstraint")], p3);
- // node_modules/@arcgis/core/Ground.js
- var w;
- var C = s.getLogger("esri.Ground");
- var S2 = w = class extends u(m2) {
- constructor(r6) {
- super(r6), this.opacity = 1, this.surfaceColor = null, this.navigationConstraint = null, this.layers = new j();
- const e2 = (r7) => {
- r7.parent && r7.parent !== this && "remove" in r7.parent && r7.parent.remove(r7), r7.parent = this, r7.type !== "elevation" && r7.type !== "base-elevation" && C.error(`Layer '${r7.title}, id:${r7.id}' of type '${r7.type}' is not supported as a ground layer and will therefore be ignored. Only layers of type 'elevation' are supported.`);
- }, t5 = (r7) => {
- r7.parent = null;
- };
- this.layers.on("after-add", (r7) => e2(r7.item)), this.layers.on("after-remove", (r7) => t5(r7.item));
- }
- initialize() {
- this.when().catch((r6) => {
- C.error("#load()", "Failed to load ground", r6);
- }), this.resourceInfo && this.read(this.resourceInfo.data, this.resourceInfo.context);
- }
- destroy() {
- const r6 = this.layers.removeAll();
- for (const e2 of r6)
- e2.destroy();
- this.layers.destroy();
- }
- normalizeCtorArgs(r6) {
- return r6 && "resourceInfo" in r6 && (this._set("resourceInfo", r6.resourceInfo), delete (r6 = { ...r6 }).resourceInfo), r6;
- }
- set layers(r6) {
- this._set("layers", n3(r6, this._get("layers")));
- }
- writeLayers(r6, e2, o2, t5) {
- const i3 = [];
- r6 ? (t5 = { ...t5, layerContainerType: "ground" }, r6.forEach((r7) => {
- if ("write" in r7) {
- const e3 = {};
- o(r7)().write(e3, t5) && i3.push(e3);
- } else
- t5 && t5.messages && t5.messages.push(new s2("layer:unsupported", `Layers (${r7.title}, ${r7.id}) of type '${r7.declaredClass}' cannot be persisted in the ground`, { layer: r7 }));
- }), e2.layers = i3) : e2.layers = i3;
- }
- load(r6) {
- return this.addResolvingPromise(this._loadFromSource(r6)), Promise.resolve(this);
- }
- loadAll() {
- return n4(this, (r6) => {
- r6(this.layers);
- });
- }
- async queryElevation(r6, e2) {
- await this.load({ signal: e2?.signal });
- const { ElevationQuery: o2 } = await import("./ElevationQuery-H57OAGAY.js");
- f(e2);
- const t5 = new o2(), s5 = this.layers.filter(L).toArray();
- return t5.queryAll(s5, r6, e2);
- }
- async createElevationSampler(r6, e2) {
- await this.load({ signal: e2?.signal });
- const { ElevationQuery: o2 } = await import("./ElevationQuery-H57OAGAY.js");
- f(e2);
- const t5 = new o2(), s5 = this.layers.filter(L).toArray();
- return t5.createSamplerAll(s5, r6, e2);
- }
- clone() {
- const r6 = { opacity: this.opacity, surfaceColor: m(this.surfaceColor), navigationConstraint: m(this.navigationConstraint), layers: this.layers.slice() };
- return this.loaded && (r6.loadStatus = "loaded"), new w({ resourceInfo: this.resourceInfo }).set(r6);
- }
- read(r6, e2) {
- this.resourceInfo || this._set("resourceInfo", { data: r6, context: e2 }), super.read(r6, e2);
- }
- _loadFromSource(r6) {
- const e2 = this.resourceInfo;
- return e2 ? this._loadLayersFromJSON(e2.data, e2.context, r6) : Promise.resolve(null);
- }
- _loadLayersFromJSON(r6, e2, o2) {
- const t5 = e2 && e2.origin || "web-scene", s5 = e2 && e2.portal || null, a2 = e2 && e2.url || null;
- return import("./layersCreator-EE7XPTEN.js").then(({ populateOperationalLayers: e3 }) => {
- f(o2);
- const i3 = [];
- if (r6.layers && Array.isArray(r6.layers)) {
- const o3 = { context: { origin: t5, url: a2, portal: s5, layerContainerType: "ground" }, defaultLayerType: "ArcGISTiledElevationServiceLayer" };
- i3.push(e3(this.layers, r6.layers, o3));
- }
- return E(i3);
- }).then(() => {
- });
- }
- };
- function I(r6) {
- return r6 && "createElevationSampler" in r6;
- }
- function L(r6) {
- return r6.type === "elevation" || I(r6);
- }
- e([d({ json: { read: false } })], S2.prototype, "layers", null), e([r2("layers")], S2.prototype, "writeLayers", null), e([d({ readOnly: true })], S2.prototype, "resourceInfo", void 0), e([d({ type: Number, nonNullable: true, range: { min: 0, max: 1 }, json: { type: S, read: { reader: r4, source: "transparency" }, write: { writer: (r6, e2) => {
- e2.transparency = n5(r6);
- }, target: "transparency" } } })], S2.prototype, "opacity", void 0), e([d({ type: l2, json: { type: [S], write: (r6, e2) => {
- e2.surfaceColor = r6.toJSON().slice(0, 3);
- } } })], S2.prototype, "surfaceColor", void 0), e([d({ type: p3, json: { write: true } })], S2.prototype, "navigationConstraint", void 0), S2 = w = e([n("esri.Ground")], S2);
- var A = S2;
- // node_modules/@arcgis/core/layers/support/editableLayers.js
- function i(i3) {
- return !!(i3 && i3.loaded && "capabilities" in i3 && i3?.capabilities?.operations && "supportsEditing" in i3.capabilities.operations && i3.capabilities.operations.supportsEditing === true) && !("editingEnabled" in i3 && !i3.editingEnabled);
- }
- // node_modules/@arcgis/core/support/basemapUtils.js
- var f2 = s.getLogger("esri.support.basemapUtils");
- function p4() {
- return {};
- }
- function y4(e2) {
- for (const r6 in e2) {
- const a2 = e2[r6];
- a2?.destroyed === false && a2.destroy(), delete e2[r6];
- }
- }
- function m3(a2, t5) {
- let n6;
- if (typeof a2 == "string") {
- if (!(a2 in s4)) {
- const e2 = Object.entries(s4).filter(([e3, a3]) => r.apiKey && !a3.classic || !r.apiKey && a3.classic && !a3.deprecated).map(([e3]) => `"${e3}"`).join(", ");
- return f2.warn(`Unable to find basemap definition for: ${a2}. Try one of these: ${e2}`), null;
- }
- t5 && (n6 = t5[a2]), n6 || (n6 = x.fromId(a2), t5 && (t5[a2] = n6));
- } else
- n6 = b(x, a2);
- return n6?.destroyed && (f2.warn("The provided basemap is already destroyed", { basemap: n6 }), n6 = null), n6;
- }
- // node_modules/@arcgis/core/support/groundUtils.js
- var i2 = s.getLogger("esri.support.groundUtils");
- var t4 = { "world-elevation": { id: "worldElevation", url: "//elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer", layerType: "ArcGISTiledElevationServiceLayer" }, "world-topobathymetry": { id: "worldTopoBathymetry", url: "//elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/TopoBathy3D/ImageServer", layerType: "ArcGISTiledElevationServiceLayer" } };
- function a(r6) {
- let a2 = null;
- if (typeof r6 == "string")
- if (r6 in t4) {
- const o2 = t4[r6];
- a2 = new A({ resourceInfo: { data: { layers: [o2] } } });
- } else
- i2.warn(`Unable to find ground definition for: ${r6}. Try "world-elevation"`);
- else
- a2 = b(A, r6);
- return a2;
- }
- // node_modules/@arcgis/core/Map.js
- var j2 = class extends p2(y2(n2.EventedMixin(y))) {
- constructor(s5) {
- super(s5), this.allLayers = new p({ getCollections: () => [this.basemap?.baseLayers, this.ground?.layers, this.layers, this.basemap?.referenceLayers], getChildrenFunction: (s6) => "layers" in s6 ? s6.layers : null }), this.allTables = t2(this), this.basemap = null, this.editableLayers = new p({ getCollections: () => [this.allLayers], itemFilterFunction: i }), this.ground = new A(), this._basemapCache = p4();
- }
- destroy() {
- this.allLayers.destroy(), this.allTables.destroy(), this.editableLayers.destroy(), this.ground?.destroy(), this.basemap?.destroy(), y4(this._basemapCache), this._basemapCache = null;
- }
- castBasemap(s5) {
- return m3(s5, this._basemapCache);
- }
- castGround(s5) {
- const e2 = a(s5);
- return t(e2) ? this._get("ground") : e2;
- }
- findLayerById(s5) {
- return this.allLayers.find((e2) => e2.id === s5);
- }
- findTableById(s5) {
- return this.allTables.find((e2) => e2.id === s5);
- }
- };
- e([d({ readOnly: true, dependsOn: [] })], j2.prototype, "allLayers", void 0), e([d({ readOnly: true })], j2.prototype, "allTables", void 0), e([d({ type: x })], j2.prototype, "basemap", void 0), e([s3("basemap")], j2.prototype, "castBasemap", null), e([d({ readOnly: true })], j2.prototype, "editableLayers", void 0), e([d({ type: A, nonNullable: true })], j2.prototype, "ground", void 0), e([s3("ground")], j2.prototype, "castGround", null), j2 = e([n("esri.Map")], j2);
- var L2 = j2;
- export {
- L2 as L
- };
- //# sourceMappingURL=chunk-VV2ERHT5.js.map
|