cd-mapgis 1.1.2 → 1.1.3

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.1.2",
3
+ "version": "1.1.3",
4
4
  "main": "./src/index.js",
5
5
  "types": "./src/index.d.ts",
6
6
  "type": "module",
package/src/LineLayer.js CHANGED
@@ -82,7 +82,11 @@ export default class LineLayer {
82
82
  * 缩放到本图层显示范围
83
83
  */
84
84
  fitToLayer(){
85
- const map = this.map;
86
- map.getView().fit(this.vectorSource.getExtent(), map.getSize())
85
+ const map = this.map;
86
+ map.getView().fit(this.vectorSource.getExtent(), {
87
+ size: map.getSize(),
88
+ maxZoom: 16,
89
+ duration: 1000
90
+ })
87
91
  }
88
92
  }
package/src/PointLayer.js CHANGED
@@ -85,8 +85,12 @@ export default class PointLayer {
85
85
  /**
86
86
  * 缩放到本图层显示范围
87
87
  */
88
- fitToLayer(){
89
- const map = this.map;
90
- map.getView().fit(this.vectorSource.getExtent(), map.getSize())
88
+ fitToLayer() {
89
+ const map = this.map;
90
+ map.getView().fit(this.vectorSource.getExtent(), {
91
+ size: map.getSize(),
92
+ maxZoom: 16,
93
+ duration: 1000
94
+ })
91
95
  }
92
96
  }