OGCFeatureLayer-BNYVD2AR.js 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352
  1. import {
  2. F,
  3. I,
  4. N,
  5. S,
  6. T,
  7. j,
  8. k as k2,
  9. v,
  10. x as x2
  11. } from "./chunk-C4RSV5VB.js";
  12. import "./chunk-JK76NUHI.js";
  13. import "./chunk-A6WD5XTM.js";
  14. import "./chunk-OP2HNSVZ.js";
  15. import {
  16. c
  17. } from "./chunk-AOQ55JXI.js";
  18. import {
  19. n as n4,
  20. p as p3
  21. } from "./chunk-X42TFXOU.js";
  22. import "./chunk-JFSMKLAQ.js";
  23. import "./chunk-LXOC7SMQ.js";
  24. import {
  25. s as s2
  26. } from "./chunk-DN6W4TJU.js";
  27. import {
  28. x as x3
  29. } from "./chunk-NLLFSKB2.js";
  30. import "./chunk-JKFWEHNK.js";
  31. import "./chunk-EDHROVWI.js";
  32. import "./chunk-3IRT3YKJ.js";
  33. import {
  34. a
  35. } from "./chunk-XEQ4FTFC.js";
  36. import "./chunk-JM5OVQAD.js";
  37. import {
  38. i as i2
  39. } from "./chunk-WWXZOC2Y.js";
  40. import {
  41. n as n5
  42. } from "./chunk-NQA5XJGK.js";
  43. import "./chunk-EKYSPJO6.js";
  44. import {
  45. i as i3,
  46. j2
  47. } from "./chunk-JAUFBT5U.js";
  48. import {
  49. o
  50. } from "./chunk-W6U6FKJ3.js";
  51. import {
  52. p as p4
  53. } from "./chunk-7C2KDOAI.js";
  54. import {
  55. n as n3,
  56. p2
  57. } from "./chunk-RHFU6KWO.js";
  58. import "./chunk-3FNKD2EB.js";
  59. import "./chunk-ZOO4I2U4.js";
  60. import "./chunk-JPUFJK2B.js";
  61. import "./chunk-HZ2WKB3G.js";
  62. import "./chunk-3HCJD762.js";
  63. import "./chunk-RVCE264D.js";
  64. import "./chunk-HKJ7X3BD.js";
  65. import "./chunk-Y74D3LKQ.js";
  66. import "./chunk-PK4W65H4.js";
  67. import "./chunk-7C23ILQ4.js";
  68. import {
  69. k as k3
  70. } from "./chunk-P6VVVEX6.js";
  71. import "./chunk-3Z755LKF.js";
  72. import "./chunk-LTZ5XXDV.js";
  73. import "./chunk-IEU3AM37.js";
  74. import "./chunk-SKKBVHTF.js";
  75. import "./chunk-DLMAGHHC.js";
  76. import {
  77. x
  78. } from "./chunk-WD4J43GZ.js";
  79. import "./chunk-JOYXMSKE.js";
  80. import "./chunk-JLYTER4T.js";
  81. import "./chunk-CRHRHOXH.js";
  82. import "./chunk-ZSW35JPD.js";
  83. import "./chunk-JLSNMUQJ.js";
  84. import "./chunk-ECY35CJI.js";
  85. import "./chunk-PT62335L.js";
  86. import {
  87. y as y2
  88. } from "./chunk-JGBXYDGB.js";
  89. import "./chunk-QEWF7QPH.js";
  90. import "./chunk-PJNBFKPF.js";
  91. import "./chunk-C7742RNZ.js";
  92. import "./chunk-FNA5GLRW.js";
  93. import "./chunk-MCWCB5IY.js";
  94. import "./chunk-TV3CFJQR.js";
  95. import "./chunk-TJV6ODRM.js";
  96. import {
  97. v as v2
  98. } from "./chunk-JUWKPBLS.js";
  99. import {
  100. c as c3
  101. } from "./chunk-WLSB4F4I.js";
  102. import {
  103. c as c2,
  104. d,
  105. f,
  106. l,
  107. m as m2,
  108. p as p5
  109. } from "./chunk-GLSWDDR3.js";
  110. import {
  111. O
  112. } from "./chunk-MIQGEDET.js";
  113. import "./chunk-DUEMJ5XS.js";
  114. import "./chunk-VRLXUHP2.js";
  115. import "./chunk-3LVSQLWJ.js";
  116. import "./chunk-4ONPMX2F.js";
  117. import {
  118. F as F2,
  119. x as x4
  120. } from "./chunk-CRGY2SDS.js";
  121. import "./chunk-4T5ZGMEN.js";
  122. import {
  123. p
  124. } from "./chunk-GN35O2ZO.js";
  125. import {
  126. n as n2
  127. } from "./chunk-XTVKPAWY.js";
  128. import "./chunk-3OSQ6GXO.js";
  129. import "./chunk-3WQOA5CB.js";
  130. import {
  131. t as t3
  132. } from "./chunk-PLWDAYK7.js";
  133. import "./chunk-FZQZIM7U.js";
  134. import "./chunk-CZBRZ6SU.js";
  135. import "./chunk-VGWC3IKZ.js";
  136. import "./chunk-2H5MD622.js";
  137. import "./chunk-3RSFVUKZ.js";
  138. import "./chunk-UVVU4UUO.js";
  139. import "./chunk-O6VYMEIX.js";
  140. import "./chunk-X4SA4ELJ.js";
  141. import "./chunk-5N7JLUJJ.js";
  142. import "./chunk-ZAY3CMAZ.js";
  143. import "./chunk-P3XKUGLS.js";
  144. import "./chunk-2ZSOO377.js";
  145. import "./chunk-YUA3AHKR.js";
  146. import "./chunk-LU5IJZB4.js";
  147. import "./chunk-7IBV2TRE.js";
  148. import "./chunk-ZLNEXZAN.js";
  149. import "./chunk-5UVJ64RB.js";
  150. import "./chunk-SFEFRQCL.js";
  151. import {
  152. b
  153. } from "./chunk-DXVOOCG4.js";
  154. import "./chunk-3GZSQU56.js";
  155. import "./chunk-ZYRIJWLX.js";
  156. import "./chunk-RYY6632W.js";
  157. import "./chunk-DW42UVIT.js";
  158. import "./chunk-YAEIHDJH.js";
  159. import "./chunk-TJNOJH33.js";
  160. import "./chunk-OSHI574D.js";
  161. import "./chunk-ETGAZ7LF.js";
  162. import {
  163. i,
  164. t as t2
  165. } from "./chunk-75U5LM2V.js";
  166. import "./chunk-RMDDCMKS.js";
  167. import "./chunk-VCH45Q2I.js";
  168. import "./chunk-LBW34VZ2.js";
  169. import "./chunk-GSSTTHIT.js";
  170. import {
  171. m
  172. } from "./chunk-YFSLJIO4.js";
  173. import "./chunk-IM3LVQXV.js";
  174. import "./chunk-55RWC67C.js";
  175. import "./chunk-HZRKBTHJ.js";
  176. import "./chunk-DVUG3KID.js";
  177. import "./chunk-FWSQEIAR.js";
  178. import "./chunk-VEGAOVMY.js";
  179. import {
  180. w2 as w
  181. } from "./chunk-6T6G6LCQ.js";
  182. import "./chunk-YEJL5NEF.js";
  183. import {
  184. k2 as k
  185. } from "./chunk-PQFTYGF5.js";
  186. import {
  187. e,
  188. n5 as n,
  189. y3 as y
  190. } from "./chunk-2Z2TG5CU.js";
  191. import "./chunk-6KZ2LTDA.js";
  192. import "./chunk-U2XHEJM7.js";
  193. import "./chunk-SQOPWYIT.js";
  194. import "./chunk-V6P2MAQQ.js";
  195. import {
  196. s3 as s
  197. } from "./chunk-E5O6P5I2.js";
  198. import "./chunk-SPWQ3AWG.js";
  199. import "./chunk-2TIUKVZN.js";
  200. import {
  201. r,
  202. t
  203. } from "./chunk-YXWMMD76.js";
  204. import "./chunk-S5KM4IGW.js";
  205. // node_modules/@arcgis/core/layers/graphics/sources/OGCFeatureSource.js
  206. var C = class extends m {
  207. constructor() {
  208. super(...arguments), this.featureDefinition = null, this.type = "ogc-feature";
  209. }
  210. load(e2) {
  211. return this.addResolvingPromise(this._loadOGCServices(this.layer, e2)), this.when();
  212. }
  213. getSource() {
  214. const { featureDefinition: { collection: e2, layerDefinition: t4, spatialReference: s3, supportedCrs: r2 }, layer: { apiKey: o2, customParameters: p6, effectiveMaxRecordCount: i4 } } = this;
  215. return { type: "ogc-source", collection: e2, layerDefinition: t4, maxRecordCount: i4, queryParameters: { apiKey: o2, customParameters: p6 }, spatialReference: s3, supportedCrs: r2 };
  216. }
  217. queryExtent(e2, t4 = {}) {
  218. return null;
  219. }
  220. queryFeatureCount(e2, t4 = {}) {
  221. return null;
  222. }
  223. queryFeatures(e2, t4 = {}) {
  224. return this.queryFeaturesJSON(e2, t4).then((e3) => x3.fromJSON(e3));
  225. }
  226. queryFeaturesJSON(e2, t4 = {}) {
  227. const s3 = this.getSource();
  228. return this.load(t4).then(() => N(s3, e2, t4));
  229. }
  230. queryObjectIds(e2, t4 = {}) {
  231. return null;
  232. }
  233. serviceSupportsSpatialReference(e2) {
  234. return !(!e2.isWGS84 && !e2.isWebMercator) || !!this.featureDefinition.supportedCrs[e2.wkid];
  235. }
  236. _conformsToType(e2, t4) {
  237. var _a;
  238. const s3 = new RegExp(`^${t4}$`, "i");
  239. return (_a = e2.conformsTo.some((e3) => s3.test(e3))) != null ? _a : false;
  240. }
  241. _getCapabilities(e2, t4) {
  242. return { analytics: { supportsCacheHint: false }, attachment: null, data: { isVersioned: false, supportsAttachment: false, supportsM: false, supportsZ: e2 }, metadata: { supportsAdvancedFieldProperties: false }, operations: { supportsCalculate: false, supportsTruncate: false, supportsValidateSql: false, supportsAdd: false, supportsDelete: false, supportsEditing: false, supportsChangeTracking: false, supportsQuery: false, supportsQueryAnalytics: false, supportsQueryAttachments: false, supportsQueryTopFeatures: false, supportsResizeAttachments: false, supportsSync: false, supportsUpdate: false, supportsExceedsLimitStatistics: false }, query: { maxRecordCount: t4, maxRecordCountFactor: void 0, standardMaxRecordCount: void 0, supportsCacheHint: false, supportsCentroid: false, supportsDisjointSpatialRelationship: false, supportsDistance: false, supportsDistinct: false, supportsExtent: false, supportsFormatPBF: false, supportsGeometryProperties: false, supportsHavingClause: false, supportsHistoricMoment: false, supportsMaxRecordCountFactor: false, supportsOrderBy: false, supportsPagination: false, supportsPercentileStatistics: false, supportsQuantization: false, supportsQuantizationEditMode: false, supportsQueryByOthers: false, supportsQueryGeometry: false, supportsResultType: false, supportsStandardizedQueriesOnly: false, supportsTopFeaturesQuery: false, supportsStatistics: false, supportsSpatialAggregationStatistics: false, supportedSpatialAggregationStatistics: { envelope: false, centroid: false, convexHull: false }, supportsDefaultSpatialReference: false, supportsFullTextSearch: false, supportsCompactGeometry: false, supportsSqlExpression: false, tileMaxRecordCount: void 0 }, queryRelated: { supportsCount: false, supportsOrderBy: false, supportsPagination: false, supportsCacheHint: false }, queryTopFeatures: { supportsCacheHint: false }, editing: { supportsDeleteByAnonymous: false, supportsDeleteByOthers: false, supportsGeometryUpdate: false, supportsGlobalId: false, supportsReturnServiceEditsInSourceSpatialReference: false, supportsRollbackOnFailure: false, supportsUpdateByAnonymous: false, supportsUpdateByOthers: false, supportsUploadWithItemId: false, supportsUpdateWithoutM: false } };
  243. }
  244. _getMaxRecordCount(e2) {
  245. var _a, _b, _c, _d, _e, _f, _g, _h, _i;
  246. return (_i = (_d = (_c = (_b = (_a = e2 == null ? void 0 : e2.components) == null ? void 0 : _a.parameters) == null ? void 0 : _b.limit) == null ? void 0 : _c.schema) == null ? void 0 : _d.maximum) != null ? _i : (_h = (_g = (_f = (_e = e2 == null ? void 0 : e2.components) == null ? void 0 : _e.parameters) == null ? void 0 : _f.limitFeatures) == null ? void 0 : _g.schema) == null ? void 0 : _h.maximum;
  247. }
  248. _getStorageSpatialReference(e2) {
  249. var _a;
  250. const t4 = (_a = e2.storageCrs) != null ? _a : F, s3 = v(t4);
  251. return t(s3) ? k.WGS84 : new k({ wkid: s3 });
  252. }
  253. _getSupportedSpatialReferences(e2, t4) {
  254. var _a;
  255. const s3 = "#/crs", r2 = (_a = e2.crs) != null ? _a : [F], o2 = r2.includes(s3) ? r2.filter((e3) => e3 !== s3).concat(t4.crs) : r2, p6 = /^http:\/\/www\.opengis.net\/def\/crs\/epsg\/.*\/3785$/i;
  256. return o2.filter((e3) => !p6.test(e3));
  257. }
  258. async _loadOGCServices(e2, s3) {
  259. const r2 = r(s3) ? s3.signal : null, { apiKey: p6, collectionId: i4, customParameters: a2, fields: u, geometryType: g, hasZ: h, objectIdField: C2, timeInfo: R, url: w2 } = e2, x5 = { fields: u == null ? void 0 : u.map((e3) => e3.toJSON()), geometryType: t2.toJSON(g), hasZ: h, objectIdField: C2, timeInfo: R == null ? void 0 : R.toJSON() }, j3 = { apiKey: p6, customParameters: a2, signal: r2 }, F3 = await x2(w2, j3), [O2, v3] = await Promise.all([k2(F3, j3), T(F3, j3)]);
  260. if (!this._conformsToType(O2, "http://www.opengis.net/spec/ogcapi-features-1/1.0/conf/geojson"))
  261. throw new s("ogc-feature-layer:no-geojson-support", "Server does not support geojson");
  262. const T2 = v3.collections.find((e3) => e3.id === i4);
  263. if (!T2)
  264. throw new s("ogc-feature-layer:collection-not-found", "Server does not contain the named collection");
  265. const D = this._conformsToType(O2, "http://www.opengis.net/spec/ogcapi-features-1/1.0/conf/oas30") ? await S(F3, j3) : null, _ = await I(T2, x5, j3), b2 = this._getMaxRecordCount(D), P = this._getCapabilities(_.hasZ, b2), q = this._getStorageSpatialReference(T2).toJSON(), M2 = this._getSupportedSpatialReferences(T2, v3), A = new RegExp(`^${j}`, "i"), E = {};
  266. for (const t4 of M2) {
  267. const e3 = v(t4);
  268. r(e3) && (E[e3] || (E[e3] = t4.replace(A, "")));
  269. }
  270. this.featureDefinition = { capabilities: P, collection: T2, layerDefinition: _, spatialReference: q, supportedCrs: E };
  271. }
  272. };
  273. e([y()], C.prototype, "featureDefinition", void 0), e([y({ constructOnly: true })], C.prototype, "layer", void 0), e([y()], C.prototype, "type", void 0), C = e([n("esri.layers.graphics.sources.OGCFeatureSource")], C);
  274. // node_modules/@arcgis/core/layers/OGCFeatureLayer.js
  275. var M = s2();
  276. var B = class extends i2(o(n4(p3(n2(c(a(t3(c3(v2(p(O(b)))))))))))) {
  277. constructor(e2) {
  278. super(e2), this.collectionId = null, this.copyright = null, this.definitionExpression = null, this.description = null, this.displayField = null, this.elevationInfo = null, this.fields = null, this.fieldsIndex = null, this.fullExtent = null, this.geometryType = null, this.hasZ = void 0, this.labelingInfo = null, this.labelsVisible = true, this.legendEnabled = true, this.maxRecordCount = null, this.objectIdField = null, this.operationalLayerType = "OGCFeatureLayer", this.popupEnabled = true, this.popupTemplate = null, this.screenSizePerspectiveEnabled = true, this.source = new C({ layer: this }), this.spatialReference = null, this.title = null, this.type = "ogc-feature", this.typeIdField = null, this.types = null, this.url = null;
  279. }
  280. destroy() {
  281. var _a;
  282. (_a = this.source) == null ? void 0 : _a.destroy();
  283. }
  284. load(e2) {
  285. return this.addResolvingPromise(this.loadFromPortal({ supportedTypes: ["OGCFeatureServer"] }, e2).then(() => this._fetchService(e2))), this.when();
  286. }
  287. get defaultPopupTemplate() {
  288. return this.createPopupTemplate();
  289. }
  290. get effectiveMaxRecordCount() {
  291. var _a, _b, _c;
  292. return (_c = (_b = this.maxRecordCount) != null ? _b : (_a = this.capabilities) == null ? void 0 : _a.query.maxRecordCount) != null ? _c : 5e3;
  293. }
  294. get isTable() {
  295. return this.loaded && null == this.geometryType;
  296. }
  297. set renderer(e2) {
  298. F2(e2, this.fieldsIndex), this._set("renderer", e2);
  299. }
  300. on(e2, r2) {
  301. return super.on(e2, r2);
  302. }
  303. createPopupTemplate(e2) {
  304. return p4(this, e2);
  305. }
  306. createQuery() {
  307. return new x();
  308. }
  309. getField(e2) {
  310. return this.fieldsIndex.get(e2);
  311. }
  312. getFieldDomain(e2, r2) {
  313. var _a;
  314. let t4, i4 = false;
  315. const o2 = (_a = r2 == null ? void 0 : r2.feature) == null ? void 0 : _a.attributes, s3 = this.typeIdField && (o2 == null ? void 0 : o2[this.typeIdField]);
  316. return null != s3 && this.types && (i4 = this.types.some((r3) => {
  317. var _a2;
  318. return r3.id == s3 && (t4 = (_a2 = r3.domains) == null ? void 0 : _a2[e2], "inherited" === (t4 == null ? void 0 : t4.type) && (t4 = this._getLayerDomain(e2)), true);
  319. })), i4 || t4 || (t4 = this._getLayerDomain(e2)), t4;
  320. }
  321. queryFeatures(e2, r2) {
  322. return this.load().then(() => this.source.queryFeatures(x.from(e2) || this.createQuery(), r2)).then((e3) => {
  323. var _a;
  324. return (_a = e3 == null ? void 0 : e3.features) == null ? void 0 : _a.forEach((e4) => {
  325. e4.layer = e4.sourceLayer = this;
  326. }), e3;
  327. });
  328. }
  329. serviceSupportsSpatialReference(e2) {
  330. var _a, _b;
  331. return (_b = (_a = this.source) == null ? void 0 : _a.serviceSupportsSpatialReference(e2)) != null ? _b : false;
  332. }
  333. async _fetchService(e2) {
  334. await this.source.load(e2), this.read(this.source.featureDefinition, { origin: "service" }), F2(this.renderer, this.fieldsIndex), x4(this.timeInfo, this.fieldsIndex);
  335. }
  336. _getLayerDomain(e2) {
  337. if (!this.fields)
  338. return null;
  339. for (const r2 of this.fields)
  340. if (r2.name === e2 && r2.domain)
  341. return r2.domain;
  342. return null;
  343. }
  344. };
  345. e([y({ readOnly: true, json: { origins: { service: { read: true } } } })], B.prototype, "capabilities", void 0), e([y({ type: String, json: { write: true } })], B.prototype, "collectionId", void 0), e([y({ type: String })], B.prototype, "copyright", void 0), e([y({ readOnly: true })], B.prototype, "defaultPopupTemplate", null), e([y({ type: String })], B.prototype, "definitionExpression", void 0), e([y({ readOnly: true, type: String, json: { origins: { service: { name: "collection.description" } } } })], B.prototype, "description", void 0), e([y({ type: String })], B.prototype, "displayField", void 0), e([y({ type: Number })], B.prototype, "effectiveMaxRecordCount", null), e([y(d)], B.prototype, "elevationInfo", void 0), e([y({ type: [y2], json: { origins: { service: { name: "layerDefinition.fields" } } } })], B.prototype, "fields", void 0), e([y(M.fieldsIndex)], B.prototype, "fieldsIndex", void 0), e([y({ readOnly: true, type: w, json: { origins: { service: { name: "layerDefinition.extent" } } } })], B.prototype, "fullExtent", void 0), e([y({ type: i.apiValues, json: { origins: { service: { name: "layerDefinition.geometryType", read: { reader: i.read } } } } })], B.prototype, "geometryType", void 0), e([y({ type: Boolean, json: { origins: { service: { name: "layerDefinition.hasZ" } } } })], B.prototype, "hasZ", void 0), e([y({ type: Boolean, readOnly: true })], B.prototype, "isTable", null), e([y({ type: [j2], json: { origins: { "web-document": { name: "layerDefinition.drawingInfo.labelingInfo", read: { reader: i3 }, write: true } } } })], B.prototype, "labelingInfo", void 0), e([y(m2)], B.prototype, "labelsVisible", void 0), e([y(c2)], B.prototype, "legendEnabled", void 0), e([y({ type: Number })], B.prototype, "maxRecordCount", void 0), e([y({ type: String, json: { origins: { service: { name: "layerDefinition.objectIdField" } } } })], B.prototype, "objectIdField", void 0), e([y({ type: ["OGCFeatureLayer"] })], B.prototype, "operationalLayerType", void 0), e([y(p5)], B.prototype, "popupEnabled", void 0), e([y({ type: k3, json: { name: "popupInfo", write: true } })], B.prototype, "popupTemplate", void 0), e([y({ types: p2, json: { origins: { service: { name: "layerDefinition.drawingInfo.renderer", write: false }, "web-scene": { types: n3, name: "layerDefinition.drawingInfo.renderer", write: true } }, name: "layerDefinition.drawingInfo.renderer", write: true } })], B.prototype, "renderer", null), e([y(l)], B.prototype, "screenSizePerspectiveEnabled", void 0), e([y({ readOnly: true })], B.prototype, "source", void 0), e([y({ readOnly: true, type: k, json: { origins: { service: { read: true } } } })], B.prototype, "spatialReference", void 0), e([y({ type: String, json: { write: { enabled: true, ignoreOrigin: true, isRequired: true }, origins: { service: { name: "collection.title" } } } })], B.prototype, "title", void 0), e([y({ readOnly: true, json: { read: false } })], B.prototype, "type", void 0), e([y({ type: String, readOnly: true })], B.prototype, "typeIdField", void 0), e([y({ type: [n5] })], B.prototype, "types", void 0), e([y(f)], B.prototype, "url", void 0), B = e([n("esri.layers.OGCFeatureLayer")], B);
  346. var V = B;
  347. export {
  348. V as default
  349. };
  350. //# sourceMappingURL=OGCFeatureLayer-BNYVD2AR.js.map