chunk-VV2ERHT5.js 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260
  1. import {
  2. p as p2,
  3. t as t2,
  4. y as y2
  5. } from "./chunk-77N52HSV.js";
  6. import {
  7. s as s4,
  8. x
  9. } from "./chunk-Q2XBTNPG.js";
  10. import {
  11. n as n4
  12. } from "./chunk-5MVUZO4F.js";
  13. import {
  14. p
  15. } from "./chunk-V7H6CJ37.js";
  16. import {
  17. o
  18. } from "./chunk-H2KDMZTR.js";
  19. import {
  20. l as l2
  21. } from "./chunk-7XXXCK2A.js";
  22. import {
  23. r as r3
  24. } from "./chunk-7ZIDBK7B.js";
  25. import {
  26. n as n5,
  27. r as r4
  28. } from "./chunk-6A4U74YA.js";
  29. import {
  30. n as n3
  31. } from "./chunk-AFZ7XSEW.js";
  32. import {
  33. m as m2
  34. } from "./chunk-TBBTRX4O.js";
  35. import {
  36. j
  37. } from "./chunk-ALDCDSPV.js";
  38. import {
  39. n as n2
  40. } from "./chunk-DT6EAZQ5.js";
  41. import {
  42. s as s3
  43. } from "./chunk-GCDJLKH4.js";
  44. import {
  45. r as r2
  46. } from "./chunk-MRJEICT6.js";
  47. import {
  48. d,
  49. e,
  50. l3 as l,
  51. n2 as n,
  52. u2 as u,
  53. y3 as y
  54. } from "./chunk-Y3WMVFTW.js";
  55. import {
  56. S,
  57. b
  58. } from "./chunk-IHXECKQQ.js";
  59. import {
  60. E,
  61. f
  62. } from "./chunk-ULGDPLM2.js";
  63. import {
  64. r,
  65. s,
  66. s3 as s2
  67. } from "./chunk-EMJ4ZSM2.js";
  68. import {
  69. m
  70. } from "./chunk-IKP3YN53.js";
  71. import {
  72. t
  73. } from "./chunk-GZT4BVFP.js";
  74. // node_modules/@arcgis/core/ground/NavigationConstraint.js
  75. var t3;
  76. var p3 = t3 = class extends l {
  77. constructor(o2) {
  78. super(o2), this.type = "none";
  79. }
  80. clone() {
  81. return new t3({ type: this.type });
  82. }
  83. };
  84. e([r3({ none: "none", stayAbove: "stay-above" })], p3.prototype, "type", void 0), p3 = t3 = e([n("esri.ground.NavigationConstraint")], p3);
  85. // node_modules/@arcgis/core/Ground.js
  86. var w;
  87. var C = s.getLogger("esri.Ground");
  88. var S2 = w = class extends u(m2) {
  89. constructor(r6) {
  90. super(r6), this.opacity = 1, this.surfaceColor = null, this.navigationConstraint = null, this.layers = new j();
  91. const e2 = (r7) => {
  92. 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.`);
  93. }, t5 = (r7) => {
  94. r7.parent = null;
  95. };
  96. this.layers.on("after-add", (r7) => e2(r7.item)), this.layers.on("after-remove", (r7) => t5(r7.item));
  97. }
  98. initialize() {
  99. this.when().catch((r6) => {
  100. C.error("#load()", "Failed to load ground", r6);
  101. }), this.resourceInfo && this.read(this.resourceInfo.data, this.resourceInfo.context);
  102. }
  103. destroy() {
  104. const r6 = this.layers.removeAll();
  105. for (const e2 of r6)
  106. e2.destroy();
  107. this.layers.destroy();
  108. }
  109. normalizeCtorArgs(r6) {
  110. return r6 && "resourceInfo" in r6 && (this._set("resourceInfo", r6.resourceInfo), delete (r6 = { ...r6 }).resourceInfo), r6;
  111. }
  112. set layers(r6) {
  113. this._set("layers", n3(r6, this._get("layers")));
  114. }
  115. writeLayers(r6, e2, o2, t5) {
  116. const i3 = [];
  117. r6 ? (t5 = { ...t5, layerContainerType: "ground" }, r6.forEach((r7) => {
  118. if ("write" in r7) {
  119. const e3 = {};
  120. o(r7)().write(e3, t5) && i3.push(e3);
  121. } else
  122. 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 }));
  123. }), e2.layers = i3) : e2.layers = i3;
  124. }
  125. load(r6) {
  126. return this.addResolvingPromise(this._loadFromSource(r6)), Promise.resolve(this);
  127. }
  128. loadAll() {
  129. return n4(this, (r6) => {
  130. r6(this.layers);
  131. });
  132. }
  133. async queryElevation(r6, e2) {
  134. await this.load({ signal: e2?.signal });
  135. const { ElevationQuery: o2 } = await import("./ElevationQuery-H57OAGAY.js");
  136. f(e2);
  137. const t5 = new o2(), s5 = this.layers.filter(L).toArray();
  138. return t5.queryAll(s5, r6, e2);
  139. }
  140. async createElevationSampler(r6, e2) {
  141. await this.load({ signal: e2?.signal });
  142. const { ElevationQuery: o2 } = await import("./ElevationQuery-H57OAGAY.js");
  143. f(e2);
  144. const t5 = new o2(), s5 = this.layers.filter(L).toArray();
  145. return t5.createSamplerAll(s5, r6, e2);
  146. }
  147. clone() {
  148. const r6 = { opacity: this.opacity, surfaceColor: m(this.surfaceColor), navigationConstraint: m(this.navigationConstraint), layers: this.layers.slice() };
  149. return this.loaded && (r6.loadStatus = "loaded"), new w({ resourceInfo: this.resourceInfo }).set(r6);
  150. }
  151. read(r6, e2) {
  152. this.resourceInfo || this._set("resourceInfo", { data: r6, context: e2 }), super.read(r6, e2);
  153. }
  154. _loadFromSource(r6) {
  155. const e2 = this.resourceInfo;
  156. return e2 ? this._loadLayersFromJSON(e2.data, e2.context, r6) : Promise.resolve(null);
  157. }
  158. _loadLayersFromJSON(r6, e2, o2) {
  159. const t5 = e2 && e2.origin || "web-scene", s5 = e2 && e2.portal || null, a2 = e2 && e2.url || null;
  160. return import("./layersCreator-EE7XPTEN.js").then(({ populateOperationalLayers: e3 }) => {
  161. f(o2);
  162. const i3 = [];
  163. if (r6.layers && Array.isArray(r6.layers)) {
  164. const o3 = { context: { origin: t5, url: a2, portal: s5, layerContainerType: "ground" }, defaultLayerType: "ArcGISTiledElevationServiceLayer" };
  165. i3.push(e3(this.layers, r6.layers, o3));
  166. }
  167. return E(i3);
  168. }).then(() => {
  169. });
  170. }
  171. };
  172. function I(r6) {
  173. return r6 && "createElevationSampler" in r6;
  174. }
  175. function L(r6) {
  176. return r6.type === "elevation" || I(r6);
  177. }
  178. 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) => {
  179. e2.transparency = n5(r6);
  180. }, target: "transparency" } } })], S2.prototype, "opacity", void 0), e([d({ type: l2, json: { type: [S], write: (r6, e2) => {
  181. e2.surfaceColor = r6.toJSON().slice(0, 3);
  182. } } })], S2.prototype, "surfaceColor", void 0), e([d({ type: p3, json: { write: true } })], S2.prototype, "navigationConstraint", void 0), S2 = w = e([n("esri.Ground")], S2);
  183. var A = S2;
  184. // node_modules/@arcgis/core/layers/support/editableLayers.js
  185. function i(i3) {
  186. 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);
  187. }
  188. // node_modules/@arcgis/core/support/basemapUtils.js
  189. var f2 = s.getLogger("esri.support.basemapUtils");
  190. function p4() {
  191. return {};
  192. }
  193. function y4(e2) {
  194. for (const r6 in e2) {
  195. const a2 = e2[r6];
  196. a2?.destroyed === false && a2.destroy(), delete e2[r6];
  197. }
  198. }
  199. function m3(a2, t5) {
  200. let n6;
  201. if (typeof a2 == "string") {
  202. if (!(a2 in s4)) {
  203. const e2 = Object.entries(s4).filter(([e3, a3]) => r.apiKey && !a3.classic || !r.apiKey && a3.classic && !a3.deprecated).map(([e3]) => `"${e3}"`).join(", ");
  204. return f2.warn(`Unable to find basemap definition for: ${a2}. Try one of these: ${e2}`), null;
  205. }
  206. t5 && (n6 = t5[a2]), n6 || (n6 = x.fromId(a2), t5 && (t5[a2] = n6));
  207. } else
  208. n6 = b(x, a2);
  209. return n6?.destroyed && (f2.warn("The provided basemap is already destroyed", { basemap: n6 }), n6 = null), n6;
  210. }
  211. // node_modules/@arcgis/core/support/groundUtils.js
  212. var i2 = s.getLogger("esri.support.groundUtils");
  213. 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" } };
  214. function a(r6) {
  215. let a2 = null;
  216. if (typeof r6 == "string")
  217. if (r6 in t4) {
  218. const o2 = t4[r6];
  219. a2 = new A({ resourceInfo: { data: { layers: [o2] } } });
  220. } else
  221. i2.warn(`Unable to find ground definition for: ${r6}. Try "world-elevation"`);
  222. else
  223. a2 = b(A, r6);
  224. return a2;
  225. }
  226. // node_modules/@arcgis/core/Map.js
  227. var j2 = class extends p2(y2(n2.EventedMixin(y))) {
  228. constructor(s5) {
  229. 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();
  230. }
  231. destroy() {
  232. this.allLayers.destroy(), this.allTables.destroy(), this.editableLayers.destroy(), this.ground?.destroy(), this.basemap?.destroy(), y4(this._basemapCache), this._basemapCache = null;
  233. }
  234. castBasemap(s5) {
  235. return m3(s5, this._basemapCache);
  236. }
  237. castGround(s5) {
  238. const e2 = a(s5);
  239. return t(e2) ? this._get("ground") : e2;
  240. }
  241. findLayerById(s5) {
  242. return this.allLayers.find((e2) => e2.id === s5);
  243. }
  244. findTableById(s5) {
  245. return this.allTables.find((e2) => e2.id === s5);
  246. }
  247. };
  248. 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);
  249. var L2 = j2;
  250. export {
  251. L2 as L
  252. };
  253. //# sourceMappingURL=chunk-VV2ERHT5.js.map