MapNotesLayer-RWML2Y3H.js 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406
  1. import {
  2. n as n2
  3. } from "./chunk-YDZD6ESX.js";
  4. import {
  5. a as a2,
  6. c as c2
  7. } from "./chunk-LE3RIDC7.js";
  8. import {
  9. Ke
  10. } from "./chunk-6NQ3AA2U.js";
  11. import "./chunk-524XACB7.js";
  12. import "./chunk-XKHC7KKF.js";
  13. import "./chunk-HGDNY7J3.js";
  14. import "./chunk-GD5TMIPM.js";
  15. import "./chunk-ZRX5UNQH.js";
  16. import "./chunk-VEAEIBHK.js";
  17. import "./chunk-6SASJ6IM.js";
  18. import "./chunk-3OHML7FO.js";
  19. import "./chunk-JGOAMEPM.js";
  20. import "./chunk-Z64YKYHD.js";
  21. import "./chunk-2VFJVI2I.js";
  22. import "./chunk-F37AVPUF.js";
  23. import "./chunk-FUEX356Y.js";
  24. import {
  25. L
  26. } from "./chunk-P4UZNLD5.js";
  27. import {
  28. An,
  29. en,
  30. rn,
  31. tn
  32. } from "./chunk-DH2OBAUC.js";
  33. import "./chunk-TNLRDNTC.js";
  34. import "./chunk-OSNKP4CI.js";
  35. import "./chunk-435DJNTD.js";
  36. import "./chunk-T3EUPDKL.js";
  37. import "./chunk-2SJEIKRW.js";
  38. import "./chunk-PHRSJJ3U.js";
  39. import "./chunk-VVBOYBFX.js";
  40. import "./chunk-S7R5EXHN.js";
  41. import "./chunk-FMKGHOGD.js";
  42. import "./chunk-6URTNEGN.js";
  43. import "./chunk-KN7TOKVN.js";
  44. import "./chunk-RQJNTZAL.js";
  45. import "./chunk-QTOOFNRV.js";
  46. import "./chunk-7O56JPWQ.js";
  47. import "./chunk-6B2LQBKM.js";
  48. import "./chunk-MFI6BALW.js";
  49. import "./chunk-CIG5OHC7.js";
  50. import "./chunk-FUD7XO3N.js";
  51. import "./chunk-6EU7GFUT.js";
  52. import "./chunk-MFUAILAT.js";
  53. import "./chunk-HZJYXMI6.js";
  54. import "./chunk-27P5ZSC7.js";
  55. import "./chunk-UPD4MTCL.js";
  56. import "./chunk-GRBROWI6.js";
  57. import "./chunk-5NKYXKIA.js";
  58. import "./chunk-MPWGHCZG.js";
  59. import "./chunk-FTI5VP6T.js";
  60. import {
  61. g
  62. } from "./chunk-RZFGRBD7.js";
  63. import "./chunk-PUSPZYFZ.js";
  64. import {
  65. S2 as S,
  66. m as m2,
  67. m2 as m3,
  68. y as y2
  69. } from "./chunk-EN7YGJWG.js";
  70. import "./chunk-VBNMTM7L.js";
  71. import "./chunk-3D3QEPRE.js";
  72. import "./chunk-JFNNSBWL.js";
  73. import "./chunk-UD63WBG3.js";
  74. import "./chunk-X7DBH4KK.js";
  75. import "./chunk-LY74KTXV.js";
  76. import "./chunk-EWE6EXPY.js";
  77. import "./chunk-KUXNUNAI.js";
  78. import "./chunk-KMAHKQ2G.js";
  79. import "./chunk-522WBHUO.js";
  80. import "./chunk-WNCU6BFU.js";
  81. import "./chunk-PIGRDDRG.js";
  82. import {
  83. y
  84. } from "./chunk-BJHM4JNS.js";
  85. import "./chunk-F6A2QQ26.js";
  86. import "./chunk-XLV7RUSE.js";
  87. import "./chunk-NTUXR253.js";
  88. import "./chunk-EOSZHC5H.js";
  89. import "./chunk-C43UE3Z5.js";
  90. import "./chunk-H2KDMZTR.js";
  91. import "./chunk-RMX2AZ4P.js";
  92. import "./chunk-NE3ESGA6.js";
  93. import "./chunk-YIS6BAC3.js";
  94. import "./chunk-7XXXCK2A.js";
  95. import "./chunk-7ZIDBK7B.js";
  96. import {
  97. v
  98. } from "./chunk-KHA63LLS.js";
  99. import {
  100. c
  101. } from "./chunk-FGKNEJKJ.js";
  102. import {
  103. x
  104. } from "./chunk-PSV473TI.js";
  105. import {
  106. O
  107. } from "./chunk-I3OBGWNS.js";
  108. import "./chunk-FONIFA5N.js";
  109. import "./chunk-EG5OI4V4.js";
  110. import "./chunk-65BYCSII.js";
  111. import "./chunk-WZQZRKNH.js";
  112. import "./chunk-LRDX4TO7.js";
  113. import "./chunk-6A4U74YA.js";
  114. import "./chunk-CYI7KFYB.js";
  115. import {
  116. a
  117. } from "./chunk-5LXROFTA.js";
  118. import "./chunk-GJXW4HL5.js";
  119. import "./chunk-WJW5DUN6.js";
  120. import {
  121. t as t3
  122. } from "./chunk-W72F6AS3.js";
  123. import "./chunk-PJ7ZQ4VD.js";
  124. import "./chunk-WDLTDV2L.js";
  125. import "./chunk-TERAW6FT.js";
  126. import "./chunk-N2663GRX.js";
  127. import "./chunk-O4FY3ITT.js";
  128. import "./chunk-WEMIK25H.js";
  129. import {
  130. b
  131. } from "./chunk-4DDBH2K5.js";
  132. import "./chunk-7N4X6GF3.js";
  133. import "./chunk-JXW4QTJA.js";
  134. import "./chunk-UXF37FQ4.js";
  135. import "./chunk-ZOEK6QHJ.js";
  136. import "./chunk-XNLG7T2T.js";
  137. import "./chunk-IR4PV7VK.js";
  138. import "./chunk-2Z6LERTI.js";
  139. import "./chunk-OWVBLVP3.js";
  140. import "./chunk-AFZ7XSEW.js";
  141. import "./chunk-EGZW6HC3.js";
  142. import "./chunk-4NKD334K.js";
  143. import "./chunk-65K7LC56.js";
  144. import "./chunk-ATPLLI5W.js";
  145. import "./chunk-WJ3OEUD3.js";
  146. import "./chunk-MXB2XLKV.js";
  147. import "./chunk-XH7RUGVZ.js";
  148. import "./chunk-TBBTRX4O.js";
  149. import "./chunk-YBSUITLL.js";
  150. import {
  151. j
  152. } from "./chunk-ALDCDSPV.js";
  153. import "./chunk-DT6EAZQ5.js";
  154. import "./chunk-HNOZUNJ4.js";
  155. import "./chunk-VNFRAYHO.js";
  156. import "./chunk-R5IG2D6H.js";
  157. import "./chunk-VBRY5KJM.js";
  158. import "./chunk-PDKDCAAD.js";
  159. import {
  160. M2 as M,
  161. o as o2
  162. } from "./chunk-ECW2QABR.js";
  163. import "./chunk-GCDJLKH4.js";
  164. import {
  165. E,
  166. k2 as k,
  167. r as r2
  168. } from "./chunk-MRJEICT6.js";
  169. import {
  170. d,
  171. e,
  172. n2 as n,
  173. t as t2
  174. } from "./chunk-Y3WMVFTW.js";
  175. import "./chunk-SAS7RONY.js";
  176. import "./chunk-WSRBH7BF.js";
  177. import "./chunk-IHXECKQQ.js";
  178. import "./chunk-ULGDPLM2.js";
  179. import {
  180. s3 as s
  181. } from "./chunk-EMJ4ZSM2.js";
  182. import {
  183. m,
  184. o
  185. } from "./chunk-IKP3YN53.js";
  186. import {
  187. r,
  188. t
  189. } from "./chunk-GZT4BVFP.js";
  190. import "./chunk-A5ICIBVI.js";
  191. // node_modules/@arcgis/core/layers/GraphicsLayer.js
  192. var n3 = class extends a(t3(b)) {
  193. constructor(r3) {
  194. super(r3), this.elevationInfo = null, this.graphics = new c2(), this.screenSizePerspectiveEnabled = true, this.type = "graphics", this.internal = false;
  195. }
  196. destroy() {
  197. this.removeAll(), this.graphics.destroy();
  198. }
  199. add(r3) {
  200. return this.graphics.add(r3), this;
  201. }
  202. addMany(r3) {
  203. return this.graphics.addMany(r3), this;
  204. }
  205. removeAll() {
  206. return this.graphics.removeAll(), this;
  207. }
  208. remove(r3) {
  209. this.graphics.remove(r3);
  210. }
  211. removeMany(r3) {
  212. this.graphics.removeMany(r3);
  213. }
  214. on(r3, e2) {
  215. return super.on(r3, e2);
  216. }
  217. graphicChanged(r3) {
  218. this.emit("graphic-update", r3);
  219. }
  220. };
  221. e([d({ type: x })], n3.prototype, "elevationInfo", void 0), e([d(a2(c2, "graphics"))], n3.prototype, "graphics", void 0), e([d({ type: ["show", "hide"] })], n3.prototype, "listMode", void 0), e([d()], n3.prototype, "screenSizePerspectiveEnabled", void 0), e([d({ readOnly: true })], n3.prototype, "type", void 0), e([d({ constructOnly: true })], n3.prototype, "internal", void 0), n3 = e([n("esri.layers.GraphicsLayer")], n3);
  222. var h = n3;
  223. // node_modules/@arcgis/core/layers/MapNotesLayer.js
  224. function F(e2) {
  225. return e2.layers.some((e3) => e3.layerDefinition.visibilityField != null);
  226. }
  227. var G = new y({ name: "OBJECTID", alias: "OBJECTID", type: "oid", nullable: false, editable: false });
  228. var _ = new y({ name: "title", alias: "Title", type: "string", nullable: true, editable: true });
  229. var P = class extends h {
  230. constructor(e2) {
  231. super(e2), this.visibilityMode = "inherited";
  232. }
  233. initialize() {
  234. for (const e2 of this.graphics)
  235. e2.sourceLayer = this.layer;
  236. this.graphics.on("after-add", (e2) => {
  237. e2.item.sourceLayer = this.layer;
  238. }), this.graphics.on("after-remove", (e2) => {
  239. e2.item.sourceLayer = null;
  240. });
  241. }
  242. get sublayers() {
  243. return this.graphics;
  244. }
  245. };
  246. e([d({ readOnly: true })], P.prototype, "sublayers", null), e([d()], P.prototype, "layer", void 0), e([d()], P.prototype, "layerId", void 0), e([d({ readOnly: true })], P.prototype, "visibilityMode", void 0), P = e([n("esri.layers.MapNotesLayer.MapNotesSublayer")], P);
  247. var k2 = [{ geometryType: "polygon", geometryTypeJSON: "esriGeometryPolygon", id: "polygonLayer", layerId: 0, title: "Polygons", identifyingSymbol: new S().toJSON() }, { geometryType: "polyline", geometryTypeJSON: "esriGeometryPolyline", id: "polylineLayer", layerId: 1, title: "Polylines", identifyingSymbol: new m2().toJSON() }, { geometryType: "multipoint", geometryTypeJSON: "esriGeometryMultipoint", id: "multipointLayer", layerId: 2, title: "Multipoints", identifyingSymbol: new y2().toJSON() }, { geometryType: "point", geometryTypeJSON: "esriGeometryPoint", id: "pointLayer", layerId: 3, title: "Points", identifyingSymbol: new y2().toJSON() }, { geometryType: "point", geometryTypeJSON: "esriGeometryPoint", id: "textLayer", layerId: 4, title: "Text", identifyingSymbol: new m3().toJSON() }];
  248. var z = class extends a(t3(c(v(O(b))))) {
  249. constructor(e2) {
  250. super(e2), this.capabilities = { operations: { supportsMapNotesEditing: true } }, this.featureCollections = null, this.featureCollectionJSON = null, this.featureCollectionType = "notes", this.legendEnabled = false, this.minScale = 0, this.maxScale = 0, this.spatialReference = k.WGS84, this.sublayers = new j(k2.map((e3) => new P({ id: e3.id, layerId: e3.layerId, title: e3.title, layer: this }))), this.title = "Map Notes", this.type = "map-notes", this.visibilityMode = "inherited";
  251. }
  252. readCapabilities(e2, t4, r3) {
  253. return { operations: { supportsMapNotesEditing: !F(t4) && r3?.origin !== "portal-item" } };
  254. }
  255. readFeatureCollections(e2, t4, o3) {
  256. if (!F(t4))
  257. return null;
  258. const i = t4.layers.map((e3) => {
  259. const t5 = new Ke();
  260. return t5.read(e3, o3), t5;
  261. });
  262. return new j({ items: i });
  263. }
  264. readLegacyfeatureCollectionJSON(e2, t4) {
  265. return F(t4) ? m(t4.featureCollection) : null;
  266. }
  267. readFullExtent(e2, t4) {
  268. if (!t4.layers.length || t4.layers.every((e3) => !e3.layerDefinition.extent))
  269. return new M({ xmin: -180, ymin: -90, xmax: 180, ymax: 90, spatialReference: k.WGS84 });
  270. const r3 = k.fromJSON(t4.layers[0].layerDefinition.spatialReference);
  271. return t4.layers.reduce((e3, t5) => {
  272. const r4 = t5.layerDefinition.extent;
  273. return r4 ? M.fromJSON(r4).union(e3) : e3;
  274. }, new M({ spatialReference: r3 }));
  275. }
  276. readMinScale(e2, t4) {
  277. for (const r3 of t4.layers)
  278. if (r3.layerDefinition.minScale != null)
  279. return r3.layerDefinition.minScale;
  280. return 0;
  281. }
  282. readMaxScale(e2, t4) {
  283. for (const r3 of t4.layers)
  284. if (r3.layerDefinition.maxScale != null)
  285. return r3.layerDefinition.maxScale;
  286. return 0;
  287. }
  288. get multipointLayer() {
  289. return this._findSublayer("multipointLayer");
  290. }
  291. get pointLayer() {
  292. return this._findSublayer("pointLayer");
  293. }
  294. get polygonLayer() {
  295. return this._findSublayer("polygonLayer");
  296. }
  297. get polylineLayer() {
  298. return this._findSublayer("polylineLayer");
  299. }
  300. readSpatialReference(e2, t4) {
  301. return t4.layers.length ? k.fromJSON(t4.layers[0].layerDefinition.spatialReference) : k.WGS84;
  302. }
  303. readSublayers(e2, o3, i) {
  304. if (F(o3))
  305. return null;
  306. const a3 = [];
  307. let l = o3.layers.reduce((e3, t4) => Math.max(e3, t4.layerDefinition.id ?? -1), -1) + 1;
  308. for (const { layerDefinition: r3, featureSet: n4 } of o3.layers) {
  309. const e3 = r3.geometryType ?? n4.geometryType, o4 = r3.id ?? l++, i2 = k2.find((t4) => e3 === t4.geometryTypeJSON && r3.drawingInfo?.renderer?.symbol?.type === t4.identifyingSymbol.type);
  310. if (i2) {
  311. const e4 = new P({ id: i2.id, title: r3.name, layerId: o4, layer: this, graphics: n4.features.map(({ geometry: e5, symbol: r4, attributes: o5, popupInfo: i3 }) => g.fromJSON({ attributes: o5, geometry: e5, symbol: r4, popupTemplate: i3 })) });
  312. a3.push(e4);
  313. }
  314. }
  315. return new j(a3);
  316. }
  317. writeSublayers(e2, t4, r3, i) {
  318. const { minScale: n4, maxScale: p } = this;
  319. if (t(e2))
  320. return;
  321. const y3 = e2.some((e3) => e3.graphics.length > 0);
  322. if (!this.capabilities.operations.supportsMapNotesEditing)
  323. return void (y3 && i?.messages?.push(new s("map-notes-layer:editing-not-supported", "New map notes cannot be added to this layer")));
  324. const m4 = [];
  325. let u = this.spatialReference.toJSON();
  326. e:
  327. for (const o3 of e2)
  328. for (const e3 of o3.graphics)
  329. if (r(e3.geometry)) {
  330. u = e3.geometry.spatialReference.toJSON();
  331. break e;
  332. }
  333. for (const o3 of k2) {
  334. const t5 = e2.find((e3) => o3.id === e3.id);
  335. this._writeMapNoteSublayer(m4, t5, o3, n4, p, u, i);
  336. }
  337. o("featureCollection.layers", m4, t4);
  338. }
  339. get textLayer() {
  340. return this._findSublayer("textLayer");
  341. }
  342. load(e2) {
  343. return this.addResolvingPromise(this.loadFromPortal({ supportedTypes: ["Feature Collection"] }, e2)), Promise.resolve(this);
  344. }
  345. read(e2, t4) {
  346. "featureCollection" in e2 && (e2 = m(e2), Object.assign(e2, e2.featureCollection)), super.read(e2, t4);
  347. }
  348. async beforeSave() {
  349. if (t(this.sublayers))
  350. return;
  351. let e2 = null;
  352. const t4 = [];
  353. for (const o3 of this.sublayers)
  354. for (const r4 of o3.graphics)
  355. if (r(r4.geometry)) {
  356. const o4 = r4.geometry;
  357. e2 ? E(o4.spatialReference, e2) || (An(o4.spatialReference, e2) || en() || await tn(), r4.geometry = rn(o4, e2)) : e2 = o4.spatialReference, t4.push(r4);
  358. }
  359. const r3 = await L(t4.map((e3) => e3.geometry));
  360. t4.forEach((e3, t5) => e3.geometry = r3[t5]);
  361. }
  362. _findSublayer(e2) {
  363. return t(this.sublayers) ? null : this.sublayers?.find((t4) => t4.id === e2) ?? null;
  364. }
  365. _writeMapNoteSublayer(e2, t4, r3, o3, l, n4, s2) {
  366. const p = [];
  367. if (!t(t4)) {
  368. for (const e3 of t4.graphics)
  369. this._writeMapNote(p, e3, r3.geometryType, s2);
  370. this._normalizeObjectIds(p, G), e2.push({ layerDefinition: { name: t4.title, drawingInfo: { renderer: { type: "simple", symbol: m(r3.identifyingSymbol) } }, id: t4.layerId, geometryType: r3.geometryTypeJSON, minScale: o3, maxScale: l, objectIdField: "OBJECTID", fields: [G.toJSON(), _.toJSON()], spatialReference: n4 }, featureSet: { features: p, geometryType: r3.geometryTypeJSON } });
  371. }
  372. }
  373. _writeMapNote(e2, t4, r3, o3) {
  374. if (t(t4))
  375. return;
  376. const { geometry: i, symbol: n4, popupTemplate: s2 } = t4;
  377. if (t(i))
  378. return;
  379. if (i.type !== r3)
  380. return void o3?.messages?.push(new t2("map-notes-layer:invalid-geometry-type", `Geometry "${i.type}" cannot be saved in "${r3}" layer`, { graphic: t4 }));
  381. if (t(n4))
  382. return void o3?.messages?.push(new t2("map-notes-layer:no-symbol", "Skipping map notes with no symbol", { graphic: t4 }));
  383. const y3 = { attributes: { ...t4.attributes }, geometry: i.toJSON(), symbol: n4.toJSON() };
  384. r(s2) && (y3.popupInfo = s2.toJSON()), e2.push(y3);
  385. }
  386. _normalizeObjectIds(e2, t4) {
  387. const r3 = t4.name;
  388. let o3 = n2(r3, e2) + 1;
  389. const i = new Set();
  390. for (const a3 of e2) {
  391. a3.attributes || (a3.attributes = {});
  392. const { attributes: e3 } = a3;
  393. (e3[r3] == null || i.has(e3[r3])) && (e3[r3] = o3++), i.add(e3[r3]);
  394. }
  395. }
  396. };
  397. e([d({ readOnly: true })], z.prototype, "capabilities", void 0), e([o2(["portal-item", "web-map"], "capabilities", ["layers"])], z.prototype, "readCapabilities", null), e([d({ readOnly: true })], z.prototype, "featureCollections", void 0), e([o2(["web-map", "portal-item"], "featureCollections", ["layers"])], z.prototype, "readFeatureCollections", null), e([d({ readOnly: true, json: { origins: { "web-map": { write: { enabled: true, target: "featureCollection" } } } } })], z.prototype, "featureCollectionJSON", void 0), e([o2(["web-map", "portal-item"], "featureCollectionJSON", ["featureCollection"])], z.prototype, "readLegacyfeatureCollectionJSON", null), e([d({ readOnly: true, json: { read: false, write: { enabled: true, ignoreOrigin: true } } })], z.prototype, "featureCollectionType", void 0), e([d({ json: { write: false } })], z.prototype, "fullExtent", void 0), e([o2(["web-map", "portal-item"], "fullExtent", ["layers"])], z.prototype, "readFullExtent", null), e([d({ readOnly: true, json: { origins: { "web-map": { write: { target: "featureCollection.showLegend", overridePolicy() {
  398. return { enabled: this.featureCollectionJSON != null };
  399. } } } } } })], z.prototype, "legendEnabled", void 0), e([d({ type: ["show", "hide"] })], z.prototype, "listMode", void 0), e([d({ type: Number, nonNullable: true, json: { write: false } })], z.prototype, "minScale", void 0), e([o2(["web-map", "portal-item"], "minScale", ["layers"])], z.prototype, "readMinScale", null), e([d({ type: Number, nonNullable: true, json: { write: false } })], z.prototype, "maxScale", void 0), e([o2(["web-map", "portal-item"], "maxScale", ["layers"])], z.prototype, "readMaxScale", null), e([d({ readOnly: true })], z.prototype, "multipointLayer", null), e([d({ value: "ArcGISFeatureLayer", type: ["ArcGISFeatureLayer"] })], z.prototype, "operationalLayerType", void 0), e([d({ readOnly: true })], z.prototype, "pointLayer", null), e([d({ readOnly: true })], z.prototype, "polygonLayer", null), e([d({ readOnly: true })], z.prototype, "polylineLayer", null), e([d({ type: k })], z.prototype, "spatialReference", void 0), e([o2(["web-map", "portal-item"], "spatialReference", ["layers"])], z.prototype, "readSpatialReference", null), e([d({ readOnly: true, json: { origins: { "web-map": { write: { ignoreOrigin: true } } } } })], z.prototype, "sublayers", void 0), e([o2("web-map", "sublayers", ["layers"])], z.prototype, "readSublayers", null), e([r2("web-map", "sublayers")], z.prototype, "writeSublayers", null), e([d({ readOnly: true })], z.prototype, "textLayer", null), e([d()], z.prototype, "title", void 0), e([d({ readOnly: true, json: { read: false } })], z.prototype, "type", void 0), z = e([n("esri.layers.MapNotesLayer")], z);
  400. var B = z;
  401. export {
  402. B as default
  403. };
  404. //# sourceMappingURL=MapNotesLayer-RWML2Y3H.js.map