|
@@ -19,6 +19,9 @@ var selectMarkerLayer;
|
|
|
var ljghMarkerLayer; // 路径规划 图标层
|
|
|
var ljghSegmentLayer;// 路径规划 路线层
|
|
|
var ljghResourcesLayer;// 路径规划 资源图层
|
|
|
+var ljghResSfzLayer;// 路径规划 收费站资源图层
|
|
|
+var ljghResFwqLayer;// 路径规划 服务区资源图层
|
|
|
+var ljghResCameraLayer;// 路径规划 摄像头资源图层
|
|
|
|
|
|
var terminalMarkerlayer; // 终端图层
|
|
|
var kyzMarkerlayer; // 客运站图层
|
|
@@ -61,6 +64,8 @@ $(function() {
|
|
|
$("#layer_items").css("height", layerHeight);
|
|
|
// 增加图例
|
|
|
addTuliDiv("command");
|
|
|
+ // 初始化资源窗口信息
|
|
|
+ initResourceDiv()
|
|
|
});
|
|
|
|
|
|
function initCommd() {
|
|
@@ -289,6 +294,9 @@ function initCommdMap(baseUrl) {
|
|
|
ljghSegmentLayer = new SuperMap.Layer.Vector("路径规划路段"); // 路段
|
|
|
ljghMarkerLayer = new SuperMap.Layer.Markers("路径规划选中坐标"); // // 路径规划 图标层
|
|
|
ljghResourcesLayer = new SuperMap.Layer.Markers("路径规划资源图层"); // // 路径规划资源图层
|
|
|
+ ljghResSfzLayer = new SuperMap.Layer.Markers("路径规划资源图层收费站"); // // 路径规划资源图层收费站
|
|
|
+ ljghResFwqLayer = new SuperMap.Layer.Markers("路径规划资源图层服务区"); // // 路径规划资源图层服务区
|
|
|
+ ljghResCameraLayer = new SuperMap.Layer.Markers("路径规划资源图层摄像头"); // // 路径规划资源图层摄像头
|
|
|
// 终端轨迹图层
|
|
|
terminalTrackLayer = new SuperMap.Layer.Vector("终端轨迹"); // 终端
|
|
|
|
|
@@ -661,6 +669,7 @@ function addCommdIntersection() {
|
|
|
// waterWayBaseLayer2.isBaseLayer = true;
|
|
|
map.addLayers([ commdBaseLayer, segmentLayer, intersectionLayer, selectMarkerLayer,
|
|
|
ljghSegmentLayer, ljghMarkerLayer, ljghResourcesLayer,
|
|
|
+ ljghResSfzLayer,ljghResFwqLayer,ljghResCameraLayer,
|
|
|
waterWayBaseLayer, segmentWaterLayer]);
|
|
|
|
|
|
// 显示地图范围
|
|
@@ -1280,7 +1289,10 @@ function setTerminalClickIcon(params) {
|
|
|
function clearLjghRoute() {
|
|
|
ljghMarkerLayer.clearMarkers();
|
|
|
ljghSegmentLayer.removeAllFeatures();
|
|
|
- ljghResourcesLayer.clearMarkers();
|
|
|
+ //ljghResourcesLayer.clearMarkers();
|
|
|
+ ljghResSfzLayer.clearMarkers();
|
|
|
+ ljghResFwqLayer.clearMarkers();
|
|
|
+ ljghResCameraLayer.clearMarkers();
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -1305,7 +1317,7 @@ function addLjghRoute(result, isClear) {
|
|
|
var centerLon = addLonOffset((a+c)/2).toFixed(6);
|
|
|
var centerLat = addLatOffset((b+d)/2).toFixed(6);
|
|
|
// 缩放地图比例
|
|
|
- setMapCenter(centerLat, centerLon, 7);
|
|
|
+ setMapCenter(centerLat, centerLon, 6);
|
|
|
// 绘制路线
|
|
|
var steps = result.route.paths[0].steps;
|
|
|
var pathFeatures = [];
|
|
@@ -1380,7 +1392,7 @@ function addLjghResouces(resources) {
|
|
|
tempBasicType = [
|
|
|
{
|
|
|
"id" : type,
|
|
|
- layer : ljghResourcesLayer
|
|
|
+ layer : ljghResCameraLayer
|
|
|
}
|
|
|
];
|
|
|
if(resources && resources.length > 0) {
|
|
@@ -1389,9 +1401,9 @@ function addLjghResouces(resources) {
|
|
|
if(resources[i].type == "camera") {
|
|
|
addCameraMarker(resources[i], type, tempBasicType);
|
|
|
} else if (resources[i].type == "sfz") {
|
|
|
- addCommandMarkerBasic(resources[i], tc_shoufeizhan, ljghResourcesLayer);
|
|
|
+ addCommandMarkerBasic(resources[i], tc_shoufeizhan, ljghResSfzLayer);
|
|
|
} else if (resources[i].type == "fwq") {
|
|
|
- addCommandMarkerBasic(resources[i], tc_fwq, ljghResourcesLayer);
|
|
|
+ addCommandMarkerBasic(resources[i], tc_fwq, ljghResFwqLayer);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -1598,7 +1610,7 @@ function circleClick(type, id, chatIds, userNames, adcode) {
|
|
|
}
|
|
|
}, 'json');
|
|
|
} else if (type=="zyck") {
|
|
|
- showLoadLayer();
|
|
|
+ /*showLoadLayer();
|
|
|
$.get(basePath + '/ljgh/searchWay2',
|
|
|
{
|
|
|
"id":id
|
|
@@ -1609,7 +1621,10 @@ function circleClick(type, id, chatIds, userNames, adcode) {
|
|
|
addLjghRoute(result, true);
|
|
|
},
|
|
|
'json'
|
|
|
- );
|
|
|
+ );*/
|
|
|
+ // 绘制弹出窗口
|
|
|
+ currentTaskId = id;
|
|
|
+ showResourceWin();
|
|
|
} else if (type=="jtgj") {
|
|
|
$.get(basePath + '/commandTask/findJtgj',
|
|
|
{
|
|
@@ -2106,3 +2121,91 @@ function addSfw(sfwId) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+/**
|
|
|
+ * 绘制弹出窗口
|
|
|
+ * @param
|
|
|
+ */
|
|
|
+function showResourceWin() {
|
|
|
+ if($("#divResource").css("display") == "none") {
|
|
|
+ $("#divResource").css("display","block");
|
|
|
+ $('#divResource input[type="checkbox"]').attr("checked", false);
|
|
|
+ } else {
|
|
|
+ $("#divResource").css("display","none");
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * 绘制弹出窗口
|
|
|
+ * @param
|
|
|
+ */
|
|
|
+function closeResourceWin() {
|
|
|
+ $("#divResource").css("display","none");
|
|
|
+ //关闭当前对应图层弹出的左下角信息框
|
|
|
+ clearLjghRoute();
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * 初始化资源窗口信息
|
|
|
+ */
|
|
|
+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}
|
|
|
+ ];
|
|
|
+ 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>';
|
|
|
+ var htmlDiv = "";
|
|
|
+ for (var i = 0; i < mapResourceType.length; i++) {
|
|
|
+ htmlDiv += $.formatString(htmltemplate, mapResourceType[i].id, mapResourceType[i].id, mapResourceType[i].label);
|
|
|
+ }
|
|
|
+ var clsHtml = '<div style="width:20px;height:20px;padding-left:78px;cursor:pointer">'
|
|
|
+ + '<img onclick="closeResourceWin()" src="'
|
|
|
+ + basePath + '/static/xt/images/icon/close-gray.png"/>'
|
|
|
+ + "</div>";
|
|
|
+ $("#divResource").html(clsHtml+htmlDiv);
|
|
|
+ $('.layer.ui.res.checkbox').checkbox({
|
|
|
+ onChecked: function () {
|
|
|
+ showLayerResoures(this.name);
|
|
|
+ },
|
|
|
+ onUnchecked: function () {
|
|
|
+ if(this.name == "res_sfz") {
|
|
|
+ ljghResSfzLayer.clearMarkers();
|
|
|
+ } else if(this.name == "res_fwq") {
|
|
|
+ ljghResFwqLayer.clearMarkers();
|
|
|
+ } else if(this.name == "res_camera") {
|
|
|
+ ljghResCameraLayer.clearMarkers();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+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'
|
|
|
+ );
|
|
|
+}
|
|
|
+
|