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 1173a79 commit 50a5397Copy full SHA for 50a5397
src/openlayers/mapping/WebMap.js
@@ -212,11 +212,23 @@ export class WebMap extends ol.Observable {
212
this.mapParams.extent = extent;
213
this.mapParams.projection = projection;
214
}
215
+
216
+ // 计算当前最大分辨率
217
+ let maxResolution;
218
+ if(extent && extent.length === 4){
219
+ let width = extent[2] - extent[0];
220
+ let height = extent[3] - extent[1];
221
+ let maxResolution1 = width/256;
222
+ let maxResolution2 = height/256;
223
+ maxResolution = Math.max(maxResolution1, maxResolution2);
224
+ }
225
226
this.map.setView(new ol.View({
227
zoom,
228
center,
229
projection,
- extent
230
+ extent,
231
+ maxResolution
232
}));
233
234
/**
0 commit comments