Skip to content

Commit 4c7a97f

Browse files
committed
【fix】尽量保持原有逻辑不影响,相关测试见overlay is TILE which carried credential token
AI-GEN: 80% Claude
1 parent f0946df commit 4c7a97f

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

src/common/mapping/WebMapV2.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2786,7 +2786,14 @@ export function createWebMapV2Extending(SuperClass, { MapManager, mapRepo, DataF
27862786
if (left >= right || bottom >= top) {
27872787
return false;
27882788
}
2789-
if (Math.abs(left) > 180 || Math.abs(right) > 180 || Math.abs(bottom) > 90 || Math.abs(top) > 90) {
2789+
// 容差,吸收浮点计算误差(如 180.00000000000006)
2790+
const tolerance = 1e-6;
2791+
if (
2792+
Math.abs(left) > 180 + tolerance ||
2793+
Math.abs(right) > 180 + tolerance ||
2794+
Math.abs(bottom) > 90 + tolerance ||
2795+
Math.abs(top) > 90 + tolerance
2796+
) {
27902797
return false;
27912798
}
27922799
if (Math.abs(left) < 0.5 && Math.abs(right) < 0.5 && Math.abs(bottom) < 0.5 && Math.abs(top) < 0.5) {

0 commit comments

Comments
 (0)