Skip to content

Commit b5daf13

Browse files
committed
【update】1)webMap中修复eslint报错
(reviewed by chengl)
1 parent 72ef785 commit b5daf13

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/openlayers/mapping/WebMap.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1087,9 +1087,10 @@ export class WebMap extends Observable {
10871087
if (layerInfo.layerType === "TILE") {
10881088
layerInfo.extent = [result.bounds.left, result.bounds.bottom, result.bounds.right, result.bounds.top];
10891089
layerInfo.projection = `EPSG:${result.prjCoordSys.epsgCode}`;
1090-
// let token = layerInfo.credential ? layerInfo.credential.token : undefined;
1091-
// let isSupprtWebp = await that.isSupportWebp(layerInfo.url, token);
1092-
// layerInfo.format = isSupprtWebp ? 'webp' : 'png';
1090+
let token = layerInfo.credential ? layerInfo.credential.token : undefined;
1091+
let isSupprtWebp = await that.isSupportWebp(layerInfo.url, token);
1092+
// eslint-disable-next-line require-atomic-updates
1093+
layerInfo.format = isSupprtWebp ? 'webp' : 'png';
10931094
callback(layerInfo);
10941095
} else {
10951096
layerInfo.projection = that.baseProjection;
@@ -1128,9 +1129,10 @@ export class WebMap extends Observable {
11281129
}
11291130
layerInfo.maxZoom = result.maxZoom;
11301131
layerInfo.maxZoom = result.minZoom;
1131-
// let token = layerInfo.credential ? layerInfo.credential.token : undefined;
1132-
// let isSupprtWebp = await that.isSupportWebp(layerInfo.url, token);
1133-
// layerInfo.format = isSupprtWebp ? 'webp' : 'png';
1132+
let token = layerInfo.credential ? layerInfo.credential.token : undefined;
1133+
let isSupprtWebp = await that.isSupportWebp(layerInfo.url, token);
1134+
// eslint-disable-next-line require-atomic-updates
1135+
layerInfo.format = isSupprtWebp ? 'webp' : 'png';
11341136
// 请求结果完成 继续添加图层
11351137
if(mapInfo){
11361138
//todo 这个貌似没有用到,下次优化

0 commit comments

Comments
 (0)