function joinHouTai(){
|
var user = $("#yhm").text();
|
var data = "username="+user
|
$.get("/hxzkuwb/findUserRole",data,function (data){
|
if(data.ujoin == "No"){
|
layer.msg('当前没有权限进入后台,请联系管理员')
|
}else{
|
window.open("../../HouTai/HouTai.jsp")
|
}
|
})
|
}
|
|
let graphics = []; // 用于存储所有跌落位置的数组
|
|
function KuaiSuDingWei(){
|
var pTagid = $("#KuaiSuDingWeiTag").val();
|
if (pTagid == ""){
|
graphics.forEach(graphic => {
|
graphicLayer.removeGraphic(graphic); // 从图层中移除
|
});
|
graphics = []; // 清空标记数组
|
|
layer.msg("清空跌落位置!"); // 显示清除成功消息
|
return false;
|
}
|
if (pTagid && pTagid.includes(',')) {
|
const coordinates = pTagid.split(',');
|
|
if (coordinates.length === 2) {
|
const lon = parseFloat(coordinates[0]);
|
const lat = parseFloat(coordinates[1]);
|
|
if (!isNaN(lon) && !isNaN(lat)) {
|
// 经纬度搜索
|
map.camera.flyTo({
|
destination: Cesium.Cartesian3.fromDegrees(lon, lat, 500),
|
duration: 3
|
});
|
layer.msg("搜索位置成功"); // 显示成功消息
|
|
// 在指定位置添加标记
|
var graphic = new mars3d.graphic.PointEntity({
|
name: "贴地点",
|
position: new mars3d.LngLatPoint(lon, lat),
|
style: {
|
color: "#ffff00",
|
pixelSize: 10,
|
clampToGround: true,
|
outlineWidth: 0,
|
label: { text: "坠落地点", pixelOffsetY: -10 },
|
// 高亮时的样式(默认为鼠标移入,也可以指定type:'click'单击高亮),构造后也可以openHighlight、closeHighlight方法来手动调用
|
highlight: {
|
type: mars3d.EventType.click, // 默认为鼠标移入高亮,也可以指定click单击高亮
|
pixelSize: 15,
|
outlineColor: "#ff0000",
|
outlineWidth: 2
|
}
|
},
|
attr: { remark: "跌落位置" }
|
})
|
graphicLayer.addGraphic(graphic)
|
graphics.push(graphic); // 将新标记添加到数组中
|
|
} else {
|
layer.msg("不正确的纬度和经度格式。");
|
}
|
} else {
|
layer.msg("请输入有效纬度和经度。");
|
}
|
}else{
|
var data = "pTagid="+pTagid
|
$.ajax({
|
url: "/hxzkuwb/findOnePerson",
|
type: "POST",
|
data: data,
|
async: false,
|
success: function(data) {
|
if (data !=""){
|
var targetPoint = {
|
lat: data.baoliu3, // 纬度
|
lon: data.baoliu2 // 经度
|
};
|
// 使用 Mars3D 的 flyTo 方法来移动地图
|
map.camera.flyTo({
|
destination: Cesium.Cartesian3.fromDegrees(targetPoint.lon, targetPoint.lat, 500), // 目标点经纬度和视角高度
|
duration: 3 // 动画持续时间(秒)
|
});
|
console.log(graphicLayer)
|
layer.msg("搜索位置成功!")
|
|
}else{
|
layer.msg("请输入有效人员或设备")
|
}
|
},
|
error: function(xhr, status, error) {
|
layer.msg("请联系管理员")
|
}
|
});
|
}
|
}
|