diff --git a/src/main/webapp/content/ems/ems.jsp b/src/main/webapp/content/ems/ems.jsp index ac8ad94..f56d01d 100644 --- a/src/main/webapp/content/ems/ems.jsp +++ b/src/main/webapp/content/ems/ems.jsp @@ -520,10 +520,11 @@ - + <%-- + --%> <%-- diff --git a/src/main/webapp/content/ems/ems.jsp b/src/main/webapp/content/ems/ems.jsp index ac8ad94..f56d01d 100644 --- a/src/main/webapp/content/ems/ems.jsp +++ b/src/main/webapp/content/ems/ems.jsp @@ -520,10 +520,11 @@ - + <%-- + --%> <%-- diff --git a/src/main/webapp/content/marker/marker-info-list.jsp b/src/main/webapp/content/marker/marker-info-list.jsp index aee7c62..dc0f1dc 100644 --- a/src/main/webapp/content/marker/marker-info-list.jsp +++ b/src/main/webapp/content/marker/marker-info-list.jsp @@ -1 +1 @@ -<%@page contentType="text/html;charset=UTF-8" %> <%@include file="/taglibs.jsp" %> <%pageContext.setAttribute("currentMenu", "markerManagerMenu");%> 地下管线电子标识系统 <%----%> <%----%> <%@include file="/common/layout/header.jsp" %>
<%@include file="/common/layout/menu_new.jsp" %>
<%--<%@include file="/common/layout/second-menu-auth.jsp" %>--%>
标识器管理
<%--
--%> <%----%> <%--
--%> <%--
--%> <%----%> <%--
--%>
<%--
--%> <%----%> <%----%> <%----%> <%----%> <%----%> <%----%> <%--
--%>
<%----%> <%----%> <%----%> <%----%> <%----%> <%----%> <%----%> <%----%> <%----%> <%----%> <%----%> <%----%> <%----%> <%----%> <%----%> <%----%> <%----%> <%----%>
id标识器编号标识器名称区域线路类型埋深里程1里程2安装时间安装人员备注编辑删除
<%@include file="/common/layout/footer.jsp" %> <%----%> <%----%> \ No newline at end of file +<%@page contentType="text/html;charset=UTF-8" %> <%@include file="/taglibs.jsp" %> <%pageContext.setAttribute("currentMenu", "markerManagerMenu");%> 地下管线电子标识系统 <%----%> <%----%> <%@include file="/common/layout/header.jsp" %>
<%@include file="/common/layout/menu_new.jsp" %>
<%--<%@include file="/common/layout/second-menu-auth.jsp" %>--%>
标识器管理
<%--
--%> <%----%> <%--
--%> <%--
--%> <%----%> <%--
--%>
<%--
--%> <%----%> <%----%> <%----%> <%----%> <%----%> <%----%> <%--
--%>
<%--
--%> <%----%> <%----%> <%----%> <%--
--%>
<%----%> <%----%> <%----%> <%----%> <%----%> <%----%> <%----%> <%----%> <%----%> <%----%> <%----%> <%----%> <%----%> <%----%> <%----%> <%----%> <%----%> <%----%>
id标识器编号标识器名称区域线路类型埋深里程1里程2安装时间安装人员备注编辑删除
<%@include file="/common/layout/footer.jsp" %> <%----%> <%----%> \ No newline at end of file diff --git a/src/main/webapp/content/ems/ems.jsp b/src/main/webapp/content/ems/ems.jsp index ac8ad94..f56d01d 100644 --- a/src/main/webapp/content/ems/ems.jsp +++ b/src/main/webapp/content/ems/ems.jsp @@ -520,10 +520,11 @@ - + <%-- + --%> <%-- diff --git a/src/main/webapp/content/marker/marker-info-list.jsp b/src/main/webapp/content/marker/marker-info-list.jsp index aee7c62..dc0f1dc 100644 --- a/src/main/webapp/content/marker/marker-info-list.jsp +++ b/src/main/webapp/content/marker/marker-info-list.jsp @@ -1 +1 @@ -<%@page contentType="text/html;charset=UTF-8" %> <%@include file="/taglibs.jsp" %> <%pageContext.setAttribute("currentMenu", "markerManagerMenu");%> 地下管线电子标识系统 <%----%> <%----%> <%@include file="/common/layout/header.jsp" %>
<%@include file="/common/layout/menu_new.jsp" %>
<%--<%@include file="/common/layout/second-menu-auth.jsp" %>--%>
标识器管理
<%--
--%> <%----%> <%--
--%> <%--
--%> <%----%> <%--
--%>
<%--
--%> <%----%> <%----%> <%----%> <%----%> <%----%> <%----%> <%--
--%>
<%----%> <%----%> <%----%> <%----%> <%----%> <%----%> <%----%> <%----%> <%----%> <%----%> <%----%> <%----%> <%----%> <%----%> <%----%> <%----%> <%----%> <%----%>
id标识器编号标识器名称区域线路类型埋深里程1里程2安装时间安装人员备注编辑删除
<%@include file="/common/layout/footer.jsp" %> <%----%> <%----%> \ No newline at end of file +<%@page contentType="text/html;charset=UTF-8" %> <%@include file="/taglibs.jsp" %> <%pageContext.setAttribute("currentMenu", "markerManagerMenu");%> 地下管线电子标识系统 <%----%> <%----%> <%@include file="/common/layout/header.jsp" %>
<%@include file="/common/layout/menu_new.jsp" %>
<%--<%@include file="/common/layout/second-menu-auth.jsp" %>--%>
标识器管理
<%--
--%> <%----%> <%--
--%> <%--
--%> <%----%> <%--
--%>
<%--
--%> <%----%> <%----%> <%----%> <%----%> <%----%> <%----%> <%--
--%>
<%--
--%> <%----%> <%----%> <%----%> <%--
--%>
<%----%> <%----%> <%----%> <%----%> <%----%> <%----%> <%----%> <%----%> <%----%> <%----%> <%----%> <%----%> <%----%> <%----%> <%----%> <%----%> <%----%> <%----%>
id标识器编号标识器名称区域线路类型埋深里程1里程2安装时间安装人员备注编辑删除
<%@include file="/common/layout/footer.jsp" %> <%----%> <%----%> \ No newline at end of file diff --git a/src/main/webapp/s/app/ems/ems-gd.js b/src/main/webapp/s/app/ems/ems-gd.js index 8875ae8..09592ee 100644 --- a/src/main/webapp/s/app/ems/ems-gd.js +++ b/src/main/webapp/s/app/ems/ems-gd.js @@ -12,41 +12,37 @@ var vectorMarkers = []; var markerData = []; var hadRequest = false; + var viewMarkers = []; //视域范围内的点 - var blueIcon = new AMap.Icon({ - size: new AMap.Size(25, 34), - image: $('#context').val() + '/images/drop/0.png' - }); - - var orangeIcon = new AMap.Icon({ - size: new AMap.Size(25, 34), - image: $('#context').val() + '/images/drop/1.png' - }); - - var redIcon = new AMap.Icon({ - size: new AMap.Size(25, 34), - image: $('#context').val() + '/images/drop/2.png' - }); - - var blackIcon = new AMap.Icon({ - size: new AMap.Size(25, 34), - image: $('#context').val() + '/images/drop/3.png' - }); - - var pinkIcon = new AMap.Icon({ - size: new AMap.Size(25, 34), - image: $('#context').val() + '/images/drop/4.png' - }); - - var yellowIcon = new AMap.Icon({ - size: new AMap.Size(25, 34), - image: $('#context').val() + '/images/drop/5.png' - }); - - var greenIcon = new AMap.Icon({ - size: new AMap.Size(25, 34), - image: $('#context').val() + '/images/drop/6.png' - }); + var style = [{ + url: $('#context').val() + '/images/drop/0.png', // 蓝色图标地址 + anchor: new AMap.Pixel(15, 20), // 图标显示位置偏移量,基准点为图标左上角 + size: new AMap.Size(15, 20) // 图标大小 + }, { + url: $('#context').val() + '/images/drop/1.png', // 橙色图标地址 + anchor: new AMap.Pixel(15, 20), // 图标显示位置偏移量,基准点为图标左上角 + size: new AMap.Size(15, 20) // 图标大小 + }, { + url: $('#context').val() + '/images/drop/2.png', // 红色图标地址 + anchor: new AMap.Pixel(15, 20), // 图标显示位置偏移量,基准点为图标左上角 + size: new AMap.Size(15, 20) // 图标大小 + }, { + url: $('#context').val() + '/images/drop/3.png', // 黑色图标地址 + anchor: new AMap.Pixel(15, 20), // 图标显示位置偏移量,基准点为图标左上角 + size: new AMap.Size(15, 20) // 图标大小 + }, { + url: $('#context').val() + '/images/drop/4.png', // 粉色图标地址 + anchor: new AMap.Pixel(15, 20), // 图标显示位置偏移量,基准点为图标左上角 + size: new AMap.Size(15, 20) // 图标大小 + }, { + url: $('#context').val() + '/images/drop/5.png', // 黄色图标地址 + anchor: new AMap.Pixel(15, 20), // 图标显示位置偏移量,基准点为图标左上角 + size: new AMap.Size(15, 20) // 图标大小 + }, { + url: $('#context').val() + '/images/drop/6.png', // 绿色图标地址 + anchor: new AMap.Pixel(15, 20), // 图标显示位置偏移量,基准点为图标左上角 + size: new AMap.Size(15, 20) // 图标大小 + }]; var handleDatePickers = function () { @@ -97,6 +93,46 @@ } + // 处理鼠标单击事件 + function processClickInfo(emsBean){ + var msg = ""; + if (emsBean.recordType == 1) { + msg = msg + "管线种类:" + emsBean.markerObjectType + "
" + + "管线直径(mm):" + emsBean.pipeDiameter + "
" + + "管线材质:" + emsBean.pipeMaterial + "
" + + "埋设方式:" + emsBean.layStyle + "
" + + "管线埋深(mm):" + emsBean.depth + "
"; + } else if (emsBean.recordType == 2) { + msg = msg + "附属物名称:" + emsBean.markerObjectType + "
" + + "井深(mm):" + emsBean.depth + "
"; + } else if (emsBean.recordType == 3) { + msg = msg + "管点特征:" + emsBean.markerObjectType + "
" + + "特征点埋深(mm):" + emsBean.depth + "
"; + } else { + msg = msg + "上层管种类:" + emsBean.markerObjectType + "
" + + "上层管埋深(mm):" + emsBean.depth + "
" + + "上层管直径(mm):" + emsBean.pipeDiameter + "
" + + "上层管材料:" + emsBean.pipeMaterial + "
" + + "下层管种类:" + emsBean.belowType + "
" + + "下层管埋深(mm):" + emsBean.belowDepth + "
"+ + "下层管直径(mm):" + emsBean.belowDiameter + "
" + + "下层管材料:" + emsBean.belowMaterial + "
" ; + } + msg = msg + "所属区域:" + emsBean.area + "
" + + "所属线路:" + emsBean.line + "
" + + "所属道路:" + emsBean.road + "
" + + "建设年代:" + emsBean.constructTime + "
" + + "权属单位:" + emsBean.ownerComp + "
" + + "标识器ID:" + emsBean.markerId + "
" + + "标识器类型:" + emsBean.markerType + "
" + + "标识器埋深(mm):" + emsBean.markerDepth + "
" + + "安装部门:" + emsBean.creator + "
" + + "最后修改时间:"+emsBean.createTime + "
" + + "备注:" + emsBean.memo + "
"; + + return msg; + } + return { //添加标识器 @@ -469,6 +505,7 @@ var vectorMarker = new AMap.Marker({ position: [r.data[a].longitude,r.data[a].latitude], size: new AMap.Size(30, 30), + offset: new AMap.Pixel(-15, -30), //相对于基点的偏移位置 icon: $('#context').val() + '/images/point.png' }); vectorMarkers.push(vectorMarker); @@ -533,95 +570,74 @@ }, addMarker: function (data) { + var points = []; for (var i = 0; i < data.length; i++) { - var icon = blueIcon; - var color = data[i].colorType; - if (color == "1") { - icon = orangeIcon; - } else if (color == "2") { - icon = redIcon; - } else if (color == "3") { - icon = blackIcon; - } else if (color == "4") { - icon = pinkIcon; - } else if (color == "5") { - icon = yellowIcon; - } else if (color == "6") { - icon = greenIcon; - } + var point = {}; + var lnglat = [data[i].longitude, data[i].latitude]; + var name = data[i].markerId; + var id = i; + var styleIndex = parseInt(data[i].colorType); + if (styleIndex < 1 || styleIndex > 6) styleIndex = 0; + + point.lnglat = lnglat; + point.name = name; + point.id = id; + point.style = styleIndex; + points.push(point); var marker = new AMap.Marker({ - position: [data[i].longitude, data[i].latitude], - icon: icon + position: [data[i].longitude, data[i].latitude] }); marker.Tag = data[i]; - marker.on("click", function (e) { + viewMarkers.push(marker); + } - var emsBean = e.target.Tag; - var msg = ""; - var height = 0; - var titleName =""; - if (emsBean.recordType == 1) { - titleName = "
管线
"; - msg = msg + "管线种类:" + emsBean.markerObjectType + "
" + - "管线直径(mm):" + emsBean.pipeDiameter + "
" + - "管线材质:" + emsBean.pipeMaterial + "
" + - "埋设方式:" + emsBean.layStyle + "
" + - "管线埋深(mm):" + emsBean.depth + "
"; - height = 100; - } else if (emsBean.recordType == 2) { - titleName = "
管线附属物
"; - msg = msg + "附属物名称:" + emsBean.markerObjectType + "
" + - "井深(mm):" + emsBean.depth + "
"; - height = 40; - } else if (emsBean.recordType == 3) { - titleName = "
管线特征管点
"; - msg = msg + "管点特征:" + emsBean.markerObjectType + "
" + - "特征点埋深(mm):" + emsBean.depth + "
"; - height = 40; - } else { - titleName = "
交叉穿越点
"; - msg = msg + "上层管种类:" + emsBean.markerObjectType + "
" + - "上层管埋深(mm):" + emsBean.depth + "
" + - "上层管直径(mm):" + emsBean.pipeDiameter + "
" + - "上层管材料:" + emsBean.pipeMaterial + "
" + - "下层管种类:" + emsBean.belowType + "
" + - "下层管埋深(mm):" + emsBean.belowDepth + "
"+ - "下层管直径(mm):" + emsBean.belowDiameter + "
" + - "下层管材料:" + emsBean.belowMaterial + "
" ; - height = 160; - } - height = height +225; - msg = msg + "所属区域:" + emsBean.area + "
" + - "所属线路:" + emsBean.line + "
" + - "所属道路:" + emsBean.road + "
" + - "建设年代:" + emsBean.constructTime + "
" + - "权属单位:" + emsBean.ownerComp + "
" + - "标识器ID:" + emsBean.markerId + "
" + - "标识器类型:" + emsBean.markerType + "
" + - "标识器埋深(mm):" + emsBean.markerDepth + "
" + - "安装部门:" + emsBean.creator + "
" + - "最后修改时间:"+emsBean.createTime + "
" + - "备注:" + emsBean.memo + "
"; - var imgUrl = $('#context').val() + "/images/ems.jpg"; - var content = titleName + '
' + - '' + msg + - '
'; + var mass = new AMap.MassMarks(points, { + zIndex: 5, // 海量点图层叠加的顺序 + zooms: [3, 19], // 在指定地图缩放级别范围内展示海量点图层 + style: style // 设置样式对象 + }); + mass.setMap(map); - var infowindow = new AMap.AdvancedInfoWindow({ - content: content, - width: 290, //宽度 - height: height, //高度 - panel: "panel", //检索结果面板 - enableAutoPan: true //自动平移 - }); + map.setFitView(viewMarkers); - infowindow.open(map, [e.lnglat.lng, e.lnglat.lat]); + mass.on("click", function(e) { + var index = parseInt(e.data.id); + var emsBean = viewMarkers[index].Tag; + + var msg = processClickInfo(emsBean); + var titleName =""; + var height = 0; + if (emsBean.recordType == 1) { + titleName = "
管线
"; + height = 100; + } else if (emsBean.recordType == 2) { + titleName = "
管线附属物
"; + height = 40; + } else if (emsBean.recordType == 3) { + titleName = "
管线特征管点
"; + height = 40; + } else if (emsBean.recordType == 4) { + titleName = "
交叉穿越点
"; + height = 160; + } + height = height +225; + var imgUrl = $('#context').val() + "/images/ems.jpg"; + var content = titleName + '
' + + '' + msg + + '
'; + + var infowindow = new AMap.AdvancedInfoWindow({ + content: content, + width: 290, //宽度 + height: height, + panel: "panel", //检索结果面板 + enableAutoPan: true //自动平移 }); - map.add(marker); - } + infowindow.open(map, [e.data.lnglat.lng, e.data.lnglat.lat]); + }); } }; }(); \ No newline at end of file diff --git a/src/main/webapp/content/ems/ems.jsp b/src/main/webapp/content/ems/ems.jsp index ac8ad94..f56d01d 100644 --- a/src/main/webapp/content/ems/ems.jsp +++ b/src/main/webapp/content/ems/ems.jsp @@ -520,10 +520,11 @@ - + <%-- + --%> <%-- diff --git a/src/main/webapp/content/marker/marker-info-list.jsp b/src/main/webapp/content/marker/marker-info-list.jsp index aee7c62..dc0f1dc 100644 --- a/src/main/webapp/content/marker/marker-info-list.jsp +++ b/src/main/webapp/content/marker/marker-info-list.jsp @@ -1 +1 @@ -<%@page contentType="text/html;charset=UTF-8" %> <%@include file="/taglibs.jsp" %> <%pageContext.setAttribute("currentMenu", "markerManagerMenu");%> 地下管线电子标识系统 <%----%> <%----%> <%@include file="/common/layout/header.jsp" %>
<%@include file="/common/layout/menu_new.jsp" %>
<%--<%@include file="/common/layout/second-menu-auth.jsp" %>--%>
标识器管理
<%--
--%> <%----%> <%--
--%> <%--
--%> <%----%> <%--
--%>
<%--
--%> <%----%> <%----%> <%----%> <%----%> <%----%> <%----%> <%--
--%>
<%----%> <%----%> <%----%> <%----%> <%----%> <%----%> <%----%> <%----%> <%----%> <%----%> <%----%> <%----%> <%----%> <%----%> <%----%> <%----%> <%----%> <%----%>
id标识器编号标识器名称区域线路类型埋深里程1里程2安装时间安装人员备注编辑删除
<%@include file="/common/layout/footer.jsp" %> <%----%> <%----%> \ No newline at end of file +<%@page contentType="text/html;charset=UTF-8" %> <%@include file="/taglibs.jsp" %> <%pageContext.setAttribute("currentMenu", "markerManagerMenu");%> 地下管线电子标识系统 <%----%> <%----%> <%@include file="/common/layout/header.jsp" %>
<%@include file="/common/layout/menu_new.jsp" %>
<%--<%@include file="/common/layout/second-menu-auth.jsp" %>--%>
标识器管理
<%--
--%> <%----%> <%--
--%> <%--
--%> <%----%> <%--
--%>
<%--
--%> <%----%> <%----%> <%----%> <%----%> <%----%> <%----%> <%--
--%>
<%--
--%> <%----%> <%----%> <%----%> <%--
--%>
<%----%> <%----%> <%----%> <%----%> <%----%> <%----%> <%----%> <%----%> <%----%> <%----%> <%----%> <%----%> <%----%> <%----%> <%----%> <%----%> <%----%> <%----%>
id标识器编号标识器名称区域线路类型埋深里程1里程2安装时间安装人员备注编辑删除
<%@include file="/common/layout/footer.jsp" %> <%----%> <%----%> \ No newline at end of file diff --git a/src/main/webapp/s/app/ems/ems-gd.js b/src/main/webapp/s/app/ems/ems-gd.js index 8875ae8..09592ee 100644 --- a/src/main/webapp/s/app/ems/ems-gd.js +++ b/src/main/webapp/s/app/ems/ems-gd.js @@ -12,41 +12,37 @@ var vectorMarkers = []; var markerData = []; var hadRequest = false; + var viewMarkers = []; //视域范围内的点 - var blueIcon = new AMap.Icon({ - size: new AMap.Size(25, 34), - image: $('#context').val() + '/images/drop/0.png' - }); - - var orangeIcon = new AMap.Icon({ - size: new AMap.Size(25, 34), - image: $('#context').val() + '/images/drop/1.png' - }); - - var redIcon = new AMap.Icon({ - size: new AMap.Size(25, 34), - image: $('#context').val() + '/images/drop/2.png' - }); - - var blackIcon = new AMap.Icon({ - size: new AMap.Size(25, 34), - image: $('#context').val() + '/images/drop/3.png' - }); - - var pinkIcon = new AMap.Icon({ - size: new AMap.Size(25, 34), - image: $('#context').val() + '/images/drop/4.png' - }); - - var yellowIcon = new AMap.Icon({ - size: new AMap.Size(25, 34), - image: $('#context').val() + '/images/drop/5.png' - }); - - var greenIcon = new AMap.Icon({ - size: new AMap.Size(25, 34), - image: $('#context').val() + '/images/drop/6.png' - }); + var style = [{ + url: $('#context').val() + '/images/drop/0.png', // 蓝色图标地址 + anchor: new AMap.Pixel(15, 20), // 图标显示位置偏移量,基准点为图标左上角 + size: new AMap.Size(15, 20) // 图标大小 + }, { + url: $('#context').val() + '/images/drop/1.png', // 橙色图标地址 + anchor: new AMap.Pixel(15, 20), // 图标显示位置偏移量,基准点为图标左上角 + size: new AMap.Size(15, 20) // 图标大小 + }, { + url: $('#context').val() + '/images/drop/2.png', // 红色图标地址 + anchor: new AMap.Pixel(15, 20), // 图标显示位置偏移量,基准点为图标左上角 + size: new AMap.Size(15, 20) // 图标大小 + }, { + url: $('#context').val() + '/images/drop/3.png', // 黑色图标地址 + anchor: new AMap.Pixel(15, 20), // 图标显示位置偏移量,基准点为图标左上角 + size: new AMap.Size(15, 20) // 图标大小 + }, { + url: $('#context').val() + '/images/drop/4.png', // 粉色图标地址 + anchor: new AMap.Pixel(15, 20), // 图标显示位置偏移量,基准点为图标左上角 + size: new AMap.Size(15, 20) // 图标大小 + }, { + url: $('#context').val() + '/images/drop/5.png', // 黄色图标地址 + anchor: new AMap.Pixel(15, 20), // 图标显示位置偏移量,基准点为图标左上角 + size: new AMap.Size(15, 20) // 图标大小 + }, { + url: $('#context').val() + '/images/drop/6.png', // 绿色图标地址 + anchor: new AMap.Pixel(15, 20), // 图标显示位置偏移量,基准点为图标左上角 + size: new AMap.Size(15, 20) // 图标大小 + }]; var handleDatePickers = function () { @@ -97,6 +93,46 @@ } + // 处理鼠标单击事件 + function processClickInfo(emsBean){ + var msg = ""; + if (emsBean.recordType == 1) { + msg = msg + "管线种类:" + emsBean.markerObjectType + "
" + + "管线直径(mm):" + emsBean.pipeDiameter + "
" + + "管线材质:" + emsBean.pipeMaterial + "
" + + "埋设方式:" + emsBean.layStyle + "
" + + "管线埋深(mm):" + emsBean.depth + "
"; + } else if (emsBean.recordType == 2) { + msg = msg + "附属物名称:" + emsBean.markerObjectType + "
" + + "井深(mm):" + emsBean.depth + "
"; + } else if (emsBean.recordType == 3) { + msg = msg + "管点特征:" + emsBean.markerObjectType + "
" + + "特征点埋深(mm):" + emsBean.depth + "
"; + } else { + msg = msg + "上层管种类:" + emsBean.markerObjectType + "
" + + "上层管埋深(mm):" + emsBean.depth + "
" + + "上层管直径(mm):" + emsBean.pipeDiameter + "
" + + "上层管材料:" + emsBean.pipeMaterial + "
" + + "下层管种类:" + emsBean.belowType + "
" + + "下层管埋深(mm):" + emsBean.belowDepth + "
"+ + "下层管直径(mm):" + emsBean.belowDiameter + "
" + + "下层管材料:" + emsBean.belowMaterial + "
" ; + } + msg = msg + "所属区域:" + emsBean.area + "
" + + "所属线路:" + emsBean.line + "
" + + "所属道路:" + emsBean.road + "
" + + "建设年代:" + emsBean.constructTime + "
" + + "权属单位:" + emsBean.ownerComp + "
" + + "标识器ID:" + emsBean.markerId + "
" + + "标识器类型:" + emsBean.markerType + "
" + + "标识器埋深(mm):" + emsBean.markerDepth + "
" + + "安装部门:" + emsBean.creator + "
" + + "最后修改时间:"+emsBean.createTime + "
" + + "备注:" + emsBean.memo + "
"; + + return msg; + } + return { //添加标识器 @@ -469,6 +505,7 @@ var vectorMarker = new AMap.Marker({ position: [r.data[a].longitude,r.data[a].latitude], size: new AMap.Size(30, 30), + offset: new AMap.Pixel(-15, -30), //相对于基点的偏移位置 icon: $('#context').val() + '/images/point.png' }); vectorMarkers.push(vectorMarker); @@ -533,95 +570,74 @@ }, addMarker: function (data) { + var points = []; for (var i = 0; i < data.length; i++) { - var icon = blueIcon; - var color = data[i].colorType; - if (color == "1") { - icon = orangeIcon; - } else if (color == "2") { - icon = redIcon; - } else if (color == "3") { - icon = blackIcon; - } else if (color == "4") { - icon = pinkIcon; - } else if (color == "5") { - icon = yellowIcon; - } else if (color == "6") { - icon = greenIcon; - } + var point = {}; + var lnglat = [data[i].longitude, data[i].latitude]; + var name = data[i].markerId; + var id = i; + var styleIndex = parseInt(data[i].colorType); + if (styleIndex < 1 || styleIndex > 6) styleIndex = 0; + + point.lnglat = lnglat; + point.name = name; + point.id = id; + point.style = styleIndex; + points.push(point); var marker = new AMap.Marker({ - position: [data[i].longitude, data[i].latitude], - icon: icon + position: [data[i].longitude, data[i].latitude] }); marker.Tag = data[i]; - marker.on("click", function (e) { + viewMarkers.push(marker); + } - var emsBean = e.target.Tag; - var msg = ""; - var height = 0; - var titleName =""; - if (emsBean.recordType == 1) { - titleName = "
管线
"; - msg = msg + "管线种类:" + emsBean.markerObjectType + "
" + - "管线直径(mm):" + emsBean.pipeDiameter + "
" + - "管线材质:" + emsBean.pipeMaterial + "
" + - "埋设方式:" + emsBean.layStyle + "
" + - "管线埋深(mm):" + emsBean.depth + "
"; - height = 100; - } else if (emsBean.recordType == 2) { - titleName = "
管线附属物
"; - msg = msg + "附属物名称:" + emsBean.markerObjectType + "
" + - "井深(mm):" + emsBean.depth + "
"; - height = 40; - } else if (emsBean.recordType == 3) { - titleName = "
管线特征管点
"; - msg = msg + "管点特征:" + emsBean.markerObjectType + "
" + - "特征点埋深(mm):" + emsBean.depth + "
"; - height = 40; - } else { - titleName = "
交叉穿越点
"; - msg = msg + "上层管种类:" + emsBean.markerObjectType + "
" + - "上层管埋深(mm):" + emsBean.depth + "
" + - "上层管直径(mm):" + emsBean.pipeDiameter + "
" + - "上层管材料:" + emsBean.pipeMaterial + "
" + - "下层管种类:" + emsBean.belowType + "
" + - "下层管埋深(mm):" + emsBean.belowDepth + "
"+ - "下层管直径(mm):" + emsBean.belowDiameter + "
" + - "下层管材料:" + emsBean.belowMaterial + "
" ; - height = 160; - } - height = height +225; - msg = msg + "所属区域:" + emsBean.area + "
" + - "所属线路:" + emsBean.line + "
" + - "所属道路:" + emsBean.road + "
" + - "建设年代:" + emsBean.constructTime + "
" + - "权属单位:" + emsBean.ownerComp + "
" + - "标识器ID:" + emsBean.markerId + "
" + - "标识器类型:" + emsBean.markerType + "
" + - "标识器埋深(mm):" + emsBean.markerDepth + "
" + - "安装部门:" + emsBean.creator + "
" + - "最后修改时间:"+emsBean.createTime + "
" + - "备注:" + emsBean.memo + "
"; - var imgUrl = $('#context').val() + "/images/ems.jpg"; - var content = titleName + '
' + - '' + msg + - '
'; + var mass = new AMap.MassMarks(points, { + zIndex: 5, // 海量点图层叠加的顺序 + zooms: [3, 19], // 在指定地图缩放级别范围内展示海量点图层 + style: style // 设置样式对象 + }); + mass.setMap(map); - var infowindow = new AMap.AdvancedInfoWindow({ - content: content, - width: 290, //宽度 - height: height, //高度 - panel: "panel", //检索结果面板 - enableAutoPan: true //自动平移 - }); + map.setFitView(viewMarkers); - infowindow.open(map, [e.lnglat.lng, e.lnglat.lat]); + mass.on("click", function(e) { + var index = parseInt(e.data.id); + var emsBean = viewMarkers[index].Tag; + + var msg = processClickInfo(emsBean); + var titleName =""; + var height = 0; + if (emsBean.recordType == 1) { + titleName = "
管线
"; + height = 100; + } else if (emsBean.recordType == 2) { + titleName = "
管线附属物
"; + height = 40; + } else if (emsBean.recordType == 3) { + titleName = "
管线特征管点
"; + height = 40; + } else if (emsBean.recordType == 4) { + titleName = "
交叉穿越点
"; + height = 160; + } + height = height +225; + var imgUrl = $('#context').val() + "/images/ems.jpg"; + var content = titleName + '
' + + '' + msg + + '
'; + + var infowindow = new AMap.AdvancedInfoWindow({ + content: content, + width: 290, //宽度 + height: height, + panel: "panel", //检索结果面板 + enableAutoPan: true //自动平移 }); - map.add(marker); - } + infowindow.open(map, [e.data.lnglat.lng, e.data.lnglat.lat]); + }); } }; }(); \ No newline at end of file diff --git a/src/main/webapp/s/app/marker/marker-info-list.js b/src/main/webapp/s/app/marker/marker-info-list.js index acff146..6fabbab 100644 --- a/src/main/webapp/s/app/marker/marker-info-list.js +++ b/src/main/webapp/s/app/marker/marker-info-list.js @@ -447,10 +447,19 @@ init: function () { //监听类型下拉列表变化事件, //$("#markerObjectType").chosen(); - $("#markerObjectType").live("change", function (e) { + $("#markerObjectType, #ownerComp, #area, #line, #road, #creator, #txt_begin_day, #txt_end_day, #markerId, #memo").live("change", function (e) { typeValue = $("#markerObjectType").val(); $("#table_marker").children().remove(); Marker.recordType = typeValue; + Marker.ownerComp = $("#ownerComp").val(); + Marker.area = $("#area").val(); + Marker.line = $("#line").val(); + Marker.road = $("#road").val(); + Marker.creator = $("#creator").val(); + Marker.memo = $("#memo").val(); + Marker.sDate = $("#txt_begin_day").val(); + Marker.eDate = $("#txt_end_day").val(); + Marker.markerId = $("#markerId").val(); var title = MarkerInfoList.tableTitle(typeValue); oTable = $('#table_marker').dataTable({ // set the initial value @@ -623,7 +632,7 @@ }); - $('#searchMarker').bind('click', function (e) { + /*$('#searchMarker').bind('click', function (e) { Marker = {}; Marker.recordType=$("#markerObjectType").val(); Marker.line = $("#line").val(); @@ -635,22 +644,28 @@ Marker.sDate = $("#txt_begin_day").val(); Marker.eDate = $("#txt_end_day").val(); Marker.markerId = $("#markerId").val(); + + console.log(Marker); + oTable.fnDraw(true); // oTable.fnClearTable(); // oTable.ajax.reload(); - }); + });*/ $('#exp').live('click', function (e) { Marker = {}; Marker.recordType = $("#markerObjectType").val(); + Marker.area = $("#area").val(); + Marker.line = $("#line"); Marker.road = $("#road").val(); Marker.ownerComp = $("#ownerComp").val(); - Marker.memo = $("#memo").val(); Marker.creator = $("#creator").val(); Marker.sDate = $("#txt_begin_day").val(); Marker.eDate = $("#txt_end_day").val(); Marker.markerId = $("#markerId").val(); - location.href = $('#context').val() + "/marker/export.do?strMarkerDto=" + JSON.stringify(Marker); + Marker.memo = $("#memo").val(); + + window.open($('#context').val() + "/marker/export.do?strMarkerDto=" + JSON.stringify(Marker)); }); diff --git a/src/main/webapp/content/ems/ems.jsp b/src/main/webapp/content/ems/ems.jsp index ac8ad94..f56d01d 100644 --- a/src/main/webapp/content/ems/ems.jsp +++ b/src/main/webapp/content/ems/ems.jsp @@ -520,10 +520,11 @@ - + <%-- + --%> <%-- diff --git a/src/main/webapp/content/marker/marker-info-list.jsp b/src/main/webapp/content/marker/marker-info-list.jsp index aee7c62..dc0f1dc 100644 --- a/src/main/webapp/content/marker/marker-info-list.jsp +++ b/src/main/webapp/content/marker/marker-info-list.jsp @@ -1 +1 @@ -<%@page contentType="text/html;charset=UTF-8" %> <%@include file="/taglibs.jsp" %> <%pageContext.setAttribute("currentMenu", "markerManagerMenu");%> 地下管线电子标识系统 <%----%> <%----%> <%@include file="/common/layout/header.jsp" %>
<%@include file="/common/layout/menu_new.jsp" %>
<%--<%@include file="/common/layout/second-menu-auth.jsp" %>--%>
标识器管理
<%--
--%> <%----%> <%--
--%> <%--
--%> <%----%> <%--
--%>
<%--
--%> <%----%> <%----%> <%----%> <%----%> <%----%> <%----%> <%--
--%>
<%----%> <%----%> <%----%> <%----%> <%----%> <%----%> <%----%> <%----%> <%----%> <%----%> <%----%> <%----%> <%----%> <%----%> <%----%> <%----%> <%----%> <%----%>
id标识器编号标识器名称区域线路类型埋深里程1里程2安装时间安装人员备注编辑删除
<%@include file="/common/layout/footer.jsp" %> <%----%> <%----%> \ No newline at end of file +<%@page contentType="text/html;charset=UTF-8" %> <%@include file="/taglibs.jsp" %> <%pageContext.setAttribute("currentMenu", "markerManagerMenu");%> 地下管线电子标识系统 <%----%> <%----%> <%@include file="/common/layout/header.jsp" %>
<%@include file="/common/layout/menu_new.jsp" %>
<%--<%@include file="/common/layout/second-menu-auth.jsp" %>--%>
标识器管理
<%--
--%> <%----%> <%--
--%> <%--
--%> <%----%> <%--
--%>
<%--
--%> <%----%> <%----%> <%----%> <%----%> <%----%> <%----%> <%--
--%>
<%--
--%> <%----%> <%----%> <%----%> <%--
--%>
<%----%> <%----%> <%----%> <%----%> <%----%> <%----%> <%----%> <%----%> <%----%> <%----%> <%----%> <%----%> <%----%> <%----%> <%----%> <%----%> <%----%> <%----%>
id标识器编号标识器名称区域线路类型埋深里程1里程2安装时间安装人员备注编辑删除
<%@include file="/common/layout/footer.jsp" %> <%----%> <%----%> \ No newline at end of file diff --git a/src/main/webapp/s/app/ems/ems-gd.js b/src/main/webapp/s/app/ems/ems-gd.js index 8875ae8..09592ee 100644 --- a/src/main/webapp/s/app/ems/ems-gd.js +++ b/src/main/webapp/s/app/ems/ems-gd.js @@ -12,41 +12,37 @@ var vectorMarkers = []; var markerData = []; var hadRequest = false; + var viewMarkers = []; //视域范围内的点 - var blueIcon = new AMap.Icon({ - size: new AMap.Size(25, 34), - image: $('#context').val() + '/images/drop/0.png' - }); - - var orangeIcon = new AMap.Icon({ - size: new AMap.Size(25, 34), - image: $('#context').val() + '/images/drop/1.png' - }); - - var redIcon = new AMap.Icon({ - size: new AMap.Size(25, 34), - image: $('#context').val() + '/images/drop/2.png' - }); - - var blackIcon = new AMap.Icon({ - size: new AMap.Size(25, 34), - image: $('#context').val() + '/images/drop/3.png' - }); - - var pinkIcon = new AMap.Icon({ - size: new AMap.Size(25, 34), - image: $('#context').val() + '/images/drop/4.png' - }); - - var yellowIcon = new AMap.Icon({ - size: new AMap.Size(25, 34), - image: $('#context').val() + '/images/drop/5.png' - }); - - var greenIcon = new AMap.Icon({ - size: new AMap.Size(25, 34), - image: $('#context').val() + '/images/drop/6.png' - }); + var style = [{ + url: $('#context').val() + '/images/drop/0.png', // 蓝色图标地址 + anchor: new AMap.Pixel(15, 20), // 图标显示位置偏移量,基准点为图标左上角 + size: new AMap.Size(15, 20) // 图标大小 + }, { + url: $('#context').val() + '/images/drop/1.png', // 橙色图标地址 + anchor: new AMap.Pixel(15, 20), // 图标显示位置偏移量,基准点为图标左上角 + size: new AMap.Size(15, 20) // 图标大小 + }, { + url: $('#context').val() + '/images/drop/2.png', // 红色图标地址 + anchor: new AMap.Pixel(15, 20), // 图标显示位置偏移量,基准点为图标左上角 + size: new AMap.Size(15, 20) // 图标大小 + }, { + url: $('#context').val() + '/images/drop/3.png', // 黑色图标地址 + anchor: new AMap.Pixel(15, 20), // 图标显示位置偏移量,基准点为图标左上角 + size: new AMap.Size(15, 20) // 图标大小 + }, { + url: $('#context').val() + '/images/drop/4.png', // 粉色图标地址 + anchor: new AMap.Pixel(15, 20), // 图标显示位置偏移量,基准点为图标左上角 + size: new AMap.Size(15, 20) // 图标大小 + }, { + url: $('#context').val() + '/images/drop/5.png', // 黄色图标地址 + anchor: new AMap.Pixel(15, 20), // 图标显示位置偏移量,基准点为图标左上角 + size: new AMap.Size(15, 20) // 图标大小 + }, { + url: $('#context').val() + '/images/drop/6.png', // 绿色图标地址 + anchor: new AMap.Pixel(15, 20), // 图标显示位置偏移量,基准点为图标左上角 + size: new AMap.Size(15, 20) // 图标大小 + }]; var handleDatePickers = function () { @@ -97,6 +93,46 @@ } + // 处理鼠标单击事件 + function processClickInfo(emsBean){ + var msg = ""; + if (emsBean.recordType == 1) { + msg = msg + "管线种类:" + emsBean.markerObjectType + "
" + + "管线直径(mm):" + emsBean.pipeDiameter + "
" + + "管线材质:" + emsBean.pipeMaterial + "
" + + "埋设方式:" + emsBean.layStyle + "
" + + "管线埋深(mm):" + emsBean.depth + "
"; + } else if (emsBean.recordType == 2) { + msg = msg + "附属物名称:" + emsBean.markerObjectType + "
" + + "井深(mm):" + emsBean.depth + "
"; + } else if (emsBean.recordType == 3) { + msg = msg + "管点特征:" + emsBean.markerObjectType + "
" + + "特征点埋深(mm):" + emsBean.depth + "
"; + } else { + msg = msg + "上层管种类:" + emsBean.markerObjectType + "
" + + "上层管埋深(mm):" + emsBean.depth + "
" + + "上层管直径(mm):" + emsBean.pipeDiameter + "
" + + "上层管材料:" + emsBean.pipeMaterial + "
" + + "下层管种类:" + emsBean.belowType + "
" + + "下层管埋深(mm):" + emsBean.belowDepth + "
"+ + "下层管直径(mm):" + emsBean.belowDiameter + "
" + + "下层管材料:" + emsBean.belowMaterial + "
" ; + } + msg = msg + "所属区域:" + emsBean.area + "
" + + "所属线路:" + emsBean.line + "
" + + "所属道路:" + emsBean.road + "
" + + "建设年代:" + emsBean.constructTime + "
" + + "权属单位:" + emsBean.ownerComp + "
" + + "标识器ID:" + emsBean.markerId + "
" + + "标识器类型:" + emsBean.markerType + "
" + + "标识器埋深(mm):" + emsBean.markerDepth + "
" + + "安装部门:" + emsBean.creator + "
" + + "最后修改时间:"+emsBean.createTime + "
" + + "备注:" + emsBean.memo + "
"; + + return msg; + } + return { //添加标识器 @@ -469,6 +505,7 @@ var vectorMarker = new AMap.Marker({ position: [r.data[a].longitude,r.data[a].latitude], size: new AMap.Size(30, 30), + offset: new AMap.Pixel(-15, -30), //相对于基点的偏移位置 icon: $('#context').val() + '/images/point.png' }); vectorMarkers.push(vectorMarker); @@ -533,95 +570,74 @@ }, addMarker: function (data) { + var points = []; for (var i = 0; i < data.length; i++) { - var icon = blueIcon; - var color = data[i].colorType; - if (color == "1") { - icon = orangeIcon; - } else if (color == "2") { - icon = redIcon; - } else if (color == "3") { - icon = blackIcon; - } else if (color == "4") { - icon = pinkIcon; - } else if (color == "5") { - icon = yellowIcon; - } else if (color == "6") { - icon = greenIcon; - } + var point = {}; + var lnglat = [data[i].longitude, data[i].latitude]; + var name = data[i].markerId; + var id = i; + var styleIndex = parseInt(data[i].colorType); + if (styleIndex < 1 || styleIndex > 6) styleIndex = 0; + + point.lnglat = lnglat; + point.name = name; + point.id = id; + point.style = styleIndex; + points.push(point); var marker = new AMap.Marker({ - position: [data[i].longitude, data[i].latitude], - icon: icon + position: [data[i].longitude, data[i].latitude] }); marker.Tag = data[i]; - marker.on("click", function (e) { + viewMarkers.push(marker); + } - var emsBean = e.target.Tag; - var msg = ""; - var height = 0; - var titleName =""; - if (emsBean.recordType == 1) { - titleName = "
管线
"; - msg = msg + "管线种类:" + emsBean.markerObjectType + "
" + - "管线直径(mm):" + emsBean.pipeDiameter + "
" + - "管线材质:" + emsBean.pipeMaterial + "
" + - "埋设方式:" + emsBean.layStyle + "
" + - "管线埋深(mm):" + emsBean.depth + "
"; - height = 100; - } else if (emsBean.recordType == 2) { - titleName = "
管线附属物
"; - msg = msg + "附属物名称:" + emsBean.markerObjectType + "
" + - "井深(mm):" + emsBean.depth + "
"; - height = 40; - } else if (emsBean.recordType == 3) { - titleName = "
管线特征管点
"; - msg = msg + "管点特征:" + emsBean.markerObjectType + "
" + - "特征点埋深(mm):" + emsBean.depth + "
"; - height = 40; - } else { - titleName = "
交叉穿越点
"; - msg = msg + "上层管种类:" + emsBean.markerObjectType + "
" + - "上层管埋深(mm):" + emsBean.depth + "
" + - "上层管直径(mm):" + emsBean.pipeDiameter + "
" + - "上层管材料:" + emsBean.pipeMaterial + "
" + - "下层管种类:" + emsBean.belowType + "
" + - "下层管埋深(mm):" + emsBean.belowDepth + "
"+ - "下层管直径(mm):" + emsBean.belowDiameter + "
" + - "下层管材料:" + emsBean.belowMaterial + "
" ; - height = 160; - } - height = height +225; - msg = msg + "所属区域:" + emsBean.area + "
" + - "所属线路:" + emsBean.line + "
" + - "所属道路:" + emsBean.road + "
" + - "建设年代:" + emsBean.constructTime + "
" + - "权属单位:" + emsBean.ownerComp + "
" + - "标识器ID:" + emsBean.markerId + "
" + - "标识器类型:" + emsBean.markerType + "
" + - "标识器埋深(mm):" + emsBean.markerDepth + "
" + - "安装部门:" + emsBean.creator + "
" + - "最后修改时间:"+emsBean.createTime + "
" + - "备注:" + emsBean.memo + "
"; - var imgUrl = $('#context').val() + "/images/ems.jpg"; - var content = titleName + '
' + - '' + msg + - '
'; + var mass = new AMap.MassMarks(points, { + zIndex: 5, // 海量点图层叠加的顺序 + zooms: [3, 19], // 在指定地图缩放级别范围内展示海量点图层 + style: style // 设置样式对象 + }); + mass.setMap(map); - var infowindow = new AMap.AdvancedInfoWindow({ - content: content, - width: 290, //宽度 - height: height, //高度 - panel: "panel", //检索结果面板 - enableAutoPan: true //自动平移 - }); + map.setFitView(viewMarkers); - infowindow.open(map, [e.lnglat.lng, e.lnglat.lat]); + mass.on("click", function(e) { + var index = parseInt(e.data.id); + var emsBean = viewMarkers[index].Tag; + + var msg = processClickInfo(emsBean); + var titleName =""; + var height = 0; + if (emsBean.recordType == 1) { + titleName = "
管线
"; + height = 100; + } else if (emsBean.recordType == 2) { + titleName = "
管线附属物
"; + height = 40; + } else if (emsBean.recordType == 3) { + titleName = "
管线特征管点
"; + height = 40; + } else if (emsBean.recordType == 4) { + titleName = "
交叉穿越点
"; + height = 160; + } + height = height +225; + var imgUrl = $('#context').val() + "/images/ems.jpg"; + var content = titleName + '
' + + '' + msg + + '
'; + + var infowindow = new AMap.AdvancedInfoWindow({ + content: content, + width: 290, //宽度 + height: height, + panel: "panel", //检索结果面板 + enableAutoPan: true //自动平移 }); - map.add(marker); - } + infowindow.open(map, [e.data.lnglat.lng, e.data.lnglat.lat]); + }); } }; }(); \ No newline at end of file diff --git a/src/main/webapp/s/app/marker/marker-info-list.js b/src/main/webapp/s/app/marker/marker-info-list.js index acff146..6fabbab 100644 --- a/src/main/webapp/s/app/marker/marker-info-list.js +++ b/src/main/webapp/s/app/marker/marker-info-list.js @@ -447,10 +447,19 @@ init: function () { //监听类型下拉列表变化事件, //$("#markerObjectType").chosen(); - $("#markerObjectType").live("change", function (e) { + $("#markerObjectType, #ownerComp, #area, #line, #road, #creator, #txt_begin_day, #txt_end_day, #markerId, #memo").live("change", function (e) { typeValue = $("#markerObjectType").val(); $("#table_marker").children().remove(); Marker.recordType = typeValue; + Marker.ownerComp = $("#ownerComp").val(); + Marker.area = $("#area").val(); + Marker.line = $("#line").val(); + Marker.road = $("#road").val(); + Marker.creator = $("#creator").val(); + Marker.memo = $("#memo").val(); + Marker.sDate = $("#txt_begin_day").val(); + Marker.eDate = $("#txt_end_day").val(); + Marker.markerId = $("#markerId").val(); var title = MarkerInfoList.tableTitle(typeValue); oTable = $('#table_marker').dataTable({ // set the initial value @@ -623,7 +632,7 @@ }); - $('#searchMarker').bind('click', function (e) { + /*$('#searchMarker').bind('click', function (e) { Marker = {}; Marker.recordType=$("#markerObjectType").val(); Marker.line = $("#line").val(); @@ -635,22 +644,28 @@ Marker.sDate = $("#txt_begin_day").val(); Marker.eDate = $("#txt_end_day").val(); Marker.markerId = $("#markerId").val(); + + console.log(Marker); + oTable.fnDraw(true); // oTable.fnClearTable(); // oTable.ajax.reload(); - }); + });*/ $('#exp').live('click', function (e) { Marker = {}; Marker.recordType = $("#markerObjectType").val(); + Marker.area = $("#area").val(); + Marker.line = $("#line"); Marker.road = $("#road").val(); Marker.ownerComp = $("#ownerComp").val(); - Marker.memo = $("#memo").val(); Marker.creator = $("#creator").val(); Marker.sDate = $("#txt_begin_day").val(); Marker.eDate = $("#txt_end_day").val(); Marker.markerId = $("#markerId").val(); - location.href = $('#context').val() + "/marker/export.do?strMarkerDto=" + JSON.stringify(Marker); + Marker.memo = $("#memo").val(); + + window.open($('#context').val() + "/marker/export.do?strMarkerDto=" + JSON.stringify(Marker)); }); diff --git a/src/main/webapp/s/app/task/task-gd.js b/src/main/webapp/s/app/task/task-gd.js index abf4da0..7a8a3f1 100644 --- a/src/main/webapp/s/app/task/task-gd.js +++ b/src/main/webapp/s/app/task/task-gd.js @@ -17,41 +17,37 @@ var viewPoints = []; var markerData = []; var hadRequest = false; + var viewMarkers = []; //视域范围内的点 - var blueIcon = new AMap.Icon({ - size: new AMap.Size(25, 34), - image: $('#context').val() + '/images/drop/0.png' - }); - - var orangeIcon = new AMap.Icon({ - size: new AMap.Size(25, 34), - image: $('#context').val() + '/images/drop/1.png' - }); - - var redIcon = new AMap.Icon({ - size: new AMap.Size(25, 34), - image: $('#context').val() + '/images/drop/2.png' - }); - - var blackIcon = new AMap.Icon({ - size: new AMap.Size(25, 34), - image: $('#context').val() + '/images/drop/3.png' - }); - - var pinkIcon = new AMap.Icon({ - size: new AMap.Size(25, 34), - image: $('#context').val() + '/images/drop/4.png' - }); - - var yellowIcon = new AMap.Icon({ - size: new AMap.Size(25, 34), - image: $('#context').val() + '/images/drop/5.png' - }); - - var greenIcon = new AMap.Icon({ - size: new AMap.Size(25, 34), - image: $('#context').val() + '/images/drop/6.png' - }); + var style = [{ + url: $('#context').val() + '/images/drop/0.png', // 蓝色图标地址 + anchor: new AMap.Pixel(15, 20), // 图标显示位置偏移量,基准点为图标左上角 + size: new AMap.Size(15, 20) // 图标大小 + }, { + url: $('#context').val() + '/images/drop/1.png', // 橙色图标地址 + anchor: new AMap.Pixel(15, 20), // 图标显示位置偏移量,基准点为图标左上角 + size: new AMap.Size(15, 20) // 图标大小 + }, { + url: $('#context').val() + '/images/drop/2.png', // 红色图标地址 + anchor: new AMap.Pixel(15, 20), // 图标显示位置偏移量,基准点为图标左上角 + size: new AMap.Size(15, 20) // 图标大小 + }, { + url: $('#context').val() + '/images/drop/3.png', // 黑色图标地址 + anchor: new AMap.Pixel(15, 20), // 图标显示位置偏移量,基准点为图标左上角 + size: new AMap.Size(15, 20) // 图标大小 + }, { + url: $('#context').val() + '/images/drop/4.png', // 粉色图标地址 + anchor: new AMap.Pixel(15, 20), // 图标显示位置偏移量,基准点为图标左上角 + size: new AMap.Size(15, 20) // 图标大小 + }, { + url: $('#context').val() + '/images/drop/5.png', // 黄色图标地址 + anchor: new AMap.Pixel(15, 20), // 图标显示位置偏移量,基准点为图标左上角 + size: new AMap.Size(15, 20) // 图标大小 + }, { + url: $('#context').val() + '/images/drop/6.png', // 绿色图标地址 + anchor: new AMap.Pixel(15, 20), // 图标显示位置偏移量,基准点为图标左上角 + size: new AMap.Size(15, 20) // 图标大小 + }]; // 历史工单列表属性 var options = { @@ -77,6 +73,9 @@ map.remove(drawOverlays[i]); } drawOverlays.length = 0; + + clearAllTaskPoint(); + clearAllEventPoint(); } // 清除工单任务绘制的标识器点 @@ -228,6 +227,47 @@ } } + + + // 处理鼠标单击事件 + function processClickInfo(emsBean){ + var msg = ""; + if (emsBean.recordType == 1) { + msg = msg + "管线种类:" + emsBean.markerObjectType + "
" + + "管线直径(mm):" + emsBean.pipeDiameter + "
" + + "管线材质:" + emsBean.pipeMaterial + "
" + + "埋设方式:" + emsBean.layStyle + "
" + + "管线埋深(mm):" + emsBean.depth + "
"; + } else if (emsBean.recordType == 2) { + msg = msg + "附属物名称:" + emsBean.markerObjectType + "
" + + "井深(mm):" + emsBean.depth + "
"; + } else if (emsBean.recordType == 3) { + msg = msg + "管点特征:" + emsBean.markerObjectType + "
" + + "特征点埋深(mm):" + emsBean.depth + "
"; + } else { + msg = msg + "上层管种类:" + emsBean.markerObjectType + "
" + + "上层管埋深(mm):" + emsBean.depth + "
" + + "上层管直径(mm):" + emsBean.pipeDiameter + "
" + + "上层管材料:" + emsBean.pipeMaterial + "
" + + "下层管种类:" + emsBean.belowType + "
" + + "下层管埋深(mm):" + emsBean.belowDepth + "
"+ + "下层管直径(mm):" + emsBean.belowDiameter + "
" + + "下层管材料:" + emsBean.belowMaterial + "
" ; + } + msg = msg + "所属区域:" + emsBean.area + "
" + + "所属线路:" + emsBean.line + "
" + + "所属道路:" + emsBean.road + "
" + + "建设年代:" + emsBean.constructTime + "
" + + "权属单位:" + emsBean.ownerComp + "
" + + "标识器ID:" + emsBean.markerId + "
" + + "标识器类型:" + emsBean.markerType + "
" + + "标识器埋深(mm):" + emsBean.markerDepth + "
" + + "安装部门:" + emsBean.creator + "
" + + "最后修改时间:"+emsBean.createTime + "
" + + "备注:" + emsBean.memo + "
"; + + return msg; + } return { //添加工单 @@ -516,95 +556,75 @@ // 显示标识器点 addMarker: function (data) { + var points = []; for (var i = 0; i < data.length; i++) { - var icon = blueIcon; - var color = data[i].colorType; - if (color == "1") { - icon = orangeIcon; - } else if (color == "2") { - icon = redIcon; - } else if (color == "3") { - icon = blackIcon; - } else if (color == "4") { - icon = pinkIcon; - } else if (color == "5") { - icon = yellowIcon; - } else if (color == "6") { - icon = greenIcon; - } + var point = {}; + var lnglat = [data[i].longitude, data[i].latitude]; + var name = data[i].markerId; + var id = i; + var styleIndex = parseInt(data[i].colorType); + if (styleIndex < 1 || styleIndex > 6) styleIndex = 0; + point.lnglat = lnglat; + point.name = name; + point.id = id; + point.style = styleIndex; + points.push(point); + + //不在地图上显示,纯粹为了调整视窗 var marker = new AMap.Marker({ - position: [data[i].longitude, data[i].latitude], - icon: icon + position: [data[i].longitude, data[i].latitude] }); marker.Tag = data[i]; - marker.on("click", function (e) { + viewMarkers.push(marker); + } - var emsBean = e.target.Tag; - var msg = ""; - var height = 0; - var titleName =""; - if (emsBean.recordType == 1) { - titleName = "
管线
"; - msg = msg + "管线种类:" + emsBean.markerObjectType + "
" + - "管线直径(mm):" + emsBean.pipeDiameter + "
" + - "管线材质:" + emsBean.pipeMaterial + "
" + - "埋设方式:" + emsBean.layStyle + "
" + - "管线埋深(mm):" + emsBean.depth + "
"; - height = 100; - } else if (emsBean.recordType == 2) { - titleName = "
管线附属物
"; - msg = msg + "附属物名称:" + emsBean.markerObjectType + "
" + - "井深(mm):" + emsBean.depth + "
"; - height = 40; - } else if (emsBean.recordType == 3) { - titleName = "
管线特征管点
"; - msg = msg + "管点特征:" + emsBean.markerObjectType + "
" + - "特征点埋深(mm):" + emsBean.depth + "
"; - height = 40; - } else { - titleName = "
交叉穿越点
"; - msg = msg + "上层管种类:" + emsBean.markerObjectType + "
" + - "上层管埋深(mm):" + emsBean.depth + "
" + - "上层管直径(mm):" + emsBean.pipeDiameter + "
" + - "上层管材料:" + emsBean.pipeMaterial + "
" + - "下层管种类:" + emsBean.belowType + "
" + - "下层管埋深(mm):" + emsBean.belowDepth + "
"+ - "下层管直径(mm):" + emsBean.belowDiameter + "
" + - "下层管材料:" + emsBean.belowMaterial + "
" ; - height = 160; - } - height = height +225; - msg = msg + "所属区域:" + emsBean.area + "
" + - "所属线路:" + emsBean.line + "
" + - "所属道路:" + emsBean.road + "
" + - "建设年代:" + emsBean.constructTime + "
" + - "权属单位:" + emsBean.ownerComp + "
" + - "标识器ID:" + emsBean.markerId + "
" + - "标识器类型:" + emsBean.markerType + "
" + - "标识器埋深(mm):" + emsBean.markerDepth + "
" + - "安装部门:" + emsBean.creator + "
" + - "最后修改时间:"+emsBean.createTime + "
" + - "备注:" + emsBean.memo + "
"; - var imgUrl = $('#context').val() + "/images/ems.jpg"; - var content = titleName + '
' + - '' + msg + - '
'; + var mass = new AMap.MassMarks(points, { + zIndex: 5, // 海量点图层叠加的顺序 + zooms: [3, 19], // 在指定地图缩放级别范围内展示海量点图层 + style: style // 设置样式对象 + }); + mass.setMap(map); - var infowindow = new AMap.AdvancedInfoWindow({ - content: content, - width: 290, //宽度 - height: height, //高度 - panel: "panel", //检索结果面板 - enableAutoPan: true //自动平移 - }); + map.setFitView(viewMarkers); - infowindow.open(map, [e.lnglat.lng, e.lnglat.lat]); + mass.on("click", function(e) { + var index = parseInt(e.data.id); + var emsBean = viewMarkers[index].Tag; + + var msg = processClickInfo(emsBean); + var titleName = ""; + var height = 0; + if (emsBean.recordType == 1) { + titleName = "
管线
"; + height = 100; + } else if (emsBean.recordType == 2) { + titleName = "
管线附属物
"; + height = 40; + } else if (emsBean.recordType == 3) { + titleName = "
管线特征管点
"; + height = 40; + } else if (emsBean.recordType == 4) { + titleName = "
交叉穿越点
"; + height = 160; + } + height = height + 225; + var imgUrl = $('#context').val() + "/images/ems.jpg"; + var content = titleName + '
' + + '' + msg + + '
'; + + var infowindow = new AMap.AdvancedInfoWindow({ + content: content, + width: 290, //宽度 + height: height, + panel: "panel", //检索结果面板 + enableAutoPan: true //自动平移 }); - map.add(marker); - } + infowindow.open(map, [e.data.lnglat.lng, e.data.lnglat.lat]); + }); }, //增加事件图片的marker @@ -642,6 +662,7 @@ var marker = new AMap.Marker({ position: [data[i].longitude, data[i].latitude], size: new AMap.Size(30, 30), + offset: new AMap.Pixel(-15, -30), //相对于基点的偏移位置 icon: data[i].icon });