|
|
@@ -327,7 +327,7 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
handleDownload() {
|
|
|
- const zipfile = this.newObj.proxypath + ".zip";
|
|
|
+ let zipfile = this.newObj.proxypath + ".zip";
|
|
|
window.open(`${zipfile}`);
|
|
|
},
|
|
|
tableClick(row) {
|
|
|
@@ -423,25 +423,25 @@ export default {
|
|
|
zIndex: 9999,
|
|
|
});
|
|
|
|
|
|
- // 7. 获取中心点坐标并验证
|
|
|
- let center = [item["中心点经度"], item["中心点纬度"]];
|
|
|
- if (!Array.isArray(center) || center.length !== 2) {
|
|
|
- console.warn("无效的中心点坐标:", center);
|
|
|
+ // 7. 获取实体地理范围(优先使用geom范围,而非中心点)
|
|
|
+ let extent = this.itemObj.getSource().getExtent();
|
|
|
+ if (!extent || extent.length !== 4) {
|
|
|
+ console.warn("无效的实体范围:", extent);
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- // 8. 对所有相关地图执行添加图层和视角动画
|
|
|
+ // 8. 对所有相关地图执行添加图层和基于实体范围的飞入动画
|
|
|
mapNames.forEach((mapName) => {
|
|
|
let map = window.map[mapName];
|
|
|
if (map) {
|
|
|
// 添加新图层
|
|
|
map.addLayer(this.itemObj);
|
|
|
- // 视角动画(仅在第一个地图执行一次,避免多地图重复动画)
|
|
|
+ // 基于实体范围的飞入动画(仅在第一个地图执行一次)
|
|
|
if (mapName === mapNames[0]) {
|
|
|
- map.getView().animate({
|
|
|
- center,
|
|
|
- zoom: 16.5,
|
|
|
- duration: 2000,
|
|
|
+ map.getView().fit(extent, {
|
|
|
+ duration: 2000, // 动画持续时间
|
|
|
+ padding: [50, 50, 50, 50], // 边界内边距,避免实体贴边
|
|
|
+ maxZoom: 16.5, // 最大缩放级别限制
|
|
|
});
|
|
|
}
|
|
|
} else {
|