|
@@ -47,13 +47,13 @@ class BoundaryLayer {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
fitView() {
|
|
fitView() {
|
|
|
- const source = this.boundaryLayer.source.getSource();
|
|
|
|
|
|
|
+ const source = this.boundaryLayer.layer.getSource();
|
|
|
if (!source || source.getFeatures().length === 0) {
|
|
if (!source || source.getFeatures().length === 0) {
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- let extent = this.boundaryLayer.source.getExtent();
|
|
|
|
|
|
|
+ let extent = source.getExtent();
|
|
|
// 地图自适应到区域可视范围
|
|
// 地图自适应到区域可视范围
|
|
|
- this.kmap.getView().fit(extent, { duration: 500, padding: [100, 100, 100, 100] });
|
|
|
|
|
|
|
+ this.kmap.getView().fit(extent, { duration: 500, padding: [120, 100, 80, 100] });
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
toggleLayer(val) {
|
|
toggleLayer(val) {
|