chunk-JF6B6S7W.js 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. import {
  2. j,
  3. p as p2
  4. } from "./chunk-YLEVJ6UV.js";
  5. import {
  6. v
  7. } from "./chunk-JUWKPBLS.js";
  8. import {
  9. c
  10. } from "./chunk-WLSB4F4I.js";
  11. import {
  12. O
  13. } from "./chunk-MIQGEDET.js";
  14. import {
  15. p
  16. } from "./chunk-GN35O2ZO.js";
  17. import {
  18. n as n3
  19. } from "./chunk-XTVKPAWY.js";
  20. import {
  21. t
  22. } from "./chunk-PLWDAYK7.js";
  23. import {
  24. b
  25. } from "./chunk-DXVOOCG4.js";
  26. import {
  27. U
  28. } from "./chunk-DVUG3KID.js";
  29. import {
  30. F,
  31. ft,
  32. y as y3
  33. } from "./chunk-VEGAOVMY.js";
  34. import {
  35. o,
  36. w,
  37. w2
  38. } from "./chunk-6T6G6LCQ.js";
  39. import {
  40. k2 as k,
  41. r
  42. } from "./chunk-PQFTYGF5.js";
  43. import {
  44. e,
  45. l3 as l,
  46. n5 as n2,
  47. y3 as y2
  48. } from "./chunk-2Z2TG5CU.js";
  49. import {
  50. s3 as s
  51. } from "./chunk-E5O6P5I2.js";
  52. import {
  53. n2 as n,
  54. y
  55. } from "./chunk-SPWQ3AWG.js";
  56. // node_modules/@arcgis/core/layers/support/WMTSLayerInfo.js
  57. var i;
  58. var p3 = i = class extends l {
  59. constructor(r2) {
  60. super(r2);
  61. }
  62. clone() {
  63. return new i({ customLayerParameters: y(this.customLayerParameters), customParameters: y(this.customParameters), layerIdentifier: this.layerIdentifier, tileMatrixSet: this.tileMatrixSet, url: this.url });
  64. }
  65. };
  66. e([y2({ json: { type: Object, write: true } })], p3.prototype, "customLayerParameters", void 0), e([y2({ json: { type: Object, write: true } })], p3.prototype, "customParameters", void 0), e([y2({ type: String, json: { write: true } })], p3.prototype, "layerIdentifier", void 0), e([y2({ type: String, json: { write: true } })], p3.prototype, "tileMatrixSet", void 0), e([y2({ type: String, json: { write: true } })], p3.prototype, "url", void 0), p3 = i = e([n2("esri.layer.support.WMTSLayerInfo")], p3);
  67. // node_modules/@arcgis/core/layers/WebTileLayer.js
  68. var R = class extends n3(p(t(c(v(O(b)))))) {
  69. constructor(...e2) {
  70. super(...e2), this.copyright = "", this.fullExtent = new w2(-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 j({ size: [256, 256], dpi: 96, format: "png8", compressionQuality: 0, origin: new w({ x: -20037508342787e-6, y: 20037508342787e-6, spatialReference: k.WebMercator }), spatialReference: k.WebMercator, lods: [new p2({ level: 0, scale: 591657527591555e-6, resolution: 156543.033928 }), new p2({ level: 1, scale: 295828763795777e-6, resolution: 78271.5169639999 }), new p2({ level: 2, scale: 147914381897889e-6, resolution: 39135.7584820001 }), new p2({ level: 3, scale: 73957190948944e-6, resolution: 19567.8792409999 }), new p2({ level: 4, scale: 36978595474472e-6, resolution: 9783.93962049996 }), new p2({ level: 5, scale: 18489297737236e-6, resolution: 4891.96981024998 }), new p2({ level: 6, scale: 9244648868618e-6, resolution: 2445.98490512499 }), new p2({ level: 7, scale: 4622324434309e-6, resolution: 1222.99245256249 }), new p2({ level: 8, scale: 2311162217155e-6, resolution: 611.49622628138 }), new p2({ level: 9, scale: 1155581108577e-6, resolution: 305.748113140558 }), new p2({ level: 10, scale: 577790.554289, resolution: 152.874056570411 }), new p2({ level: 11, scale: 288895.277144, resolution: 76.4370282850732 }), new p2({ level: 12, scale: 144447.638572, resolution: 38.2185141425366 }), new p2({ level: 13, scale: 72223.819286, resolution: 19.1092570712683 }), new p2({ level: 14, scale: 36111.909643, resolution: 9.55462853563415 }), new p2({ level: 15, scale: 18055.954822, resolution: 4.77731426794937 }), new p2({ level: 16, scale: 9027.977411, resolution: 2.38865713397468 }), new p2({ level: 17, scale: 4513.988705, resolution: 1.19432856685505 }), new p2({ level: 18, scale: 2256.994353, resolution: 0.597164283559817 }), new p2({ level: 19, scale: 1128.497176, resolution: 0.298582141647617 }), new p2({ level: 20, scale: 564.248588, resolution: 0.14929107082380833 }), new p2({ level: 21, scale: 282.124294, resolution: 0.07464553541190416 }), new p2({ level: 22, scale: 141.062147, resolution: 0.03732276770595208 }), new p2({ 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 "string" == typeof e2 ? { 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 y3(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: r2 } = this, l2 = new y3(t2), o2 = l2.scheme ? l2.scheme + "://" : "//", i2 = o2 + l2.authority + "/";
  106. if (l2.authority.includes("{subDomain}")) {
  107. if (r2 && r2.length > 0 && l2.authority.split(".").length > 1)
  108. for (const s2 of r2)
  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 y3(e2), r2 = (t2.scheme ? t2.scheme + "://" : "//") + t2.authority + "/";
  118. return e2.substring(r2.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, r2, l2, o2 = {}) {
  127. const { signal: s2 } = o2, i2 = this.getTileUrl(e2, r2, l2), n4 = { responseType: "image", signal: s2, query: { ...this.refreshParameters } };
  128. return U(i2, n4).then((e3) => e3.data);
  129. }
  130. async fetchImageBitmapTile(e2, r2, l2, o2 = {}) {
  131. const { signal: s2 } = o2, i2 = this.getTileUrl(e2, r2, l2), n4 = { responseType: "blob", signal: s2, query: { ...this.refreshParameters } }, { data: a } = await U(i2, n4);
  132. return createImageBitmap(a);
  133. }
  134. getTileUrl(e2, t2, r2) {
  135. const l2 = this.levelValues[e2];
  136. return this.tileServers[t2 % this.tileServers.length] + n(this.urlPath, { level: l2, z: l2, col: r2, x: r2, row: t2, y: t2 });
  137. }
  138. };
  139. e([y2({ type: String, value: "", json: { write: true } })], R.prototype, "copyright", void 0), e([y2({ type: w2, json: { write: true }, nonNullable: true })], R.prototype, "fullExtent", void 0), e([y2({ readOnly: true, json: { read: false, write: false } })], R.prototype, "legendEnabled", void 0), e([y2({ type: ["show", "hide"] })], R.prototype, "listMode", void 0), e([y2({ json: { read: true, write: true } })], R.prototype, "blendMode", void 0), e([y2()], R.prototype, "levelValues", null), e([y2({ type: Boolean, json: { read: false, write: { enabled: true, overridePolicy: () => ({ enabled: false }) } } })], R.prototype, "isReference", void 0), e([y2({ type: ["WebTiledLayer"], value: "WebTiledLayer" })], R.prototype, "operationalLayerType", void 0), e([y2({ readOnly: true, json: { read: false, write: false } })], R.prototype, "popupEnabled", void 0), e([y2({ type: k })], R.prototype, "spatialReference", void 0), e([o("spatialReference", ["spatialReference", "fullExtent.spatialReference"])], R.prototype, "readSpatialReference", null), e([y2({ type: [String], json: { write: true } })], R.prototype, "subDomains", void 0), e([y2({ type: j, json: { write: true } })], R.prototype, "tileInfo", void 0), e([y2({ readOnly: true })], R.prototype, "tileServers", null), e([y2({ json: { read: false } })], R.prototype, "type", void 0), e([y2()], R.prototype, "urlPath", null), e([y2({ type: String, json: { origins: { "portal-item": { read: { source: "url" } } } } })], R.prototype, "urlTemplate", void 0), e([o("urlTemplate", ["urlTemplate", "templateUrl"])], R.prototype, "readUrlTemplate", null), e([r("urlTemplate", { templateUrl: { type: String } })], R.prototype, "writeUrlTemplate", null), e([y2({ type: p3, json: { write: true } })], R.prototype, "wmtsInfo", void 0), R = e([n2("esri.layers.WebTileLayer")], R);
  140. var x = R;
  141. export {
  142. p3 as p,
  143. x
  144. };
  145. //# sourceMappingURL=chunk-JF6B6S7W.js.map