StreamLayer-BWRCEZIN.js 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290
  1. import {
  2. n as n4,
  3. p as p5
  4. } from "./chunk-X42TFXOU.js";
  5. import "./chunk-JFSMKLAQ.js";
  6. import "./chunk-LXOC7SMQ.js";
  7. import {
  8. s as s4
  9. } from "./chunk-DN6W4TJU.js";
  10. import {
  11. t as t2
  12. } from "./chunk-5GYJGY4C.js";
  13. import {
  14. a
  15. } from "./chunk-XEQ4FTFC.js";
  16. import "./chunk-JM5OVQAD.js";
  17. import {
  18. p as p4
  19. } from "./chunk-ZOKNWEG3.js";
  20. import {
  21. i as i2,
  22. j2 as j
  23. } from "./chunk-JAUFBT5U.js";
  24. import {
  25. o as o3
  26. } from "./chunk-W6U6FKJ3.js";
  27. import {
  28. p as p6
  29. } from "./chunk-7C2KDOAI.js";
  30. import {
  31. n as n3,
  32. o as o2,
  33. p as p2,
  34. p2 as p3
  35. } from "./chunk-RHFU6KWO.js";
  36. import {
  37. C
  38. } from "./chunk-3FNKD2EB.js";
  39. import "./chunk-ZOO4I2U4.js";
  40. import "./chunk-JPUFJK2B.js";
  41. import "./chunk-HZ2WKB3G.js";
  42. import "./chunk-3HCJD762.js";
  43. import "./chunk-RVCE264D.js";
  44. import "./chunk-HKJ7X3BD.js";
  45. import "./chunk-Y74D3LKQ.js";
  46. import "./chunk-PK4W65H4.js";
  47. import "./chunk-7C23ILQ4.js";
  48. import {
  49. k as k2
  50. } from "./chunk-P6VVVEX6.js";
  51. import {
  52. M
  53. } from "./chunk-3Z755LKF.js";
  54. import "./chunk-LTZ5XXDV.js";
  55. import "./chunk-IEU3AM37.js";
  56. import "./chunk-SKKBVHTF.js";
  57. import "./chunk-DLMAGHHC.js";
  58. import {
  59. x
  60. } from "./chunk-WD4J43GZ.js";
  61. import "./chunk-JOYXMSKE.js";
  62. import "./chunk-SZFMKPVM.js";
  63. import "./chunk-JLYTER4T.js";
  64. import "./chunk-CRHRHOXH.js";
  65. import "./chunk-ZSW35JPD.js";
  66. import "./chunk-JLSNMUQJ.js";
  67. import "./chunk-ECY35CJI.js";
  68. import "./chunk-PT62335L.js";
  69. import "./chunk-JGBXYDGB.js";
  70. import "./chunk-QEWF7QPH.js";
  71. import "./chunk-PJNBFKPF.js";
  72. import "./chunk-C7742RNZ.js";
  73. import "./chunk-FNA5GLRW.js";
  74. import "./chunk-MCWCB5IY.js";
  75. import "./chunk-TV3CFJQR.js";
  76. import "./chunk-TJV6ODRM.js";
  77. import {
  78. v
  79. } from "./chunk-JUWKPBLS.js";
  80. import {
  81. c as c2
  82. } from "./chunk-WLSB4F4I.js";
  83. import {
  84. I,
  85. c,
  86. f,
  87. l as l2,
  88. m,
  89. p as p7,
  90. v as v2
  91. } from "./chunk-GLSWDDR3.js";
  92. import {
  93. O
  94. } from "./chunk-MIQGEDET.js";
  95. import {
  96. x as x3
  97. } from "./chunk-DUEMJ5XS.js";
  98. import "./chunk-VRLXUHP2.js";
  99. import "./chunk-3LVSQLWJ.js";
  100. import "./chunk-4ONPMX2F.js";
  101. import {
  102. F,
  103. x as x2
  104. } from "./chunk-CRGY2SDS.js";
  105. import "./chunk-4T5ZGMEN.js";
  106. import {
  107. p
  108. } from "./chunk-GN35O2ZO.js";
  109. import {
  110. n as n2
  111. } from "./chunk-XTVKPAWY.js";
  112. import "./chunk-3OSQ6GXO.js";
  113. import "./chunk-3WQOA5CB.js";
  114. import {
  115. t
  116. } from "./chunk-PLWDAYK7.js";
  117. import "./chunk-FZQZIM7U.js";
  118. import "./chunk-CZBRZ6SU.js";
  119. import "./chunk-VGWC3IKZ.js";
  120. import "./chunk-2H5MD622.js";
  121. import "./chunk-3RSFVUKZ.js";
  122. import "./chunk-UVVU4UUO.js";
  123. import "./chunk-O6VYMEIX.js";
  124. import "./chunk-X4SA4ELJ.js";
  125. import "./chunk-5N7JLUJJ.js";
  126. import "./chunk-ZAY3CMAZ.js";
  127. import "./chunk-P3XKUGLS.js";
  128. import "./chunk-2ZSOO377.js";
  129. import "./chunk-YUA3AHKR.js";
  130. import "./chunk-LU5IJZB4.js";
  131. import "./chunk-7IBV2TRE.js";
  132. import "./chunk-ZLNEXZAN.js";
  133. import "./chunk-5UVJ64RB.js";
  134. import "./chunk-SFEFRQCL.js";
  135. import {
  136. b
  137. } from "./chunk-DXVOOCG4.js";
  138. import "./chunk-3GZSQU56.js";
  139. import "./chunk-ZYRIJWLX.js";
  140. import "./chunk-RYY6632W.js";
  141. import "./chunk-DW42UVIT.js";
  142. import "./chunk-YAEIHDJH.js";
  143. import "./chunk-TJNOJH33.js";
  144. import "./chunk-OSHI574D.js";
  145. import "./chunk-ETGAZ7LF.js";
  146. import {
  147. i
  148. } from "./chunk-75U5LM2V.js";
  149. import "./chunk-RMDDCMKS.js";
  150. import "./chunk-VCH45Q2I.js";
  151. import "./chunk-LBW34VZ2.js";
  152. import "./chunk-GSSTTHIT.js";
  153. import "./chunk-YFSLJIO4.js";
  154. import "./chunk-IM3LVQXV.js";
  155. import "./chunk-55RWC67C.js";
  156. import "./chunk-HZRKBTHJ.js";
  157. import {
  158. U
  159. } from "./chunk-DVUG3KID.js";
  160. import "./chunk-FWSQEIAR.js";
  161. import "./chunk-VEGAOVMY.js";
  162. import {
  163. o,
  164. w2
  165. } from "./chunk-6T6G6LCQ.js";
  166. import "./chunk-YEJL5NEF.js";
  167. import {
  168. k2 as k
  169. } from "./chunk-PQFTYGF5.js";
  170. import {
  171. e,
  172. l3 as l,
  173. n5 as n,
  174. s5 as s3,
  175. y3 as y
  176. } from "./chunk-2Z2TG5CU.js";
  177. import "./chunk-6KZ2LTDA.js";
  178. import "./chunk-U2XHEJM7.js";
  179. import {
  180. T
  181. } from "./chunk-SQOPWYIT.js";
  182. import {
  183. w
  184. } from "./chunk-V6P2MAQQ.js";
  185. import {
  186. s2 as s,
  187. s3 as s2
  188. } from "./chunk-E5O6P5I2.js";
  189. import "./chunk-SPWQ3AWG.js";
  190. import "./chunk-2TIUKVZN.js";
  191. import {
  192. r
  193. } from "./chunk-YXWMMD76.js";
  194. import "./chunk-S5KM4IGW.js";
  195. // node_modules/@arcgis/core/layers/support/PurgeOptions.js
  196. var t3;
  197. var i3 = t3 = class extends l {
  198. constructor() {
  199. super(...arguments), this.age = null, this.ageReceived = null, this.displayCount = null, this.maxObservations = 1;
  200. }
  201. clone() {
  202. return new t3({ age: this.age, ageReceived: this.ageReceived, displayCount: this.displayCount, maxObservations: this.maxObservations });
  203. }
  204. };
  205. e([y({ type: Number, json: { write: true } })], i3.prototype, "age", void 0), e([y({ type: Number, json: { write: true } })], i3.prototype, "ageReceived", void 0), e([y({ type: Number, json: { write: true } })], i3.prototype, "displayCount", void 0), e([y({ type: Number, json: { write: true } })], i3.prototype, "maxObservations", void 0), i3 = t3 = e([n("esri.layers.support.PurgeOptions")], i3);
  206. var p8 = i3;
  207. // node_modules/@arcgis/core/layers/StreamLayer.js
  208. var X = s4();
  209. var Y = class extends n4(p5(n2(a(t(p(p4(c2(v(O(o3(b))))))))))) {
  210. constructor(...e2) {
  211. super(...e2), this.copyright = null, this.definitionExpression = null, this.displayField = null, this.elevationInfo = null, this.fields = null, this.fieldsIndex = null, this.geometryDefinition = null, this.geometryType = null, this.labelsVisible = true, this.labelingInfo = null, this.legendEnabled = true, this.maxReconnectionAttempts = 0, this.maxReconnectionInterval = 20, this.maxScale = 0, this.minScale = 0, this.objectIdField = null, this.operationalLayerType = "ArcGISStreamLayer", this.popupEnabled = true, this.popupTemplate = null, this.purgeOptions = new p8(), this.screenSizePerspectiveEnabled = true, this.sourceJSON = null, this.spatialReference = k.WGS84, this.type = "stream", this.url = null, this.updateInterval = 300, this.webSocketUrl = null;
  212. }
  213. normalizeCtorArgs(e2, r2) {
  214. return "string" == typeof e2 ? { url: e2, ...r2 } : e2;
  215. }
  216. load(e2) {
  217. if (!("WebSocket" in globalThis))
  218. return this.addResolvingPromise(Promise.reject(new s2("stream-layer:websocket-unsupported", "WebSocket is not supported in this browser. StreamLayer will not have real-time connection with the stream service."))), Promise.resolve(this);
  219. const r2 = r(e2) ? e2.signal : null;
  220. return this.addResolvingPromise(this.loadFromPortal({ supportedTypes: ["Stream Service", "Feed"] }, e2).catch(w).then(() => this._fetchService(r2))), Promise.resolve(this);
  221. }
  222. get defaultPopupTemplate() {
  223. return this.createPopupTemplate();
  224. }
  225. set renderer(e2) {
  226. F(e2, this.fieldsIndex), this._set("renderer", e2);
  227. }
  228. readRenderer(e2, r2, s5) {
  229. const n5 = (r2 = r2.layerDefinition || r2).drawingInfo && r2.drawingInfo.renderer || void 0;
  230. if (n5) {
  231. const e3 = o2(n5, r2, s5) || void 0;
  232. return e3 || s.getLogger(this.declaredClass).error("Failed to create renderer", { rendererDefinition: r2.drawingInfo.renderer, layer: this, context: s5 }), e3;
  233. }
  234. if (r2.defaultSymbol)
  235. return r2.types && r2.types.length ? new C({ defaultSymbol: Z(r2.defaultSymbol, r2, s5), field: r2.typeIdField, uniqueValueInfos: r2.types.map((e3) => ({ id: e3.id, symbol: Z(e3.symbol, e3, s5) })) }) : new p2({ symbol: Z(r2.defaultSymbol, r2, s5) });
  236. }
  237. async connect(e2) {
  238. const [{ createConnection: r2 }] = await Promise.all([import("./createConnection-DO7F3L4B.js"), this.load()]), t4 = i.toJSON(this.geometryType), { customParameters: o4 = null, definitionExpression: i4 = null, geometryDefinition: s5 = null, maxReconnectionAttempts: n5 = 0, maxReconnectionInterval: p9 = 20, spatialReference: a2 = this.spatialReference } = e2 || this.createConnectionParameters();
  239. return r2(this.parsedUrl, this.spatialReference, a2, t4, { geometry: s5, where: i4 }, n5, p9, o4);
  240. }
  241. createConnectionParameters() {
  242. return { spatialReference: this.spatialReference, customParameters: this.customParameters, definitionExpression: this.definitionExpression, geometryDefinition: this.geometryDefinition, maxReconnectionAttempts: this.maxReconnectionAttempts, maxReconnectionInterval: this.maxReconnectionInterval };
  243. }
  244. createPopupTemplate(e2) {
  245. return p6(this, e2);
  246. }
  247. createQuery() {
  248. const e2 = new x();
  249. return e2.returnGeometry = true, e2.outFields = ["*"], e2.where = this.definitionExpression || "1=1", e2;
  250. }
  251. getFieldDomain(e2, r2) {
  252. if (!this.fields)
  253. return null;
  254. let t4 = null;
  255. return this.fields.some((r3) => (r3.name === e2 && (t4 = r3.domain), !!t4)), t4;
  256. }
  257. getField(e2) {
  258. return this.fieldsIndex.get(e2);
  259. }
  260. serviceSupportsSpatialReference(e2) {
  261. return true;
  262. }
  263. async _fetchService(e2) {
  264. var _a, _b;
  265. if (!!this.webSocketUrl) {
  266. if (!((_a = this.timeInfo) == null ? void 0 : _a.trackIdField))
  267. throw new s2("stream-layer:missing-metadata", "The stream layer trackIdField must be specified.");
  268. if (!this.objectIdField)
  269. throw new s2("stream-layer:missing-metadata", "The stream layer objectIdField must be specified.");
  270. if (!this.fields)
  271. throw new s2("stream-layer:missing-metadata", "The stream layer fields must be specified.");
  272. if (!this.geometryType)
  273. throw new s2("stream-layer:missing-metadata", "The stream layer geometryType must be specified.");
  274. this.url = this.webSocketUrl;
  275. } else if (!this.sourceJSON) {
  276. const { data: r2 } = await U(this.parsedUrl.path, { query: { f: "json", ...this.customParameters, ...this.parsedUrl.query }, responseType: "json", signal: e2 });
  277. this.sourceJSON = r2;
  278. }
  279. return this.sourceJSON = { ...(_b = this.sourceJSON) != null ? _b : {}, objectIdField: "__esri_stream_id__" }, this.read(this.sourceJSON, { origin: "service", url: this.parsedUrl }), F(this.renderer, this.fieldsIndex), x2(this.timeInfo, this.fieldsIndex), t2(this, { origin: "service" });
  280. }
  281. };
  282. e([y({ type: String })], Y.prototype, "copyright", void 0), e([y({ readOnly: true })], Y.prototype, "defaultPopupTemplate", null), e([y({ type: String, json: { name: "layerDefinition.definitionExpression", write: { enabled: true, allowNull: true } } })], Y.prototype, "definitionExpression", void 0), e([y({ type: String })], Y.prototype, "displayField", void 0), e([y({ type: x3 })], Y.prototype, "elevationInfo", void 0), e([y(X.fields)], Y.prototype, "fields", void 0), e([y(X.fieldsIndex)], Y.prototype, "fieldsIndex", void 0), e([y({ type: w2 })], Y.prototype, "geometryDefinition", void 0), e([y({ type: i.apiValues, json: { read: { reader: i.read } } })], Y.prototype, "geometryType", void 0), e([y(m)], Y.prototype, "labelsVisible", void 0), e([y({ type: [j], json: { read: { source: "layerDefinition.drawingInfo.labelingInfo", reader: i2 }, write: { target: "layerDefinition.drawingInfo.labelingInfo" } } })], Y.prototype, "labelingInfo", void 0), e([y(c)], Y.prototype, "legendEnabled", void 0), e([y({ type: ["show", "hide"] })], Y.prototype, "listMode", void 0), e([y({ type: T })], Y.prototype, "maxReconnectionAttempts", void 0), e([y({ type: T })], Y.prototype, "maxReconnectionInterval", void 0), e([y(I)], Y.prototype, "maxScale", void 0), e([y(v2)], Y.prototype, "minScale", void 0), e([y({ type: String })], Y.prototype, "objectIdField", void 0), e([y({ value: "ArcGISStreamLayer", type: ["ArcGISStreamLayer"] })], Y.prototype, "operationalLayerType", void 0), e([y(p7)], Y.prototype, "popupEnabled", void 0), e([y({ type: k2, json: { read: { source: "popupInfo" }, write: { target: "popupInfo" } } })], Y.prototype, "popupTemplate", void 0), e([y({ type: p8 })], Y.prototype, "purgeOptions", void 0), e([y({ types: p3, json: { origins: { service: { write: { target: "drawingInfo.renderer", enabled: false } }, "web-scene": { name: "layerDefinition.drawingInfo.renderer", types: n3, write: true } }, write: { target: "layerDefinition.drawingInfo.renderer" } } })], Y.prototype, "renderer", null), e([o("service", "renderer", ["drawingInfo.renderer", "defaultSymbol"]), o("renderer", ["layerDefinition.drawingInfo.renderer", "layerDefinition.defaultSymbol"])], Y.prototype, "readRenderer", null), e([y(l2)], Y.prototype, "screenSizePerspectiveEnabled", void 0), e([y()], Y.prototype, "sourceJSON", void 0), e([y({ type: k, json: { origins: { service: { read: { source: "spatialReference" } } } } })], Y.prototype, "spatialReference", void 0), e([y({ json: { read: false } })], Y.prototype, "type", void 0), e([y(f)], Y.prototype, "url", void 0), e([y({ type: Number })], Y.prototype, "updateInterval", void 0), e([y({ type: String })], Y.prototype, "webSocketUrl", void 0), Y = e([n("esri.layers.StreamLayer")], Y);
  283. var Z = s3({ types: M });
  284. var $ = Y;
  285. export {
  286. $ as default
  287. };
  288. //# sourceMappingURL=StreamLayer-BWRCEZIN.js.map