use lodash-es everywhere, replace custom clamp methods with lodash

This commit is contained in:
Martin Raifer
2025-04-21 14:43:35 +02:00
parent 4254e67ca7
commit aa96a67c65
12 changed files with 15 additions and 28 deletions
+2 -5
View File
@@ -1,4 +1,6 @@
import { range as d3_range } from 'd3-array';
import { clamp } from 'lodash-es';
import { geoExtent, geoScaleToZoom } from '../geo';
@@ -12,11 +14,6 @@ export function utilTiler() {
var _skipNullIsland = false;
function clamp(num, min, max) {
return Math.max(min, Math.min(num, max));
}
function nearNullIsland(tile) {
var x = tile[0];
var y = tile[1];
+2 -4
View File
@@ -1,3 +1,5 @@
import { clamp } from 'lodash-es';
import { t, localizer } from '../core/localizer';
var OSM_PRECISION = 7;
@@ -102,10 +104,6 @@ function wrap(x, min, max) {
return ((x - min) % d + d) % d + min;
}
function clamp(x, min, max) {
return Math.max(min, Math.min(x, max));
}
function roundToDecimal (target, decimalPlace) {
target = Number(target);
decimalPlace = Number(decimalPlace);