|
@@ -160,7 +160,7 @@ function initCommd() {
|
|
|
{
|
|
|
"id" : tc_camera,
|
|
|
"type" : "command",
|
|
|
- label : "摄像头",
|
|
|
+ label : "视频监控",
|
|
|
layer : cameraMarkerlayer
|
|
|
},
|
|
|
{
|
|
@@ -873,7 +873,7 @@ function addCommandTask(taskId) {
|
|
|
$("#divSuggestion").css("display", "none");
|
|
|
clearSelectRoute();
|
|
|
closeRoutePopupWin();
|
|
|
- clearLjghRoute();
|
|
|
+ closeResourceWin();
|
|
|
},
|
|
|
area : [ '500px', '590px' ],
|
|
|
content : url, // iframe的url
|
|
@@ -932,7 +932,7 @@ function openTaskInfo(taskId, operFlg) {
|
|
|
$("#divSuggestion").css("display", "none");
|
|
|
clearSelectRoute();
|
|
|
closeRoutePopupWin();
|
|
|
- clearLjghRoute();
|
|
|
+ closeResourceWin();
|
|
|
},
|
|
|
area : [ '500px', '590px' ],
|
|
|
content : url, // iframe的url
|
|
@@ -1306,9 +1306,6 @@ function addLjghRoute(result, isClear) {
|
|
|
if(isClear) {
|
|
|
clearLjghRoute();
|
|
|
}
|
|
|
- // 绘制起始点
|
|
|
- addLjghMarker(result.route.origin, "start.png");
|
|
|
- addLjghMarker(result.route.destination, "end.png");
|
|
|
// 获取起始重点经纬度,并设置两点中心点为地图中心点
|
|
|
var a = parseFloat(result.route.origin.split(",")[0]);
|
|
|
var b = parseFloat(result.route.origin.split(",")[1]);
|
|
@@ -1317,7 +1314,7 @@ function addLjghRoute(result, isClear) {
|
|
|
var centerLon = addLonOffset((a+c)/2).toFixed(6);
|
|
|
var centerLat = addLatOffset((b+d)/2).toFixed(6);
|
|
|
// 缩放地图比例
|
|
|
- setMapCenter(centerLat, centerLon, 6);
|
|
|
+ //setMapCenter(centerLat, centerLon, 6);
|
|
|
// 绘制路线
|
|
|
var steps = result.route.paths[0].steps;
|
|
|
var pathFeatures = [];
|
|
@@ -1595,20 +1592,7 @@ function circleClick(type, id, chatIds, userNames, adcode) {
|
|
|
} else if (type=="zxrdw") {
|
|
|
zxrdw(chatIds, userNames, id);
|
|
|
} else if (type=="tqck") {
|
|
|
- if(adcode == "") {
|
|
|
- layer.alert('未关联到天气信息', {icon: 0});
|
|
|
- return;
|
|
|
- }
|
|
|
- // 查询江苏机场信息
|
|
|
- $.get(basePath + "/air/weatherxqqh/"+adcode, {
|
|
|
- }, function(result) {
|
|
|
- if(result) {
|
|
|
- shouWeather(result.areaid, result.namecn);
|
|
|
- } else {
|
|
|
- layer.alert('未关联到天气信息', {icon: 0});
|
|
|
- return;
|
|
|
- }
|
|
|
- }, 'json');
|
|
|
+ showWeather(adcode);
|
|
|
} else if (type=="zyck") {
|
|
|
/*showLoadLayer();
|
|
|
$.get(basePath + '/ljgh/searchWay2',
|
|
@@ -1624,7 +1608,7 @@ function circleClick(type, id, chatIds, userNames, adcode) {
|
|
|
);*/
|
|
|
// 绘制弹出窗口
|
|
|
currentTaskId = id;
|
|
|
- showResourceWin();
|
|
|
+ showResourceWin(adcode);
|
|
|
} else if (type=="jtgj") {
|
|
|
$.get(basePath + '/commandTask/findJtgj',
|
|
|
{
|
|
@@ -1655,6 +1639,23 @@ function circleClick(type, id, chatIds, userNames, adcode) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+function showWeather(adcode){
|
|
|
+ if(adcode == "") {
|
|
|
+ layer.alert('未关联到天气信息', {icon: 0});
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ // 查询江苏机场信息
|
|
|
+ $.get(basePath + "/air/weatherxqqh/"+adcode, {
|
|
|
+ }, function(result) {
|
|
|
+ if(result) {
|
|
|
+ shouWeather(result.areaid, result.namecn);
|
|
|
+ } else {
|
|
|
+ layer.alert('未关联到天气信息', {icon: 0});
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }, 'json');
|
|
|
+}
|
|
|
+
|
|
|
/**
|
|
|
* 交通工具
|
|
|
*/
|
|
@@ -2125,7 +2126,7 @@ function addSfw(sfwId) {
|
|
|
* 绘制弹出窗口
|
|
|
* @param
|
|
|
*/
|
|
|
-function showResourceWin() {
|
|
|
+function showResourceWin(adcode) {
|
|
|
if($("#divResource").css("display") == "none") {
|
|
|
$("#divResource").css("display","block");
|
|
|
$('#divResource input[type="checkbox"]').attr("checked", false);
|
|
@@ -2136,9 +2137,22 @@ function showResourceWin() {
|
|
|
"resType":"line"
|
|
|
},
|
|
|
function (result) {
|
|
|
+ CirMenuHandler.RadiusHide();
|
|
|
+ setClickIcon(null);
|
|
|
+ clickMaker_params = null;
|
|
|
+ $("#MainDiv").css("display","none");
|
|
|
closeLoadLayer();
|
|
|
- // 增加路线规划
|
|
|
- addLjghRoute(result, true);
|
|
|
+ // 增加路线规划
|
|
|
+ addLjghRoute(result, true);
|
|
|
+ if(result && result.status == "1") {
|
|
|
+ // 绘制任务
|
|
|
+ addTaskInfoMarker(result, "m_task.png", result.taskEntity.taskTime);
|
|
|
+ // 绘制天气
|
|
|
+ addWeatherMarker(result, "m_weather.png", adcode);
|
|
|
+ // 绘制起始点
|
|
|
+ addLjghMarker(result.route.origin, "start2.png");
|
|
|
+ addLjghMarker(result.route.destination, "end2.png");
|
|
|
+ }
|
|
|
},
|
|
|
'json'
|
|
|
);
|
|
@@ -2146,6 +2160,50 @@ function showResourceWin() {
|
|
|
$("#divResource").css("display","none");
|
|
|
}
|
|
|
}
|
|
|
+/**
|
|
|
+ * 绘制弹出窗口
|
|
|
+ * @param
|
|
|
+ */
|
|
|
+function showResourceWinFromPlan(obj) {
|
|
|
+ currentTaskId = null;
|
|
|
+ if($("#divResource").css("display") == "none") {
|
|
|
+ $("#divResource").css("display","block");
|
|
|
+ $('#divResource input[type="checkbox"]').attr("checked", false);
|
|
|
+ }
|
|
|
+ showLoadLayer();
|
|
|
+ //获取资源选中类型
|
|
|
+ var resType = getResType();
|
|
|
+ $.get(basePath + '/ljgh/searchWay',
|
|
|
+ {
|
|
|
+ "origin":obj.origin,
|
|
|
+ "destination": obj.destination,
|
|
|
+ "strategy": obj.strategy,
|
|
|
+ "waypoints": obj.waypoints,
|
|
|
+ "avoidroad":obj.avoidroad,
|
|
|
+ "isShowResource":true,
|
|
|
+ "resType":resType
|
|
|
+ },
|
|
|
+ function (result) {
|
|
|
+ CirMenuHandler.RadiusHide();
|
|
|
+ setClickIcon(null);
|
|
|
+ clickMaker_params = null;
|
|
|
+ $("#MainDiv").css("display","none");
|
|
|
+ closeLoadLayer();
|
|
|
+ // 增加路线规划
|
|
|
+ addLjghRoute(result, true);
|
|
|
+ if(result && result.status == "1") {
|
|
|
+ // 绘制任务
|
|
|
+ addTaskInfoMarker(result, "m_task.png", obj.taskTime);
|
|
|
+ // 绘制天气
|
|
|
+ addWeatherMarker(result, "m_weather.png", obj.adcode);
|
|
|
+ // 绘制起始点
|
|
|
+ addLjghMarker(result.route.origin, "start2.png");
|
|
|
+ addLjghMarker(result.route.destination, "end2.png");
|
|
|
+ }
|
|
|
+ },
|
|
|
+ 'json'
|
|
|
+ );
|
|
|
+}
|
|
|
|
|
|
/**
|
|
|
* 绘制弹出窗口
|
|
@@ -2155,6 +2213,7 @@ function closeResourceWin() {
|
|
|
$("#divResource").css("display","none");
|
|
|
//关闭当前对应图层弹出的左下角信息框
|
|
|
clearLjghRoute();
|
|
|
+ closeTaskInfoWin();
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -2164,7 +2223,7 @@ function initResourceDiv(){
|
|
|
mapResourceType = [
|
|
|
{"id": "res_sfz", "type": "railway", label: "收费站", layer: cameraMarkerlayer},
|
|
|
{"id": "res_fwq", "type": "railway", label: "服务区", layer: cameraMarkerlayer},
|
|
|
- {"id": "res_camera", "type": "railway", label: "摄像头", layer: cameraMarkerlayer}
|
|
|
+ {"id": "res_camera", "type": "railway", label: "视频监控", layer: cameraMarkerlayer}
|
|
|
];
|
|
|
var htmltemplate = '<a class="layui-layer-ico layui-layer-close layui-layer-close2" href="javascript:;"></a>'+
|
|
|
'<div class="field"><div class="layer ui res checkbox" style="padding: 5px"><input id="{0}" type="checkbox" name="{1}"><label>{2}</label></div></div>';
|
|
@@ -2192,33 +2251,179 @@ function initResourceDiv(){
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
+/**
|
|
|
+ * 获取资源选中类型
|
|
|
+ */
|
|
|
+function getResType() {
|
|
|
+ var resType = "";
|
|
|
+ $('#divResource input[type="checkbox"]').each(function(){
|
|
|
+ if($(this).prop("checked"))
|
|
|
+ {
|
|
|
+ if($(this).attr("id") == "res_sfz") {
|
|
|
+ resType+="sfz";
|
|
|
+ } else if($(this).attr("id") == "res_fwq") {
|
|
|
+ resType+="fwq";
|
|
|
+ } else if($(this).attr("id") == "res_camera") {
|
|
|
+ resType+="camera";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ if(resType == "") {
|
|
|
+ resType = "line";
|
|
|
+ }
|
|
|
+ return resType;
|
|
|
+}
|
|
|
|
|
|
function showLayerResoures(type) {
|
|
|
- var resType = "";
|
|
|
- $('#divResource input[type="checkbox"]').each(function(){
|
|
|
- if($(this).prop("checked"))
|
|
|
- {
|
|
|
- if($(this).attr("id") == "res_sfz") {
|
|
|
- resType+="sfz";
|
|
|
- } else if($(this).attr("id") == "res_fwq") {
|
|
|
- resType+="fwq";
|
|
|
- } else if($(this).attr("id") == "res_camera") {
|
|
|
- resType+="camera";
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
- showLoadLayer();
|
|
|
- $.get(basePath + '/ljgh/searchWay2',
|
|
|
- {
|
|
|
- "id":currentTaskId,
|
|
|
- "resType":resType
|
|
|
- },
|
|
|
- function (result) {
|
|
|
- closeLoadLayer();
|
|
|
- // 增加路线规划
|
|
|
- addLjghRoute(result, true);
|
|
|
- },
|
|
|
- 'json'
|
|
|
- );
|
|
|
+ if(currentTaskId != null) {
|
|
|
+ var resType = getResType();
|
|
|
+ showLoadLayer();
|
|
|
+ $.get(basePath + '/ljgh/searchWay2',
|
|
|
+ {
|
|
|
+ "id":currentTaskId,
|
|
|
+ "resType":resType
|
|
|
+ },
|
|
|
+ function (result) {
|
|
|
+ closeLoadLayer();
|
|
|
+ // 增加路线规划
|
|
|
+ addLjghRoute(result, true);
|
|
|
+ // 绘制任务
|
|
|
+ addTaskInfoMarker(result, "m_task.png", result.taskEntity.taskTime);
|
|
|
+ // 绘制天气
|
|
|
+ addWeatherMarker(result, "m_weather.png", result.ljghEntity.endAdcode);
|
|
|
+ // 绘制起始点
|
|
|
+ addLjghMarker(result.route.origin, "start2.png");
|
|
|
+ addLjghMarker(result.route.destination, "end2.png");
|
|
|
+ },
|
|
|
+ 'json'
|
|
|
+ );
|
|
|
+ } else {
|
|
|
+ if(taskIframeWin) {
|
|
|
+ taskIframeWin.searchWay();
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+function addWeatherMarker(result, imgName, adcode) {
|
|
|
+ var lonlat = result.route.destination;
|
|
|
+ var obj = {lon:lonlat.split(",")[0], lat:lonlat.split(",")[1]};
|
|
|
+ var icon_url = "static/xt/images/ljgh/" + imgName;
|
|
|
+ var size = new SuperMap.Size(19, 52);
|
|
|
+ var offset = new SuperMap.Pixel(-19/2, 31/2-52);
|
|
|
+ var icon = new SuperMap.Icon(icon_url, size, offset);
|
|
|
+ var marker = new SuperMap.Marker(new SuperMap.LonLat(addLonOffset(obj.lon), addLatOffset(obj.lat)), icon);
|
|
|
+ result.adcode = adcode;
|
|
|
+ marker.events.on({
|
|
|
+ "click": function (params) {
|
|
|
+ clickWeatherHandler(marker);
|
|
|
+ },
|
|
|
+ "scope": marker
|
|
|
+ });
|
|
|
+ marker.attr = result;
|
|
|
+ ljghMarkerLayer.addMarker(marker);
|
|
|
+}
|
|
|
+function clickWeatherHandler(marker){
|
|
|
+ showWeather(marker.attr.adcode);
|
|
|
+}
|
|
|
+function addTaskInfoMarker(result, imgName, taskTime) {
|
|
|
+ result.taskTime = taskTime;
|
|
|
+ var lonlat = result.route.destination;
|
|
|
+ var obj = {lon:lonlat.split(",")[0], lat:lonlat.split(",")[1]};
|
|
|
+ var icon_url = "static/xt/images/ljgh/" + imgName;
|
|
|
+ var size = new SuperMap.Size(19, 73);
|
|
|
+ var offset = new SuperMap.Pixel(-19/2, 31/2-73);
|
|
|
+ var icon = new SuperMap.Icon(icon_url, size, offset);
|
|
|
+ var marker = new SuperMap.Marker(new SuperMap.LonLat(addLonOffset(obj.lon), addLatOffset(obj.lat)), icon);
|
|
|
+ marker.events.on({
|
|
|
+ "click": function (params) {
|
|
|
+ clickTaskInfoHandler(marker);
|
|
|
+ },
|
|
|
+ "scope": marker
|
|
|
+ });
|
|
|
+ marker.attr = result;
|
|
|
+ ljghMarkerLayer.addMarker(marker);
|
|
|
+}
|
|
|
+function clickTaskInfoHandler(marker){
|
|
|
+ openTaskInfoWin(marker);
|
|
|
+}
|
|
|
+
|
|
|
+//弹出的窗口
|
|
|
+var infowin = null;
|
|
|
+function openTaskInfoWin(marker){ //打开窗体
|
|
|
+ closeTaskInfoWin();//关闭之前打开的窗口。
|
|
|
+ var result = marker.attr;
|
|
|
+ var lonlat = marker.lonlat;
|
|
|
+ var ditance = (result.route.paths[0].distance/1000);
|
|
|
+ var seconds = result.route.paths[0].duration;
|
|
|
+ var taskTime = result.taskTime;
|
|
|
+ if(taskTime.length > 16) {
|
|
|
+ taskTime = taskTime.substr(0,16);
|
|
|
+ }
|
|
|
+ var content = '<div id="airDetailDiv"><div class="ui middle aligned selection list" style="padding-left: 0px;padding-top: 5px;">';
|
|
|
+ content += $.formatString('<div class="item"> <div class="header">路线全长:{0}公里</div></div>', ditance.toFixed(1));
|
|
|
+ content += $.formatString('<div class="item"> <div class="header" style="white-space:nowrap;">执行时间:{0}</div></div>', taskTime);
|
|
|
+ content += $.formatString('<div class="item"> <div class="header">预计用时:{0}</div></div>', toHourMinute(seconds/60));
|
|
|
+ content += $.formatString('<div class="item"> <div class="header" style="white-space:nowrap;">预计到达:{0}</div></div>', judgFailTime(taskTime, seconds/60));
|
|
|
+ content + '</div></div>';
|
|
|
+ var size = new SuperMap.Size(19, 31);
|
|
|
+ var offset = new SuperMap.Pixel(-size.w/2, -52);
|
|
|
+ var icon = new SuperMap.Icon("marker.png", size, offset);
|
|
|
+ var popup = new SuperMap.Popup.FramedCloud("popwin",
|
|
|
+ new SuperMap.LonLat(lonlat.lon,lonlat.lat),
|
|
|
+ null,
|
|
|
+ content,
|
|
|
+ icon,
|
|
|
+ true);
|
|
|
+ infowin = popup;
|
|
|
+ map.addPopup(popup);
|
|
|
+ $($("#popTask").parent().parent()).css("background-color","#D6E7FE");
|
|
|
+ /*$('div[id^=popwin_FrameDecorationDiv]').each(function(){
|
|
|
+ $(this).css("background-color","#D6E7FE");
|
|
|
+ });*/
|
|
|
+}
|
|
|
+
|
|
|
+function judgFailTime(time, minute) {
|
|
|
+ time = time + ":00";
|
|
|
+ var date = new Date(time.replace("-","/"));
|
|
|
+ date.setMinutes(date.getMinutes() + minute, date.getSeconds(), 0);
|
|
|
+ var years = date.getFullYear();
|
|
|
+ var months = date.getMonth()+1;
|
|
|
+ if(months <10) {
|
|
|
+ months = "0"+months;
|
|
|
+ }
|
|
|
+ var days = date.getDate();
|
|
|
+ if(days <10) {
|
|
|
+ days = "0"+days;
|
|
|
+ }
|
|
|
+ var hour = date.getHours();
|
|
|
+ if(hour <10) {
|
|
|
+ hour = "0"+hour;
|
|
|
+ }
|
|
|
+ var minute = date.getMinutes();
|
|
|
+ if(minute <10) {
|
|
|
+ minute = "0"+minute;
|
|
|
+ }
|
|
|
+ return years+"-"+months+"-"+days + " " + hour + ":" + minute;
|
|
|
+}
|
|
|
+
|
|
|
+function closeTaskInfoWin(){//关闭窗口
|
|
|
+ if(infowin){
|
|
|
+ try{
|
|
|
+ infowin.hide();//隐藏窗体对象
|
|
|
+ infowin.destroy();//消毁窗体对象
|
|
|
+ }
|
|
|
+ catch(e){}
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+//将分钟数量转换为小时和分钟字符串
|
|
|
+function toHourMinute(minutes){
|
|
|
+ if(minutes<60) {
|
|
|
+ return (minutes%60) + "分" ;
|
|
|
+ } else if(minutes==60){
|
|
|
+ return (Math.floor(minutes/60) + "小时");
|
|
|
+ } else if(minutes>60){
|
|
|
+ return (Math.floor(minutes/60) + "小时" + (minutes%60) + "分" );
|
|
|
+ }
|
|
|
+}
|