Skip to content

Commit 50e755b

Browse files
committed
[bug] rest map 可用比例尺不存在的时候 数组长度为0的情况 没有考虑 review by zhaoqin
1 parent a9eeeac commit 50e755b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/openlayers/mapping/WebMap.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ export class WebMap extends ol.Observable {
405405
maxResolution = Math.max(maxResolution1, maxResolution2);
406406
}
407407

408-
if(options.baseLayer.visibleScales){
408+
if(options.baseLayer.visibleScales && options.baseLayer.visibleScales.length > 0){
409409
maxZoom = options.baseLayer.visibleScales.length;
410410
}
411411

@@ -688,7 +688,7 @@ export class WebMap extends ol.Observable {
688688
prjCoordSys:{ epsgCode: isBaseLayer ? layerInfo.projection.split(':')[1] : this.baseProjection.split(':')[1] },
689689
tileProxy: this.tileProxy
690690
};
691-
if(layerInfo.visibleScales){
691+
if(layerInfo.visibleScales && layerInfo.visibleScales.length >0){
692692
let result = this.getReslutionsFromScales(layerInfo.visibleScales, 96, layerInfo.coordUnit);
693693
let tileGrid = new ol.tilegrid.TileGrid({
694694
extent: layerInfo.extent,

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy