runbir-tools 1.0.8 → 1.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/runbir-tools.es.js
CHANGED
|
@@ -838,7 +838,7 @@ const MapBrowserEventType = {
|
|
|
838
838
|
POINTERCANCEL: "pointercancel"
|
|
839
839
|
}, ua = typeof navigator < "u" && typeof navigator.userAgent < "u" ? navigator.userAgent.toLowerCase() : "", SAFARI = ua.includes("safari") && !ua.includes("chrom");
|
|
840
840
|
SAFARI && (ua.includes("version/15.4") || /cpu (os|iphone os) 15_4 like mac os x/.test(ua));
|
|
841
|
-
const WEBKIT = ua.includes("webkit") && !ua.includes("edge"), MAC = ua.includes("macintosh"), DEVICE_PIXEL_RATIO = typeof devicePixelRatio < "u" ? devicePixelRatio : 1, WORKER_OFFSCREEN_CANVAS = typeof WorkerGlobalScope < "u" && typeof OffscreenCanvas < "u" && self instanceof WorkerGlobalScope, IMAGE_DECODE = typeof Image < "u" && Image.prototype.decode, CREATE_IMAGE_BITMAP = typeof createImageBitmap == "function", PASSIVE_EVENT_LISTENERS = function() {
|
|
841
|
+
const WEBKIT = ua.includes("webkit") && !ua.includes("edge"), MAC = ua.includes("macintosh"), DEVICE_PIXEL_RATIO = typeof devicePixelRatio < "u" ? devicePixelRatio : 1, WORKER_OFFSCREEN_CANVAS = typeof WorkerGlobalScope < "u" && typeof OffscreenCanvas < "u" && self instanceof WorkerGlobalScope, IMAGE_DECODE = typeof Image < "u" && Image.prototype.decode, CREATE_IMAGE_BITMAP = typeof createImageBitmap == "function", PASSIVE_EVENT_LISTENERS = (function() {
|
|
842
842
|
let s = !1;
|
|
843
843
|
try {
|
|
844
844
|
const e = Object.defineProperty({}, "passive", {
|
|
@@ -850,7 +850,7 @@ const WEBKIT = ua.includes("webkit") && !ua.includes("edge"), MAC = ua.includes(
|
|
|
850
850
|
} catch {
|
|
851
851
|
}
|
|
852
852
|
return s;
|
|
853
|
-
}(), PointerEventType = {
|
|
853
|
+
})(), PointerEventType = {
|
|
854
854
|
POINTERMOVE: "pointermove",
|
|
855
855
|
POINTERDOWN: "pointerdown"
|
|
856
856
|
};
|
|
@@ -1415,7 +1415,7 @@ function createExtent(s, e, t) {
|
|
|
1415
1415
|
* @param {Array<number>} [centerShift] Shift between map center and viewport center.
|
|
1416
1416
|
* @return {import("./coordinate.js").Coordinate|undefined} Center.
|
|
1417
1417
|
*/
|
|
1418
|
-
function(i, n, r, o, a) {
|
|
1418
|
+
(function(i, n, r, o, a) {
|
|
1419
1419
|
if (!i)
|
|
1420
1420
|
return;
|
|
1421
1421
|
if (!n && !e)
|
|
@@ -1429,7 +1429,7 @@ function createExtent(s, e, t) {
|
|
|
1429
1429
|
p += -y * Math.log(1 + Math.max(0, d - i[0]) / y) + y * Math.log(1 + Math.max(0, i[0] - g) / y), _ += -y * Math.log(1 + Math.max(0, f - i[1]) / y) + y * Math.log(1 + Math.max(0, i[1] - m) / y);
|
|
1430
1430
|
}
|
|
1431
1431
|
return [p, _];
|
|
1432
|
-
}
|
|
1432
|
+
})
|
|
1433
1433
|
);
|
|
1434
1434
|
}
|
|
1435
1435
|
function none$1(s) {
|
|
@@ -2082,7 +2082,7 @@ function createTransformFromCoordinateTransform(s) {
|
|
|
2082
2082
|
* @param {number} [stride] Stride.
|
|
2083
2083
|
* @return {Array<number>} Output.
|
|
2084
2084
|
*/
|
|
2085
|
-
function(e, t, i, n) {
|
|
2085
|
+
(function(e, t, i, n) {
|
|
2086
2086
|
const r = e.length;
|
|
2087
2087
|
i = i !== void 0 ? i : 2, n = n ?? i, t = t !== void 0 ? t : new Array(r);
|
|
2088
2088
|
for (let o = 0; o < r; o += n) {
|
|
@@ -2091,7 +2091,7 @@ function createTransformFromCoordinateTransform(s) {
|
|
|
2091
2091
|
t[o + c] = c >= l ? e[o + c] : a[c];
|
|
2092
2092
|
}
|
|
2093
2093
|
return t;
|
|
2094
|
-
}
|
|
2094
|
+
})
|
|
2095
2095
|
);
|
|
2096
2096
|
}
|
|
2097
2097
|
function equivalent$1(s, e) {
|
|
@@ -3867,7 +3867,7 @@ function createSnapToResolutions(s, e, t, i) {
|
|
|
3867
3867
|
* @param {boolean} [isMoving] True if an interaction or animation is in progress.
|
|
3868
3868
|
* @return {number|undefined} Resolution.
|
|
3869
3869
|
*/
|
|
3870
|
-
function(n, r, o, a) {
|
|
3870
|
+
(function(n, r, o, a) {
|
|
3871
3871
|
if (n !== void 0) {
|
|
3872
3872
|
const l = s[0], c = s[s.length - 1], h = t ? getViewportClampedResolution(
|
|
3873
3873
|
l,
|
|
@@ -3884,7 +3884,7 @@ function createSnapToResolutions(s, e, t, i) {
|
|
|
3884
3884
|
const u = Math.min(h, n), d = Math.floor(linearFindNearest(s, u, r));
|
|
3885
3885
|
return s[d] > h && d < s.length - 1 ? s[d + 1] : s[d];
|
|
3886
3886
|
}
|
|
3887
|
-
};
|
|
3887
|
+
});
|
|
3888
3888
|
}
|
|
3889
3889
|
function createSnapToPower(s, e, t, i, n, r) {
|
|
3890
3890
|
return i = i !== void 0 ? i : !0, t = t !== void 0 ? t : 0, /**
|
|
@@ -3894,7 +3894,7 @@ function createSnapToPower(s, e, t, i, n, r) {
|
|
|
3894
3894
|
* @param {boolean} [isMoving] True if an interaction or animation is in progress.
|
|
3895
3895
|
* @return {number|undefined} Resolution.
|
|
3896
3896
|
*/
|
|
3897
|
-
function(o, a, l, c) {
|
|
3897
|
+
(function(o, a, l, c) {
|
|
3898
3898
|
if (o !== void 0) {
|
|
3899
3899
|
const h = n ? getViewportClampedResolution(
|
|
3900
3900
|
e,
|
|
@@ -3915,7 +3915,7 @@ function createSnapToPower(s, e, t, i, n, r) {
|
|
|
3915
3915
|
), p = Math.max(d, m), _ = e / Math.pow(s, p);
|
|
3916
3916
|
return clamp(_, t, h);
|
|
3917
3917
|
}
|
|
3918
|
-
};
|
|
3918
|
+
});
|
|
3919
3919
|
}
|
|
3920
3920
|
function createMinMaxResolution(s, e, t, i, n) {
|
|
3921
3921
|
return t = t !== void 0 ? t : !0, /**
|
|
@@ -3925,7 +3925,7 @@ function createMinMaxResolution(s, e, t, i, n) {
|
|
|
3925
3925
|
* @param {boolean} [isMoving] True if an interaction or animation is in progress.
|
|
3926
3926
|
* @return {number|undefined} Resolution.
|
|
3927
3927
|
*/
|
|
3928
|
-
function(r, o, a, l) {
|
|
3928
|
+
(function(r, o, a, l) {
|
|
3929
3929
|
if (r !== void 0) {
|
|
3930
3930
|
const c = i ? getViewportClampedResolution(
|
|
3931
3931
|
s,
|
|
@@ -3939,7 +3939,7 @@ function createMinMaxResolution(s, e, t, i, n) {
|
|
|
3939
3939
|
e
|
|
3940
3940
|
);
|
|
3941
3941
|
}
|
|
3942
|
-
};
|
|
3942
|
+
});
|
|
3943
3943
|
}
|
|
3944
3944
|
function disable(s) {
|
|
3945
3945
|
if (s !== void 0)
|
|
@@ -3957,12 +3957,12 @@ function createSnapToN(s) {
|
|
|
3957
3957
|
* @param {boolean} [isMoving] True if an interaction or animation is in progress.
|
|
3958
3958
|
* @return {number|undefined} Rotation.
|
|
3959
3959
|
*/
|
|
3960
|
-
function(t, i) {
|
|
3960
|
+
(function(t, i) {
|
|
3961
3961
|
if (i)
|
|
3962
3962
|
return t;
|
|
3963
3963
|
if (t !== void 0)
|
|
3964
3964
|
return t = Math.floor(t / e + 0.5) * e, t;
|
|
3965
|
-
}
|
|
3965
|
+
})
|
|
3966
3966
|
);
|
|
3967
3967
|
}
|
|
3968
3968
|
function createSnapToZero(s) {
|
|
@@ -3973,9 +3973,9 @@ function createSnapToZero(s) {
|
|
|
3973
3973
|
* @param {boolean} [isMoving] True if an interaction or animation is in progress.
|
|
3974
3974
|
* @return {number|undefined} Rotation.
|
|
3975
3975
|
*/
|
|
3976
|
-
function(t, i) {
|
|
3976
|
+
(function(t, i) {
|
|
3977
3977
|
return i || t === void 0 ? t : Math.abs(t) <= e ? 0 : t;
|
|
3978
|
-
}
|
|
3978
|
+
})
|
|
3979
3979
|
);
|
|
3980
3980
|
}
|
|
3981
3981
|
const DEFAULT_MAX_ZOOM = 42, DEFAULT_TILE_SIZE = 256, DEFAULT_MIN_ZOOM = 0;
|
|
@@ -4489,9 +4489,9 @@ class View extends BaseObject {
|
|
|
4489
4489
|
* @param {number} value Value.
|
|
4490
4490
|
* @return {number} Resolution.
|
|
4491
4491
|
*/
|
|
4492
|
-
function(r) {
|
|
4492
|
+
(function(r) {
|
|
4493
4493
|
return t / Math.pow(e, r * n);
|
|
4494
|
-
}
|
|
4494
|
+
})
|
|
4495
4495
|
);
|
|
4496
4496
|
}
|
|
4497
4497
|
/**
|
|
@@ -4519,9 +4519,9 @@ class View extends BaseObject {
|
|
|
4519
4519
|
* @param {number} resolution Resolution.
|
|
4520
4520
|
* @return {number} Value.
|
|
4521
4521
|
*/
|
|
4522
|
-
function(o) {
|
|
4522
|
+
(function(o) {
|
|
4523
4523
|
return Math.log(i / o) / t / r;
|
|
4524
|
-
}
|
|
4524
|
+
})
|
|
4525
4525
|
);
|
|
4526
4526
|
}
|
|
4527
4527
|
/**
|
|
@@ -9104,7 +9104,7 @@ const textHeights = {}, genericFontFamilies = /* @__PURE__ */ new Set([
|
|
|
9104
9104
|
function getFontKey(s, e, t) {
|
|
9105
9105
|
return `${s} ${e} 16px "${t}"`;
|
|
9106
9106
|
}
|
|
9107
|
-
const registerFont = /* @__PURE__ */ function() {
|
|
9107
|
+
const registerFont = /* @__PURE__ */ (function() {
|
|
9108
9108
|
let e, t;
|
|
9109
9109
|
async function i(r) {
|
|
9110
9110
|
await t.ready;
|
|
@@ -9151,7 +9151,7 @@ const registerFont = /* @__PURE__ */ function() {
|
|
|
9151
9151
|
}
|
|
9152
9152
|
l && (clearTimeout(e), e = setTimeout(n, 100));
|
|
9153
9153
|
};
|
|
9154
|
-
}(), measureTextHeight = /* @__PURE__ */ function() {
|
|
9154
|
+
})(), measureTextHeight = /* @__PURE__ */ (function() {
|
|
9155
9155
|
let s;
|
|
9156
9156
|
return function(e) {
|
|
9157
9157
|
let t = textHeights[e];
|
|
@@ -9165,7 +9165,7 @@ const registerFont = /* @__PURE__ */ function() {
|
|
|
9165
9165
|
}
|
|
9166
9166
|
return t;
|
|
9167
9167
|
};
|
|
9168
|
-
}();
|
|
9168
|
+
})();
|
|
9169
9169
|
function measureText(s, e) {
|
|
9170
9170
|
return measureContext || (measureContext = createCanvasContext2D(1, 1)), s != measureFont && (measureContext.font = s, measureFont = measureContext.font), measureContext.measureText(e);
|
|
9171
9171
|
}
|
|
@@ -21948,7 +21948,7 @@ function createFromTemplate(s, e) {
|
|
|
21948
21948
|
* @param {import("./proj/Projection.js").default} projection Projection.
|
|
21949
21949
|
* @return {string|undefined} Tile URL.
|
|
21950
21950
|
*/
|
|
21951
|
-
function(t, i, n) {
|
|
21951
|
+
(function(t, i, n) {
|
|
21952
21952
|
if (!t)
|
|
21953
21953
|
return;
|
|
21954
21954
|
let r;
|
|
@@ -21958,7 +21958,7 @@ function createFromTemplate(s, e) {
|
|
|
21958
21958
|
a && (r = a.getHeight() - 1);
|
|
21959
21959
|
}
|
|
21960
21960
|
return renderXYZTemplate(s, o, t[1], t[2], r);
|
|
21961
|
-
}
|
|
21961
|
+
})
|
|
21962
21962
|
);
|
|
21963
21963
|
}
|
|
21964
21964
|
function createFromTemplates(s, e) {
|
|
@@ -21975,12 +21975,12 @@ function createFromTileUrlFunctions(s) {
|
|
|
21975
21975
|
* @param {import("./proj/Projection.js").default} projection Projection.
|
|
21976
21976
|
* @return {string|undefined} Tile URL.
|
|
21977
21977
|
*/
|
|
21978
|
-
function(e, t, i) {
|
|
21978
|
+
(function(e, t, i) {
|
|
21979
21979
|
if (!e)
|
|
21980
21980
|
return;
|
|
21981
21981
|
const n = hash(e), r = modulo(n, s.length);
|
|
21982
21982
|
return s[r](e, t, i);
|
|
21983
|
-
}
|
|
21983
|
+
})
|
|
21984
21984
|
);
|
|
21985
21985
|
}
|
|
21986
21986
|
class TileSource extends Source {
|