//接处警应急,根据坐标获取周边100米范围内得摄像头
|
function getRHPCVideo(position){
|
var pt = position.toString();
|
var cameraArgs = JSON.stringify({
|
"camPosition" : pt
|
});
|
$.ajax({
|
type : "post",
|
url : "../../easyAPI/video/getRHPCVideo.action",
|
data : cameraArgs,
|
contentType : "application/json;charset=utf-8",
|
success : function (data){
|
if(data !== undefined){
|
camData = data;
|
var objvlc = {
|
'sysType':'vlc',
|
};
|
var argsvlc = JSON.stringify(objvlc);
|
$.ajax({
|
type : "post",
|
url : "../../easyAPI/sys/querySysParabyType.action",
|
data : argsvlc,
|
async : false,
|
contentType : "application/json;charset=utf-8",
|
success : function(data) {
|
showRHPCVideo_3D(camData,data[0].sysContent);
|
},
|
error : function(XMLHttpRequest, textStatus, errorThrown) {
|
console.log("ajax请求失败!","请重试!","error");
|
}
|
});
|
}
|
},
|
error : function(XMLHttpRequest, textStatus, errorThrown){
|
console.log("接处警应急100米范围内摄像头获取失败!");
|
}
|
});
|
}
|
//接处警应急,根据坐标获取周边200米范围内的人员
|
var thePolicemanArr = [];
|
var deviceList = [];
|
function getRHPCPolice(position){
|
$.ajax({
|
type : "post",
|
url : "../../easyAPI/police/getPoliceRealDateWithManPos.action",
|
contentType : "application/json;charset=utf-8",
|
success : function(data) {
|
var lng = Number(position[0]);
|
var lat = Number(position[1]);
|
|
for (var i = 0; i < data.length; i++) {
|
var dis = getFlatternDistance(lng,lat,Number(data[i].longitude),Number(data[i].latitude));
|
if(dis <= Number($("#ePoliceRadius").val())){
|
deviceList.push(data[i]);
|
}
|
}
|
showPolice_3D(deviceList,'RHPC');
|
},
|
error : function(XMLHttpRequest, textStatus, errorThrown) {
|
// 请求失败时执行该函数
|
console.log("接处警应急200米范围内人员获取失败!");
|
}
|
});
|
}
|
//接处警应急,根据坐标获取周边200米范围内的车辆
|
var carEmresult = [];
|
function getRHPCCar(position){
|
$.ajax({
|
type : "post",
|
url : "../../easyAPI/car/getPoliceCarRealData.action",
|
contentType : "application/json;charset=utf-8",
|
success : function (data){
|
var lng = Number(position[0]);
|
var lat = Number(position[1]);
|
|
for ( var i = 0; i < data.length; i++) {
|
if(data[i].realdata != undefined){
|
var dis = getFlatternDistance(lng,lat,data[i].realdata.longitude,data[i].realdata.latitude);
|
if(dis <= Number($("#ePoliceRadius").val())){
|
carEmresult.push(data[i]);
|
}
|
}
|
}
|
showPoliceCar_3D(carEmresult)//显示200米范围内的车辆
|
},
|
error : function(XMLHttpRequest, textStatus, errorThrown){
|
console.log("接处警应急200米范围内车辆获取失败!");
|
}
|
});
|
}
|
//接处警应急,框选人员
|
function selectCommandPolice(comPoints){
|
$.ajax({
|
type : "post",
|
url : "../../easyAPI/police/getPoliceRealDateWithManPos.action",
|
contentType : "application/json;charset=utf-8",
|
success : function(data) {
|
if(data !== undefined){
|
var insidedata = [];
|
for ( var i = 0; i < data.length; i++) {
|
var testPoi = [Number(data[i].longitude),Number(data[i].latitude)];
|
//判断是否在选框内
|
if(insidePolygon(comPoints,testPoi)){
|
insidedata.push(data[i]);
|
}
|
}
|
if(insidedata.length!=0){
|
//人员定位
|
showPolice_3D(insidedata,'RHPC');
|
//选中并填入正在对讲人的姓名
|
stopintercom();
|
startintercom(insidedata,'police');
|
//显示多个路径导航
|
showRoadNavs(insidedata);
|
}else{
|
clearrhpcVideo();
|
swal("没有选中警力!","请重试!","error");
|
}
|
}
|
},
|
error : function(XMLHttpRequest, textStatus, errorThrown) {
|
console.log("获取人员信息失败!");
|
}
|
});
|
}
|
//接处警应急,框选车辆
|
function selectCommandCar(comPoints){
|
$.ajax({
|
type : "post",
|
url : "../../easyAPI/car/getPoliceCarRealData.action",
|
contentType : "charset=utf-8",
|
success : function(data) {
|
if(data !== undefined){
|
var insidedata = [];
|
var insidedataCar=[];
|
for ( var i = 0; i < data.length; i++) {
|
if(data[i].realdata != undefined){
|
var testPoi = [Number(data[i].realdata.longitude),Number(data[i].realdata.latitude)];
|
//判断是否在选框内
|
if(insidePolygon(comPoints,testPoi)){
|
insidedataCar.push(data[i].realdata);
|
insidedata.push(data[i]);
|
}
|
}
|
}
|
if(insidedata.length!=0){
|
//车辆定位
|
showPoliceCar_3D(insidedata)
|
//选中并填入正在对讲人的车牌
|
stopintercom();
|
startintercom(insidedataCar);
|
//显示多个路径导航
|
showRoadNavs(insidedataCar);
|
}else{
|
clearrhpcVideo();
|
swal("没有选中警力!","请重试!","error");
|
}
|
}
|
},
|
error : function(XMLHttpRequest, textStatus, errorThrown) {
|
console.log("获取车辆信息失败!");
|
}
|
});
|
}
|
//多路径路径导航,向百度服务发送请求
|
function getRoadNavs(url){
|
$.ajax({
|
url: url,
|
dataType: "jsonp",
|
async: false,
|
cache:false,
|
success:function(data){
|
showRouteLines(data);
|
}
|
});
|
}
|
//定位报警写入案件中
|
function insertEmergencyCase(caseName,casePosition){
|
var args = JSON.stringify({
|
"caseName":caseName,
|
"casePosition":emergencyPosArr.join(',')
|
});
|
$.ajax({
|
type : "post",
|
url : "../../easyAPI/case/insertEmergencyCase.action",
|
data : args,
|
contentType : "application/json;charset=utf-8",
|
success : function(data) {
|
if(data==1){
|
swal("定位报警已记录,请在后台完善案件信息!","定位成功!","success");
|
}
|
},
|
error : function(XMLHttpRequest, textStatus, errorThrown) {
|
console.log("定位报警写入案件请求失败!");
|
}
|
});
|
}
|