|
@@ -21,6 +21,10 @@
|
|
|
width: 100%;
|
|
width: 100%;
|
|
|
height: 100vh;
|
|
height: 100vh;
|
|
|
}
|
|
}
|
|
|
|
|
+ .BMapLib_SearchInfoWindow .BMapLib_bubble_content p{
|
|
|
|
|
+ line-height: 24px;
|
|
|
|
|
+ font-size: 14px;
|
|
|
|
|
+ }
|
|
|
</style>
|
|
</style>
|
|
|
</head>
|
|
</head>
|
|
|
|
|
|
|
@@ -125,6 +129,7 @@
|
|
|
$("#mapControl_type").html("卫星");
|
|
$("#mapControl_type").html("卫星");
|
|
|
map.centerAndZoom(new BMap.Point(map_center[0], map_center[1]), 15);
|
|
map.centerAndZoom(new BMap.Point(map_center[0], map_center[1]), 15);
|
|
|
map.enableScrollWheelZoom(true);
|
|
map.enableScrollWheelZoom(true);
|
|
|
|
|
+ geoc = new BMap.Geocoder();
|
|
|
|
|
|
|
|
//气象站标识
|
|
//气象站标识
|
|
|
var qxzIcon = new BMap.Icon("{% static 'imgs/qxz.png'%}", new BMap.Size(30, 40), { imageSize: new BMap.Size(30, 40),anchor: new BMap.Size(0, 0) });
|
|
var qxzIcon = new BMap.Icon("{% static 'imgs/qxz.png'%}", new BMap.Size(30, 40), { imageSize: new BMap.Size(30, 40),anchor: new BMap.Size(0, 0) });
|
|
@@ -137,12 +142,17 @@
|
|
|
//摄像头标识——加密
|
|
//摄像头标识——加密
|
|
|
var sxtEncryptIcon = new BMap.Icon("{% static 'imgs/sxt-Encrypt.png'%}", new BMap.Size(30, 40), { imageSize: new BMap.Size(30, 40) });
|
|
var sxtEncryptIcon = new BMap.Icon("{% static 'imgs/sxt-Encrypt.png'%}", new BMap.Size(30, 40), { imageSize: new BMap.Size(30, 40) });
|
|
|
|
|
|
|
|
- function openInfo(title, content, e) {
|
|
|
|
|
|
|
+ function openInfo(title, id, e) {
|
|
|
var p = e.target;
|
|
var p = e.target;
|
|
|
- var point = new BMap.Point(p.getPosition().lng, p.getPosition().lat);
|
|
|
|
|
|
|
+ var point = new BMap.Point(p.getPosition().lng-.0004, p.getPosition().lat-.001);
|
|
|
|
|
+ geoc.getLocation(point, function (rs) {
|
|
|
|
|
+ var addComp = rs.addressComponents;
|
|
|
|
|
+ $('.area').html('位置:' + addComp.province + ", " + addComp.city + ", " + addComp.district)
|
|
|
|
|
+ });
|
|
|
//var infoWindow = new BMap.InfoWindow(content); // 创建信息窗口对象
|
|
//var infoWindow = new BMap.InfoWindow(content); // 创建信息窗口对象
|
|
|
//map.openInfoWindow(infoWindow, point); //开启信息窗口
|
|
//map.openInfoWindow(infoWindow, point); //开启信息窗口
|
|
|
|
|
|
|
|
|
|
+ var content = '<p>IMEI:' + id + '</p><p class="area">位置:' + e.point.equip_location + '</p></br>';
|
|
|
var searchInfoWindow = new BMapLib.SearchInfoWindow(map, content, {
|
|
var searchInfoWindow = new BMapLib.SearchInfoWindow(map, content, {
|
|
|
title: title, //标题
|
|
title: title, //标题
|
|
|
panel: "panel", //检索结果面板
|
|
panel: "panel", //检索结果面板
|
|
@@ -180,22 +190,27 @@
|
|
|
var WeatherstationMarker = [];//气象站
|
|
var WeatherstationMarker = [];//气象站
|
|
|
var CameraMarker = [];//摄像头
|
|
var CameraMarker = [];//摄像头
|
|
|
|
|
|
|
|
- GetMonitorMark(1);
|
|
|
|
|
|
|
+ // GetMonitorMark(1);
|
|
|
|
|
+ getData()
|
|
|
function getData(){
|
|
function getData(){
|
|
|
$.ajax({
|
|
$.ajax({
|
|
|
- url:'',
|
|
|
|
|
|
|
+ url:'equip_addr',
|
|
|
type:'post',
|
|
type:'post',
|
|
|
data:'',
|
|
data:'',
|
|
|
dataType:'json',
|
|
dataType:'json',
|
|
|
success:function(data){
|
|
success:function(data){
|
|
|
-
|
|
|
|
|
|
|
+ var dat = {
|
|
|
|
|
+ "Status": true,
|
|
|
|
|
+ "list":data
|
|
|
|
|
+ }
|
|
|
|
|
+ GetMonitorMark(dat)
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//监测数据
|
|
//监测数据
|
|
|
- function GetMonitorMark(ShowStatus) {
|
|
|
|
|
- var data = {
|
|
|
|
|
|
|
+ function GetMonitorMark(data) {
|
|
|
|
|
+ var data1 = {
|
|
|
"Status": true,
|
|
"Status": true,
|
|
|
"list": [{
|
|
"list": [{
|
|
|
"id": "D08652664",
|
|
"id": "D08652664",
|
|
@@ -239,8 +254,8 @@
|
|
|
for (var i = 0; i < jsonObj.list.length; i++) {
|
|
for (var i = 0; i < jsonObj.list.length; i++) {
|
|
|
var markObj = jsonObj.list[i];
|
|
var markObj = jsonObj.list[i];
|
|
|
|
|
|
|
|
- var id = markObj.id;
|
|
|
|
|
- var markType = markObj.markType;
|
|
|
|
|
|
|
+ var id = markObj.equip_id;
|
|
|
|
|
+ var markType = markObj.equip_type;
|
|
|
var title = markObj.title;
|
|
var title = markObj.title;
|
|
|
var theName = markObj.EquipmentName;
|
|
var theName = markObj.EquipmentName;
|
|
|
var lng = markObj.lng;
|
|
var lng = markObj.lng;
|
|
@@ -256,9 +271,9 @@
|
|
|
var CameraNo = markObj.CameraNo;
|
|
var CameraNo = markObj.CameraNo;
|
|
|
marker = createCameraMarker(lng, lat, icon, title, id, CameraNo);
|
|
marker = createCameraMarker(lng, lat, icon, title, id, CameraNo);
|
|
|
}
|
|
}
|
|
|
- else //气象站
|
|
|
|
|
- marker = createMarker(lng, lat, icon, title, content);
|
|
|
|
|
-
|
|
|
|
|
|
|
+ else if (markType == "5") { //气象站
|
|
|
|
|
+ marker = createMarker(lng, lat, icon, '气象站', id);
|
|
|
|
|
+ }
|
|
|
map.addOverlay(marker);
|
|
map.addOverlay(marker);
|
|
|
|
|
|
|
|
switch (markType) {
|
|
switch (markType) {
|
|
@@ -287,31 +302,25 @@
|
|
|
$("#" + objId).html("");
|
|
$("#" + objId).html("");
|
|
|
}
|
|
}
|
|
|
function GetMarkerIcon(markType, isRun) {
|
|
function GetMarkerIcon(markType, isRun) {
|
|
|
- var icon = qxzIcon;
|
|
|
|
|
|
|
+ var icon = '';
|
|
|
|
|
|
|
|
switch (markType) {
|
|
switch (markType) {
|
|
|
case 5:
|
|
case 5:
|
|
|
- if (isRun)
|
|
|
|
|
- icon = qxzIcon;
|
|
|
|
|
- else
|
|
|
|
|
- icon = qxzOffIcon;
|
|
|
|
|
|
|
+ icon = qxzIcon;
|
|
|
break;
|
|
break;
|
|
|
case 6:
|
|
case 6:
|
|
|
- if (isRun)
|
|
|
|
|
- icon = sxtIcon;
|
|
|
|
|
- else
|
|
|
|
|
- icon = sxtOffIcon;
|
|
|
|
|
|
|
+ icon = sxtIcon;
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
return icon;
|
|
return icon;
|
|
|
}
|
|
}
|
|
|
//将创建marker的方法抽出来,否则的话总是打开最后一个InfoWindow
|
|
//将创建marker的方法抽出来,否则的话总是打开最后一个InfoWindow
|
|
|
- function createMarker(lng, lat, icon, title, content) {
|
|
|
|
|
|
|
+ function createMarker(lng, lat, icon, title, id) {
|
|
|
|
|
|
|
|
var markerx = new BMap.Marker(new BMap.Point(lng, lat), { icon: icon });
|
|
var markerx = new BMap.Marker(new BMap.Point(lng, lat), { icon: icon });
|
|
|
markerx.addEventListener("click", function (e) {
|
|
markerx.addEventListener("click", function (e) {
|
|
|
- openInfo(title, content, e);
|
|
|
|
|
|
|
+ openInfo(title, id, e);
|
|
|
});
|
|
});
|
|
|
return markerx;
|
|
return markerx;
|
|
|
}
|
|
}
|
|
@@ -358,6 +367,43 @@
|
|
|
$("#mapControl_typeChange").hide();
|
|
$("#mapControl_typeChange").hide();
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
+ function toggleIcon(obj, markType) {
|
|
|
|
|
+ var IconShow = false;
|
|
|
|
|
+
|
|
|
|
|
+ if ($(obj).hasClass("IconHide")) {
|
|
|
|
|
+ IconShow = true;
|
|
|
|
|
+ $(obj).removeClass("IconHide");
|
|
|
|
|
+ }
|
|
|
|
|
+ else {
|
|
|
|
|
+ IconShow = false;
|
|
|
|
|
+ $(obj).addClass("IconHide");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ var pointArray;
|
|
|
|
|
+
|
|
|
|
|
+ switch (markType) {
|
|
|
|
|
+ case 5:
|
|
|
|
|
+ pointArray = WeatherstationMarker;
|
|
|
|
|
+ break;
|
|
|
|
|
+ case 6:
|
|
|
|
|
+ pointArray = CameraMarker;
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ for (var i = 0; i < pointArray.length; i++) {
|
|
|
|
|
+ var marker = pointArray[i];
|
|
|
|
|
+ if (IconShow) {
|
|
|
|
|
+ var marker = pointArray[i];
|
|
|
|
|
+ //map.addOverlay(marker);
|
|
|
|
|
+ marker.show();
|
|
|
|
|
+ }
|
|
|
|
|
+ else {
|
|
|
|
|
+ var marker = pointArray[i];
|
|
|
|
|
+ // map.removeOverlay(marker);
|
|
|
|
|
+ marker.hide();
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
// 图例悬浮
|
|
// 图例悬浮
|
|
|
function SetAnimation(opFlag, markType) {
|
|
function SetAnimation(opFlag, markType) {
|
|
|
|
|
|