chunk-UYUDNSNC.js 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. import {
  2. v
  3. } from "./chunk-KHA63LLS.js";
  4. import {
  5. c
  6. } from "./chunk-FGKNEJKJ.js";
  7. import {
  8. O
  9. } from "./chunk-I3OBGWNS.js";
  10. import {
  11. S,
  12. p
  13. } from "./chunk-RBZL6SRZ.js";
  14. import {
  15. n as n2
  16. } from "./chunk-CYI7KFYB.js";
  17. import {
  18. a
  19. } from "./chunk-5LXROFTA.js";
  20. import {
  21. t
  22. } from "./chunk-W72F6AS3.js";
  23. import {
  24. b
  25. } from "./chunk-4DDBH2K5.js";
  26. import {
  27. U
  28. } from "./chunk-VNFRAYHO.js";
  29. import {
  30. F,
  31. ft,
  32. y
  33. } from "./chunk-VBRY5KJM.js";
  34. import {
  35. M2 as M,
  36. j2 as j,
  37. o
  38. } from "./chunk-ECW2QABR.js";
  39. import {
  40. k2 as k,
  41. r as r2
  42. } from "./chunk-MRJEICT6.js";
  43. import {
  44. d,
  45. e,
  46. l3 as l,
  47. n2 as n
  48. } from "./chunk-Y3WMVFTW.js";
  49. import {
  50. s3 as s
  51. } from "./chunk-EMJ4ZSM2.js";
  52. import {
  53. m,
  54. r
  55. } from "./chunk-IKP3YN53.js";
  56. // node_modules/@arcgis/core/layers/support/WMTSLayerInfo.js
  57. var i;
  58. var p2 = i = class extends l {
  59. constructor(r3) {
  60. super(r3);
  61. }
  62. clone() {
  63. return new i({ customLayerParameters: m(this.customLayerParameters), customParameters: m(this.customParameters), layerIdentifier: this.layerIdentifier, tileMatrixSet: this.tileMatrixSet, url: this.url });
  64. }
  65. };
  66. e([d({ json: { type: Object, write: true } })], p2.prototype, "customLayerParameters", void 0), e([d({ json: { type: Object, write: true } })], p2.prototype, "customParameters", void 0), e([d({ type: String, json: { write: true } })], p2.prototype, "layerIdentifier", void 0), e([d({ type: String, json: { write: true } })], p2.prototype, "tileMatrixSet", void 0), e([d({ type: String, json: { write: true } })], p2.prototype, "url", void 0), p2 = i = e([n("esri.layer.support.WMTSLayerInfo")], p2);
  67. // node_modules/@arcgis/core/layers/WebTileLayer.js
  68. var R = class extends a(n2(t(c(v(O(b)))))) {
  69. constructor(...e2) {
  70. super(...e2), this.copyright = "", this.fullExtent = new M(-20037508342787e-6, -2003750834278e-5, 2003750834278e-5, 20037508342787e-6, k.WebMercator), this.legendEnabled = false, this.isReference = null, this.popupEnabled = false, this.spatialReference = k.WebMercator, this.subDomains = null, this.tileInfo = new S({ size: [256, 256], dpi: 96, format: "png8", compressionQuality: 0, origin: new j({ x: -20037508342787e-6, y: 20037508342787e-6, spatialReference: k.WebMercator }), spatialReference: k.WebMercator, lods: [new p({ level: 0, scale: 591657527591555e-6, resolution: 156543.033928 }), new p({ level: 1, scale: 295828763795777e-6, resolution: 78271.5169639999 }), new p({ level: 2, scale: 147914381897889e-6, resolution: 39135.7584820001 }), new p({ level: 3, scale: 73957190948944e-6, resolution: 19567.8792409999 }), new p({ level: 4, scale: 36978595474472e-6, resolution: 9783.93962049996 }), new p({ level: 5, scale: 18489297737236e-6, resolution: 4891.96981024998 }), new p({ level: 6, scale: 9244648868618e-6, resolution: 2445.98490512499 }), new p({ level: 7, scale: 4622324434309e-6, resolution: 1222.99245256249 }), new p({ level: 8, scale: 2311162217155e-6, resolution: 611.49622628138 }), new p({ level: 9, scale: 1155581108577e-6, resolution: 305.748113140558 }), new p({ level: 10, scale: 577790.554289, resolution: 152.874056570411 }), new p({ level: 11, scale: 288895.277144, resolution: 76.4370282850732 }), new p({ level: 12, scale: 144447.638572, resolution: 38.2185141425366 }), new p({ level: 13, scale: 72223.819286, resolution: 19.1092570712683 }), new p({ level: 14, scale: 36111.909643, resolution: 9.55462853563415 }), new p({ level: 15, scale: 18055.954822, resolution: 4.77731426794937 }), new p({ level: 16, scale: 9027.977411, resolution: 2.38865713397468 }), new p({ level: 17, scale: 4513.988705, resolution: 1.19432856685505 }), new p({ level: 18, scale: 2256.994353, resolution: 0.597164283559817 }), new p({ level: 19, scale: 1128.497176, resolution: 0.298582141647617 }), new p({ level: 20, scale: 564.248588, resolution: 0.14929107082380833 }), new p({ level: 21, scale: 282.124294, resolution: 0.07464553541190416 }), new p({ level: 22, scale: 141.062147, resolution: 0.03732276770595208 }), new p({ level: 23, scale: 70.5310735, resolution: 0.01866138385297604 })] }), this.type = "web-tile", this.urlTemplate = null, this.wmtsInfo = null;
  71. }
  72. normalizeCtorArgs(e2, t2) {
  73. return typeof e2 == "string" ? { urlTemplate: e2, ...t2 } : e2;
  74. }
  75. load(e2) {
  76. const t2 = this.loadFromPortal({ supportedTypes: ["WMTS"] }, e2).then(() => {
  77. let e3 = "";
  78. if (this.urlTemplate)
  79. if (this.spatialReference.equals(this.tileInfo.spatialReference)) {
  80. const t3 = new y(this.urlTemplate);
  81. !(!!this.subDomains && this.subDomains.length > 0) && t3.authority.includes("{subDomain}") && (e3 = "is missing 'subDomains' property");
  82. } else
  83. e3 = "spatialReference must match tileInfo.spatialReference";
  84. else
  85. e3 = "is missing the required 'urlTemplate' property value";
  86. if (e3)
  87. throw new s("web-tile-layer:load", `WebTileLayer (title: '${this.title}', id: '${this.id}') ${e3}`);
  88. });
  89. return this.addResolvingPromise(t2), Promise.resolve(this);
  90. }
  91. get levelValues() {
  92. const e2 = [];
  93. if (!this.tileInfo)
  94. return null;
  95. for (const t2 of this.tileInfo.lods)
  96. e2[t2.level] = t2.levelValue || t2.level;
  97. return e2;
  98. }
  99. readSpatialReference(e2, t2) {
  100. return e2 || t2.fullExtent && t2.fullExtent.spatialReference && k.fromJSON(t2.fullExtent.spatialReference);
  101. }
  102. get tileServers() {
  103. if (!this.urlTemplate)
  104. return null;
  105. const e2 = [], { urlTemplate: t2, subDomains: r3 } = this, l2 = new y(t2), o2 = l2.scheme ? l2.scheme + "://" : "//", i2 = o2 + l2.authority + "/";
  106. if (l2.authority.includes("{subDomain}")) {
  107. if (r3 && r3.length > 0 && l2.authority.split(".").length > 1)
  108. for (const s2 of r3)
  109. e2.push(o2 + l2.authority.replace(/\{subDomain\}/gi, s2) + "/");
  110. } else
  111. e2.push(i2);
  112. return e2.map((e3) => (e3.charAt(e3.length - 1) !== "/" && (e3 += "/"), e3));
  113. }
  114. get urlPath() {
  115. if (!this.urlTemplate)
  116. return null;
  117. const e2 = this.urlTemplate, t2 = new y(e2), r3 = (t2.scheme ? t2.scheme + "://" : "//") + t2.authority + "/";
  118. return e2.substring(r3.length);
  119. }
  120. readUrlTemplate(e2, t2) {
  121. return e2 || t2.templateUrl;
  122. }
  123. writeUrlTemplate(e2, t2) {
  124. e2 && ft(e2) && (e2 = "https:" + e2), e2 && (e2 = e2.replace(/\{z\}/gi, "{level}").replace(/\{x\}/gi, "{col}").replace(/\{y\}/gi, "{row}"), e2 = F(e2)), t2.templateUrl = e2;
  125. }
  126. fetchTile(e2, r3, l2, o2 = {}) {
  127. const { signal: s2 } = o2, i2 = this.getTileUrl(e2, r3, l2), n3 = { responseType: "image", signal: s2, query: { ...this.refreshParameters } };
  128. return U(i2, n3).then((e3) => e3.data);
  129. }
  130. getTileUrl(e2, t2, r3) {
  131. const l2 = this.levelValues[e2];
  132. return this.tileServers[t2 % this.tileServers.length] + r(this.urlPath, { level: l2, z: l2, col: r3, x: r3, row: t2, y: t2 });
  133. }
  134. };
  135. e([d({ type: String, value: "", json: { write: true } })], R.prototype, "copyright", void 0), e([d({ type: M, json: { write: true }, nonNullable: true })], R.prototype, "fullExtent", void 0), e([d({ readOnly: true, json: { read: false, write: false } })], R.prototype, "legendEnabled", void 0), e([d({ type: ["show", "hide"] })], R.prototype, "listMode", void 0), e([d({ json: { read: true, write: true } })], R.prototype, "blendMode", void 0), e([d()], R.prototype, "levelValues", null), e([d({ type: Boolean, json: { read: false, write: { enabled: true, overridePolicy: () => ({ enabled: false }) } } })], R.prototype, "isReference", void 0), e([d({ type: ["WebTiledLayer"], value: "WebTiledLayer" })], R.prototype, "operationalLayerType", void 0), e([d({ readOnly: true, json: { read: false, write: false } })], R.prototype, "popupEnabled", void 0), e([d({ type: k })], R.prototype, "spatialReference", void 0), e([o("spatialReference", ["spatialReference", "fullExtent.spatialReference"])], R.prototype, "readSpatialReference", null), e([d({ type: [String], json: { write: true } })], R.prototype, "subDomains", void 0), e([d({ type: S, json: { write: true } })], R.prototype, "tileInfo", void 0), e([d({ readOnly: true })], R.prototype, "tileServers", null), e([d({ json: { read: false } })], R.prototype, "type", void 0), e([d()], R.prototype, "urlPath", null), e([d({ type: String, json: { origins: { "portal-item": { read: { source: "url" } } } } })], R.prototype, "urlTemplate", void 0), e([o("urlTemplate", ["urlTemplate", "templateUrl"])], R.prototype, "readUrlTemplate", null), e([r2("urlTemplate", { templateUrl: { type: String } })], R.prototype, "writeUrlTemplate", null), e([d({ type: p2, json: { write: true } })], R.prototype, "wmtsInfo", void 0), R = e([n("esri.layers.WebTileLayer")], R);
  136. var x = R;
  137. export {
  138. p2 as p,
  139. x
  140. };
  141. //# sourceMappingURL=chunk-UYUDNSNC.js.map