chunk-FIYKFRB2.js 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. import {
  2. e
  3. } from "./chunk-WSRBH7BF.js";
  4. // node_modules/@arcgis/core/views/2d/tiling/TileKey.js
  5. var e2 = class {
  6. constructor(t, e3, l, s) {
  7. this.set(t, e3, l, s);
  8. }
  9. static getId(t, e3, l, s) {
  10. return typeof t == "object" ? `${t.level}/${t.row}/${t.col}/${t.world}` : `${t}/${e3}/${l}/${s}`;
  11. }
  12. get key() {
  13. return this;
  14. }
  15. get id() {
  16. return this.toString();
  17. }
  18. set id(t) {
  19. this.set(t);
  20. }
  21. get hash() {
  22. const t = 4095 & this.row, e3 = 4095 & this.col, l = 63 & this.level;
  23. return (3 & this.world) << 30 | e3 << 22 | t << 8 | l;
  24. }
  25. acquire(t, e3, l, s) {
  26. this.set(t, e3, l, s);
  27. }
  28. contains(t) {
  29. const e3 = t.level - this.level;
  30. return this.row === t.row >> e3 && this.col === t.col >> e3 && this.world === t.world;
  31. }
  32. equals(t) {
  33. return this.level === t.level && this.row === t.row && this.col === t.col && this.world === t.world;
  34. }
  35. clone() {
  36. return new e2(this);
  37. }
  38. release() {
  39. this.level = 0, this.row = 0, this.col = 0, this.world = 0;
  40. }
  41. set(t, e3, l, s) {
  42. if (t == null)
  43. this.level = 0, this.row = 0, this.col = 0, this.world = 0;
  44. else if (typeof t == "object")
  45. this.level = t.level || 0, this.row = t.row || 0, this.col = t.col || 0, this.world = t.world || 0;
  46. else if (typeof t == "string") {
  47. const [e4, l2, s2, o] = t.split("/");
  48. this.level = parseFloat(e4), this.row = parseFloat(l2), this.col = parseFloat(s2), this.world = parseFloat(o);
  49. } else
  50. this.level = +t, this.row = +e3, this.col = +l, this.world = +s || 0;
  51. return this;
  52. }
  53. toString() {
  54. return `${this.level}/${this.row}/${this.col}/${this.world}`;
  55. }
  56. getParentKey() {
  57. return this.level <= 0 ? null : new e2(this.level - 1, this.row >> 1, this.col >> 1, this.world);
  58. }
  59. getChildKeys() {
  60. const t = this.level + 1, l = this.row << 1, s = this.col << 1, o = this.world;
  61. return [new e2(t, l, s, o), new e2(t, l, s + 1, o), new e2(t, l + 1, s, o), new e2(t, l + 1, s + 1, o)];
  62. }
  63. compareRowMajor(t) {
  64. return this.row < t.row ? -1 : this.row > t.row ? 1 : this.col < t.col ? -1 : this.col > t.col ? 1 : 0;
  65. }
  66. };
  67. e2.pool = new e(e2, null, null, 25, 50);
  68. export {
  69. e2 as e
  70. };
  71. //# sourceMappingURL=chunk-FIYKFRB2.js.map