Skip to content

Commit 8f3ab61

Browse files
committed
【update】对接iportal注册的iserver地图
1 parent 2861879 commit 8f3ab61

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/openlayers/mapping/WebMap.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,8 @@ export class WebMap extends ol.Observable {
121121
description: mapInfo.description
122122
}; //存储地图的名称以及描述等信息,返回给用户
123123
that.addBaseMap(mapInfo);
124-
if(mapInfo.layers.length === 0) {
125-
that.sendMapToUser(0, mapInfo.layers.length);
124+
if(!mapInfo.layers || mapInfo.layers.length === 0) {
125+
that.sendMapToUser(0, 0);
126126
} else {
127127
that.addLayers(mapInfo);
128128
}
@@ -159,7 +159,7 @@ export class WebMap extends ol.Observable {
159159
*/
160160
createView(options) {
161161
let oldcenter = options.center,
162-
zoom = options.level,
162+
zoom = options.level || 1,
163163
extent = options.extent,
164164
projection = this.baseProjection;
165165
let center = [];

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