cd-mapgis 1.0.55 → 1.0.56

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cd-mapgis",
3
- "version": "1.0.55",
3
+ "version": "1.0.56",
4
4
  "main": "./src/index.js",
5
5
  "types": "./src/index.d.ts",
6
6
  "type": "module",
package/src/MapView.js CHANGED
@@ -23,6 +23,7 @@ export default class MapView {
23
23
  this.viewLayers = [];
24
24
  //所有的geoServer图层列表
25
25
  this.geoServerLayers = [];
26
+ this._reset_bounds = null;//复位窗口范围
26
27
 
27
28
  this._view_templayer = null;
28
29
  this._init(this.params);
@@ -231,4 +232,10 @@ export default class MapView {
231
232
  this.swipeUtil = null;
232
233
  }
233
234
  }
235
+ //复位
236
+ reSet() {
237
+ if (this._reset_bounds) {
238
+ this.map.getView().fit(this._reset_bounds, this.map.getSize());
239
+ }
240
+ }
234
241
  }
package/src/OM.js CHANGED
@@ -149,6 +149,9 @@ export default class OM {
149
149
  layers.forEach(function (layer) {
150
150
  map.removeLayer(layer); // 移除每个图层
151
151
  });
152
+ mapView.layerGroup = [];
153
+ mapView.viewLayers = [];
154
+ mapView.geoServerLayers = [];
152
155
  }
153
156
  //先加载后端默认加载的图层
154
157
  let mapKey = (p.comm && p.comm.mapKey) ? p.comm.mapKey : 'def_view_layers';
@@ -276,6 +279,7 @@ export default class OM {
276
279
  let mapView = mapViews[k];
277
280
  let map = mapView.map;
278
281
  map.getView().fit(bounds, map.getSize());
282
+ mapView._reset_bounds = bounds;
279
283
  }
280
284
  }
281
285
  }