We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2861879 commit 8f3ab61Copy full SHA for 8f3ab61
src/openlayers/mapping/WebMap.js
@@ -121,8 +121,8 @@ export class WebMap extends ol.Observable {
121
description: mapInfo.description
122
}; //存储地图的名称以及描述等信息,返回给用户
123
that.addBaseMap(mapInfo);
124
- if(mapInfo.layers.length === 0) {
125
- that.sendMapToUser(0, mapInfo.layers.length);
+ if(!mapInfo.layers || mapInfo.layers.length === 0) {
+ that.sendMapToUser(0, 0);
126
} else {
127
that.addLayers(mapInfo);
128
}
@@ -159,7 +159,7 @@ export class WebMap extends ol.Observable {
159
*/
160
createView(options) {
161
let oldcenter = options.center,
162
- zoom = options.level,
+ zoom = options.level || 1,
163
extent = options.extent,
164
projection = this.baseProjection;
165
let center = [];
0 commit comments