水源相关修改完成
parent
422b40366c
commit
b8c0808ad8
|
|
@ -140,13 +140,13 @@ export default {
|
|||
// 抛出事件
|
||||
this.$emit("onload", map);
|
||||
//开场动画
|
||||
map.openFlyAnimation({
|
||||
// duration1:4,
|
||||
// easingFunction1: Cesium.EasingFunction.QUINTIC_IN_OUT,
|
||||
callback: function () {
|
||||
//动画播放完成后回调
|
||||
},
|
||||
});
|
||||
// map.openFlyAnimation({
|
||||
// // duration1:4,
|
||||
// // easingFunction1: Cesium.EasingFunction.QUINTIC_IN_OUT,
|
||||
// callback: function () {
|
||||
// //动画播放完成后回调
|
||||
// },
|
||||
// });
|
||||
},
|
||||
|
||||
//初始化外部静态widget功能(兼容使用传统模式开发的一些widget)
|
||||
|
|
|
|||
|
|
@ -179,7 +179,7 @@
|
|||
></goodsbox>
|
||||
</div>
|
||||
<!-- 水源 -->
|
||||
<div class="goods-container" v-if="waterVisible && finishLoadMap">
|
||||
<div class="goods-container" v-if="waterVisible && finishLoadMap" v-drag>
|
||||
<waterbox
|
||||
:waterCenter="waterCenter"
|
||||
:firePopup = "firePopupClosed"
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@ import appConfig from "../../../../public/config/app.json";
|
|||
import * as turf from "@turf/turf";
|
||||
import { parse } from "../lib/handleGeojson";
|
||||
import axios from "axios";
|
||||
import { postMethodCommon, getMethodCommon } from "../../../api/common";
|
||||
export default {
|
||||
name: "monitorbox",
|
||||
props: ["waterCenter", "firePopup"],
|
||||
|
|
@ -67,12 +68,10 @@ export default {
|
|||
},
|
||||
firePopup: {
|
||||
handler(newVal, oldVal) {
|
||||
console.log('newVal: ', newVal);
|
||||
console.log(newVal)
|
||||
if (newVal == true) {
|
||||
alert(1)
|
||||
this.close();
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
created() {
|
||||
|
|
@ -83,6 +82,9 @@ export default {
|
|||
this.waterGraphicLayerArr.forEach((item) => {
|
||||
this.waterGraphicLayer.removeGraphic(item);
|
||||
});
|
||||
if (this.pathPointGraphicLayer) {
|
||||
this.pathPointGraphicLayer.clear();
|
||||
}
|
||||
this.$emit("close");
|
||||
},
|
||||
radioChange(e) {
|
||||
|
|
@ -174,6 +176,7 @@ export default {
|
|||
var s = parseInt((a % 3600) % 60);
|
||||
return h + "小时" + m + "分" + s + "秒";
|
||||
},
|
||||
//火情附近所有点
|
||||
getNestPoint(lng, lat) {
|
||||
let from = turf.point([lng, lat]);
|
||||
this.nestWaterPoints = [];
|
||||
|
|
@ -196,36 +199,34 @@ export default {
|
|||
flyToPosition(lngLat) {
|
||||
this.startLngLat = lngLat;
|
||||
this.getRoutePath();
|
||||
window.globalmap.flyToPoint(lngLat, { radius: 400, pitch: -90 });
|
||||
window.globalmap.flyToPoint(lngLat, { radius: 1200, pitch: -90 });
|
||||
// {"lat":34.984709,"lng":118.253932,"alt":6066,"heading":354,}
|
||||
},
|
||||
getRoutePath() {
|
||||
// 获取路线数据
|
||||
let startCoor = this.startLngLat;
|
||||
let endCoor = this.waterCenter;
|
||||
let _this = this;
|
||||
axios({
|
||||
method: "get",
|
||||
url: "http://123.132.248.154:9210/api/FirePrevention/LoadRoad",
|
||||
headers: {
|
||||
"X-Token": localStorage.getItem("X-Token"),
|
||||
},
|
||||
params: {
|
||||
startlng: parseFloat(startCoor[0]),
|
||||
startlat: parseFloat(startCoor[1]),
|
||||
endlng: parseFloat(endCoor[0]),
|
||||
endlat: parseFloat(endCoor[1]),
|
||||
},
|
||||
}).then((data) => {
|
||||
if (data.data.data.length > 0) {
|
||||
let LineString = data.data.data[0].route;
|
||||
let params = {
|
||||
startlng: parseFloat(startCoor[0]),
|
||||
startlat: parseFloat(startCoor[1]),
|
||||
endlng: parseFloat(endCoor[0]),
|
||||
endlat: parseFloat(endCoor[1]),
|
||||
areaname: localStorage.getItem("areaName"),
|
||||
};
|
||||
getMethodCommon("/FirePrevention/LoadRoad", params).then((res) => {
|
||||
console.log("res: ", res);
|
||||
if (res.data.length > 0) {
|
||||
let LineString = res.data[0].route;
|
||||
if (LineString == null || LineString == "null") {
|
||||
this.$message({
|
||||
type: "warning",
|
||||
message: "距离太近,没有找到合适的路线",
|
||||
});
|
||||
if (this.pathPointGraphicLayer) {
|
||||
this.pathPointGraphicLayer.clear();
|
||||
}
|
||||
} else {
|
||||
setTimeout(function () {
|
||||
console.log("LineStringing", LineString);
|
||||
_this.drawRoutePath(parse(LineString));
|
||||
console.log("2222222222");
|
||||
}, 1000);
|
||||
this.drawRoutePath(parse(LineString));
|
||||
}
|
||||
} else {
|
||||
}
|
||||
|
|
@ -236,14 +237,12 @@ export default {
|
|||
if (this.pathPointGraphicLayer == null) {
|
||||
this.pathPointGraphicLayer = new mars3d.layer.GraphicLayer();
|
||||
window.globalmap.addLayer(this.pathPointGraphicLayer);
|
||||
} else {
|
||||
this.pathPointGraphicLayer.clear();
|
||||
}
|
||||
console.log("geojson", geojson);
|
||||
this.pathPointGraphicLayer.clear();
|
||||
|
||||
if (geojson.type == "LineString") {
|
||||
geojson.coordinates = [geojson.coordinates];
|
||||
}
|
||||
|
||||
// 虚线部分
|
||||
var startCoor = this.startLngLat;
|
||||
var endCoor = this.waterCenter;
|
||||
|
|
@ -278,7 +277,6 @@ export default {
|
|||
dashLength: 8.0,
|
||||
},
|
||||
},
|
||||
attr: { remark: "虚线" },
|
||||
});
|
||||
this.pathPointGraphicLayer.addGraphic(graphic);
|
||||
}
|
||||
|
|
@ -331,7 +329,6 @@ export default {
|
|||
speed: 10,
|
||||
},
|
||||
},
|
||||
attr: { remark: "示例13" },
|
||||
});
|
||||
this.pathPointGraphicLayer.addGraphic(graphic);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue