Skip to content

Commit 193f29a

Browse files
[fix]sonar
1 parent 93ef8f3 commit 193f29a

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

src/openlayers/mapping/WebMap.js

+3-7
Original file line numberDiff line numberDiff line change
@@ -1343,17 +1343,13 @@ export class WebMap extends Observable {
13431343
if (mapBounds) {
13441344
return mapBounds;
13451345
}
1346-
const getBoundsByResoutions = (maxResolution, origin) => {
1347-
const size = maxResolution * tileSize;
1348-
return [origin[0], origin[1] - size, origin[0] + size, origin[1]];
1349-
};
1350-
13511346
if (resolutions) {
13521347
const maxResolution = resolutions.sort((a, b) => b - a)[0];
1353-
return getBoundsByResoutions(maxResolution, origin);
1348+
const size = maxResolution * tileSize;
1349+
return [origin[0], origin[1] - size, origin[0] + size, origin[1]];
13541350
}
13551351
// 兼容之前的3857全球剖分
1356-
if (this.baseProjection === 'EPSG:3857') {
1352+
if (this.baseProjection == 'EPSG:3857') {
13571353
return [-20037508.3427892, -20037508.3427892, 20037508.3427892, 20037508.3427892];
13581354
}
13591355
}

0 commit comments

Comments
 (0)