From c6d9be2aac4965e847fd958288170e26e79b219d Mon Sep 17 00:00:00 2001
From: 15832144755 <67030627+15832144755@users.noreply.github.com>
Date: 星期三, 01 九月 2021 16:09:44 +0800
Subject: [PATCH] 9.1
---
src/main/webapp/WEB-INF/classes/com/hxzkoa/udp/Udp_Out.class | 0
/dev/null | 2003 -------------------
src/main/webapp/hxzk/mapshow/mapShow.jsp | 2415 +++++++++++-----------
src/main/webapp/hxzk/mapshow/mapShow2.jsp | 1691 ++++++++++++++++
src/main/webapp/hxzk/index.jsp | 102
src/main/java/com/hxzkoa/udp/Udp_Out.java | 2
6 files changed, 2,948 insertions(+), 3,265 deletions(-)
diff --git a/src/main/java/com/hxzkoa/udp/Udp_Out.java b/src/main/java/com/hxzkoa/udp/Udp_Out.java
index 6520b95..cb44a12 100644
--- a/src/main/java/com/hxzkoa/udp/Udp_Out.java
+++ b/src/main/java/com/hxzkoa/udp/Udp_Out.java
@@ -29,7 +29,7 @@
DatagramSocket socket =null;
InetAddress address=null;
int port = 7000;
- String ip = "39.106.210.13";
+ String ip = "127.0.0.1";
byte[] data = null;
try {
data = message.getBytes("gbk");
diff --git a/src/main/webapp/WEB-INF/classes/com/hxzkoa/udp/Udp_Out.class b/src/main/webapp/WEB-INF/classes/com/hxzkoa/udp/Udp_Out.class
index 10d7262..1aad9bc 100644
--- a/src/main/webapp/WEB-INF/classes/com/hxzkoa/udp/Udp_Out.class
+++ b/src/main/webapp/WEB-INF/classes/com/hxzkoa/udp/Udp_Out.class
Binary files differ
diff --git a/src/main/webapp/hxzk/index.jsp b/src/main/webapp/hxzk/index.jsp
index 69faddc..36c44ff 100644
--- a/src/main/webapp/hxzk/index.jsp
+++ b/src/main/webapp/hxzk/index.jsp
@@ -976,12 +976,12 @@
for (var i = 0; i < gps_node_list1.length; i++) {
//var zhuangtaia = gps_node_list1[i][4];
if ((bm_offView == '1' && gps_node_list1[i][4] == '1') || (bm_offView == '0')) {
- if (current_node_list[gps_node_list1[i][0]] == null) {
- current_node_list[gps_node_list1[i][0]] = new Queue();
- }
- var point = new BMap.Point(new Number(gps_node_list1[i][1]), new Number(gps_node_list1[i][2]));
- points.push(point);
- gps_node_list.push(gps_node_list1[i]);
+ if (current_node_list[gps_node_list1[i][0]] == null) {
+ current_node_list[gps_node_list1[i][0]] = new Queue();
+ }
+ var point = new BMap.Point(new Number(gps_node_list1[i][1]), new Number(gps_node_list1[i][2]));
+ points.push(point);
+ gps_node_list.push(gps_node_list1[i]);
}
};
gps_node_list1 = null
@@ -990,55 +990,53 @@
}
function baidumm(data) {
+ bm.clearOverlays();
for (var i = 0; i < gps_node_list.length; i++) {
//var zhuangtaia = getstatus(gps_node_list[i][0]);
- if (current_node_list[gps_node_list[i][0]].size() > 0) {
- old_mark = current_node_list[gps_node_list[i][0]].front();
- current_node_list[gps_node_list[i][0]].dequeue();
- bm.removeOverlay(old_mark);//娓呴櫎涓婁竴涓�
+ // if (current_node_list[gps_node_list[i][0]].size() > 0) {
+ // old_mark = current_node_list[gps_node_list[i][0]].front();
+ // current_node_list[gps_node_list[i][0]].dequeue();
+ // bm.removeOverlay(old_mark);//娓呴櫎涓婁竴涓�
+ // old_mark = null;
+ // }
+ marker = new BMap.Marker(data[i], { icon: myIcon });
+ bm.addOverlay(marker);
+ current_node_list[gps_node_list[i][0]].enqueue(marker);
+ if (bm_viewTagid == "1") {
+ var aaaaa = gps_node_list[i][15] + " " + gps_node_list[i][0]
+ var tagid = new BMap.Label(aaaaa, { offset: new BMap.Size(20, -30) });
+ tagid.setStyle({
+ color: "#fff",
+ fontSize: "14px",
+ borderRadius: "5px",
+ padding: "5px 5px",
+ border: "0",
+ backgroundColor: "#32CD32",
+ transform: 'translateX(-50%)',
+ });
+ marker.setLabel(tagid); //娣诲姞label-tagid
+ tagid = null;
}
- //if ((bm_offView == '1' && zhuangtaia == '1') || (bm_offView == '0')) {
- marker = new BMap.Marker(data[i], { icon: myIcon });
- bm.addOverlay(marker);
- current_node_list[gps_node_list[i][0]].enqueue(marker);
-
- if (bm_viewTagid == "1") {
- var aaaaa = gps_node_list[i][15] + " " + gps_node_list[i][0]
- var tagid = new BMap.Label(aaaaa, { offset: new BMap.Size(20, -30) });
- tagid.setStyle({
- color: "#fff",
- fontSize: "14px",
- borderRadius: "5px",
- padding: "5px 5px",
- border: "0",
- backgroundColor: "#32CD32",
- transform: 'translateX(-50%)',
- });
- marker.setLabel(tagid); //娣诲姞label-tagid
- tagid = null;
- }
- if (bm_tagZb == "1") {
- var zuobiao = new BMap.Label(gps_node_list[i][1] + ',' + gps_node_list[i][2], { offset: new BMap.Size(20, +40) });
- zuobiao.setStyle({
- transform: 'translateX(-50%)',
- backgroundColor: "0.000000000001",
- border: 'none'
- });
- marker.setLabel(zuobiao);
- zuobiao = null;
- }
- if (bm_viewPower == "1") {
- var dianliang = new BMap.Label("璁惧鐢甸噺" + gps_node_list[i][12], { offset: new BMap.Size(20, +55) });
- dianliang.setStyle({
- transform: 'translateX(-50%)',
- backgroundColor: "0.000000000001",
- border: 'none'
- });
- marker.setLabel(dianliang);
- dianliang = null;
- }
- marker = null;
- //}
+ if (bm_tagZb == "1") {
+ var zuobiao = new BMap.Label(gps_node_list[i][1] + ',' + gps_node_list[i][2], { offset: new BMap.Size(20, +40) });
+ zuobiao.setStyle({
+ transform: 'translateX(-50%)',
+ backgroundColor: "0.000000000001",
+ border: 'none'
+ });
+ marker.setLabel(zuobiao);
+ zuobiao = null;
+ }
+ if (bm_viewPower == "1") {
+ var dianliang = new BMap.Label("璁惧鐢甸噺" + gps_node_list[i][12], { offset: new BMap.Size(20, +55) });
+ dianliang.setStyle({
+ transform: 'translateX(-50%)',
+ backgroundColor: "0.000000000001",
+ border: 'none'
+ });
+ marker.setLabel(dianliang);
+ dianliang = null;
+ }
}
gps_node_list = null;
};
diff --git a/src/main/webapp/hxzk/index2.jsp b/src/main/webapp/hxzk/index2.jsp
deleted file mode 100644
index c21b263..0000000
--- a/src/main/webapp/hxzk/index2.jsp
+++ /dev/null
@@ -1,2083 +0,0 @@
-<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" %>
- <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
- <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
- <html lang="en">
-
- <head>
- <meta charset="utf-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, shrink-to-fit=no">
- <title></title>
- <link href="/hxzkoa/hxzk/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
- <link href="/hxzkoa/hxzk/assets/img/favicon.ico" rel="icon" type="image/x-icon" />
- <link href="/hxzkoa/hxzk/assets/css/components/custom-modal.css" rel="stylesheet" type="text/css" />
- <link href="/hxzkoa/hxzk/assets/css/components/custom-sweetalert.css" rel="stylesheet"
- type="text/css" />
- <link href="/hxzkoa/hxzk/assets/css/dashboard/dash_2.css" rel="stylesheet" type="text/css" />
- <link href="/hxzkoa/hxzk/assets/css/elements/custom-pagination.css" rel="stylesheet" type="text/css" />
- <link href="/hxzkoa/hxzk/assets/css/loader.css" rel="stylesheet" type="text/css" />
- <link href="/hxzkoa/hxzk/assets/css/scrollspyNav.css" rel="stylesheet" type="text/css" />
- <link href="/hxzkoa/hxzk/assets/css/main.css" rel="stylesheet" type="text/css" />
- <link href="/hxzkoa/hxzk/assets/css/structure.css" rel="stylesheet" type="text/css" />
- <link href="/hxzkoa/hxzk/assets/css/elements/search.css" rel="stylesheet" type="text/css" />
- <link href="/hxzkoa/hxzk/plugins/apex/apexcharts.css" rel="stylesheet" type="text/css">
- <link href="/hxzkoa/hxzk/plugins/animate/animate.css" rel="stylesheet" type="text/css" />
- <link href="/hxzkoa/hxzk/plugins/highlight/styles/monokai-sublime.css" rel="stylesheet"
- type="text/css" />
- <link href="/hxzkoa/hxzk/plugins/sweetalerts/sweetalert2.min.css" rel="stylesheet" type="text/css" />
- <link href="/hxzkoa/hxzk/plugins/sweetalerts/sweetalert.css" rel="stylesheet" type="text/css" />
- <link href="/hxzkoa/hxzk/plugins/table/datatable/datatables.css" rel="stylesheet" type="text/css">
- <link href="/hxzkoa/hxzk/plugins/table/datatable/custom_dt_html5.css" rel="stylesheet" type="text/css">
- <link href="/hxzkoa/hxzk/plugins/table/datatable/dt-global_style.css" rel="stylesheet" type="text/css">
- <link href="/hxzkoa/hxzk/plugins/perfect-scrollbar/perfect-scrollbar.css" rel="stylesheet"
- type="text/css" />
- <link href="https://fonts.gstatic.com" rel="preconnect">
- <link href="https://fonts.googleapis.com/css2?family=Ma+Shan+Zheng&display=swap" rel="stylesheet">
- <link href="https://fonts.googleapis.com/css?family=Quicksand:400,500,600,700&display=swap"
- rel="stylesheet">
- <style>
- .panel-head {
- font-size: 1rem;
- color: rgba(255, 255, 255, .7);
- line-height: 2rem;
- text-align: center;
- background: linear-gradient(rgb(0, 20, 30), rgb(0, 40, 70));
- border: 2px solid rgba(0, 90, 120, .3);
- }
-
- .table-bordered td,
- .table-bordered th {
- border: 1px solid #ebedf2;
- }
-
- .fonts {
- color: #fff;
- font-size: 50px;
- font-family: "瀹嬩綋";
- }
-
- .fonts1 {
- color: #5c9792;
- font-size: 40px;
- font-family: "瀹嬩綋";
- text-shadow: 5px 5px 5px rgb(223, 65, 65);
- }
-
- .text {
- text-align: center;
- margin-top: 10px;
- }
- </style>
- <script src="/hxzkoa/hxzk/assets/js/app.js"></script>
- <script src="/hxzkoa/hxzk/assets/js/dashboard/dash_2.js"></script>
- <script src="/hxzkoa/hxzk/assets/js/loader.js"></script>
- <script src="/hxzkoa/hxzk/assets/js/libs/jquery-3.1.1.min.js"></script>
- <script src="/hxzkoa/hxzk/bootstrap/js/bootstrap.min.js"></script>
- <script src="/hxzkoa/hxzk/bootstrap/js/popper.min.js"></script>
- <script src="/hxzkoa/hxzk/plugins/apex/apexcharts.js"></script>
- <script src="/hxzkoa/hxzk/plugins/table/datatable/button-ext/jszip.min.js"></script>
- <script src="/hxzkoa/hxzk/plugins/table/jquery.table2excel.js"></script>
- <script src="/hxzkoa/hxzk/plugins/sweetalerts/promise-polyfill.js"></script>
- <script src="/hxzkoa/hxzk/plugins/sweetalerts/sweetalert2.min.js"></script>
- <script src="/hxzkoa/hxzk/plugins/sweetalerts/custom-sweetalert.js"></script>
- <script src="/hxzkoa/hxzk/plugins/perfect-scrollbar/perfect-scrollbar.min.js"></script>
-
- <!-- 鐧惧害鍦板浘鎺ュ彛 -->
- <script type="text/javascript" id="baidumap_api"
- src="http://api.map.baidu.com/getscript?v=3.0&ak=PUftjeZCKHtEn8ZMjeAGnViSO8NBvBNm"></script>
- </head>
-
- <body class="alt-menu sidebar-noneoverflow" style="overflow:auto">
- <!-- BEGIN LOADER -->
- <div id="load_screen">
- <div class="loader">
- <div class="loader-content">
- <div class="spinner-grow align-self-center"></div>
- </div>
- </div>
- </div>
- <!-- END LOADER -->
- <div class="border-left"
- style="opacity:0.4;float:left;position:absolute;z-index:1;left:120px;height:20px;"><img alt=""
- src="/hxzkoa/resources/images/border.png" class="img-left"></div>
- <div class="border-right" style="opacity:0.4;float:right;position:absolute;z-index:2;right:120px;"><img
- alt="" src="/hxzkoa/resources/images/border2.png" class="img-right"></div>
- <!-- BEGIN NAVBAR -->
- <div class="login-page"></div>
- <!-- END NAVBAR -->
- <!-- BEGIN MAIN CONTAINER -->
- <div class="main-container" id="container">
- <div class="overlay"></div>
- <div class="search-overlay"></div>
- <!-- BEGIN TOPBAR -->
- <div class="header-page"></div>
- <!-- END TOPBAR -->
- <!-- BEGIN CONTENT PART -->
- <div id="content" class="main-content">
- <div class="layout-px-spacing">
- <div class="row layout-top-spacing">
- <div class="col-xl-3 col-lg-6 col-md-6 col-sm-12 col-12 layout-spacing"
- style="padding-right:5px;padding-left:5px;padding-bottom:5px;padding-top:5px;"
- id="jizhanxinxi">
- <div class="widget widget-one_hybrid widget-engagement" style="height:380px;">
- <div class='panel-head'>浣嶇疆鏁版嵁</div>
- <div id="wasd" class="" style="margin-top:50px;">
- </div>
- </div>
- </div>
- <!-- <div class="col-xl-3 col-lg-6 col-md-6 col-sm-12 col-12 layout-spacing"
- style="padding-right:5px;padding-left:5px;padding-bottom:5px;padding-top:5px;"
- id='jizhanxinxi'>
- <div class="widget widget-one_hybrid widget-engagement">
- <div class="widget-heading" style="height:380px;">
- <div class='panel-head'>瀹炴椂鏁版嵁</div>
- <div id="realtime" class="" style="margin-top:50px;">
- </div>
- <div class="table-responsive mb-4 mt-4"
- style="position:absolute;top:10px;display: flex;justify-content: center;flex-wrap: wrap;">
- <div class="item"
- style="width: 50%;height: 173px;border: solid 7px rgb(90, 90, 77); border-style: inset;">
- <div class="text" id="ssc1"></div>
- </div>
- <div class="item"
- style="width: 50%;height: 173px;border: solid 7px rgb(90, 90, 77); border-style: inset;">
- <div class="text" id="ssc2"></div>
- </div>
- <div class="item"
- style="width: 100%;height: 173px;border: solid 7px rgb(90, 90, 77); border-style: inset;">
- <div class="text" id="ssc3"></div>
- </div>
- </div>
- </div>
- </div>
- </div> -->
- <div class="col-xl-6 col-lg-6 col-md-6 col-sm-12 col-12 layout-spacing"
- style="padding-right:5px;padding-left:5px;padding-bottom:5px;padding-top:5px;"
- id="ditu">
- <div class="widget widget-one_hybrid widget-engagement" id="map">
- <div class="widget-heading" style="height:480px;" id="map_bg">
- <div class='panel-head' id="maphead">鍦板浘 <div
- style="position:absolute;right:8px;top:8px;" id="quanping"
- onclick="changeMapSize()"><svg t="1618401864629" class="icon"
- viewBox="0 0 1024 1024" version="1.1"
- xmlns="http://www.w3.org/2000/svg" p-id="1141" width="16"
- height="16">
- <path d="M868.6 96H720c-7.6 0-15.2 2.9-21 8.7-5.8 5.8-8.7 13.4-8.7 21s2.9 15.2 8.7 21c5.8 5.8 13.4 8.7 21
- 8.7h106.5L580.1 401.8c-11.6 11.6-11.6 30.4 0 42 11.6 11.6 30.4 11.6 42 0l246.4-246.4V304c0 7.6 2.9 15.2 8.7 21 5.8 5.8 13.4 8.7
- 21 8.7s15.2-2.9 21-8.7c5.8-5.8 8.7-13.4 8.7-21V155.4c0.1-32.8-26.5-59.4-59.3-59.4zM898.3 690.3c-7.6 0-15.2 2.9-21 8.7-5.8 5.8-8.7
- 13.4-8.7 21v106.5L622.2 580.1c-11.6-11.6-30.4-11.6-42 0s-11.6 30.4 0 42l246.4 246.4H720c-7.6 0-15.2 2.9-21 8.7-5.8 5.8-8.7 13.4-8.7
- 21s2.9 15.2 8.7 21c5.8 5.8 13.4 8.7 21 8.7h148.6c32.8 0 59.4-26.6 59.4-59.4V720c0-7.6-2.9-15.2-8.7-21-5.8-5.8-13.4-8.7-21-8.7zM401.8
- 580.1L155.4 826.5V720c0-7.6-2.9-15.2-8.7-21-5.8-5.8-13.4-8.7-21-8.7s-15.2 2.9-21 8.7c-5.8 5.8-8.7 13.4-8.7 21v148.6c0 32.8 26.6 59.4 59.4
- 59.4H304c7.6 0 15.2-2.9 21-8.7 5.8-5.8 8.7-13.4 8.7-21s-2.9-15.2-8.7-21c-5.8-5.8-13.4-8.7-21-8.7H197.5l246.4-246.4c11.6-11.6 11.6-30.4
- 0-42-11.6-11.7-30.5-11.7-42.1-0.1zM197.5 155.4H304c7.6 0 15.2-2.9 21-8.7 5.8-5.8 8.7-13.4 8.7-21s-2.9-15.2-8.7-21c-5.8-5.8-13.4-8.7-21-8.7H155.4C122.6
- 96 96 122.6 96 155.4V304c0 7.6 2.9 15.2 8.7 21 5.8 5.8 13.4 8.7 21 8.7s15.2-2.9 21-8.7c5.8-5.8 8.7-13.4 8.7-21V197.5l246.4 246.4c11.6 11.6 30.4
- 11.6 42 0 11.6-11.6 11.6-30.4 0-42L197.5 155.4z" p-id="1142" fill="#ffffff"></path>
- </svg></div>
- </div>
- <div style="width:100%; height:430px; float:left" id="wrap">
- <canvas id="draw"></canvas>1
- </div>
- <div style="width: 100%;
- height: 100%;
- overflow: hidden;
- margin:0;
- font-family:" 寰蒋闆呴粦";" id="baidumap">
- </div>
- </div>
- </div>
- </div>
- <div class="col-xl-3 col-lg-6 col-md-6 col-sm-12 col-12 layout-spacing"
- style="padding-right:5px;padding-left:5px;padding-bottom:5px;padding-top:5px;"
- id="gaojinghuizong">
- <div class="widget widget-one_hybrid widget-engagement" style="height:380px;">
- <div class='panel-head'>鍛婅姹囨��</div>
- <div id="s-col" class="" style="margin-top:50px">
- <input type="hidden" id="shebei" value="${shebei}">
- <input type="hidden" id="reWarningSummary_k" value="${reWarningSummary_k}">
- <input type="hidden" id="reWarningSummary_v" value="${reWarningSummary_v}">
- <input type="hidden" id="realAttendance_k" value="${realAttendance_k}">
- <input type="hidden" id="realAttendance_v" value="${realAttendance_v}">
- <input type="hidden" id="realtongji_k" value="${realtongji_k}">
- <input type="hidden" id="realtongji_v" value="${realtongji_v}">
- <input type="hidden" id="realshishi_k" value="${realshishi_k}">
- <input type="hidden" id="realshishi_v" value="${realshishi_v}">
- <input type="hidden" id="weizhi" value="${weizhi}">
- </div>
- </div>
- </div>
- <div class="col-xl-3 col-lg-6 col-md-6 col-sm-12 col-12 layout-spacing"
- style="bottom:100px;padding-right:5px;padding-left:5px;padding-bottom:5px;padding-top:5px;"
- id="tongjishuju">
- <div class="widget widget-one_hybrid widget-engagement" style="height:380px;">
- <div class='panel-head'>缁熻鏁版嵁</div>
- <div id="polarArea-chart" class="" style="margin-top:50px;">
- </div>
- </div>
- </div>
- <div class="col-xl-6 col-lg-6 col-md-6 col-sm-12 col-12 layout-spacing"
- style="padding-right:5px;padding-left:5px;padding-bottom:5px;padding-top:5px;"
- id="shishikaoqin">
- <div class="widget widget-one_hybrid widget-engagement">
- <div class="widget-heading" style="height:280px;">
- <div class='panel-head'>璁惧淇℃伅</div>
- <div class="table-responsive mb-4 mt-4" style="position:absolute;top:10px;">
- <table id="html5-extension" class="table table-hover"
- style="width:100%;">
- <thead>
- <tr align="center">
- <th style="padding:12px 5px;">鐘舵��</th>
- <th style="padding:12px 5px;">璁惧缂栧彿</th>
- <th style="padding:12px 5px;">缁戝畾瀵硅薄</th>
- <th style="padding:12px 5px;">鐗堟湰</th>
- <th style="padding:12px 5px;">璁惧璇︽儏</th>
- <th style="padding:12px 5px;">鏇存柊鏃堕棿</th>
- </tr>
- </thead>
- <tbody id="nr">
- <%-- <c:forEach items="${anchorManagementList}" var="list">
- <tr align="center">
- <td class="noExl">
- <c:choose>
- <c:when test="${list.anchormode == '0'}">
- <img src="hxzk/image/anchor/鍩虹珯绂荤嚎.png" />
- </c:when>
- <c:otherwise>
- <img src="hxzk/image/anchor/鍩虹珯鍦ㄧ嚎.png" />
- </c:otherwise>
- </c:choose>
- </td>
- <td>${list.anchorid}</td>
- <td>瀹氫綅鍩虹珯</td>
- <td>${list.version}</td>
- <td>${list.anchorip}</td>
- <td>${list.greateTime}</td>
- </tr>
- </c:forEach> --%>
- </tbody>
- </table>
- </div>
- </div>
- </div>
- </div>
- <div class="col-xl-3 col-lg-6 col-md-6 col-sm-12 col-12 layout-spacing"
- style="bottom:100px;padding-right:5px;padding-left:5px;padding-bottom:5px;padding-top:5px;"
- id="xianchanggongzhong">
- <div class="widget widget-one_hybrid widget-engagement" style="height:380px;">
- <div class='panel-head'>鐜板満宸ョ</div>
- <div id="donut-chart" class="" style="margin-top:50px;">
- </div>
- </div>
- </div>
-
- </div>
- </div>
- <!-- END CONTENT PART -->
- </div>
-
- <script>
- //var current_map;
- var current_floor;
- var current_map;
- function getMapNow() {
- var map;
- $.ajax({
- async: false,
- type: "POST",
- url: "/hxzkoa/qiehuanditu_get.do",
- dataType: 'json',
- data: {},
- success: function (data) {
- map = data[0];
- },
- })
- return map
- };
-
- $(document).ready(function () {
- App.init();
- $.ajax({
- async: false, //鍚屾鐨�
- type: "POST",
- url: "/hxzkoa/getSysSetting_list.do",
- data: {
-
- },
- dataType: "json",
- success: function (data) {
- title = data[0].title
- document.title = title;
- },
- });
-
- current_map = getMapNow();
- if (current_map == "鐧惧害鍦板浘") {
- document.getElementById("wrap").style.display = "none";
- diaoyongbaidumap();
-
- } else {
- document.getElementById("baidumap").style.display = "none";
- $.ajax({
- async: false,
- type: "POST",
- url: "/hxzkoa/getFloorByMapname.do",
- dataType: 'json',
- data: {
- map: current_map,
- },
- success: function (data) {
- current_floor = data[0].floor;
- diaoyonghuatu(current_floor);
- qufloor(current_floor);
- },
- });
-
- };
- });
- $('.header-page').load('/hxzkoa/hxzk/top.html'); $('.login-page').load('/hxzkoa/hxzk/head.html');
- var params = {
- zoomVal: 1,
- left: 0,
- top: 0,
- currentX: 0,
- currentY: 0,
- flag: false
- };
- </script>
-
- <!-- BEGIN FUNCTION SCRIPTS -->
-
- <script type="text/javascript">
- var timer1;//鍦板浘缂╁皬鏃剁殑timer
- var timer2;//鍦板浘鏀惧ぇ鏃剁殑timer
- //棣栭〉鍦板浘鎺у埗
- var expand = false;
-
- function changeMapSize() {
- if (expand == false) {
- //鐐瑰嚮鏀惧ぇ
- expand = true;
- modified = false;
- if (document.getElementById("wrap").style.display == "none") {
- //褰撳墠姝e湪浣跨敤鐧惧害鍦板浘
- document.getElementById('ditu').className = "col-xl-12 col-lg-6 col-md-6 col-sm-12 col-12 layout-spacing";
- document.getElementById("map").style.width = "100%";
- document.getElementById("map").style.height = "860px";
- document.getElementById("baidumap").style.width = "100%";
- document.getElementById("baidumap").style.height = "860px";
- //diaoyongbaidumap();
- } else if (document.getElementById("baidumap").style.display == "none") {
- //褰撳墠姝e湪浣跨敤瀹ゅ唴鍦板浘
- document.getElementById('ditu').className = "col-xl-12 col-lg-6 col-md-6 col-sm-12 col-12 layout-spacing";
- document.getElementById("map").style.width = "100%";
- document.getElementById("map").style.height = "960px";
- document.getElementById("maphead").style.width = "100%";
- document.getElementById("map_bg").style.height = "960px";
- document.getElementById("wrap").style.width = "100%";
- document.getElementById("wrap").style.height = "920px";
- document.getElementById("draw").style.width = "100%";
- document.getElementById("draw").style.height = "920px";
- diaoyonghuatu(current_floor);
- }
- document.getElementById("jizhanxinxi").style.display = "none";
- document.getElementById("gaojinghuizong").style.display = "none";
- document.getElementById("tongjishuju").style.display = "none";
- document.getElementById("shishikaoqin").style.display = "none";
- document.getElementById("xianchanggongzhong").style.display = "none";
- } else {
- //鏀惧ぇ鐘舵�佷笅鐐瑰嚮鎭㈠鍘熸牱
- expand = false;
- modified = false;
- document.getElementById("jizhanxinxi").style.display = "";
- if (document.getElementById("wrap").style.display == "none") {
- //褰撳墠姝e湪浣跨敤鐧惧害鍦板浘
- document.getElementById('ditu').className = "col-xl-6 col-lg-6 col-md-6 col-sm-12 col-12 layout-spacing";
- document.getElementById("map").style.width = null;
- document.getElementById("map").style.height = null;
- document.getElementById("baidumap").style.width = "100%";
- document.getElementById("baidumap").style.height = "100%";
- //diaoyongbaidumap();
- } else if (document.getElementById("baidumap").style.display == "none") {
- //褰撳墠姝e湪浣跨敤瀹ゅ唴鍦板浘
- document.getElementById('ditu').className = "col-xl-6 col-lg-6 col-md-6 col-sm-12 col-12 layout-spacing";
- document.getElementById("map").style.width = null;
- document.getElementById("map").style.height = "480px";
- document.getElementById("maphead").style.width = null;
- document.getElementById("map_bg").style.height = "480px";
- document.getElementById("wrap").style.width = "100%";
- document.getElementById("wrap").style.height = "430px";
- document.getElementById("draw").style.width = null;
- document.getElementById("draw").style.height = null;
- diaoyonghuatu(current_floor);
- }
- document.getElementById("gaojinghuizong").style.display = "";
- document.getElementById("jizhanxinxi").style.display = "";
- document.getElementById("tongjishuju").style.display = "";
- document.getElementById("shishikaoqin").style.display = "";
- document.getElementById("xianchanggongzhong").style.display = "";
- }
- };
-
- function getTruemap() {
- var map_wl = [];
- $.ajax({
- async: false,
- type: "POST",
- url: "/hxzkoa/floornumTomap.do",
- dataType: 'json',
- data: {
- value: current_floor,
- },
- success: function (data) {
- map_wl = [data[0].x_Truelength, data[0].y_Truewidth];
- },
- });
- return map_wl;
- };
-
- function getYuandian() {
- var map_wl = [];
- $.ajax({
- async: false,
- type: "POST",
- url: "/hxzkoa/floornumTomap.do",
- dataType: 'json',
- data: {
- value: current_floor
- },
- success: function (data) {
- yuandian = [data[0].x0_length, data[0].y0_width];
- },
- });
- return yuandian;
- };
-
- function getSystemSetting() {
- var sysset = [];
- $.ajax({
- async: false,
- type: 'POST',
- url: "/hxzkoa/getSysSetting_list.do",
- dataType: 'json',
- success: function (data) {
- sysset = data;
- },
- });
- return sysset;
- };
-
- function loadImages(sources, callback) {
- var count = 0,
- images = {},
- imgNum = 0;
- for (src in sources) {
- imgNum++;
- }
- for (src in sources) {
- images[src] = new Image();
-
- images[src].onload = function () {
- if (++count >= imgNum) {
- callback(images);
- }
- }
- images[src].src = sources[src];
- }
- };
-
- function getTrackColor(yanse) {
- var color;
- if (yanse == "绾㈣壊") {
- var color = "red";
- } else if (yanse == "缁胯壊") {
- var color = "green";
- } else if (yanse == "钃濊壊") {
- var color = "blue";
- } else if (yanse == "鐧借壊") {
- var color = "white";
- } else if (yanse == "榛戣壊") {
- var color = "black";
- } else if (yanse == "榛勮壊") {
- var color = "yellow";
- }
- return color
- };
-
- function getExistFence(leixing) {
- var fencelist = [];
- var fencecolor = [];
- var fencename = [];
- var fencetype = [];
- $.ajax({
- async: false,
- type: 'POST',
- url: "/hxzkoa/getFloorFence.do",
- dataType: 'json',
- data: {
- value: current_floor
- },
- success: function (data) {
- for (var i = 0; i < data.length; i++) {
- fencelist.push(data[i].zuobiao);
- fencecolor.push(data[i].color);
- fencename.push(data[i].name);
- fencetype.push(data[i].type);
- }
- }
- });
- if (leixing == "zuobiao") {
- return fencelist
- } else if (leixing == "color") {
- return fencecolor
- } else if (leixing == "name") {
- return fencename
- } else if (leixing == "type") {
- return fencetype
- };
- };
-
- function getDrawColor(yanse) {
- var color;
- if (yanse == "绾㈣壊") {
- var color = "rgba(255,0,0,0.3)";
- } else if (yanse == "缁胯壊") {
- var color = "rgba(0,255,0,0.3)";
- } else if (yanse == "钃濊壊") {
- var color = "rgba(0,0,255,0.3)";
- } else if (yanse == "鐧借壊") {
- var color = "rgba(255,255,255,0.3)";
- } else if (yanse == "榛戣壊") {
- var color = "rgba(0,0,0,0.3)";
- }
- return color
- };
-
- function inFenceOrNot(fence_list, node_list) {
- //fence_list[x,y]
- //node_list[x,y]
- if (fence_list.length == 2) { //鐭╁舰
- if (node_list[0] >= Math.min(fence_list[0][0], fence_list[1][0]) && node_list[0] <= Math.max(fence_list[0][0], fence_list[1][0])) {
- if (node_list[1] >= Math.min(fence_list[0][1], fence_list[1][1]) && node_list[1] <= Math.max(fence_list[0][1], fence_list[1][1])) {
- return true //鍦ㄨ�冨嫟鍖哄煙
- }
- }
- return false //涓嶅湪鑰冨嫟鍖哄煙
- } else if (fence_list.length > 2) { //澶氳竟褰�
- for (var c = false, i = -1, l = fence_list.length, j = l - 1; ++i < l; j = i)
- ((fence_list[i][1] <= node_list[1] && node_list[1] < fence_list[j][1]) || (fence_list[j][1] <= node_list[1] && node_list[1] < fence_list[i][1]))
- && (node_list[0] < (fence_list[j][0] - fence_list[i][0]) * (node_list[1] - fence_list[i][1]) / (fence_list[j][1] - fence_list[i][1]) + fence_list[i][0])
- && (c = !c);
- return c;
- }
- };
-
- function getGas(leixing) {
- var gaslist = [];
- var gasnongdu = [];
- var gastype = [];
- $.ajax({
- async: false,
- type: 'POST',
- url: "/hxzkoa/getGas_list.do",
- dataType: 'json',
- data: {},
- success: function (data) {
- for (var i = 0; i < data.length; i++) {
- gaslist.push([data[i].x, data[i].y]);
- gasnongdu.push(data[i].nong_du);
- gastype.push(data[i].gas_type);
- }
- }
- });
- if (leixing == "zuobiao") {
- return gaslist
- } else if (leixing == "type") {
- return gastype
- } else if (leixing == "nongdu") {
- return gasnongdu
- };
- };
-
- function getRealPosition() {
- var realposition = [];
- $.ajax({
- async: false,
- type: 'POST',
- url: "/hxzkoa/getRealPosition.do",
- dataType: 'json',
- data: {
- floor: current_floor,
- },
- success: function (data) {
- for (var i = 0; i < data.length; i++) {
- //playMark[id,name,power,life,x,y,time]
- realposition.push([data[i].tagid, data[i].name, data[i].power, data[i].life, data[i].posx, data[i].posy, data[i].time, data[i].fence == 1 || data[i].sos == 1, data[i].sos, data[i].fence])
- }
- },
- });
- return realposition
- };
-
- function getstatus(tagida) {
- var panduan;
- $.ajax({
- async: false,
- type: 'POST',
- url: "/hxzkoa/getstatus.do",
- dataType: 'JSON',
- data: {
- tagid: tagida
- },
- success: function (data) {
- panduan = data
- }
- })
- return panduan;
- }
-
- function str_to_time(str) {
- //鏍规嵁瀛楃涓茶浆鎹㈡垚瀵瑰簲鐨勬椂闂达紙绉掞級
- if (str == "涓嶆樉绀哄疄鏃惰建杩�") {
- return 0;
- } else if (str == "10绉掗挓") {
- return 10;
- } else if (str == "30绉掗挓") {
- return 30;
- } else if (str == "1鍒嗛挓") {
- return 60;
- } else if (str == "10鍒嗛挓") {
- return 600;
- } else if (str == "30鍒嗛挓") {
- return 1800;
- } else if (str == "1灏忔椂") {
- return 3600;
- };
- };
-
- function getTracknow(tagid_str, time) {
- var finalrealtrack = {};
- $.ajax({
- async: false,
- type: 'POST',
- url: "/hxzkoa/getRealTrack.do",
- dataType: 'json',
- data: {
- time: time,
- floor: current_floor,
- tagid: tagid_str,
- },
- success: function (data) {
- for (var i = 0; i < data.length; i++) {
- finalrealtrack[data[i][0].tagid] = [];
- for (var j = 0; j < data[i].length; j++) {
- finalrealtrack[data[i][0].tagid].push([data[i][j].x, data[i][j].y, data[i][j].time])
- }
- }
- //for (var i=0;i<data.length;i++)
- /* let tmp = new Set();
- for (var i=0;i<data.length;i++){
- tmp.add(data[i].tagid);
- };
- let tmpl = Array.from(tmp);
- for (i in tmpl){
- realtrack[tmpl[i]]=[];
- finalrealtrack[tmpl[i]]=[];
- }
- for(var i=0; i<data.length; i++){
- realtrack[data[i].tagid].push([data[i].x, data[i].y, data[i].time])
- }
- for (var i in realtrack){
- if (realtrack[i].length>50){
- var itvl = new Number(realtrack[i].length/50);
- var tmp_result = [];
- for (j=0;i<realtrack[i].length;j+=itvl){
- tmp_result.push(realtrack[i][j])
- }
- finalrealtrack[i]=tmp_result;
- } else {
- finalrealtrack[i]=realtrack[i]
- }
- } */
- },
- });
- return finalrealtrack;
- };
-
- function getAnchorInfo() {
- var online_anchorList = [];
- var offline_anchorList = [];
- $.ajax({
- async: false,
- type: 'POST',
- url: "/hxzkoa/getAnchorInfo.do",
- dataType: 'json',
- data: {
- floor: current_floor,
- },
- success: function (data) {
- for (var i = 0; i < data.length; i++) {
- tmplist = [data[i].anchorid, data[i].posx, data[i].posy, data[i].posz, data[i].GreateTime];
- if (data[i].anchormode == "1") {
- online_anchorList.push(tmplist);
- } else if (data[i].anchormode == "0") {
- offline_anchorList.push(tmplist);
- }
- }
- }
- });
- return [online_anchorList, offline_anchorList]
- };
-
- function ToDigital(strDu, strFen, strMiao, len) {
- len = (len > 6 || typeof (len) == "undefined") ? 6 : len;//绮剧‘鍒板皬鏁扮偣鍚庢渶澶氬叚浣�
- strDu = (typeof (strDu) == "undefined" || strDu == "") ? 0 : parseFloat(strDu);
- strFen = (typeof (strFen) == "undefined" || strFen == "") ? 0 : parseFloat(strFen) / 60;
- strMiao = (typeof (strMiao) == "undefined" || strMiao == "") ? 0 : parseFloat(strMiao) / 60; //绉掍负鍒嗙殑鏍煎紡
- var digital = strDu + strFen + strMiao;
- if (digital == 0) {
- return "";
- } else {
- return digital.toFixed(len);
- }
- };
-
- function getGPS() {
- var gpslist = [];
- $.ajax({
- async: false,
- type: 'POST',
- traditional: true,
- url: "/hxzkoa/getGPS.do",
- dataType: 'json',
- data: {},
- success: function (data) {
- //缁忕含搴︿粠搴﹀垎绉掕浆鎴愬害
- for (var i = 0; i < data.length; i++) {
- if (data[i].gps_weidu != "" && data[i].gsp_jingdu != "") {
- //data[i].gps_weidu="3951.74908"
- var weidu = ToDigital(data[i].gps_weidu.substring(0, 2), data[i].gps_weidu.substring(2, 4), data[i].gps_weidu.substring(4));
- if (data[i].gps_NS == "S") {
- weidu = String(0 - weidu);
- };
- //data[i].gsp_jingdu="11615.43424"
- var jingdu = ToDigital(data[i].gsp_jingdu.substring(0, 3), data[i].gsp_jingdu.substring(3, 5), data[i].gsp_jingdu.substring(5));
- if (data[i].gps_EW == "W") {
- jingdu = String(0 - jingdu);
- };
- gpslist.push([data[i].tagid, jingdu, weidu, data[i].gps_haiba_gao, data[i].gps_state, data[i].gps_num, data[i].gps_hdop, data[i].gps_tuoqiu, data[i].gps_chafen_time, data[i].gps_chafen_id, data[i].gps_jiaoyan, data[i].gps_kahao, data[i].gps_power, data[i].gps_sos, data[i].addtime, data[i].name]);
- }
- };
- },
- });
- return gpslist;
- };
-
- function Queue() {
- let items = [];
- // 鍚戦槦鍒楁坊鍔犲厓绱狅紙涓�涓垨澶氫釜锛�
- this.enqueue = function (element) {
- if (element instanceof Array) items = items.concat(element);
- else items.push(element);
- };
- this.enqueue_list = function (element) {
- items.push(element);
- };
- // 浠庨槦鍒楃Щ闄ゅ厓绱�
- this.dequeue = function () {
- return items.shift();
- };
- // 杩斿洖闃熷垪涓殑绗竴涓厓绱�
- this.front = function () {
- return items[0];
- };
- // 杩斿洖闃熷垪鐨勯暱搴�
- this.size = function () {
- return items.length;
- };
- // 娓呯┖闃熷垪
- this.clear = function () {
- items = [];
- };
-
- // 鎵撳嵃闃熷垪鍐呯殑鎵�鏈夊厓绱�
- this.print = function () {
- };
- };
-
- /**璇ユ柟娉曠敤鏉ョ粯鍒朵竴涓湁濉厖鑹茬殑鍦嗚鐭╁舰
- *@param cxt:canvas鐨勪笂涓嬫枃鐜
- *@param x:宸︿笂瑙抶杞村潗鏍�
- *@param y:宸︿笂瑙抷杞村潗鏍�
- *@param width:鐭╁舰鐨勫搴�
- *@param height:鐭╁舰鐨勯珮搴�
- *@param radius:鍦嗙殑鍗婂緞
- *@param fillColor:濉厖棰滆壊
- **/
- function fillRoundRect(cxt, x, y, width, height, radius, /*optional*/ fillColor) {
- //鍦嗙殑鐩村緞蹇呯劧瑕佸皬浜庣煩褰㈢殑瀹介珮
- if (2 * radius > width || 2 * radius > height) { return false; }
-
- cxt.save();
- cxt.translate(x, y);
- //缁樺埗鍦嗚鐭╁舰鐨勫悇涓竟
- drawRoundRectPath(cxt, width, height, radius);
- cxt.fillStyle = fillColor || "#000"; //鑻ユ槸缁欏畾浜嗗�煎氨鐢ㄧ粰瀹氱殑鍊煎惁鍒欑粰浜堥粯璁ゅ��
- cxt.fill();
- cxt.restore();
- }
-
- function drawRoundRectPath(cxt, width, height, radius) {
- cxt.beginPath(0);
- //浠庡彸涓嬭椤烘椂閽堢粯鍒讹紝寮у害浠�0鍒�1/2PI
- cxt.arc(width - radius, height - radius, radius, 0, Math.PI / 2);
-
- //鐭╁舰涓嬭竟绾�
- cxt.lineTo(radius, height);
-
- //宸︿笅瑙掑渾寮э紝寮у害浠�1/2PI鍒癙I
- cxt.arc(radius, height - radius, radius, Math.PI / 2, Math.PI);
-
- //鐭╁舰宸﹁竟绾�
- cxt.lineTo(0, radius);
-
- //宸︿笂瑙掑渾寮э紝寮у害浠嶱I鍒�3/2PI
- cxt.arc(radius, radius, radius, Math.PI, Math.PI * 3 / 2);
-
- //涓婅竟绾�
- cxt.lineTo(width - radius, 0);
-
- //鍙充笂瑙掑渾寮�
- cxt.arc(width - radius, radius, radius, Math.PI * 3 / 2, Math.PI * 2);
-
- //鍙宠竟绾�
- cxt.lineTo(width, height - radius);
- cxt.closePath();
- }
-
- function isEmptyObject(obj) {
- for (var n in obj) {
- return false
- }
- return true;
- }
- </script>
-
- <!-- 鐧惧害鍦板浘鍔熻兘 -->
- <script type="text/javascript">
-
- function Convertor(ak) {
- this.stepCount = 100;
- this.pointCount = [];
- this.Result = [];
- this.NoisIndex = [];
- this.Time = new Date();
- this.AK = ak;
- this.M_PI = 3.14159265358979324;
- this.A = 6378245.0;
- this.EE = 0.00669342162296594323;
- this.X_PI = this.M_PI * 3000.0 / 180.0;
- }
- Convertor.prototype.outofChine = function(p) {
- if (p.lng < 72.004 || p.lng > 137.8347) {
- return true;
- }
- if (p.lat < 0.8293 || p.lat > 55.8271) {
- return true;
- }
- return false;
- }
- ;
- Convertor.prototype.WGS2GCJ_lat = function(x, y) {
- var ret1 = -100.0 + 2.0 * x + 3.0 * y + 0.2 * y * y + 0.1 * x * y + 0.2 * Math.sqrt(Math.abs(x));
- ret1 += (20.0 * Math.sin(6.0 * x * this.M_PI) + 20.0 * Math.sin(2.0 * x * this.M_PI)) * 2.0 / 3.0;
- ret1 += (20.0 * Math.sin(y * this.M_PI) + 40.0 * Math.sin(y / 3.0 * this.M_PI)) * 2.0 / 3.0;
- ret1 += (160.0 * Math.sin(y / 12.0 * this.M_PI) + 320 * Math.sin(y * this.M_PI / 30.0)) * 2.0 / 3.0;
- return ret1;
- }
- ;
- Convertor.prototype.WGS2GCJ_lng = function(x, y) {
- var ret2 = 300.0 + x + 2.0 * y + 0.1 * x * x + 0.1 * x * y + 0.1 * Math.sqrt(Math.abs(x));
- ret2 += (20.0 * Math.sin(6.0 * x * this.M_PI) + 20.0 * Math.sin(2.0 * x * this.M_PI)) * 2.0 / 3.0;
- ret2 += (20.0 * Math.sin(x * this.M_PI) + 40.0 * Math.sin(x / 3.0 * this.M_PI)) * 2.0 / 3.0;
- ret2 += (150.0 * Math.sin(x / 12.0 * this.M_PI) + 300.0 * Math.sin(x / 30.0 * this.M_PI)) * 2.0 / 3.0;
- return ret2;
- }
- ;
- Convertor.prototype.WGS2GCJ = function(poi) {
- if (this.outofChine(poi)) {
- return;
- }
- var poi2 = {};
- var dLat = this.WGS2GCJ_lat(poi.lng - 105.0, poi.lat - 35.0);
- var dLon = this.WGS2GCJ_lng(poi.lng - 105.0, poi.lat - 35.0);
- var radLat = poi.lat / 180.0 * this.M_PI;
- var magic = Math.sin(radLat);
- magic = 1 - this.EE * magic * magic;
- var sqrtMagic = Math.sqrt(magic);
- dLat = (dLat * 180.0) / ((this.A * (1 - this.EE)) / (magic * sqrtMagic) * this.M_PI);
- dLon = (dLon * 180.0) / (this.A / sqrtMagic * Math.cos(radLat) * this.M_PI);
- poi2.lat = poi.lat + dLat;
- poi2.lng = poi.lng + dLon;
- return poi2;
- }
- ;
- Convertor.prototype.GCJ2BD09 = function(poi) {
- var poi2 = {};
- var x = poi.lng
- , y = poi.lat;
- var z = Math.sqrt(x * x + y * y) + 0.00002 * Math.sin(y * this.X_PI);
- var theta = Math.atan2(y, x) + 0.000003 * Math.cos(x * this.X_PI);
- poi2.lng = z * Math.cos(theta) + 0.0065;
- poi2.lat = z * Math.sin(theta) + 0.006;
- return poi2;
- }
- ;
- /**
- * WGS->鐧惧害鍧愭爣绯�
- */
- Convertor.prototype.WGS2BD09 = function(poi) {
- //WGS->GCJ
- var poi2 = this.WGS2GCJ(poi);
- if (typeof poi2 === "undefined") {
- return;
- }
- //GCJ->鐧惧害鍧愭爣绯�
- return this.GCJ2BD09(poi2);
- }
-
- function zhuanhuan(aaa) {
- var c=new Convertor();
- var bbb = [];
- for(var i = 0; i < aaa.length; i++){
- var rr = c.WGS2BD09({lng:aaa[i].lng,lat:aaa[i].lat});
- bbb.push(rr);
- }
- return bbb;
- }
-
- function diaoyongbaidumap() {
- //璇诲彇绯荤粺璁剧疆
- var bm_sysSetting = getSystemSetting();
- var bm_tagZb = bm_sysSetting[0].tagZb;//鏄惁鏄剧ず鏍囩鍧愭爣
- var bm_viewName = bm_sysSetting[0].viewName;//鏄惁鏄剧ず浜哄憳鍚嶇О
- var bm_viewPower = bm_sysSetting[0].viewPower;//鏄惁鏄剧ず鐢甸噺
- var bm_viewTagid = bm_sysSetting[0].viewTagid;//鏄惁鏄剧ず鏍囩ID
- var bm_offView = bm_sysSetting[0].offView;//鏄惁绂荤嚎涓嶆樉绀哄浘鏍�
- var bm_quiet = bm_sysSetting[0].quiet;//闈欐杈撳嚭鍥哄畾鍧愭爣
- var bm_name = bm_sysSetting[0].viewName;//鏄惁鏄剧ず浜哄憳濮撳悕
- var bm_baidu_j = bm_sysSetting[0].baidu_j;//鐧惧害鍦板浘绮惧害
- var bm_baidu_w = bm_sysSetting[0].baidu_w;//鐧惧害鍦板浘缁村害
-
- // 鐧惧害鍦板浘API鍔熻兘
- var bm = new BMap.Map("baidumap"); // 鍒涘缓Map瀹炰緥
-
- bm.centerAndZoom(new BMap.Point(bm_baidu_j, bm_baidu_w), 12); // 鍒濆鍖栧湴鍥�,璁剧疆涓績鐐瑰潗鏍囧拰鍦板浘绾у埆
- //娣诲姞鍦板浘绫诲瀷鎺т欢
- var opts = { type: BMAP_NAVIGATION_CONTROL_ZOOM }; //浠呬繚鐣欐帶浠剁缉鏀鹃儴鍒�
- bm.addControl(new BMap.NavigationControl(opts)); //娣诲姞瀵艰埅鎺т欢
- //map.addControl(new BMap.OverviewMapControl());
- bm.setCurrentCity("鍖椾含"); // 璁剧疆鍦板浘鏄剧ず鐨勫煄甯� 姝ら」鏄繀椤昏缃殑
- bm.enableScrollWheelZoom(true); //寮�鍚紶鏍囨粴杞缉鏀�
- bm.addControl(new BMap.MapTypeControl({
- mapTypes: [
- BMAP_NORMAL_MAP,
- BMAP_SATELLITE_MAP,
- BMAP_HYBRID_MAP
- ]
- }));
-
- var myIcon = new BMap.Icon("/hxzkoa/hxzk/image/targeticon/default.png", new BMap.Size(40, 40), {
- //浣跨敤鑷畾涔夋爣娉ㄦ椂锛屾寚鍚戠殑鍦扮悊浣嶇疆浣嶄簬鍥剧墖鐨勪腑蹇冪偣
- //anchor涓哄浘鐗囧乏涓婅鐩稿浜庡湴鐞嗕綅缃殑鍋忕Щ閲忥紝姝ゆ椂鎸囧悜鐨勫湴鐞嗕綅缃綅浜庡浘鏍囦腑蹇冩渶涓嬫柟
- anchor: new BMap.Size(20, 40)
- }
- );
-
- //current_node_list涓簕key(tagid):zuobiao_mark}
- var current_node_list = new Array();
- //var current_node_list = new Queue();
-
- /* function getGPSInfo(data){
- return "GPS鐘舵��:"+gps_node_list[current_gps_index][4]+"\n姝e湪浣跨敤鐨勫崼鏄熸暟閲�:"+gps_node_list[current_gps_index][5]+"\nHDOP姘村钩绮惧害鍥犲瓙:"+gps_node_list[current_gps_index][6]+"\n鍦扮悆妞悆闈㈢浉瀵瑰ぇ鍦版按鍑嗛潰鐨勯珮搴�:"+gps_node_list[current_gps_index][7]+
- "\n宸垎鏃堕棿:"+gps_node_list[current_gps_index][8]+"\n宸垎绔橧D鍙�:"+gps_node_list[current_gps_index][9]+"\n鏍¢獙鍊�:"+gps_node_list[current_gps_index][10]+"\n璁惧鐗╄仈缃戝崱鍙�:"+gps_node_list[current_gps_index][11]+"\n璁惧SOS鐘舵��:"+gps_node_list[current_gps_index][13]
- +"\n娣诲姞鏃堕棿"+gps_node_list[current_gps_index][14]
- }; */
-
- var t = 300; //姣�600ms浠庡悗鍙拌姹備竴娆℃渶鏂扮殑鏁版嵁
- fn();
-
- var timer = setTimeout(function f() {
- fn();
- timer = setTimeout(f, 300);
- }, t);
-
- //timer_bm = setTimeout(fn ,t);
-
- function fn() {
- //鑾峰彇gps鍧愭爣, [tagid, jingdu, weidu, gps_haiba_gao, gps_state, gps_num, gps_hdop, gps_tuoqiu, gps_chafen_time, gps_chafen_id, gps_jiaoyan, gps_kahao, gps_power, gps_sos, addtime]
- var gps_node_list = getGPS();
- var gpslist = [];
- //鍧愭爣杞崲瀹屼箣鍚庣殑鍥炶皟鍑芥暟
- translateCallback = function (data) {
- // if (data.status == 0) {
- for (var l = 0;l < data.points.length; l++){
- gpslist.push(data.points[l])
- }
- for(var i = 0;i<gpslist.length;i++){
- console.log(gpslist[i].lng)
- console.log(gpslist[i].lat)
- }
- if (gpslist.length == gps_node_list.length) {
- for (var i = 0; i < gpslist.length; i++) {
- var zhuangtaia = getstatus(gps_node_list[i][0]);
- if (current_node_list[gps_node_list[i][0]].size() > 0) {
- old_mark = current_node_list[gps_node_list[i][0]].front();
- current_node_list[gps_node_list[i][0]].dequeue();
- bm.removeOverlay(old_mark);//娓呴櫎涓婁竴涓�
- }
- if ((bm_offView == '1' && zhuangtaia == '1') || (bm_offView == '0')) {
- marker = new BMap.Marker(gpslist[i], { icon: myIcon });
- bm.addOverlay(marker);
- current_node_list[gps_node_list[i][0]].enqueue(marker);
-
- if (bm_viewTagid == "1") {
- var tagid = new BMap.Label(gps_node_list[i][0], { offset: new BMap.Size(20, -30) });
- tagid.setStyle({
- color: "#fff",
- fontSize: "14px",
- borderRadius: "5px",
- padding: "5px 5px",
- border: "0",
- backgroundColor: "#32CD32",
- transform: 'translateX(-50%)',
- });
- marker.setLabel(tagid); //娣诲姞label-tagid
- }
- if (bm_tagZb == "1") {
- var zuobiao = new BMap.Label(gps_node_list[i][1] + ',' + gps_node_list[i][2], { offset: new BMap.Size(20, +40) });
- zuobiao.setStyle({ transform: 'translateX(-50%)' });
- marker.setLabel(zuobiao);
- }
- if (bm_viewPower == "1") {
- var dianliang = new BMap.Label("璁惧鐢甸噺" + gps_node_list[i][12], { offset: new BMap.Size(20, +80) });
- dianliang.setStyle({ transform: 'translateX(-50%)' });
- marker.setLabel(dianliang);
- }
- if (bm_name=="1") {
- var name=new BMap.Label("璁惧鍚嶇О:"+gps_node_list[i][15],{offset:new BMap.Size(20,+60)});
- name.setStyle({transform: 'translateX(-50%)'});
- marker.setLabel(name); //娣诲姞label-tagid
- }
- /* // 鍒涘缓淇℃伅绐楀彛
- var opts = {
- width: 200,
- height: 100,
- title: '褰撳墠鍧愭爣淇℃伅'
- };
- var infoWindow = new BMap.InfoWindow(getGPSInfo(data.points[0]), opts);
- // 鐐规爣璁版坊鍔犵偣鍑讳簨浠�
- marker.addEventListener('click', function () {
- bm.openInfoWindow(infoWindow, point); // 寮�鍚俊鎭獥鍙�
- }); */
-
- //bm.setCenter(data.points[i]);
- }
- }
- gpslist = [];
- }
- // }
- /* if(data.status === 0) {
- var marker = new BMap.Marker(data.points[0], {
- icon: myIcon
- });
-
- //var marker = new BMap.Marker(data.points[0]);
- bm.addOverlay(marker);
- if (bm_viewTagid=="1"){
- var tagid=new BMap.Label("璁惧ID:"+gps_node_list[current_gps_index][0],{offset:new BMap.Size(0,-20)});
- marker.setLabel(tagid); //娣诲姞label-tagid
- }
- if (bm_tagZb=="1"){
- var zuobiao = new BMap.Label("璁惧鍧愭爣:"+gps_node_list[current_gps_index][1]+','+gps_node_list[current_gps_index][2],{offset:new BMap.Size(-20,30)});
- marker.setLabel(zuobiao);
- }
- if (bm_viewPower=="1"){
- var dianliang = new BMap.Label("璁惧鐢甸噺"+gps_node_list[current_gps_index][12],{offset:new BMap.Size(20,5)});
- marker.setLabel(dianliang);
- }
- // 鍒涘缓淇℃伅绐楀彛
- var opts = {
- width: 200,
- height: 100,
- title: '褰撳墠鍧愭爣淇℃伅'
- };
- var infoWindow = new BMap.InfoWindow(getGPSInfo(data.points[0]), opts);
- // 鐐规爣璁版坊鍔犵偣鍑讳簨浠�
- marker.addEventListener('click', function () {
- bm.openInfoWindow(infoWindow, point); // 寮�鍚俊鎭獥鍙�
- });
-
- bm.setCenter(data.points[0]);
- } */
- };
-
- //bm.clearOverlays();
- var points = [];
- var allPoint = [];
- if (gps_node_list.length != 0) {
- for (var i = 0; i < gps_node_list.length; i++) {
- if (current_node_list[gps_node_list[i][0]] == null) {
- current_node_list[gps_node_list[i][0]] = new Queue();
- }
- var point = new BMap.Point(new Number(gps_node_list[i][1]), new Number(gps_node_list[i][2]));
- points.push(point);
- };
- var convertor = new BMap.Convertor();
- var translatePoint = [];
- for (var i=0; i<points.length;i+=10){
- translatePoint.push(points.slice(i,i+10)); // 浠庡凡鏈夌殑鏁扮粍涓繑鍥為�夊畾鐨勫厓绱�,璇ユ柟娉曞苟涓嶄細淇敼鏁扮粍锛岃�屾槸杩斿洖涓�涓瓙鏁扮粍
- }
- for (var i=0 ;i<translatePoint.length;i++){
- (function (index) {
- convertor.translate(translatePoint[index],1,5,translateCallback);
- })(i);
- }
- //convertor.translate(pointArr, 1, 5, translateCallback);
- }
- // else {
- // current_node_list.clear();
- // bm.clearOverlays();
- // }
-
-
- /**
- * 鍧愭爣甯搁噺璇存槑锛�
- * COORDINATES_WGS84 = 1, WGS84鍧愭爣
- * COORDINATES_WGS84_MC = 2, WGS84鐨勫钩闈㈠ⅷ鍗℃墭鍧愭爣
- * COORDINATES_GCJ02 = 3锛孏CJ02鍧愭爣
- * COORDINATES_GCJ02_MC = 4, GCJ02鐨勫钩闈㈠ⅷ鍗℃墭鍧愭爣
- * COORDINATES_BD09 = 5, 鐧惧害bd09缁忕含搴﹀潗鏍�
- * COORDINATES_BD09_MC = 6锛岀櫨搴d09澧ㄥ崱鎵樺潗鏍�
- * COORDINATES_MAPBAR = 7锛宮apbar鍦板浘鍧愭爣
- * COORDINATES_51 = 8锛�51鍦板浘鍧愭爣
- */
-
- };
- };
- </script>
- <!-- 鐧惧害鍦板浘鍔熻兘缁撴潫 -->
-
- <!-- 瀹ゅ唴瀹氫綅鍦板浘鍔熻兘 -->
- <script>
- // img map related
- //if (current_map!="鐧惧害鍦板浘"){
- function diaoyonghuatu(current_floor) {
- var imgUrl = '/hxzkoa/hxzk/image/mapfile/' + current_map;//鍥剧墖璺緞
- //var imgUrl = '/hxzkoa/hxzk/image/mapfile/office.jpg';//鍥剧墖璺緞
- var imgList = new Array();
- imgList['map'] = imgUrl;
- var iconUrl = '/hxzkoa/hxzk/image/targeticon/default.png';
- imgList['icon'] = iconUrl;
-
- var anckicon_on = '/hxzkoa/hxzk/image/anchor/鍩虹珯鍦ㄧ嚎.png';
- //var anckicon_on = '/hxzkoa/hxzk/image/anchor/lingjin.png';
- imgList['anchor_online'] = anckicon_on;
-
- var anckicon_off = '/hxzkoa/hxzk/image/anchor/鍩虹珯绂荤嚎.png'
- //var anckicon_off = '/hxzkoa/hxzk/image/anchor/ceju.png';
- imgList['anchor_offline'] = anckicon_off;
- new MarkPoints(imgList);
- }
- var tuodong = false;
- var sosType = true;
- var sos = document.createElement('img');
- sos.src = '/hxzkoa/hxzk/image/icon/SOS.png';
- var sos1 = document.createElement('img');
- sos1.src = '/hxzkoa/hxzk/image/icon/SOS1.png';
-
- function MarkPoints(imgList) {
- this.imgX = 0;//鍦ㄧ敾甯冧笂鍥剧墖鐨刋鍋忕Щ閲�
- this.imgScale = 1;//鍥剧墖鐨勭缉鏀炬瘮渚�
- this.imgY = 0;//鍦ㄧ敾甯冧笂鍥剧墖鐨刌鍋忕Щ閲�
- this.rateNum;//鍥剧墖楂樺害鑷�傚簲姣斾緥,鍥剧墖绛夋瘮灞呬腑灞曠ず鍦╟anvas
- this.scaleFlag = 0;//缂╂斁鍥犲瓙锛屾渶澶х缉鏀�9,鏈�灏忕缉鏀�-9
- this.context;
- this.img; //鍦板浘
- this.playIndex = 0;
- this.pos = {};//姣忔鎷栨嫿鍓嶅潗鏍囦繚瀛�
-
- this.imgLoadList = new Array();
- this.rateNumList = new Array();
- this.imgXList = new Array();
- this.imgYList = new Array();
- this.imgScaleList = new Array();
-
- //鑾峰彇鐪熷疄鍦板浘
- this.trueMeasure;
- this.trueLength;
- this.trueWidth;
- this.x_ratio;
- this.y_ratio;
- this.x_x0;
- this.y_y0;
-
- //system setting
- this.sysSetting;
- this.tagZb = '0';//鏄惁鏄剧ず鏍囩鍧愭爣
- this.diskaoqin = '0'; //鍑鸿�冨嫟鍖哄煙鏄惁娑堝け
- this.viewAnckid = '0';//鏄惁鏄剧ず鍩虹珯ID
- this.viewName = '0';//鏄惁鏄剧ず浜哄憳鍚嶇О
- this.tunlDw = '0'//闅ч亾瀹氫綅妯″紡
- this.guiji_sava = '0'//鏄惁寮�鍚建杩逛繚瀛�
- this.viewPower = '0';//鏄惁鏄剧ず鐢甸噺
- this.viewTagid = '0';//鏄惁鏄剧ず鏍囩ID
- this.viewAnckzb = '0';//鏄惁鏄剧ず鍩虹珯鍧愭爣
- this.offView = '0'//鏄惁绂荤嚎涓嶆樉绀哄浘鏍�
- this.anckicon = '0'//鏄惁鏄剧ず鍩虹珯鍥炬爣
- this.gas_show = '0'//鏄剧ず鍏朵粬妫�娴�(姘斾綋鏄剧ず)
- this.quiet = '0'//闈欐杈撳嚭鍥哄畾鍧愭爣
- this.real_trak_time = 0//瀹炴椂杞ㄨ抗鏄剧ず鏃堕暱
- this.real_trak_color = '绾㈣壊'//瀹炴椂杞ㄨ抗鏄剧ず鐨勯鑹�
-
- this.playFlag = false;//鏄惁鎾斁
- this.dragFlag = false;//鏄惁鍙嫋鎷藉綋鍓峣mg锛岄粯璁や笉鑳�
- this.markFlag = false;//鏍囪鍖哄煙寮�鍚叧闂璮lag
- this.CreatLinepoints = [];//姣忔鍒涘缓鏂板尯鍩熺殑鍧愭爣闆嗗悎
- this.playMark; //姝e湪灞曠ず鐨勬爣璁�
- this.playMarkInKaoQin;//褰撳墠鏍囪鏄惁鍦ㄨ�冨嫟鍖哄煙鍐�
- this.trackNow; //褰撳墠杞ㄨ抗
-
- this.onlineAnchorList;//褰撳墠鍦ㄧ嚎鍩虹珯鍒楄〃
- this.offlineAnchorList;//褰撳墠绂荤嚎鍩虹珯鍒楄〃
-
- this.allMarkLins = [];//宸插垱寤虹殑鍖哄煙闆嗗悎锛屼緥濡俒[{x,y},{x,y},{x,y}],[{n,m},{n,m},{n,m}]]鐩墠鍙渶瑕佷竴涓尯鍩燂紝鎵�浠ユ暟缁勫唴閮ㄥ彧鏈変竴椤�
- this.allFenceColor = [];//宸插垱寤虹殑鍖哄煙棰滆壊
-
- this.FenceList; //鍥存爮鍧愭爣
- this.FenceColor; //鍥存爮棰滆壊
- this.FenceName; //鍥存爮鍚嶇О
- this.realFenceList = []; // [鍚嶇О锛岀被鍨嬶紝瀹為檯鍧愭爣]
- this.fenceMarkCount; //鍖哄煙鍐呯殑鍧愭爣鏁伴噺
- this.cacheCanvas = null; //缂撳瓨鍥存爮缁樺浘
-
- this.GasList; //姘斾綋鍧愭爣
- this.GasType; //姘斾綋绫诲瀷
- this.GasNongdu; //姘斾綋娴撳害
-
- this.getImgLoad(imgList);
- this.init();
- document.oncontextmenu = new Function("event.returnValue=false;");
- document.onselectstart = new Function("event.returnValue=false;");
- };
-
- MarkPoints.prototype = {
- getImgLoad: function (imgList) {
- var _this = this;
- var wrap = document.getElementById('wrap');
- _this.canvas = document.getElementById('draw');
- _this.context = draw.getContext('2d');
- _this.canvas.height = wrap.offsetHeight;
- _this.canvas.width = wrap.offsetWidth;
-
- loadImages(imgList, function (images) {
- for (var key in images) {
- if (key == 'map') {
- _this.imgScaleList[key] = 1;
- _this.img = images[key];
- } else if (key == 'icon') {
- _this.imgScaleList[key] = 0.037;
- } else {
- _this.imgScaleList[key] = images[key].naturalWidth / images['map'].naturalWidth;
- };
- _this.rateNumList[key] = _this.canvas.width / images[key].naturalWidth;
- _this.imgXList[key] = (_this.canvas.width - images[key].naturalWidth * _this.imgScaleList[key] * _this.rateNumList[key]) / 2;
- _this.imgYList[key] = (_this.canvas.height - images[key].naturalHeight * _this.imgScaleList[key] * _this.rateNumList[key]) / 2;//榛樿杩涙潵褰撳墠鍥惧儚灞呬腑鏄剧ず
- _this.imgLoadList[key] = images[key];
- }
- /*鐢诲嚭褰撳墠鍥剧墖*/
- //_this.drawImg();
- });
- },
-
- drawImg: function () {
- var _this = this;
- var can = _this.context;
- can.clearRect(0, 0, _this.canvas.width, _this.canvas.height);
-
- can.globalCompositeOperation = "source-over";
- //can.globalCompositeOperation = "destination-over";
- var images = _this.imgLoadList;
-
- //鐢诲湴鍥�
- can.drawImage(_this.img, 0, 0, _this.img.naturalWidth, _this.img.naturalHeight, _this.imgXList['map'], _this.imgYList['map'], _this.img.naturalWidth * _this.imgScaleList['map'] * _this.rateNumList['map'], _this.img.naturalHeight * _this.imgScaleList['map'] * _this.rateNumList['map']);
-
- //瀹為檯涓庡浘鐗囩殑姣斾緥灏�
- _this.x_ratio = new Number(_this.imgLoadList['map'].naturalWidth / _this.trueLength);
- _this.y_ratio = new Number(_this.imgLoadList['map'].naturalHeight / _this.trueWidth);
-
- if (tuodong == true) {
- return false;
- }
-
- if (_this.cacheCanvas == null) {
- _this.cacheCanvas = document.createElement("canvas");
- _this.cacheCanvas.width = _this.canvas.width;
- _this.cacheCanvas.height = _this.canvas.height;
- var cacheCtx = _this.cacheCanvas.getContext("2d");
- //鐢诲嚭褰撳墠宸叉湁鐨勫洿鏍忓尯鍩�
- if (_this.FenceList.length) {
- //閬嶅巻姣忎釜fence锛屽苟鐢诲嚭
- for (var m = 0; m < _this.FenceList.length; m++) {
- var draw_points_list = [];
- var points_list = _this.FenceList[m].split(",");
- //瀹為檯鍧愭爣杞垚鍥句笂鍧愭爣
- for (var i = 0; i < points_list.length; i++) {
- if (i % 2 == 0) {
- //鍋舵暟鍧愭爣锛屽嵆x鍧愭爣
- tmp_list = [];
- var tmp_point = new Number(_this.imgXList['map'] + _this.imgScaleList['map'] * _this.rateNumList['map'] * _this.x_ratio * (points_list[i] - _this.x_x0));
- tmp_list.push(tmp_point);
- } else {
- var tmp_point = new Number(_this.imgYList['map'] + _this.imgScaleList['map'] * _this.rateNumList['map'] * _this.y_ratio * (points_list[i] - _this.y_y0));
- tmp_list.push(tmp_point);
- draw_points_list.push(tmp_list);
- };
- };
-
- var color = getDrawColor(_this.FenceColor[m]);
- var name = _this.FenceName[m];
-
- if (draw_points_list.length == 2) {
- cacheCtx.beginPath();
- cacheCtx.fillStyle = color;
- cacheCtx.fillRect(draw_points_list[0][0], draw_points_list[0][1], draw_points_list[1][0] - draw_points_list[0][0], draw_points_list[1][1] - draw_points_list[0][1]);
- cacheCtx.stroke();
- cacheCtx.fillStyle = "red";
- cacheCtx.fillText(name, (draw_points_list[0][0] + draw_points_list[1][0]) / 2, (draw_points_list[0][1] + draw_points_list[1][1]) / 2);
- cacheCtx.closePath();
- } else {
- cacheCtx.beginPath();
- cacheCtx.fillStyle = color;
- cacheCtx.lineWidth = 1;
- var text_x = new Number(0);
- var text_y = new Number(0);
- for (var j = 0; j < draw_points_list.length; j++) {
- if (j == 0) {
- cacheCtx.moveTo(draw_points_list[j][0], draw_points_list[j][1]);
- } else {
- cacheCtx.lineTo(draw_points_list[j][0], draw_points_list[j][1]);
- }
- if (j == draw_points_list.length - 1) {
- cacheCtx.lineTo(draw_points_list[0][0], draw_points_list[0][1]);
- cacheCtx.fill();
- }
- text_x = text_x + draw_points_list[j][0];
- text_y = text_y + draw_points_list[j][1];
-
- }
- text_x = text_x / draw_points_list.length;
- text_y = text_y / draw_points_list.length;
-
- cacheCtx.fillStyle = color;
- cacheCtx.fill();
- cacheCtx.strokeStyle = color;
- cacheCtx.stroke();
- cacheCtx.fillStyle = "red";
- cacheCtx.fillText(name, text_x, text_y);
- cacheCtx.closePath();
- };
- };
- };
- can.drawImage(_this.cacheCanvas, 0, 0);
- } else {
- can.drawImage(_this.cacheCanvas, 0, 0);
- };
-
-
- //鍒ゆ柇褰撳墠鍧愭爣鏄惁鍦ㄨ�冨嫟鍖哄煙鍐�
- _this.playMarkInKaoQin = [];
- for (var n in _this.playMark) { //_this.playMark涓哄綋鍓嶅疄鏃跺湪绾跨偣浣嶇疆锛屼负[array[id,name,power,life,x,y,time]]
- node_list = [Number(_this.playMark[n][4]), Number(_this.playMark[n][5])];
- for (var f in _this.realFenceList) {
- if (_this.realFenceList[f][1] == "鑰冨嫟鍖哄煙") {
- if (inFenceOrNot(_this.realFenceList[f][2], node_list)) {
- //inFenceOrNot(fence_list, node_list) return true/false
- _this.playMarkInKaoQin.push(true);
- break;
- }
- }
- };
- if (_this.playMarkInKaoQin.length == n) {
- _this.playMarkInKaoQin.push(false);
- }
- };
-
-
- //璁$畻鍖哄煙鍐呯殑鍧愭爣鏁伴噺锛堥毀閬撳畾浣嶏級
- _this.fenceMarkCount = [];
- for (var f in _this.realFenceList) {
- //f[name, type, zuobiao_array]
- var tmp_count = new Number(0);
- for (var n in _this.playMark) {//_this.playMark涓哄綋鍓嶅疄鏃跺湪绾跨偣浣嶇疆锛屼负[array[.x, .y]]
- node_list = [Number(_this.playMark[n][4]), Number(_this.playMark[n][5])];
- if (inFenceOrNot(_this.realFenceList[f][2], node_list)) {//inFenceOrNot(fence_list, node_list) return true/false
- tmp_count += 1;
- //break;
- }
- };
- _this.fenceMarkCount.push(tmp_count);
- };
-
-
- //鐢绘爣绛惧強鍩虹珯
- for (var key in images) {
- if (key == "icon" && _this.playMark) {
- for (var i = 0; i < _this.playMark.length; i++) {
- var tagzhuangtai = _this.playMark[i][3]; //鍦ㄧ嚎鐘舵��
- //var playMarkInKaoQin = true;
- if (((_this.offView == '1' && tagzhuangtai == '1') || (_this.offView == '0')) && ((_this.diskaoqin == "1" && _this.playMarkInKaoQin[i]) || (_this.diskaoqin == "0"))) {
- //鏄惁寮�鍚绾挎秷澶憋紝骞跺垽鏂姸鎬侊紙鍦ㄧ嚎1/绂荤嚎0锛夛紱褰撳紑鍚绾挎秷澶辨椂锛堜粎鏄剧ず鍦ㄧ嚎鏍囩锛夛紝褰撴湭寮�鍚绾挎秷澶辨椂锛堝叏閮ㄦ樉绀猴級
- //鏄惁寮�鍚嚭鑰冨嫟鍖哄煙娑堝け锛屽苟鍒ゆ柇鏄惁鍦ㄨ�冨嫟鍖哄煙鍐咃紱褰撳紑鍚嚭鑰冨嫟鍖哄煙娑堝け鏃讹紙闇�瑕佸湪鑰冨嫟鍖哄煙鍐咃級锛屽綋鏈紑鍚椂锛堝叏閮ㄦ樉绀猴級
-
- //璇诲彇褰撳墠瀹為檯鍧愭爣
- var cor_x = new Number(_this.playMark[i][4]); // 姝ゅ_this.playMark鏄暟鎹簱閲屽彇鍒扮殑褰撳墠鐐瑰潗鏍�,4鏄痯osx,5鏄痯osy
- var cor_y = new Number(_this.playMark[i][5]);
- //杞负鍥句笂鍧愭爣
- var x_cor_now = new Number(_this.imgXList['map'] + _this.imgScaleList['map'] * _this.rateNumList['map'] * _this.x_ratio * (cor_x - _this.x_x0));
- var y_cor_now = new Number(_this.imgYList['map'] + _this.imgScaleList['map'] * _this.rateNumList['map'] * _this.y_ratio * (cor_y - _this.y_y0));
- //鐢诲湪鐩稿簲浣嶇疆涓�
- //can.drawImage(images[key], 0, 0, images[key].naturalWidth, images[key].naturalHeight, x_cor_now - (images[key].naturalWidth * _this.imgScaleList[key] * _this.rateNumList[key])/2, y_cor_now - (images[key].naturalHeight * _this.imgScaleList[key] * _this.rateNumList[key]), images[key].naturalWidth * _this.imgScaleList[key] * _this.rateNumList[key], images[key].naturalHeight * _this.imgScaleList[key] * _this.rateNumList[key]);
- //can.drawImage(images[key], 0, 0, images[key].naturalWidth, images[key].naturalHeight, x_cor_now - (images[key].naturalWidth * _this.imgScaleList[key] * _this.rateNumList[key])/2, y_cor_now - (images[key].naturalHeight * _this.imgScaleList[key] * _this.rateNumList[key]), images[key].naturalWidth * _this.imgScaleList[key] * _this.rateNumList[key], images[key].naturalHeight * _this.imgScaleList[key] * _this.rateNumList[key]);
- //鏄惁鏈夎建杩规嫋灏�
- if (_this.real_trak_time != 0) {
- var trackNow = [];
- var pm = _this.playMark[i];
- function ftn(pm, tn, rtk, ctt, rtc, igxm, igym, igslm, rnlm, xr, yr, xx0, yy0) {
- //trackNow = getTracknow( pm[0], rtk)
- if (tn.length == 0) {
- trackNow = [];
- } else if (pm[0] in tn) {
- trackNow = tn[pm[0]];
- } else {
- trackNow = [];
- };
- var can = ctt;
- can.beginPath();
- can.strokeStyle = rtc;
- can.fillStyle = rtc;
- for (var i = 0; i < trackNow.length; i++) {
- var cor_x = new Number(trackNow[i][0]);
- var cor_y = new Number(trackNow[i][1]);
- var x_cor = new Number(igxm + igslm * rnlm * xr * (cor_x - xx0));
- var y_cor = new Number(igym + igslm * rnlm * yr * (cor_y - yy0));
-
- // var cor_x2 = new Number(trackNow[i+1][0]);
- // var cor_y2 = new Number(trackNow[i+1][1]);
- // var x_cor2 = new Number(igxm + igslm * rnlm * xr * (cor_x2 - xx0));
- // var y_cor2 = new Number(igym + igslm * rnlm * yr * (cor_y2 - yy0));
-
- // can.moveTo(x_cor, y_cor);
- // can.lineTo(x_cor2, y_cor2);
- // can.stroke();
- // can.fill();
- can.moveTo(x_cor, y_cor);
- can.arc(x_cor, y_cor, 1, 0, Math.PI * 2, true);
- can.fill();
- };
- can.closePath();
- can.stroke();
- //_this.trackNow.push([trackNow]);
- }
- setTimeout(ftn(_this.playMark[i], _this.trackNow, _this.real_trak_time, _this.context, _this.real_trak_color, _this.imgXList['map'], _this.imgYList['map'], _this.imgScaleList['map'], _this.rateNumList['map'], _this.x_ratio, _this.y_ratio, _this.x_x0, _this.y_y0), 5);
- //var trackNow = getTracknow( _this.playMark[i][0], _this.real_trak_time);//鑾峰彇鎸囧畾鏃堕棿娈靛唴璇agid鐨勬暟鎹繘琛岀粯鍒�
- }
-
- var isSos = _this.playMark[i][_this.playMark[i].length - 3];
- if (isSos) {
- if (sosType) {
- can.drawImage(sos, 0, 0, images[key].naturalWidth, images[key].naturalHeight, x_cor_now - (images[key].naturalWidth * _this.imgScaleList[key] * _this.rateNumList[key]) / 2 + 3, y_cor_now - (images[key].naturalHeight * _this.imgScaleList[key] * _this.rateNumList[key]) + 2, images[key].naturalWidth * _this.imgScaleList[key] * _this.rateNumList[key], images[key].naturalHeight * _this.imgScaleList[key] * _this.rateNumList[key]);
- } else {
- can.drawImage(sos1, 0, 0, images[key].naturalWidth, images[key].naturalHeight, x_cor_now - (images[key].naturalWidth * _this.imgScaleList[key] * _this.rateNumList[key]) / 2 + 3, y_cor_now - (images[key].naturalHeight * _this.imgScaleList[key] * _this.rateNumList[key]) + 2, images[key].naturalWidth * _this.imgScaleList[key] * _this.rateNumList[key], images[key].naturalHeight * _this.imgScaleList[key] * _this.rateNumList[key]);
- }
- sosType = !sosType;
- } else {
- can.drawImage(images[key], 0, 0, images[key].naturalWidth, images[key].naturalHeight, x_cor_now - (images[key].naturalWidth * _this.imgScaleList[key] * _this.rateNumList[key]) / 2, y_cor_now - (images[key].naturalHeight * _this.imgScaleList[key] * _this.rateNumList[key]), images[key].naturalWidth * _this.imgScaleList[key] * _this.rateNumList[key], images[key].naturalHeight * _this.imgScaleList[key] * _this.rateNumList[key]);
- }
- //鐢诲湪鐩稿簲浣嶇疆涓�
- // can.drawImage(images[key], 0, 0, images[key].naturalWidth, images[key].naturalHeight, x_cor_now - (images[key].naturalWidth * _this.imgScaleList[key] * _this.rateNumList[key]) / 2, y_cor_now - (images[key].naturalHeight * _this.imgScaleList[key] * _this.rateNumList[key]), images[key].naturalWidth * _this.imgScaleList[key] * _this.rateNumList[key], images[key].naturalHeight * _this.imgScaleList[key] * _this.rateNumList[key]);
-
- can.font = '13px sans-serif';
- can.fillStyle = 'white';
- if (_this.tagZb == '1') { //鏄惁鏄剧ず鏍囩鍧愭爣
- can.fillStyle = 'red';
- can.font = '10px sans-serif';
- //var f = 8*( _this.imgScaleList['map']);
- //can.font=f+"px Arial";
-
- tagzuobiao = _this.playMark[i][4] + ',' + _this.playMark[i][5];
- can.fillText(tagzuobiao, x_cor_now - 20, y_cor_now + 10);
- };
- if (_this.viewName == '1') { //鏄惁鏄剧ず浜哄憳鍚嶇О
- can.font = '13px sans-serif';
- if (_this.viewTagid == '1') { //鏄惁鏄剧ず鏍囩id
- fillRoundRect(can, x_cor_now - 40, y_cor_now - images[key].naturalHeight * _this.imgScaleList[key] * _this.rateNumList[key] - 18, images[key].naturalHeight * 2, 20, 4, '#32CD32');
- can.fillStyle = 'white';
- can.fillText(_this.playMark[i][1], x_cor_now - 38, y_cor_now - images[key].naturalHeight * _this.imgScaleList[key] * _this.rateNumList[key] - 3);
- can.fillText(_this.playMark[i][0], x_cor_now + 5, y_cor_now - images[key].naturalHeight * _this.imgScaleList[key] * _this.rateNumList[key] - 3);
- } else {
- fillRoundRect(can, x_cor_now - 20, y_cor_now - images[key].naturalHeight * _this.imgScaleList[key] * _this.rateNumList[key] - 18, images[key].naturalHeight * 1.1, 20, 4, '#32CD32');
- can.fillStyle = 'white';
- can.fillText(_this.playMark[i][1], x_cor_now - 19, y_cor_now - images[key].naturalHeight * _this.imgScaleList[key] * _this.rateNumList[key] - 3);
- }
- } else {
- can.font = '13px sans-serif';
- if (_this.viewTagid == '1') {
- fillRoundRect(can, x_cor_now - 20, y_cor_now - images[key].naturalHeight * _this.imgScaleList[key] * _this.rateNumList[key] - 18, images[key].naturalHeight * 1.1, 20, 4, '#32CD32');
- can.fillStyle = 'white';
- can.fillText(_this.playMark[i][0], x_cor_now - 14, y_cor_now - images[key].naturalHeight * _this.imgScaleList[key] * _this.rateNumList[key] - 3);
- }
- }
- if (_this.viewPower == '1') { //鏄惁鏄剧ず鐢甸噺
- can.font = '10px sans-serif';
- can.fillStyle = 'red';
- can.fillText("鐢甸噺:" + _this.playMark[i][2], x_cor_now - 20, y_cor_now + 20);
- };
- can.font = '10px sans-serif';
- };
- }
- } else if (key == 'anchor_online') {
- can.font = '10px sans-serif';
- if (_this.anckicon == '1') { //鏄惁鏄剧ず鍩虹珯鍥炬爣
- //_this.onlineAnchorList = [anchorid, posx,posy,posz,layer,greatetime]
- for (var i = 0; i < _this.onlineAnchorList.length; i++) {
- var cor_x = new Number(_this.onlineAnchorList[i][1]);
- var cor_y = new Number(_this.onlineAnchorList[i][2]);
- var x_cor = new Number(_this.imgXList['map'] + _this.imgScaleList['map'] * _this.rateNumList['map'] * _this.x_ratio * (cor_x - _this.x_x0));
- var y_cor = new Number(_this.imgYList['map'] + _this.imgScaleList['map'] * _this.rateNumList['map'] * _this.y_ratio * (cor_y - _this.y_y0));
- can.drawImage(images[key], 0, 0, images[key].naturalWidth, images[key].naturalHeight, x_cor - (images[key].naturalWidth * _this.imgScaleList[key] * _this.rateNumList[key]) / 2, y_cor - (images[key].naturalHeight * _this.imgScaleList[key] * _this.rateNumList[key]), images[key].naturalWidth * _this.imgScaleList[key] * _this.rateNumList[key] + 10, images[key].naturalHeight * _this.imgScaleList[key] * _this.rateNumList[key] + 10);
- if (_this.viewAnckzb == '1') { //鏄惁鏄剧ず鍩虹珯鍧愭爣
- can.fillStyle = 'red'
- var anchorzuobiao = _this.onlineAnchorList[i][1] + ',' + _this.onlineAnchorList[i][2] + ',' + _this.onlineAnchorList[i][3];
- can.fillText(anchorzuobiao, x_cor - 20, y_cor + 20);
- };
- if (_this.viewAnckid == '1') { //鏄惁鏄剧ず鍩虹珯id
- can.fillStyle = 'red';
- can.fillText(_this.onlineAnchorList[i][0], x_cor - 7, y_cor - 5);
- };
- };
- };
- } else if (key == 'anchor_offline') {
- can.font = '10px sans-serif';
- if (_this.anckicon == '1') { //鏄惁鏄剧ず鍩虹珯鍥炬爣
- //_this.offlineAnchorList = [anchorid, posx,posy,posz,layer,greatetime]
- for (var i = 0; i < _this.offlineAnchorList.length; i++) {
- var cor_x = new Number(_this.offlineAnchorList[i][1]);
- var cor_y = new Number(_this.offlineAnchorList[i][2]);
- var x_cor = new Number(_this.imgXList['map'] + _this.imgScaleList['map'] * _this.rateNumList['map'] * _this.x_ratio * (cor_x - _this.x_x0));
- var y_cor = new Number(_this.imgYList['map'] + _this.imgScaleList['map'] * _this.rateNumList['map'] * _this.y_ratio * (cor_y - _this.y_y0));
- can.drawImage(images[key], 0, 0, images[key].naturalWidth, images[key].naturalHeight, x_cor - (images[key].naturalWidth * _this.imgScaleList[key] * _this.rateNumList[key]) / 2, y_cor - (images[key].naturalHeight * _this.imgScaleList[key] * _this.rateNumList[key]), images[key].naturalWidth * _this.imgScaleList[key] * _this.rateNumList[key] + 10, images[key].naturalHeight * _this.imgScaleList[key] * _this.rateNumList[key] + 10);
- if (_this.viewAnckzb == '1') { //鏄惁鏄剧ず鍩虹珯鍧愭爣
- can.fillStyle = 'red'
- var anchorzuobiao = _this.offlineAnchorList[i][1] + ',' + _this.offlineAnchorList[i][2] + ',' + _this.offlineAnchorList[i][3];
- can.fillText(anchorzuobiao, x_cor - 20, y_cor + 20);
- };
- if (_this.viewAnckid == '1') { //鏄惁鏄剧ず鍩虹珯id
- can.fillStyle = 'red';
- can.fillText(_this.offlineAnchorList[i][0], x_cor - 7, y_cor - 5);
- };
- };
- };
- }
- };
-
- /* var trueMeasure = getTruemap();
- var trueLength = new Number(trueMeasure[0]);
- var trueWidth = new Number(trueMeasure[1]);
- var x_ratio = new Number(_this.img.naturalWidth / trueLength);
- var y_ratio = new Number(_this.img.naturalHeight / trueWidth);
- var x_x0 = new Number(getYuandian()[0]);
- var y_y0 = new Number(getYuandian()[1]); */
-
- //寮�鍚毀閬撳畾浣嶅悗锛岄渶瑕佹樉绀哄綋鍓嶈�冨嫟鍖哄煙鍐呯殑鎬绘爣绛炬暟閲�
- //_this.fenceMarkCount(count)
- //_this.realFenceList([name, type, zuobiao_array])
- //_this.FenceColor(color)
- if (_this.tunlDw == "1") {
- var k = 0;
- can.beginPath();
- for (var i = 0; i < _this.fenceMarkCount.length; i++) {
- // if ((_this.realFenceList[i][1] == "鑰冨嫟鍖哄煙")||(_this.realFenceList[i][1] == "宸℃鍖哄煙")){
-
- //can.fillStyle = getDrawColor(_this.FenceColor[i]);
- //can.fillRect(10,10+50*k,140,30);
-
- fillRoundRect(can, 10, 10 + 50 * k, 140, 30, 5, /*optional*/ getDrawColor(_this.FenceColor[i]))
- //can.fillRoundRect(10,10+50*k,140,30,10)
- can.fillStyle = "white";
- can.font = "15px sans-serif";
-
- can.textAlign = 'center';
- can.fillText(_this.realFenceList[i][0] + "锛�" + _this.fenceMarkCount[i] + "浜�", 80, 30 + 50 * k);
- //can.textBaseline = "middle";
-
- k += 1;
- // };
- };
- can.closePath();
- can.font = "10px sans-serif";
- can.textAlign = "start";
- };
-
- //寮�鍚皵浣撴樉绀�
- if (_this.gas_show == "1") {
- _this.GasList = getGas("zuobiao"); //姘斾綋鍧愭爣
- _this.GasType = getGas("type"); //姘斾綋绫诲瀷
- _this.GasNongdu = getGas("nongdu"); //姘斾綋娴撳害
- for (var i = 0; i < _this.GasList.length; i++) {
- var cor_x = new Number(_this.GasList[i][0]);
- var cor_y = new Number(_this.GasList[i][1]);
- var x_cor = new Number(_this.imgXList['map'] + _this.imgScaleList['map'] * _this.rateNumList['map'] * _this.x_ratio * (cor_x - _this.x_x0));
- var y_cor = new Number(_this.imgYList['map'] + _this.imgScaleList['map'] * _this.rateNumList['map'] * _this.y_ratio * (cor_y - _this.y_y0));
- can.beginPath();
- can.arc(x_cor, y_cor, 6, 0, Math.PI * 2, true);
- can.fillStyle = "green";
- can.fill();
- can.fillStyle = "red";
- can.fillText(_this.GasType[i], x_cor + 10, y_cor);
- can.fillText(_this.GasNongdu[i], x_cor + 10, y_cor + 10);
- can.closePath();
- }
- };
- },
-
- init: function () {
- var _this = this;
-
- //璇诲彇绯荤粺璁剧疆
- _this.sysSetting = getSystemSetting();
- _this.tagZb = _this.sysSetting[0].tagZb;//鏄惁鏄剧ず鏍囩鍧愭爣
- _this.diskaoqin = _this.sysSetting[0].diskaoqing; //鍑鸿�冨嫟鍖哄煙鏄惁娑堝け
- _this.viewAnckid = _this.sysSetting[0].viewAnckid;//鏄惁鏄剧ず鍩虹珯ID
- _this.viewName = _this.sysSetting[0].viewName;//鏄惁鏄剧ず浜哄憳鍚嶇О
- _this.tunlDw = _this.sysSetting[0].tunlDw;//闅ч亾瀹氫綅妯″紡
- _this.guiji_sava = _this.sysSetting[0].guiji_sava;//鏄惁寮�鍚建杩逛繚瀛�
- _this.viewPower = _this.sysSetting[0].viewPower;//鏄惁鏄剧ず鐢甸噺
- _this.viewTagid = _this.sysSetting[0].viewTagid;//鏄惁鏄剧ず鏍囩ID
- _this.viewAnckzb = _this.sysSetting[0].viewAnckzb;//鏄惁鏄剧ず鍩虹珯鍧愭爣
- _this.offView = _this.sysSetting[0].offView;//鏄惁绂荤嚎涓嶆樉绀哄浘鏍�
- _this.anckicon = _this.sysSetting[0].anckicon;//鏄惁鏄剧ず鍩虹珯鍥炬爣
- _this.gas_show = _this.sysSetting[0].gas_show;//鏄剧ず鍏朵粬妫�娴�(姘斾綋鏄剧ず)
- _this.quiet = _this.sysSetting[0].quiet;//闈欐杈撳嚭鍥哄畾鍧愭爣
-
- //璇诲彇鐪熷疄鍦板浘
- //璇诲浘鐗囧疄闄呭昂瀵�
- _this.trueMeasure = getTruemap();
- _this.trueLength = new Number(_this.trueMeasure[0]);
- _this.trueWidth = new Number(_this.trueMeasure[1]);
-
- //璇诲疄闄呭師鐐瑰潗鏍�
- _this.x_x0 = new Number(getYuandian()[0]);
- _this.y_y0 = new Number(getYuandian()[1]);
-
- //璇诲彇褰撳墠鍥存爮淇℃伅
- _this.FenceList = getExistFence("zuobiao");
- _this.FenceColor = getExistFence("color");
- _this.FenceName = getExistFence("name");
- _this.FenceType = getExistFence("type");
-
- _this.realFenceList = [];
- //閬嶅巻鍥存爮淇℃伅骞跺瓨鍌ㄦ垚[鍚嶇О锛岀被鍨嬶紝鍧愭爣]
- for (var m = 0; m < _this.FenceList.length; m++) {
- var tmp_list = [];
- var points = _this.FenceList[m];
- var points_list = _this.FenceList[m].split(",");
-
- //鍥存爮瀹為檯鍧愭爣锛堝姞涓婂亸绉婚噺鐨勶級
- var points_list_sort = [];
- for (var i = 0; i < points_list.length; i++) {
- if (i % 2 == 0) {
- tmp_list = [];
- tmp_list.push(new Number(points_list[i]));
- } else {
- tmp_list.push(new Number(points_list[i]));
- points_list_sort.push(tmp_list);
- }
- }
- //瀛樺尯鍩熷悕绉�+鍖哄煙绫诲瀷+鍖哄煙鍧愭爣锛屾柟渚垮悗缁垽鏂槸鍚﹀湪鏌愬尯鍩熷唴
- _this.realFenceList.push([_this.FenceName[m], _this.FenceType[m], points_list_sort]);
- };
-
- _this.real_trak_time = str_to_time(_this.sysSetting[0].real_trak_time);//瀹炴椂杞ㄨ抗鏄剧ず鏃堕暱
- //褰撳墠浣嶇疆
- _this.playMark = getRealPosition();
- var tagid_str = "";
- for (var i = 0; i < _this.playMark.length; i++) {
- tagid_str += _this.playMark[i][0]
- if (i != _this.playMark.length - 1) {
- tagid_str += ","
- }
- }
- //瀹炴椂杞ㄨ抗
- if (_this.real_trak_time != 0) {
- _this.trackNow = getTracknow(tagid_str, _this.real_trak_time);
- } else {
- _this.trackNow = null;
- }
- _this.real_trak_color = getTrackColor(_this.sysSetting[0].real_trak_color);//瀹炴椂杞ㄨ抗鏄剧ず鐨勯鑹�
-
- _this.canvas.onmousedown = function (event) {
- _this.clickDown(event);
- };
- _this.canvas.onmousemove = function (event) {
- _this.mouseMove(event)
- };
- _this.canvas.onmouseup = function (event) {
- _this.mouseUp(event);
- };
- _this.canvas.onmousewheel = function (event) {
- _this.onmouseWheel(event);
- };
- var t = 300;//300ms
-
- _this.onlineAnchorList = getAnchorInfo()[0];
- _this.offlineAnchorList = getAnchorInfo()[1];
-
- function fn() {
- if (tuodong == true) {
- return false;
- }
- //褰撳墠瀹炴椂鍧愭爣
- _this.playMark = getRealPosition();
- var tagid_str = "";
- for (var i = 0; i < _this.playMark.length; i++) {
- tagid_str += _this.playMark[i][0]
- if (i != _this.playMark.length - 1) {
- tagid_str += ","
- }
- }
-
- if (_this.real_trak_time != 0) {
- //灏嗗綋鍓嶅疄鏃跺潗鏍囨坊鍔犺繘track涓�
- var track_now = Date.parse(new Date()); //timestamp涓烘绉掑崟浣�
- track_now = track_now / 1000;
- var track_now_head = track_now - _this.real_trak_time;
- //褰撳墠track鏈�寮�濮嬬殑鏃堕棿
- var track_head_date = new Date();
- track_head_date.setTime(track_now_head * 1000 + 8 * 3600 * 1000);
- var track_head_date_str = track_head_date.toJSON().substr(0, 19).replace('T', ' ');
-
- for (var i = 0; i < _this.playMark.length; i++) {
- if (_this.trackNow[_this.playMark[i][0]] != null) {
- if (_this.trackNow[_this.playMark[i][0]].length > 1500) {
- _this.trackNow[_this.playMark[i][0]] = _this.trackNow[_this.playMark[i][0]].slice(-1200);
- };
- for (var j = 0; j < _this.trackNow[_this.playMark[i][0]].length; j++) {
- if (_this.trackNow[_this.playMark[i][0]][0][2] < track_head_date_str) {
- _this.trackNow[_this.playMark[i][0]].shift()
- } else {
- break
- }
- };
- };
-
- var now_time = new Date();
- now_time.setTime(track_now * 1000 + 8 * 3600 * 1000);
- var now_time_str = now_time.toJSON().substr(0, 19).replace('T', ' ');
- var tmp = [_this.playMark[i][4], _this.playMark[i][5], now_time_str];
- if (_this.trackNow[_this.playMark[i][0]] == null) {
- _this.trackNow[_this.playMark[i][0]] = []
- }
- _this.trackNow[_this.playMark[i][0]].push(tmp)
- }
- }
- _this.drawImg();
- }
- if (expand == true) {
- clearInterval(timer1)
- timer2 = setInterval(fn, t);
- } else {
- clearInterval(timer2)
- timer1 = setInterval(fn, t);
- }
- //setInterval(fn, t);
-
- },
- /*璁$畻褰撳墠榧犳爣浣嶇疆璺濈canvas鐨勫亸绉婚噺*/
- xyToCanvas: function (ele, x, y) {
- var _this = this;
- var obj = _this.canvas.getBoundingClientRect();
- return {
- x: x - obj.left,
- y: y - obj.top
- };
- },
- /*榧犳爣鍗曞嚮浜嬩欢*/
- clickDown: function (event) {
- var _this = this;
- if (_this.markFlag) {
- _this.canvas.style.cursor = "none";
- if (event.button == 2) {
- _this.markFlag = false;
- _this.dragFlag = true;
- _this.canvas.style.cursor = "normal";
- _this.drawImg();
- return;
- } else {
- var posXY = _this.xyToCanvas(_this.canvas, event.clientX, event.clientY);
- posXY.x = (posXY.x - _this.imgX) / _this.imgScale;
- posXY.y = (posXY.y - _this.imgY) / _this.imgScale;
- _this.CreatLinepoints.push(posXY);
- _this.allMarkLins.pop();
- _this.allMarkLins.push(_this.CreatLinepoints);
- _this.drawImg();
- }
- return;
- }
- if (event.button == 0) {//鐐瑰嚮榧犳爣宸﹂敭
- _this.dragFlag = true;
- tuodong = true;
- _this.canvas.style.cursor = "move";
- _this.pos = _this.xyToCanvas(_this.canvas, event.clientX, event.clientY);
- }
- },
- /*榧犳爣绉诲姩浜嬩欢*/
- mouseMove: function (event) {
- var _this = this;
- /*鎷栨嫿*/
- if (_this.dragFlag) {
- tuodong = true;
- _this.canvas.style.cursor = "move";
- var pos1 = _this.xyToCanvas(_this.canvas, event.clientX, event.clientY);
- var x = pos1.x - _this.pos.x;
- var y = pos1.y - _this.pos.y;
- _this.pos = pos1;
- for (var key in _this.imgXList) {
- _this.imgXList[key] += x;
- _this.imgYList[key] += y;
- }
- _this.cacheCanvas = null;
- _this.drawImg();
- }
- },
- /*榧犳爣鏀惧紑浜嬩欢*/
- mouseUp: function (event) {
- var _this = this;
- _this.dragFlag = false;
- tuodong = false;
- if (_this.markFlag) {
- _this.canvas.style.cursor = "none";
- return;
- }
- _this.canvas.style.cursor = 'default';
-
- },
- /*榧犳爣婊氳疆浜嬩欢*/
- onmouseWheel: function (event) {
- var _this = this;
- _this.cacheCanvas = null;
- var pos = _this.xyToCanvas(_this.canvas, event.clientX, event.clientY);
- event.wheelDelta = event.wheelDelta ? event.wheelDelta : (event.deltaY * (-40));
- //鍙栨秷娴忚鍣ㄩ粯璁よ涓�
- if (event.preventDefault) {
- event.preventDefault();
- } else {
- event.returnValue = false;
- }
- if (event.wheelDelta > 0 && _this.scaleFlag < 9) {
- for (var key in _this.imgScaleList) {
- _this.imgScaleList[key] *= 1.25;
- _this.imgXList[key] = _this.imgXList[key] * 1.25 - 0.25 * pos.x;
- _this.imgYList[key] = _this.imgYList[key] * 1.25 - 0.25 * pos.y;
- }
- _this.scaleFlag += 1;
- }
- if (event.wheelDelta < 0 && _this.scaleFlag > -9) {//缂╁皬
- for (var key in _this.imgScaleList) {
- _this.imgScaleList[key] *= 0.8;
- _this.imgXList[key] = _this.imgXList[key] * 0.8 + pos.x * 0.2;
- _this.imgYList[key] = _this.imgYList[key] * 0.8 + pos.y * 0.2;
- }
- _this.scaleFlag -= 1;
- }
- _this.imgScaleList['icon'] = 0.037;
- _this.drawImg();
- },
-
- }
- /* var timeshow;
- var weizhi;
- setTimeout(function(){
- setshow();
- timeshow = setInterval(setshow, 3000);
- },0)
- function setshow () {
- $.ajax({
- async: false,
- type: "POST",
- url: "/hxzkoa/setshow.do",
- dataType: 'json',
- success (data) {
- $("#ssc1").html('<span class="fonts1">' + data[0].type + '</span><br><span class="fonts">' + data[0].num + '</span>');
- $("#ssc2").html('<span class="fonts1">' + data[1].type + '</span><br><span class="fonts">' + data[1].num + '</span>');
- $("#ssc3").html('<span class="fonts1">' + data[2].type + '</span><br><span class="fonts">' + data[2].num + '</span>');
- weizhi = data[0].num;
- }
- });
- }
- function myStopFunction () {
- clearInterval(timeshow);
- }
- /* window.setInterval(function () {
- getNewSeries(lastDate, {
- min: 10,
- max: 90
- })
-
- chart.updateSeries([{
- data: weizhi
- }])
- }, 1000) */
- /* var timeshow = setInterval(setweizhi, 5000);
- function setweizhi () {
- $.ajax({
- async: false,
- type: "POST",
- url: "/hxzkoa/setweizhi.do",
- dataType: 'json',
- });
- } */
- /* var j = 4;
- var i = 0;
- var shebei = $("#shebei").val(); */
- $.ajax({
- url: "/hxzkoa/setshebei.do",
- type: "post",
- dataType: "JSON",
- success(data) {
- var i = 0;
- shebeido()
- var times = setInterval(shebeido, 5000);
- function shebeido() {
- var html = '';
- var arr = data.slice(i, i + 4)
- for (const key in arr) {
- if (arr[key].zhuangtai == 0) {
- if (arr[key].duixiang == "瀹氫綅鍩虹珯") {
- html += '<tr align="center"><td class="noExl"><img src="hxzk/image/anchor/鍩虹珯绂荤嚎.png" /></td><td>' + arr[key].id + '</td><td>' + arr[key].duixiang + '</td><td>' + arr[key].banben + '</td><td>' + arr[key].xiangqing + '</td><td>' + arr[key].time + '</td></tr>';
- } else {
- html += '<tr align="center"><td class="noExl"><img src="hxzk/image/icon/tagoff.png" /></td><td>' + arr[key].id + '</td><td>' + arr[key].duixiang + '</td><td>' + arr[key].banben + '</td><td>' + arr[key].xiangqing + '</td><td>' + arr[key].time + '</td></tr>';
- }
- } else {
- if (arr[key].duixiang == "瀹氫綅鍩虹珯") {
- html += '<tr align="center"><td class="noExl"><img src="hxzk/image/anchor/鍩虹珯鍦ㄧ嚎.png" /></td><td>' + arr[key].id + '</td><td>' + arr[key].duixiang + '</td><td>' + arr[key].banben + '</td><td>' + arr[key].xiangqing + '</td><td>' + arr[key].time + '</td></tr>';
- } else {
- html += '<tr align="center"><td class="noExl"><img src="hxzk/image/icon/tagon.png" /></td><td>' + arr[key].id + '</td><td>' + arr[key].duixiang + '</td><td>' + arr[key].banben + '</td><td>' + arr[key].xiangqing + '</td><td>' + arr[key].time + '</td></tr>';
- }
- }
- }
- $("#nr").html(html);
- i += 4;
- if (i >= data.length) {
- i = 0;
- }
- }
- // function shebeido() {
- // var j = i + 4
- // var html = ''
- // for (i; i < j; i++) {
- // if (data[i] == false) {
- // break;
- // } else {
- // html += '<tr align="center"><td class="noExl">' + data[i].zhuangtai + '</td><td>' + data[i].id + '</td><td>' + data[i].duixiang + '</td><td>' + data[i].banben + '</td><td>' + data[i].xiangqing + '</td><td>' + data[i].time + '</td></tr>'
- // // html += '<tr align="center" class="d"><td>' + item.id + '</td><td>' + item.receive_time + '</td><td>' + item.type + '</td><td>' + item.tagid + '</td><td>' + item.neirong + '</td></tr>'
- // }
- // }
- // $("#nr").html(html)
- // if (i >= data.length) {
- // i = 0;
- // }
- // }
- }
- });
- // var timeshow = setInterval(sos, 4000);
- // function sos() {
- // $.ajax({
- // url: "/hxzkoa/sosfence.do",
- // type: "POST",
- // dataType: "JSON",
- // success(data) {
- // if (data == null) {
-
- // } else {
- // var str = ""
- // alert(str)
- // audio.play()
- // }
- // }
- // })
- // }
- //alert('涓�鑷姩寮�鍚憡璀︽彁閱�')
- var audio1 = new Audio("/hxzkoa/hxzk/image/voice/sos.wav");
- var audio2 = new Audio("/hxzkoa/hxzk/image/voice/warning.wav");
- var current_floor;
- function qufloor(floor) {
- current_floor = floor
- }
- // var zaipan = []
- // var sosgaojing1 = getRealPosition();
- // for (var i = 0; i < sosgaojing1.length; i++) {
- // zaipan.push(false)
- // }
- setInterval(baojing, 1000)
- function baojing() {
- var sosgaojing = getRealPosition();
- for (var i = 0; i < sosgaojing.length; i++) {
- if (sosgaojing[i][7] == 1) {
- if (sosgaojing[i][8] == 1) {
- // if (zaipan[i] == false) {
- var str = '娉ㄦ剰,缂栧彿[' + sosgaojing[i][0] + ']SOS鍛婅'
- // Audio1.click()
- audio1.play()
- //swal(str)
- /* $.ajax({
- url: "/hxzkoa/sosgaojing.do",
- type: "POST",
- dataType: "JSON",
- data: {
- tagid: sosgaojing[i][0]
- }
- }) */
- // }
- } if (sosgaojing[i][9] == 1) {
- // if (zaipan[i] == false) {
- var str = '娉ㄦ剰,缂栧彿[' + sosgaojing[i][0] + ']杩涘叆鍗遍櫓鍖哄煙'
- // audio2.click()
- audio2.play()
- //swal(str)
- /* $.ajax({
- url: "/hxzkoa/fencegaojing.do",
- type: "POST",
- dataType: "JSON",
- data: {
- tagid: sosgaojing[i][0]
- }
- }) */
- // }
- }
- // zaipan[i] = true
- }
- // } else {
- // zaipan[i] = false
- // }
- }
- }
-
- </script>
- <!-- 瀹ゅ唴瀹氫綅鍦板浘鍔熻兘缁撴潫 -->
-
- <!-- END FUNCTION SCRIPTS -->
-
- <script src="/hxzkoa/hxzk/plugins/apex/apexcharts.js"></script>
- <script src="/hxzkoa/hxzk/plugins/apex/custom-apexcharts.js"></script>
- </body>
-
- </html>
\ No newline at end of file
diff --git "a/src/main/webapp/hxzk/index\345\211\257\346\234\254.jsp" "b/src/main/webapp/hxzk/index\345\211\257\346\234\254.jsp"
deleted file mode 100644
index 42bfe4f..0000000
--- "a/src/main/webapp/hxzk/index\345\211\257\346\234\254.jsp"
+++ /dev/null
@@ -1,2003 +0,0 @@
-<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" %>
- <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
- <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
- <html lang="en">
-
- <head>
- <meta charset="utf-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, shrink-to-fit=no">
- <title></title>
- <link href="/hxzkoa/hxzk/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
- <link href="/hxzkoa/hxzk/assets/img/favicon.ico" rel="icon" type="image/x-icon" />
- <link href="/hxzkoa/hxzk/assets/css/components/custom-modal.css" rel="stylesheet" type="text/css" />
- <link href="/hxzkoa/hxzk/assets/css/components/custom-sweetalert.css" rel="stylesheet"
- type="text/css" />
- <link href="/hxzkoa/hxzk/assets/css/dashboard/dash_2.css" rel="stylesheet" type="text/css" />
- <link href="/hxzkoa/hxzk/assets/css/elements/custom-pagination.css" rel="stylesheet" type="text/css" />
- <link href="/hxzkoa/hxzk/assets/css/loader.css" rel="stylesheet" type="text/css" />
- <link href="/hxzkoa/hxzk/assets/css/scrollspyNav.css" rel="stylesheet" type="text/css" />
- <link href="/hxzkoa/hxzk/assets/css/main.css" rel="stylesheet" type="text/css" />
- <link href="/hxzkoa/hxzk/assets/css/structure.css" rel="stylesheet" type="text/css" />
- <link href="/hxzkoa/hxzk/assets/css/elements/search.css" rel="stylesheet" type="text/css" />
- <link href="/hxzkoa/hxzk/plugins/apex/apexcharts.css" rel="stylesheet" type="text/css">
- <link href="/hxzkoa/hxzk/plugins/animate/animate.css" rel="stylesheet" type="text/css" />
- <link href="/hxzkoa/hxzk/plugins/highlight/styles/monokai-sublime.css" rel="stylesheet"
- type="text/css" />
- <link href="/hxzkoa/hxzk/plugins/sweetalerts/sweetalert2.min.css" rel="stylesheet" type="text/css" />
- <link href="/hxzkoa/hxzk/plugins/sweetalerts/sweetalert.css" rel="stylesheet" type="text/css" />
- <link href="/hxzkoa/hxzk/plugins/table/datatable/datatables.css" rel="stylesheet" type="text/css">
- <link href="/hxzkoa/hxzk/plugins/table/datatable/custom_dt_html5.css" rel="stylesheet" type="text/css">
- <link href="/hxzkoa/hxzk/plugins/table/datatable/dt-global_style.css" rel="stylesheet" type="text/css">
- <link href="/hxzkoa/hxzk/plugins/perfect-scrollbar/perfect-scrollbar.css" rel="stylesheet"
- type="text/css" />
- <link href="https://fonts.gstatic.com" rel="preconnect">
- <link href="https://fonts.googleapis.com/css2?family=Ma+Shan+Zheng&display=swap" rel="stylesheet">
- <link href="https://fonts.googleapis.com/css?family=Quicksand:400,500,600,700&display=swap"
- rel="stylesheet">
- <style>
- .panel-head {
- font-size: 1rem;
- color: rgba(255, 255, 255, .7);
- line-height: 2rem;
- text-align: center;
- background: linear-gradient(rgb(0, 20, 30), rgb(0, 40, 70));
- border: 2px solid rgba(0, 90, 120, .3);
- }
-
- .table-bordered td,
- .table-bordered th {
- border: 1px solid #ebedf2;
- }
-
- .fonts {
- color: #fff;
- font-size: 50px;
- font-family: "瀹嬩綋";
- }
-
- .fonts1 {
- color: #5c9792;
- font-size: 40px;
- font-family: "瀹嬩綋";
- text-shadow: 5px 5px 5px rgb(223, 65, 65);
- }
-
- .text {
- text-align: center;
- margin-top: 10px;
- }
- </style>
- <script src="/hxzkoa/hxzk/assets/js/app.js"></script>
- <script src="/hxzkoa/hxzk/assets/js/dashboard/dash_2.js"></script>
- <script src="/hxzkoa/hxzk/assets/js/loader.js"></script>
- <script src="/hxzkoa/hxzk/assets/js/libs/jquery-3.1.1.min.js"></script>
- <script src="/hxzkoa/hxzk/bootstrap/js/bootstrap.min.js"></script>
- <script src="/hxzkoa/hxzk/bootstrap/js/popper.min.js"></script>
- <script src="/hxzkoa/hxzk/plugins/apex/apexcharts.js"></script>
- <script src="/hxzkoa/hxzk/plugins/table/datatable/button-ext/jszip.min.js"></script>
- <script src="/hxzkoa/hxzk/plugins/table/jquery.table2excel.js"></script>
- <script src="/hxzkoa/hxzk/plugins/sweetalerts/promise-polyfill.js"></script>
- <script src="/hxzkoa/hxzk/plugins/sweetalerts/sweetalert2.min.js"></script>
- <script src="/hxzkoa/hxzk/plugins/sweetalerts/custom-sweetalert.js"></script>
- <script src="/hxzkoa/hxzk/plugins/perfect-scrollbar/perfect-scrollbar.min.js"></script>
-
- <!-- 鐧惧害鍦板浘鎺ュ彛 -->
- <script type="text/javascript" id="baidumap_api"
- src="http://api.map.baidu.com/getscript?v=3.0&ak=PUftjeZCKHtEn8ZMjeAGnViSO8NBvBNm"></script>
- </head>
-
- <body class="alt-menu sidebar-noneoverflow" style="overflow:auto">
- <!-- BEGIN LOADER -->
- <div id="load_screen">
- <div class="loader">
- <div class="loader-content">
- <div class="spinner-grow align-self-center"></div>
- </div>
- </div>
- </div>
- <!-- END LOADER -->
- <div class="border-left"
- style="opacity:0.4;float:left;position:absolute;z-index:1;left:120px;height:20px;"><img alt=""
- src="/hxzkoa/resources/images/border.png" class="img-left"></div>
- <div class="border-right" style="opacity:0.4;float:right;position:absolute;z-index:2;right:120px;"><img
- alt="" src="/hxzkoa/resources/images/border2.png" class="img-right"></div>
- <!-- BEGIN NAVBAR -->
- <div class="login-page"></div>
- <!-- END NAVBAR -->
- <!-- BEGIN MAIN CONTAINER -->
- <div class="main-container" id="container">
- <div class="overlay"></div>
- <div class="search-overlay"></div>
- <!-- BEGIN TOPBAR -->
- <div class="header-page"></div>
- <!-- END TOPBAR -->
- <!-- BEGIN CONTENT PART -->
- <div id="content" class="main-content">
- <div class="layout-px-spacing">
- <div class="row layout-top-spacing">
- <div class="col-xl-3 col-lg-6 col-md-6 col-sm-12 col-12 layout-spacing"
- style="padding-right:5px;padding-left:5px;padding-bottom:5px;padding-top:5px;"
- id="jizhanxinxi">
- <div class="widget widget-one_hybrid widget-engagement" style="height:380px;">
- <div class='panel-head'>浣嶇疆鏁版嵁</div>
- <div id="wasd" class="" style="margin-top:50px;">
- </div>
- </div>
- </div>
- <!-- <div class="col-xl-3 col-lg-6 col-md-6 col-sm-12 col-12 layout-spacing"
- style="padding-right:5px;padding-left:5px;padding-bottom:5px;padding-top:5px;"
- id='jizhanxinxi'>
- <div class="widget widget-one_hybrid widget-engagement">
- <div class="widget-heading" style="height:380px;">
- <div class='panel-head'>瀹炴椂鏁版嵁</div>
- <div id="realtime" class="" style="margin-top:50px;">
- </div>
- <div class="table-responsive mb-4 mt-4"
- style="position:absolute;top:10px;display: flex;justify-content: center;flex-wrap: wrap;">
- <div class="item"
- style="width: 50%;height: 173px;border: solid 7px rgb(90, 90, 77); border-style: inset;">
- <div class="text" id="ssc1"></div>
- </div>
- <div class="item"
- style="width: 50%;height: 173px;border: solid 7px rgb(90, 90, 77); border-style: inset;">
- <div class="text" id="ssc2"></div>
- </div>
- <div class="item"
- style="width: 100%;height: 173px;border: solid 7px rgb(90, 90, 77); border-style: inset;">
- <div class="text" id="ssc3"></div>
- </div>
- </div>
- </div>
- </div>
- </div> -->
- <div class="col-xl-6 col-lg-6 col-md-6 col-sm-12 col-12 layout-spacing"
- style="padding-right:5px;padding-left:5px;padding-bottom:5px;padding-top:5px;"
- id="ditu">
- <div class="widget widget-one_hybrid widget-engagement" id="map">
- <div class="widget-heading" style="height:480px;" id="map_bg">
- <div class='panel-head' id="maphead">鍦板浘 <div
- style="position:absolute;right:8px;top:8px;" id="quanping"
- onclick="changeMapSize()"><svg t="1618401864629" class="icon"
- viewBox="0 0 1024 1024" version="1.1"
- xmlns="http://www.w3.org/2000/svg" p-id="1141" width="16"
- height="16">
- <path d="M868.6 96H720c-7.6 0-15.2 2.9-21 8.7-5.8 5.8-8.7 13.4-8.7 21s2.9 15.2 8.7 21c5.8 5.8 13.4 8.7 21
- 8.7h106.5L580.1 401.8c-11.6 11.6-11.6 30.4 0 42 11.6 11.6 30.4 11.6 42 0l246.4-246.4V304c0 7.6 2.9 15.2 8.7 21 5.8 5.8 13.4 8.7
- 21 8.7s15.2-2.9 21-8.7c5.8-5.8 8.7-13.4 8.7-21V155.4c0.1-32.8-26.5-59.4-59.3-59.4zM898.3 690.3c-7.6 0-15.2 2.9-21 8.7-5.8 5.8-8.7
- 13.4-8.7 21v106.5L622.2 580.1c-11.6-11.6-30.4-11.6-42 0s-11.6 30.4 0 42l246.4 246.4H720c-7.6 0-15.2 2.9-21 8.7-5.8 5.8-8.7 13.4-8.7
- 21s2.9 15.2 8.7 21c5.8 5.8 13.4 8.7 21 8.7h148.6c32.8 0 59.4-26.6 59.4-59.4V720c0-7.6-2.9-15.2-8.7-21-5.8-5.8-13.4-8.7-21-8.7zM401.8
- 580.1L155.4 826.5V720c0-7.6-2.9-15.2-8.7-21-5.8-5.8-13.4-8.7-21-8.7s-15.2 2.9-21 8.7c-5.8 5.8-8.7 13.4-8.7 21v148.6c0 32.8 26.6 59.4 59.4
- 59.4H304c7.6 0 15.2-2.9 21-8.7 5.8-5.8 8.7-13.4 8.7-21s-2.9-15.2-8.7-21c-5.8-5.8-13.4-8.7-21-8.7H197.5l246.4-246.4c11.6-11.6 11.6-30.4
- 0-42-11.6-11.7-30.5-11.7-42.1-0.1zM197.5 155.4H304c7.6 0 15.2-2.9 21-8.7 5.8-5.8 8.7-13.4 8.7-21s-2.9-15.2-8.7-21c-5.8-5.8-13.4-8.7-21-8.7H155.4C122.6
- 96 96 122.6 96 155.4V304c0 7.6 2.9 15.2 8.7 21 5.8 5.8 13.4 8.7 21 8.7s15.2-2.9 21-8.7c5.8-5.8 8.7-13.4 8.7-21V197.5l246.4 246.4c11.6 11.6 30.4
- 11.6 42 0 11.6-11.6 11.6-30.4 0-42L197.5 155.4z" p-id="1142" fill="#ffffff"></path>
- </svg></div>
- </div>
- <div style="width:100%; height:430px; float:left" id="wrap">
- <canvas id="draw"></canvas>1
- </div>
- <div style="width: 100%;
- height: 100%;
- overflow: hidden;
- margin:0;
- font-family:" 寰蒋闆呴粦";" id="baidumap">
- </div>
- </div>
- </div>
- </div>
- <div class="col-xl-3 col-lg-6 col-md-6 col-sm-12 col-12 layout-spacing"
- style="padding-right:5px;padding-left:5px;padding-bottom:5px;padding-top:5px;"
- id="gaojinghuizong">
- <div class="widget widget-one_hybrid widget-engagement" style="height:380px;">
- <div class='panel-head'>鍛婅姹囨��</div>
- <div id="s-col" class="" style="margin-top:50px">
- <input type="hidden" id="shebei" value="${shebei}">
- <input type="hidden" id="reWarningSummary_k" value="${reWarningSummary_k}">
- <input type="hidden" id="reWarningSummary_v" value="${reWarningSummary_v}">
- <input type="hidden" id="realAttendance_k" value="${realAttendance_k}">
- <input type="hidden" id="realAttendance_v" value="${realAttendance_v}">
- <input type="hidden" id="realtongji_k" value="${realtongji_k}">
- <input type="hidden" id="realtongji_v" value="${realtongji_v}">
- <input type="hidden" id="realshishi_k" value="${realshishi_k}">
- <input type="hidden" id="realshishi_v" value="${realshishi_v}">
- <input type="hidden" id="weizhi" value="${weizhi}">
- </div>
- </div>
- </div>
- <div class="col-xl-3 col-lg-6 col-md-6 col-sm-12 col-12 layout-spacing"
- style="bottom:100px;padding-right:5px;padding-left:5px;padding-bottom:5px;padding-top:5px;"
- id="tongjishuju">
- <div class="widget widget-one_hybrid widget-engagement" style="height:380px;">
- <div class='panel-head'>缁熻鏁版嵁</div>
- <div id="polarArea-chart" class="" style="margin-top:50px;">
- </div>
- </div>
- </div>
- <div class="col-xl-6 col-lg-6 col-md-6 col-sm-12 col-12 layout-spacing"
- style="padding-right:5px;padding-left:5px;padding-bottom:5px;padding-top:5px;"
- id="shishikaoqin">
- <div class="widget widget-one_hybrid widget-engagement">
- <div class="widget-heading" style="height:280px;">
- <div class='panel-head'>璁惧淇℃伅</div>
- <div class="table-responsive mb-4 mt-4" style="position:absolute;top:10px;">
- <table id="html5-extension" class="table table-hover"
- style="width:100%;">
- <thead>
- <tr align="center">
- <th style="padding:12px 5px;">鐘舵��</th>
- <th style="padding:12px 5px;">璁惧缂栧彿</th>
- <th style="padding:12px 5px;">缁戝畾瀵硅薄</th>
- <th style="padding:12px 5px;">鐗堟湰</th>
- <th style="padding:12px 5px;">璁惧璇︽儏</th>
- <th style="padding:12px 5px;">鏇存柊鏃堕棿</th>
- </tr>
- </thead>
- <tbody id="nr">
- <%-- <c:forEach items="${anchorManagementList}" var="list">
- <tr align="center">
- <td class="noExl">
- <c:choose>
- <c:when test="${list.anchormode == '0'}">
- <img src="hxzk/image/anchor/鍩虹珯绂荤嚎.png" />
- </c:when>
- <c:otherwise>
- <img src="hxzk/image/anchor/鍩虹珯鍦ㄧ嚎.png" />
- </c:otherwise>
- </c:choose>
- </td>
- <td>${list.anchorid}</td>
- <td>瀹氫綅鍩虹珯</td>
- <td>${list.version}</td>
- <td>${list.anchorip}</td>
- <td>${list.greateTime}</td>
- </tr>
- </c:forEach> --%>
- </tbody>
- </table>
- </div>
- </div>
- </div>
- </div>
- <div class="col-xl-3 col-lg-6 col-md-6 col-sm-12 col-12 layout-spacing"
- style="bottom:100px;padding-right:5px;padding-left:5px;padding-bottom:5px;padding-top:5px;"
- id="xianchanggongzhong">
- <div class="widget widget-one_hybrid widget-engagement" style="height:380px;">
- <div class='panel-head'>鐜板満宸ョ</div>
- <div id="donut-chart" class="" style="margin-top:50px;">
- </div>
- </div>
- </div>
-
- </div>
- </div>
- <!-- END CONTENT PART -->
- </div>
-
- <script>
- //var current_map;
- var current_floor;
- var current_map;
- function getMapNow() {
- var map;
- $.ajax({
- async: false,
- type: "POST",
- url: "/hxzkoa/qiehuanditu_get.do",
- dataType: 'json',
- data: {},
- success: function (data) {
- map = data[0];
- },
- })
- return map
- };
-
- $(document).ready(function () {
- App.init();
- $.ajax({
- async: false, //鍚屾鐨�
- type: "POST",
- url: "/hxzkoa/getSysSetting_list.do",
- data: {
-
- },
- dataType: "json",
- success: function (data) {
- title = data[0].title
- document.title = title;
- },
- });
-
- current_map = getMapNow();
- if (current_map == "鐧惧害鍦板浘") {
- document.getElementById("wrap").style.display = "none";
- diaoyongbaidumap();
-
- } else {
- document.getElementById("baidumap").style.display = "none";
- $.ajax({
- async: false,
- type: "POST",
- url: "/hxzkoa/getFloorByMapname.do",
- dataType: 'json',
- data: {
- map: current_map,
- },
- success: function (data) {
- current_floor = data[0].floor;
- diaoyonghuatu(current_floor);
- qufloor(current_floor);
- },
- });
-
- };
- });
- $('.header-page').load('/hxzkoa/hxzk/top.html'); $('.login-page').load('/hxzkoa/hxzk/head.html');
- var params = {
- zoomVal: 1,
- left: 0,
- top: 0,
- currentX: 0,
- currentY: 0,
- flag: false
- };
- </script>
-
- <!-- BEGIN FUNCTION SCRIPTS -->
-
- <script type="text/javascript">
- var timer1;//鍦板浘缂╁皬鏃剁殑timer
- var timer2;//鍦板浘鏀惧ぇ鏃剁殑timer
- //棣栭〉鍦板浘鎺у埗
- var expand = false;
-
- function changeMapSize() {
- if (expand == false) {
- //鐐瑰嚮鏀惧ぇ
- expand = true;
- modified = false;
- if (document.getElementById("wrap").style.display == "none") {
- //褰撳墠姝e湪浣跨敤鐧惧害鍦板浘
- document.getElementById('ditu').className = "col-xl-12 col-lg-6 col-md-6 col-sm-12 col-12 layout-spacing";
- document.getElementById("map").style.width = "100%";
- document.getElementById("map").style.height = "860px";
- document.getElementById("baidumap").style.width = "100%";
- document.getElementById("baidumap").style.height = "860px";
- //diaoyongbaidumap();
- } else if (document.getElementById("baidumap").style.display == "none") {
- //褰撳墠姝e湪浣跨敤瀹ゅ唴鍦板浘
- document.getElementById('ditu').className = "col-xl-12 col-lg-6 col-md-6 col-sm-12 col-12 layout-spacing";
- document.getElementById("map").style.width = "100%";
- document.getElementById("map").style.height = "960px";
- document.getElementById("maphead").style.width = "100%";
- document.getElementById("map_bg").style.height = "960px";
- document.getElementById("wrap").style.width = "100%";
- document.getElementById("wrap").style.height = "920px";
- document.getElementById("draw").style.width = "100%";
- document.getElementById("draw").style.height = "920px";
- diaoyonghuatu(current_floor);
- }
- document.getElementById("jizhanxinxi").style.display = "none";
- document.getElementById("gaojinghuizong").style.display = "none";
- document.getElementById("tongjishuju").style.display = "none";
- document.getElementById("shishikaoqin").style.display = "none";
- document.getElementById("xianchanggongzhong").style.display = "none";
- } else {
- //鏀惧ぇ鐘舵�佷笅鐐瑰嚮鎭㈠鍘熸牱
- expand = false;
- modified = false;
- document.getElementById("jizhanxinxi").style.display = "";
- if (document.getElementById("wrap").style.display == "none") {
- //褰撳墠姝e湪浣跨敤鐧惧害鍦板浘
- document.getElementById('ditu').className = "col-xl-6 col-lg-6 col-md-6 col-sm-12 col-12 layout-spacing";
- document.getElementById("map").style.width = null;
- document.getElementById("map").style.height = null;
- document.getElementById("baidumap").style.width = "100%";
- document.getElementById("baidumap").style.height = "100%";
- //diaoyongbaidumap();
- } else if (document.getElementById("baidumap").style.display == "none") {
- //褰撳墠姝e湪浣跨敤瀹ゅ唴鍦板浘
- document.getElementById('ditu').className = "col-xl-6 col-lg-6 col-md-6 col-sm-12 col-12 layout-spacing";
- document.getElementById("map").style.width = null;
- document.getElementById("map").style.height = "480px";
- document.getElementById("maphead").style.width = null;
- document.getElementById("map_bg").style.height = "480px";
- document.getElementById("wrap").style.width = "100%";
- document.getElementById("wrap").style.height = "430px";
- document.getElementById("draw").style.width = null;
- document.getElementById("draw").style.height = null;
- diaoyonghuatu(current_floor);
- }
- document.getElementById("gaojinghuizong").style.display = "";
- document.getElementById("jizhanxinxi").style.display = "";
- document.getElementById("tongjishuju").style.display = "";
- document.getElementById("shishikaoqin").style.display = "";
- document.getElementById("xianchanggongzhong").style.display = "";
- }
- };
-
- function getTruemap() {
- var map_wl = [];
- $.ajax({
- async: false,
- type: "POST",
- url: "/hxzkoa/floornumTomap.do",
- dataType: 'json',
- data: {
- value: current_floor,
- },
- success: function (data) {
- map_wl = [data[0].x_Truelength, data[0].y_Truewidth];
- },
- });
- return map_wl;
- };
-
- function getYuandian() {
- var map_wl = [];
- $.ajax({
- async: false,
- type: "POST",
- url: "/hxzkoa/floornumTomap.do",
- dataType: 'json',
- data: {
- value: current_floor
- },
- success: function (data) {
- yuandian = [data[0].x0_length, data[0].y0_width];
- },
- });
- return yuandian;
- };
-
- function getSystemSetting() {
- var sysset = [];
- $.ajax({
- async: false,
- type: 'POST',
- url: "/hxzkoa/getSysSetting_list.do",
- dataType: 'json',
- success: function (data) {
- sysset = data;
- },
- });
- return sysset;
- };
-
- function loadImages(sources, callback) {
- var count = 0,
- images = {},
- imgNum = 0;
- for (src in sources) {
- imgNum++;
- }
- for (src in sources) {
- images[src] = new Image();
-
- images[src].onload = function () {
- if (++count >= imgNum) {
- callback(images);
- }
- }
- images[src].src = sources[src];
- }
- };
-
- function getTrackColor(yanse) {
- var color;
- if (yanse == "绾㈣壊") {
- var color = "red";
- } else if (yanse == "缁胯壊") {
- var color = "green";
- } else if (yanse == "钃濊壊") {
- var color = "blue";
- } else if (yanse == "鐧借壊") {
- var color = "white";
- } else if (yanse == "榛戣壊") {
- var color = "black";
- } else if (yanse == "榛勮壊") {
- var color = "yellow";
- }
- return color
- };
-
- function getExistFence(leixing) {
- var fencelist = [];
- var fencecolor = [];
- var fencename = [];
- var fencetype = [];
- $.ajax({
- async: false,
- type: 'POST',
- url: "/hxzkoa/getFloorFence.do",
- dataType: 'json',
- data: {
- value: current_floor
- },
- success: function (data) {
- for (var i = 0; i < data.length; i++) {
- fencelist.push(data[i].zuobiao);
- fencecolor.push(data[i].color);
- fencename.push(data[i].name);
- fencetype.push(data[i].type);
- }
- }
- });
- if (leixing == "zuobiao") {
- return fencelist
- } else if (leixing == "color") {
- return fencecolor
- } else if (leixing == "name") {
- return fencename
- } else if (leixing == "type") {
- return fencetype
- };
- };
-
- function getDrawColor(yanse) {
- var color;
- if (yanse == "绾㈣壊") {
- var color = "rgba(255,0,0,0.3)";
- } else if (yanse == "缁胯壊") {
- var color = "rgba(0,255,0,0.3)";
- } else if (yanse == "钃濊壊") {
- var color = "rgba(0,0,255,0.3)";
- } else if (yanse == "鐧借壊") {
- var color = "rgba(255,255,255,0.3)";
- } else if (yanse == "榛戣壊") {
- var color = "rgba(0,0,0,0.3)";
- }
- return color
- };
-
- function inFenceOrNot(fence_list, node_list) {
- //fence_list[x,y]
- //node_list[x,y]
- if (fence_list.length == 2) { //鐭╁舰
- if (node_list[0] >= Math.min(fence_list[0][0], fence_list[1][0]) && node_list[0] <= Math.max(fence_list[0][0], fence_list[1][0])) {
- if (node_list[1] >= Math.min(fence_list[0][1], fence_list[1][1]) && node_list[1] <= Math.max(fence_list[0][1], fence_list[1][1])) {
- return true //鍦ㄨ�冨嫟鍖哄煙
- }
- }
- return false //涓嶅湪鑰冨嫟鍖哄煙
- } else if (fence_list.length > 2) { //澶氳竟褰�
- for (var c = false, i = -1, l = fence_list.length, j = l - 1; ++i < l; j = i)
- ((fence_list[i][1] <= node_list[1] && node_list[1] < fence_list[j][1]) || (fence_list[j][1] <= node_list[1] && node_list[1] < fence_list[i][1]))
- && (node_list[0] < (fence_list[j][0] - fence_list[i][0]) * (node_list[1] - fence_list[i][1]) / (fence_list[j][1] - fence_list[i][1]) + fence_list[i][0])
- && (c = !c);
- return c;
- }
- };
-
- function getGas(leixing) {
- var gaslist = [];
- var gasnongdu = [];
- var gastype = [];
- $.ajax({
- async: false,
- type: 'POST',
- url: "/hxzkoa/getGas_list.do",
- dataType: 'json',
- data: {},
- success: function (data) {
- for (var i = 0; i < data.length; i++) {
- gaslist.push([data[i].x, data[i].y]);
- gasnongdu.push(data[i].nong_du);
- gastype.push(data[i].gas_type);
- }
- }
- });
- if (leixing == "zuobiao") {
- return gaslist
- } else if (leixing == "type") {
- return gastype
- } else if (leixing == "nongdu") {
- return gasnongdu
- };
- };
-
- function getRealPosition() {
- var realposition = [];
- $.ajax({
- async: false,
- type: 'POST',
- url: "/hxzkoa/getRealPosition.do",
- dataType: 'json',
- data: {
- floor: current_floor,
- },
- success: function (data) {
- for (var i = 0; i < data.length; i++) {
- //playMark[id,name,power,life,x,y,time]
- realposition.push([data[i].tagid, data[i].name, data[i].power, data[i].life, data[i].posx, data[i].posy, data[i].time, data[i].fence == 1 || data[i].sos == 1, data[i].sos, data[i].fence])
- }
- },
- });
- return realposition
- };
-
- function getstatus(tagida) {
- var panduan;
- $.ajax({
- async: false,
- type: 'POST',
- url: "/hxzkoa/getstatus.do",
- dataType: 'JSON',
- data: {
- tagid: tagida
- },
- success: function (data) {
- panduan = data
- }
- })
- return panduan;
- }
-
- function str_to_time(str) {
- //鏍规嵁瀛楃涓茶浆鎹㈡垚瀵瑰簲鐨勬椂闂达紙绉掞級
- if (str == "涓嶆樉绀哄疄鏃惰建杩�") {
- return 0;
- } else if (str == "10绉掗挓") {
- return 10;
- } else if (str == "30绉掗挓") {
- return 30;
- } else if (str == "1鍒嗛挓") {
- return 60;
- } else if (str == "10鍒嗛挓") {
- return 600;
- } else if (str == "30鍒嗛挓") {
- return 1800;
- } else if (str == "1灏忔椂") {
- return 3600;
- };
- };
-
- function getTracknow(tagid_str, time) {
- var finalrealtrack = {};
- $.ajax({
- async: false,
- type: 'POST',
- url: "/hxzkoa/getRealTrack.do",
- dataType: 'json',
- data: {
- time: time,
- floor: current_floor,
- tagid: tagid_str,
- },
- success: function (data) {
- for (var i = 0; i < data.length; i++) {
- finalrealtrack[data[i][0].tagid] = [];
- for (var j = 0; j < data[i].length; j++) {
- finalrealtrack[data[i][0].tagid].push([data[i][j].x, data[i][j].y, data[i][j].time])
- }
- }
- //for (var i=0;i<data.length;i++)
- /* let tmp = new Set();
- for (var i=0;i<data.length;i++){
- tmp.add(data[i].tagid);
- };
- let tmpl = Array.from(tmp);
- for (i in tmpl){
- realtrack[tmpl[i]]=[];
- finalrealtrack[tmpl[i]]=[];
- }
- for(var i=0; i<data.length; i++){
- realtrack[data[i].tagid].push([data[i].x, data[i].y, data[i].time])
- }
- for (var i in realtrack){
- if (realtrack[i].length>50){
- var itvl = new Number(realtrack[i].length/50);
- var tmp_result = [];
- for (j=0;i<realtrack[i].length;j+=itvl){
- tmp_result.push(realtrack[i][j])
- }
- finalrealtrack[i]=tmp_result;
- } else {
- finalrealtrack[i]=realtrack[i]
- }
- } */
- },
- });
- return finalrealtrack;
- };
-
- function getAnchorInfo() {
- var online_anchorList = [];
- var offline_anchorList = [];
- $.ajax({
- async: false,
- type: 'POST',
- url: "/hxzkoa/getAnchorInfo.do",
- dataType: 'json',
- data: {
- floor: current_floor,
- },
- success: function (data) {
- for (var i = 0; i < data.length; i++) {
- tmplist = [data[i].anchorid, data[i].posx, data[i].posy, data[i].posz, data[i].GreateTime];
- if (data[i].anchormode == "1") {
- online_anchorList.push(tmplist);
- } else if (data[i].anchormode == "0") {
- offline_anchorList.push(tmplist);
- }
- }
- }
- });
- return [online_anchorList, offline_anchorList]
- };
-
- function ToDigital(strDu, strFen, strMiao, len) {
- len = (len > 6 || typeof (len) == "undefined") ? 6 : len;//绮剧‘鍒板皬鏁扮偣鍚庢渶澶氬叚浣�
- strDu = (typeof (strDu) == "undefined" || strDu == "") ? 0 : parseFloat(strDu);
- strFen = (typeof (strFen) == "undefined" || strFen == "") ? 0 : parseFloat(strFen) / 60;
- strMiao = (typeof (strMiao) == "undefined" || strMiao == "") ? 0 : parseFloat(strMiao) / 60; //绉掍负鍒嗙殑鏍煎紡
- var digital = strDu + strFen + strMiao;
- if (digital == 0) {
- return "";
- } else {
- return digital.toFixed(len);
- }
- };
-
- function getGPS() {
- var gpslist = [];
- $.ajax({
- async: false,
- type: 'POST',
- traditional: true,
- url: "/hxzkoa/getGPS.do",
- dataType: 'json',
- data: {},
- success: function (data) {
- //缁忕含搴︿粠搴﹀垎绉掕浆鎴愬害
- for (var i = 0; i < data.length; i++) {
- if (data[i].gps_weidu != "" && data[i].gsp_jingdu != "") {
- //data[i].gps_weidu="3951.74908"
- var weidu = ToDigital(data[i].gps_weidu.substring(0, 2), data[i].gps_weidu.substring(2, 4), data[i].gps_weidu.substring(4));
- if (data[i].gps_NS == "S") {
- weidu = String(0 - weidu);
- };
- //data[i].gsp_jingdu="11615.43424"
- var jingdu = ToDigital(data[i].gsp_jingdu.substring(0, 3), data[i].gsp_jingdu.substring(3, 5), data[i].gsp_jingdu.substring(5));
- if (data[i].gps_EW == "W") {
- jingdu = String(0 - jingdu);
- };
- gpslist.push([data[i].tagid, jingdu, weidu, data[i].gps_haiba_gao, data[i].gps_state, data[i].gps_num, data[i].gps_hdop, data[i].gps_tuoqiu, data[i].gps_chafen_time, data[i].gps_chafen_id, data[i].gps_jiaoyan, data[i].gps_kahao, data[i].gps_power, data[i].gps_sos, data[i].addtime, data[i].name]);
- }
- };
- },
- });
- return gpslist;
- };
-
- function Queue() {
- let items = [];
- // 鍚戦槦鍒楁坊鍔犲厓绱狅紙涓�涓垨澶氫釜锛�
- this.enqueue = function (element) {
- if (element instanceof Array) items = items.concat(element);
- else items.push(element);
- };
- this.enqueue_list = function (element) {
- items.push(element);
- };
- // 浠庨槦鍒楃Щ闄ゅ厓绱�
- this.dequeue = function () {
- return items.shift();
- };
- // 杩斿洖闃熷垪涓殑绗竴涓厓绱�
- this.front = function () {
- return items[0];
- };
- // 杩斿洖闃熷垪鐨勯暱搴�
- this.size = function () {
- return items.length;
- };
- // 娓呯┖闃熷垪
- this.clear = function () {
- items = [];
- };
-
- // 鎵撳嵃闃熷垪鍐呯殑鎵�鏈夊厓绱�
- this.print = function () {
- };
- };
-
- /**璇ユ柟娉曠敤鏉ョ粯鍒朵竴涓湁濉厖鑹茬殑鍦嗚鐭╁舰
- *@param cxt:canvas鐨勪笂涓嬫枃鐜
- *@param x:宸︿笂瑙抶杞村潗鏍�
- *@param y:宸︿笂瑙抷杞村潗鏍�
- *@param width:鐭╁舰鐨勫搴�
- *@param height:鐭╁舰鐨勯珮搴�
- *@param radius:鍦嗙殑鍗婂緞
- *@param fillColor:濉厖棰滆壊
- **/
- function fillRoundRect(cxt, x, y, width, height, radius, /*optional*/ fillColor) {
- //鍦嗙殑鐩村緞蹇呯劧瑕佸皬浜庣煩褰㈢殑瀹介珮
- if (2 * radius > width || 2 * radius > height) { return false; }
-
- cxt.save();
- cxt.translate(x, y);
- //缁樺埗鍦嗚鐭╁舰鐨勫悇涓竟
- drawRoundRectPath(cxt, width, height, radius);
- cxt.fillStyle = fillColor || "#000"; //鑻ユ槸缁欏畾浜嗗�煎氨鐢ㄧ粰瀹氱殑鍊煎惁鍒欑粰浜堥粯璁ゅ��
- cxt.fill();
- cxt.restore();
- }
-
- function drawRoundRectPath(cxt, width, height, radius) {
- cxt.beginPath(0);
- //浠庡彸涓嬭椤烘椂閽堢粯鍒讹紝寮у害浠�0鍒�1/2PI
- cxt.arc(width - radius, height - radius, radius, 0, Math.PI / 2);
-
- //鐭╁舰涓嬭竟绾�
- cxt.lineTo(radius, height);
-
- //宸︿笅瑙掑渾寮э紝寮у害浠�1/2PI鍒癙I
- cxt.arc(radius, height - radius, radius, Math.PI / 2, Math.PI);
-
- //鐭╁舰宸﹁竟绾�
- cxt.lineTo(0, radius);
-
- //宸︿笂瑙掑渾寮э紝寮у害浠嶱I鍒�3/2PI
- cxt.arc(radius, radius, radius, Math.PI, Math.PI * 3 / 2);
-
- //涓婅竟绾�
- cxt.lineTo(width - radius, 0);
-
- //鍙充笂瑙掑渾寮�
- cxt.arc(width - radius, radius, radius, Math.PI * 3 / 2, Math.PI * 2);
-
- //鍙宠竟绾�
- cxt.lineTo(width, height - radius);
- cxt.closePath();
- }
-
- function isEmptyObject(obj) {
- for (var n in obj) {
- return false
- }
- return true;
- }
- </script>
-
- <!-- 鐧惧害鍦板浘鍔熻兘 -->
- <script type="text/javascript">
-
- function Convertor(ak) {
- this.stepCount = 100;
- this.pointCount = [];
- this.Result = [];
- this.NoisIndex = [];
- this.Time = new Date();
- this.AK = ak;
- this.M_PI = 3.14159265358979324;
- this.A = 6378245.0;
- this.EE = 0.00669342162296594323;
- this.X_PI = this.M_PI * 3000.0 / 180.0;
- }
- Convertor.prototype.outofChine = function(p) {
- if (p.lng < 72.004 || p.lng > 137.8347) {
- return true;
- }
- if (p.lat < 0.8293 || p.lat > 55.8271) {
- return true;
- }
- return false;
- }
- ;
- Convertor.prototype.WGS2GCJ_lat = function(x, y) {
- var ret1 = -100.0 + 2.0 * x + 3.0 * y + 0.2 * y * y + 0.1 * x * y + 0.2 * Math.sqrt(Math.abs(x));
- ret1 += (20.0 * Math.sin(6.0 * x * this.M_PI) + 20.0 * Math.sin(2.0 * x * this.M_PI)) * 2.0 / 3.0;
- ret1 += (20.0 * Math.sin(y * this.M_PI) + 40.0 * Math.sin(y / 3.0 * this.M_PI)) * 2.0 / 3.0;
- ret1 += (160.0 * Math.sin(y / 12.0 * this.M_PI) + 320 * Math.sin(y * this.M_PI / 30.0)) * 2.0 / 3.0;
- return ret1;
- }
- ;
- Convertor.prototype.WGS2GCJ_lng = function(x, y) {
- var ret2 = 300.0 + x + 2.0 * y + 0.1 * x * x + 0.1 * x * y + 0.1 * Math.sqrt(Math.abs(x));
- ret2 += (20.0 * Math.sin(6.0 * x * this.M_PI) + 20.0 * Math.sin(2.0 * x * this.M_PI)) * 2.0 / 3.0;
- ret2 += (20.0 * Math.sin(x * this.M_PI) + 40.0 * Math.sin(x / 3.0 * this.M_PI)) * 2.0 / 3.0;
- ret2 += (150.0 * Math.sin(x / 12.0 * this.M_PI) + 300.0 * Math.sin(x / 30.0 * this.M_PI)) * 2.0 / 3.0;
- return ret2;
- }
- ;
- Convertor.prototype.WGS2GCJ = function(poi) {
- if (this.outofChine(poi)) {
- return;
- }
- var poi2 = {};
- var dLat = this.WGS2GCJ_lat(poi.lng - 105.0, poi.lat - 35.0);
- var dLon = this.WGS2GCJ_lng(poi.lng - 105.0, poi.lat - 35.0);
- var radLat = poi.lat / 180.0 * this.M_PI;
- var magic = Math.sin(radLat);
- magic = 1 - this.EE * magic * magic;
- var sqrtMagic = Math.sqrt(magic);
- dLat = (dLat * 180.0) / ((this.A * (1 - this.EE)) / (magic * sqrtMagic) * this.M_PI);
- dLon = (dLon * 180.0) / (this.A / sqrtMagic * Math.cos(radLat) * this.M_PI);
- poi2.lat = poi.lat + dLat;
- poi2.lng = poi.lng + dLon;
- return poi2;
- }
- ;
- Convertor.prototype.GCJ2BD09 = function(poi) {
- var poi2 = {};
- var x = poi.lng
- , y = poi.lat;
- var z = Math.sqrt(x * x + y * y) + 0.00002 * Math.sin(y * this.X_PI);
- var theta = Math.atan2(y, x) + 0.000003 * Math.cos(x * this.X_PI);
- poi2.lng = z * Math.cos(theta) + 0.0065;
- poi2.lat = z * Math.sin(theta) + 0.006;
- return poi2;
- }
- ;
- /**
- * WGS->鐧惧害鍧愭爣绯�
- */
- Convertor.prototype.WGS2BD09 = function(poi) {
- //WGS->GCJ
- var poi2 = this.WGS2GCJ(poi);
- if (typeof poi2 === "undefined") {
- return;
- }
- //GCJ->鐧惧害鍧愭爣绯�
- return this.GCJ2BD09(poi2);
- }
-
- function diaoyongbaidumap() {
- //璇诲彇绯荤粺璁剧疆
- var bm_sysSetting = getSystemSetting();
- var bm_tagZb = bm_sysSetting[0].tagZb;//鏄惁鏄剧ず鏍囩鍧愭爣
- var bm_viewName = bm_sysSetting[0].viewName;//鏄惁鏄剧ず浜哄憳鍚嶇О
- var bm_viewPower = bm_sysSetting[0].viewPower;//鏄惁鏄剧ず鐢甸噺
- var bm_viewTagid = bm_sysSetting[0].viewTagid;//鏄惁鏄剧ず鏍囩ID
- var bm_offView = bm_sysSetting[0].offView;//鏄惁绂荤嚎涓嶆樉绀哄浘鏍�
- var bm_quiet = bm_sysSetting[0].quiet;//闈欐杈撳嚭鍥哄畾鍧愭爣
- var bm_name = bm_sysSetting[0].viewName;//鏄惁鏄剧ず浜哄憳濮撳悕
- var bm_baidu_j = bm_sysSetting[0].baidu_j;//鐧惧害鍦板浘绮惧害
- var bm_baidu_w = bm_sysSetting[0].baidu_w;//鐧惧害鍦板浘缁村害
-
- // 鐧惧害鍦板浘API鍔熻兘
- var bm = new BMap.Map("baidumap"); // 鍒涘缓Map瀹炰緥
-
- bm.centerAndZoom(new BMap.Point(bm_baidu_j, bm_baidu_w), 12); // 鍒濆鍖栧湴鍥�,璁剧疆涓績鐐瑰潗鏍囧拰鍦板浘绾у埆
- //娣诲姞鍦板浘绫诲瀷鎺т欢
- var opts = { type: BMAP_NAVIGATION_CONTROL_ZOOM }; //浠呬繚鐣欐帶浠剁缉鏀鹃儴鍒�
- bm.addControl(new BMap.NavigationControl(opts)); //娣诲姞瀵艰埅鎺т欢
- //map.addControl(new BMap.OverviewMapControl());
- bm.setCurrentCity("鍖椾含"); // 璁剧疆鍦板浘鏄剧ず鐨勫煄甯� 姝ら」鏄繀椤昏缃殑
- bm.enableScrollWheelZoom(true); //寮�鍚紶鏍囨粴杞缉鏀�
- bm.addControl(new BMap.MapTypeControl({
- mapTypes: [
- BMAP_NORMAL_MAP,
- BMAP_SATELLITE_MAP,
- BMAP_HYBRID_MAP
- ]
- }));
-
- var myIcon = new BMap.Icon("/hxzkoa/hxzk/image/targeticon/default.png", new BMap.Size(40, 40), {
- //浣跨敤鑷畾涔夋爣娉ㄦ椂锛屾寚鍚戠殑鍦扮悊浣嶇疆浣嶄簬鍥剧墖鐨勪腑蹇冪偣
- //anchor涓哄浘鐗囧乏涓婅鐩稿浜庡湴鐞嗕綅缃殑鍋忕Щ閲忥紝姝ゆ椂鎸囧悜鐨勫湴鐞嗕綅缃綅浜庡浘鏍囦腑蹇冩渶涓嬫柟
- anchor: new BMap.Size(20, 40)
- }
- );
-
- //current_node_list涓簕key(tagid):zuobiao_mark}
- var current_node_list = new Array();
- //var current_node_list = new Queue();
-
- /* function getGPSInfo(data){
- return "GPS鐘舵��:"+gps_node_list[current_gps_index][4]+"\n姝e湪浣跨敤鐨勫崼鏄熸暟閲�:"+gps_node_list[current_gps_index][5]+"\nHDOP姘村钩绮惧害鍥犲瓙:"+gps_node_list[current_gps_index][6]+"\n鍦扮悆妞悆闈㈢浉瀵瑰ぇ鍦版按鍑嗛潰鐨勯珮搴�:"+gps_node_list[current_gps_index][7]+
- "\n宸垎鏃堕棿:"+gps_node_list[current_gps_index][8]+"\n宸垎绔橧D鍙�:"+gps_node_list[current_gps_index][9]+"\n鏍¢獙鍊�:"+gps_node_list[current_gps_index][10]+"\n璁惧鐗╄仈缃戝崱鍙�:"+gps_node_list[current_gps_index][11]+"\n璁惧SOS鐘舵��:"+gps_node_list[current_gps_index][13]
- +"\n娣诲姞鏃堕棿"+gps_node_list[current_gps_index][14]
- }; */
-
- var t = 300; //姣�600ms浠庡悗鍙拌姹備竴娆℃渶鏂扮殑鏁版嵁
- fn();
-
- var timer = setTimeout(function f() {
- fn();
- timer = setTimeout(f, 300);
- }, t);
-
- //timer_bm = setTimeout(fn ,t);
-
- function fn() {
- //鑾峰彇gps鍧愭爣, [tagid, jingdu, weidu, gps_haiba_gao, gps_state, gps_num, gps_hdop, gps_tuoqiu, gps_chafen_time, gps_chafen_id, gps_jiaoyan, gps_kahao, gps_power, gps_sos, addtime]
- var gps_node_list = getGPS();
- var n = 0;
- //鍧愭爣杞崲瀹屼箣鍚庣殑鍥炶皟鍑芥暟
- translateCallback = function (data) {
- var zhuangtaia = getstatus(gps_node_list[n][0]);
- if (current_node_list[gps_node_list[n][0]].size() > 0) {
- old_mark = current_node_list[gps_node_list[n][0]].front();
- current_node_list[gps_node_list[n][0]].dequeue();
- bm.removeOverlay(old_mark);//娓呴櫎涓婁竴涓�
- }
- if ((bm_offView == '1' && zhuangtaia == '1') || (bm_offView == '0')) {
- marker = new BMap.Marker(data.points[0], { icon: myIcon });
- bm.addOverlay(marker);
- current_node_list[gps_node_list[n][0]].enqueue(marker);
-
- if (bm_viewTagid == "1") {
- var tagid = new BMap.Label(gps_node_list[n][0], { offset: new BMap.Size(20, -30) });
- tagid.setStyle({
- color: "#fff",
- fontSize: "14px",
- borderRadius: "5px",
- padding: "5px 5px",
- border: "0",
- backgroundColor: "#32CD32",
- transform: 'translateX(-50%)',
- });
- marker.setLabel(tagid); //娣诲姞label-tagid
- }
- if (bm_tagZb == "1") {
- var zuobiao = new BMap.Label(gps_node_list[n][1] + ',' + gps_node_list[n][2], { offset: new BMap.Size(20, +40) });
- zuobiao.setStyle({ transform: 'translateX(-50%)' });
- marker.setLabel(zuobiao);
- }
- if (bm_viewPower == "1") {
- var dianliang = new BMap.Label("璁惧鐢甸噺" + gps_node_list[n][12], { offset: new BMap.Size(20, +80) });
- dianliang.setStyle({ transform: 'translateX(-50%)' });
- marker.setLabel(dianliang);
- }
- if (bm_name=="1") {
- var name=new BMap.Label("璁惧鍚嶇О:"+gps_node_list[n][15],{offset:new BMap.Size(20,+60)});
- name.setStyle({transform: 'translateX(-50%)'});
- marker.setLabel(name); //娣诲姞label-tagid
- }
- }
- n = n + 1;
- };
- var points = [];
- if (gps_node_list.length != 0) {
- var c = new Convertor();
- //var convertor = new BMap.Convertor();
- for (var i = 0; i < gps_node_list.length; i++) {
- if (current_node_list[gps_node_list[i][0]] == null) {
- current_node_list[gps_node_list[i][0]] = new Queue();
- }
- var point = new BMap.Point(new Number(gps_node_list[i][1]), new Number(gps_node_list[i][2]));
- points.push(point)
- console.log(point.lng)
- //convertor.translate(points,1,5,translateCallback);
- var r1=c.WGS2BD09({lng:point.lng,lat:point.lat});
- console.log(r1)
- points = [];
- };
- }
-
-
- /**
- * 鍧愭爣甯搁噺璇存槑锛�
- * COORDINATES_WGS84 = 1, WGS84鍧愭爣
- * COORDINATES_WGS84_MC = 2, WGS84鐨勫钩闈㈠ⅷ鍗℃墭鍧愭爣
- * COORDINATES_GCJ02 = 3锛孏CJ02鍧愭爣
- * COORDINATES_GCJ02_MC = 4, GCJ02鐨勫钩闈㈠ⅷ鍗℃墭鍧愭爣
- * COORDINATES_BD09 = 5, 鐧惧害bd09缁忕含搴﹀潗鏍�
- * COORDINATES_BD09_MC = 6锛岀櫨搴d09澧ㄥ崱鎵樺潗鏍�
- * COORDINATES_MAPBAR = 7锛宮apbar鍦板浘鍧愭爣
- * COORDINATES_51 = 8锛�51鍦板浘鍧愭爣
- */
-
- };
- };
- </script>
- <!-- 鐧惧害鍦板浘鍔熻兘缁撴潫 -->
-
- <!-- 瀹ゅ唴瀹氫綅鍦板浘鍔熻兘 -->
- <script>
- // img map related
- //if (current_map!="鐧惧害鍦板浘"){
- function diaoyonghuatu(current_floor) {
- var imgUrl = '/hxzkoa/hxzk/image/mapfile/' + current_map;//鍥剧墖璺緞
- //var imgUrl = '/hxzkoa/hxzk/image/mapfile/office.jpg';//鍥剧墖璺緞
- var imgList = new Array();
- imgList['map'] = imgUrl;
- var iconUrl = '/hxzkoa/hxzk/image/targeticon/default.png';
- imgList['icon'] = iconUrl;
-
- var anckicon_on = '/hxzkoa/hxzk/image/anchor/鍩虹珯鍦ㄧ嚎.png';
- //var anckicon_on = '/hxzkoa/hxzk/image/anchor/lingjin.png';
- imgList['anchor_online'] = anckicon_on;
-
- var anckicon_off = '/hxzkoa/hxzk/image/anchor/鍩虹珯绂荤嚎.png'
- //var anckicon_off = '/hxzkoa/hxzk/image/anchor/ceju.png';
- imgList['anchor_offline'] = anckicon_off;
- new MarkPoints(imgList);
- }
- var tuodong = false;
- var sosType = true;
- var sos = document.createElement('img');
- sos.src = '/hxzkoa/hxzk/image/icon/SOS.png';
- var sos1 = document.createElement('img');
- sos1.src = '/hxzkoa/hxzk/image/icon/SOS1.png';
-
- function MarkPoints(imgList) {
- this.imgX = 0;//鍦ㄧ敾甯冧笂鍥剧墖鐨刋鍋忕Щ閲�
- this.imgScale = 1;//鍥剧墖鐨勭缉鏀炬瘮渚�
- this.imgY = 0;//鍦ㄧ敾甯冧笂鍥剧墖鐨刌鍋忕Щ閲�
- this.rateNum;//鍥剧墖楂樺害鑷�傚簲姣斾緥,鍥剧墖绛夋瘮灞呬腑灞曠ず鍦╟anvas
- this.scaleFlag = 0;//缂╂斁鍥犲瓙锛屾渶澶х缉鏀�9,鏈�灏忕缉鏀�-9
- this.context;
- this.img; //鍦板浘
- this.playIndex = 0;
- this.pos = {};//姣忔鎷栨嫿鍓嶅潗鏍囦繚瀛�
-
- this.imgLoadList = new Array();
- this.rateNumList = new Array();
- this.imgXList = new Array();
- this.imgYList = new Array();
- this.imgScaleList = new Array();
-
- //鑾峰彇鐪熷疄鍦板浘
- this.trueMeasure;
- this.trueLength;
- this.trueWidth;
- this.x_ratio;
- this.y_ratio;
- this.x_x0;
- this.y_y0;
-
- //system setting
- this.sysSetting;
- this.tagZb = '0';//鏄惁鏄剧ず鏍囩鍧愭爣
- this.diskaoqin = '0'; //鍑鸿�冨嫟鍖哄煙鏄惁娑堝け
- this.viewAnckid = '0';//鏄惁鏄剧ず鍩虹珯ID
- this.viewName = '0';//鏄惁鏄剧ず浜哄憳鍚嶇О
- this.tunlDw = '0'//闅ч亾瀹氫綅妯″紡
- this.guiji_sava = '0'//鏄惁寮�鍚建杩逛繚瀛�
- this.viewPower = '0';//鏄惁鏄剧ず鐢甸噺
- this.viewTagid = '0';//鏄惁鏄剧ず鏍囩ID
- this.viewAnckzb = '0';//鏄惁鏄剧ず鍩虹珯鍧愭爣
- this.offView = '0'//鏄惁绂荤嚎涓嶆樉绀哄浘鏍�
- this.anckicon = '0'//鏄惁鏄剧ず鍩虹珯鍥炬爣
- this.gas_show = '0'//鏄剧ず鍏朵粬妫�娴�(姘斾綋鏄剧ず)
- this.quiet = '0'//闈欐杈撳嚭鍥哄畾鍧愭爣
- this.real_trak_time = 0//瀹炴椂杞ㄨ抗鏄剧ず鏃堕暱
- this.real_trak_color = '绾㈣壊'//瀹炴椂杞ㄨ抗鏄剧ず鐨勯鑹�
-
- this.playFlag = false;//鏄惁鎾斁
- this.dragFlag = false;//鏄惁鍙嫋鎷藉綋鍓峣mg锛岄粯璁や笉鑳�
- this.markFlag = false;//鏍囪鍖哄煙寮�鍚叧闂璮lag
- this.CreatLinepoints = [];//姣忔鍒涘缓鏂板尯鍩熺殑鍧愭爣闆嗗悎
- this.playMark; //姝e湪灞曠ず鐨勬爣璁�
- this.playMarkInKaoQin;//褰撳墠鏍囪鏄惁鍦ㄨ�冨嫟鍖哄煙鍐�
- this.trackNow; //褰撳墠杞ㄨ抗
-
- this.onlineAnchorList;//褰撳墠鍦ㄧ嚎鍩虹珯鍒楄〃
- this.offlineAnchorList;//褰撳墠绂荤嚎鍩虹珯鍒楄〃
-
- this.allMarkLins = [];//宸插垱寤虹殑鍖哄煙闆嗗悎锛屼緥濡俒[{x,y},{x,y},{x,y}],[{n,m},{n,m},{n,m}]]鐩墠鍙渶瑕佷竴涓尯鍩燂紝鎵�浠ユ暟缁勫唴閮ㄥ彧鏈変竴椤�
- this.allFenceColor = [];//宸插垱寤虹殑鍖哄煙棰滆壊
-
- this.FenceList; //鍥存爮鍧愭爣
- this.FenceColor; //鍥存爮棰滆壊
- this.FenceName; //鍥存爮鍚嶇О
- this.realFenceList = []; // [鍚嶇О锛岀被鍨嬶紝瀹為檯鍧愭爣]
- this.fenceMarkCount; //鍖哄煙鍐呯殑鍧愭爣鏁伴噺
- this.cacheCanvas = null; //缂撳瓨鍥存爮缁樺浘
-
- this.GasList; //姘斾綋鍧愭爣
- this.GasType; //姘斾綋绫诲瀷
- this.GasNongdu; //姘斾綋娴撳害
-
- this.getImgLoad(imgList);
- this.init();
- document.oncontextmenu = new Function("event.returnValue=false;");
- document.onselectstart = new Function("event.returnValue=false;");
- };
-
- MarkPoints.prototype = {
- getImgLoad: function (imgList) {
- var _this = this;
- var wrap = document.getElementById('wrap');
- _this.canvas = document.getElementById('draw');
- _this.context = draw.getContext('2d');
- _this.canvas.height = wrap.offsetHeight;
- _this.canvas.width = wrap.offsetWidth;
-
- loadImages(imgList, function (images) {
- for (var key in images) {
- if (key == 'map') {
- _this.imgScaleList[key] = 1;
- _this.img = images[key];
- } else if (key == 'icon') {
- _this.imgScaleList[key] = 0.037;
- } else {
- _this.imgScaleList[key] = images[key].naturalWidth / images['map'].naturalWidth;
- };
- _this.rateNumList[key] = _this.canvas.width / images[key].naturalWidth;
- _this.imgXList[key] = (_this.canvas.width - images[key].naturalWidth * _this.imgScaleList[key] * _this.rateNumList[key]) / 2;
- _this.imgYList[key] = (_this.canvas.height - images[key].naturalHeight * _this.imgScaleList[key] * _this.rateNumList[key]) / 2;//榛樿杩涙潵褰撳墠鍥惧儚灞呬腑鏄剧ず
- _this.imgLoadList[key] = images[key];
- }
- /*鐢诲嚭褰撳墠鍥剧墖*/
- //_this.drawImg();
- });
- },
-
- drawImg: function () {
- var _this = this;
- var can = _this.context;
- can.clearRect(0, 0, _this.canvas.width, _this.canvas.height);
-
- can.globalCompositeOperation = "source-over";
- //can.globalCompositeOperation = "destination-over";
- var images = _this.imgLoadList;
-
- //鐢诲湴鍥�
- can.drawImage(_this.img, 0, 0, _this.img.naturalWidth, _this.img.naturalHeight, _this.imgXList['map'], _this.imgYList['map'], _this.img.naturalWidth * _this.imgScaleList['map'] * _this.rateNumList['map'], _this.img.naturalHeight * _this.imgScaleList['map'] * _this.rateNumList['map']);
-
- //瀹為檯涓庡浘鐗囩殑姣斾緥灏�
- _this.x_ratio = new Number(_this.imgLoadList['map'].naturalWidth / _this.trueLength);
- _this.y_ratio = new Number(_this.imgLoadList['map'].naturalHeight / _this.trueWidth);
-
- if (tuodong == true) {
- return false;
- }
-
- if (_this.cacheCanvas == null) {
- _this.cacheCanvas = document.createElement("canvas");
- _this.cacheCanvas.width = _this.canvas.width;
- _this.cacheCanvas.height = _this.canvas.height;
- var cacheCtx = _this.cacheCanvas.getContext("2d");
- //鐢诲嚭褰撳墠宸叉湁鐨勫洿鏍忓尯鍩�
- if (_this.FenceList.length) {
- //閬嶅巻姣忎釜fence锛屽苟鐢诲嚭
- for (var m = 0; m < _this.FenceList.length; m++) {
- var draw_points_list = [];
- var points_list = _this.FenceList[m].split(",");
- //瀹為檯鍧愭爣杞垚鍥句笂鍧愭爣
- for (var i = 0; i < points_list.length; i++) {
- if (i % 2 == 0) {
- //鍋舵暟鍧愭爣锛屽嵆x鍧愭爣
- tmp_list = [];
- var tmp_point = new Number(_this.imgXList['map'] + _this.imgScaleList['map'] * _this.rateNumList['map'] * _this.x_ratio * (points_list[i] - _this.x_x0));
- tmp_list.push(tmp_point);
- } else {
- var tmp_point = new Number(_this.imgYList['map'] + _this.imgScaleList['map'] * _this.rateNumList['map'] * _this.y_ratio * (points_list[i] - _this.y_y0));
- tmp_list.push(tmp_point);
- draw_points_list.push(tmp_list);
- };
- };
-
- var color = getDrawColor(_this.FenceColor[m]);
- var name = _this.FenceName[m];
-
- if (draw_points_list.length == 2) {
- cacheCtx.beginPath();
- cacheCtx.fillStyle = color;
- cacheCtx.fillRect(draw_points_list[0][0], draw_points_list[0][1], draw_points_list[1][0] - draw_points_list[0][0], draw_points_list[1][1] - draw_points_list[0][1]);
- cacheCtx.stroke();
- cacheCtx.fillStyle = "red";
- cacheCtx.fillText(name, (draw_points_list[0][0] + draw_points_list[1][0]) / 2, (draw_points_list[0][1] + draw_points_list[1][1]) / 2);
- cacheCtx.closePath();
- } else {
- cacheCtx.beginPath();
- cacheCtx.fillStyle = color;
- cacheCtx.lineWidth = 1;
- var text_x = new Number(0);
- var text_y = new Number(0);
- for (var j = 0; j < draw_points_list.length; j++) {
- if (j == 0) {
- cacheCtx.moveTo(draw_points_list[j][0], draw_points_list[j][1]);
- } else {
- cacheCtx.lineTo(draw_points_list[j][0], draw_points_list[j][1]);
- }
- if (j == draw_points_list.length - 1) {
- cacheCtx.lineTo(draw_points_list[0][0], draw_points_list[0][1]);
- cacheCtx.fill();
- }
- text_x = text_x + draw_points_list[j][0];
- text_y = text_y + draw_points_list[j][1];
-
- }
- text_x = text_x / draw_points_list.length;
- text_y = text_y / draw_points_list.length;
-
- cacheCtx.fillStyle = color;
- cacheCtx.fill();
- cacheCtx.strokeStyle = color;
- cacheCtx.stroke();
- cacheCtx.fillStyle = "red";
- cacheCtx.fillText(name, text_x, text_y);
- cacheCtx.closePath();
- };
- };
- };
- can.drawImage(_this.cacheCanvas, 0, 0);
- } else {
- can.drawImage(_this.cacheCanvas, 0, 0);
- };
-
-
- //鍒ゆ柇褰撳墠鍧愭爣鏄惁鍦ㄨ�冨嫟鍖哄煙鍐�
- _this.playMarkInKaoQin = [];
- for (var n in _this.playMark) { //_this.playMark涓哄綋鍓嶅疄鏃跺湪绾跨偣浣嶇疆锛屼负[array[id,name,power,life,x,y,time]]
- node_list = [Number(_this.playMark[n][4]), Number(_this.playMark[n][5])];
- for (var f in _this.realFenceList) {
- if (_this.realFenceList[f][1] == "鑰冨嫟鍖哄煙") {
- if (inFenceOrNot(_this.realFenceList[f][2], node_list)) {
- //inFenceOrNot(fence_list, node_list) return true/false
- _this.playMarkInKaoQin.push(true);
- break;
- }
- }
- };
- if (_this.playMarkInKaoQin.length == n) {
- _this.playMarkInKaoQin.push(false);
- }
- };
-
-
- //璁$畻鍖哄煙鍐呯殑鍧愭爣鏁伴噺锛堥毀閬撳畾浣嶏級
- _this.fenceMarkCount = [];
- for (var f in _this.realFenceList) {
- //f[name, type, zuobiao_array]
- var tmp_count = new Number(0);
- for (var n in _this.playMark) {//_this.playMark涓哄綋鍓嶅疄鏃跺湪绾跨偣浣嶇疆锛屼负[array[.x, .y]]
- node_list = [Number(_this.playMark[n][4]), Number(_this.playMark[n][5])];
- if (inFenceOrNot(_this.realFenceList[f][2], node_list)) {//inFenceOrNot(fence_list, node_list) return true/false
- tmp_count += 1;
- //break;
- }
- };
- _this.fenceMarkCount.push(tmp_count);
- };
-
-
- //鐢绘爣绛惧強鍩虹珯
- for (var key in images) {
- if (key == "icon" && _this.playMark) {
- for (var i = 0; i < _this.playMark.length; i++) {
- var tagzhuangtai = _this.playMark[i][3]; //鍦ㄧ嚎鐘舵��
- //var playMarkInKaoQin = true;
- if (((_this.offView == '1' && tagzhuangtai == '1') || (_this.offView == '0')) && ((_this.diskaoqin == "1" && _this.playMarkInKaoQin[i]) || (_this.diskaoqin == "0"))) {
- //鏄惁寮�鍚绾挎秷澶憋紝骞跺垽鏂姸鎬侊紙鍦ㄧ嚎1/绂荤嚎0锛夛紱褰撳紑鍚绾挎秷澶辨椂锛堜粎鏄剧ず鍦ㄧ嚎鏍囩锛夛紝褰撴湭寮�鍚绾挎秷澶辨椂锛堝叏閮ㄦ樉绀猴級
- //鏄惁寮�鍚嚭鑰冨嫟鍖哄煙娑堝け锛屽苟鍒ゆ柇鏄惁鍦ㄨ�冨嫟鍖哄煙鍐咃紱褰撳紑鍚嚭鑰冨嫟鍖哄煙娑堝け鏃讹紙闇�瑕佸湪鑰冨嫟鍖哄煙鍐咃級锛屽綋鏈紑鍚椂锛堝叏閮ㄦ樉绀猴級
-
- //璇诲彇褰撳墠瀹為檯鍧愭爣
- var cor_x = new Number(_this.playMark[i][4]); // 姝ゅ_this.playMark鏄暟鎹簱閲屽彇鍒扮殑褰撳墠鐐瑰潗鏍�,4鏄痯osx,5鏄痯osy
- var cor_y = new Number(_this.playMark[i][5]);
- //杞负鍥句笂鍧愭爣
- var x_cor_now = new Number(_this.imgXList['map'] + _this.imgScaleList['map'] * _this.rateNumList['map'] * _this.x_ratio * (cor_x - _this.x_x0));
- var y_cor_now = new Number(_this.imgYList['map'] + _this.imgScaleList['map'] * _this.rateNumList['map'] * _this.y_ratio * (cor_y - _this.y_y0));
- //鐢诲湪鐩稿簲浣嶇疆涓�
- //can.drawImage(images[key], 0, 0, images[key].naturalWidth, images[key].naturalHeight, x_cor_now - (images[key].naturalWidth * _this.imgScaleList[key] * _this.rateNumList[key])/2, y_cor_now - (images[key].naturalHeight * _this.imgScaleList[key] * _this.rateNumList[key]), images[key].naturalWidth * _this.imgScaleList[key] * _this.rateNumList[key], images[key].naturalHeight * _this.imgScaleList[key] * _this.rateNumList[key]);
- //can.drawImage(images[key], 0, 0, images[key].naturalWidth, images[key].naturalHeight, x_cor_now - (images[key].naturalWidth * _this.imgScaleList[key] * _this.rateNumList[key])/2, y_cor_now - (images[key].naturalHeight * _this.imgScaleList[key] * _this.rateNumList[key]), images[key].naturalWidth * _this.imgScaleList[key] * _this.rateNumList[key], images[key].naturalHeight * _this.imgScaleList[key] * _this.rateNumList[key]);
- //鏄惁鏈夎建杩规嫋灏�
- if (_this.real_trak_time != 0) {
- var trackNow = [];
- var pm = _this.playMark[i];
- function ftn(pm, tn, rtk, ctt, rtc, igxm, igym, igslm, rnlm, xr, yr, xx0, yy0) {
- //trackNow = getTracknow( pm[0], rtk)
- if (tn.length == 0) {
- trackNow = [];
- } else if (pm[0] in tn) {
- trackNow = tn[pm[0]];
- } else {
- trackNow = [];
- };
- var can = ctt;
- can.beginPath();
- can.strokeStyle = rtc;
- can.fillStyle = rtc;
- for (var i = 0; i < trackNow.length; i++) {
- var cor_x = new Number(trackNow[i][0]);
- var cor_y = new Number(trackNow[i][1]);
- var x_cor = new Number(igxm + igslm * rnlm * xr * (cor_x - xx0));
- var y_cor = new Number(igym + igslm * rnlm * yr * (cor_y - yy0));
-
- // var cor_x2 = new Number(trackNow[i+1][0]);
- // var cor_y2 = new Number(trackNow[i+1][1]);
- // var x_cor2 = new Number(igxm + igslm * rnlm * xr * (cor_x2 - xx0));
- // var y_cor2 = new Number(igym + igslm * rnlm * yr * (cor_y2 - yy0));
-
- // can.moveTo(x_cor, y_cor);
- // can.lineTo(x_cor2, y_cor2);
- // can.stroke();
- // can.fill();
- can.moveTo(x_cor, y_cor);
- can.arc(x_cor, y_cor, 1, 0, Math.PI * 2, true);
- can.fill();
- };
- can.closePath();
- can.stroke();
- //_this.trackNow.push([trackNow]);
- }
- setTimeout(ftn(_this.playMark[i], _this.trackNow, _this.real_trak_time, _this.context, _this.real_trak_color, _this.imgXList['map'], _this.imgYList['map'], _this.imgScaleList['map'], _this.rateNumList['map'], _this.x_ratio, _this.y_ratio, _this.x_x0, _this.y_y0), 5);
- //var trackNow = getTracknow( _this.playMark[i][0], _this.real_trak_time);//鑾峰彇鎸囧畾鏃堕棿娈靛唴璇agid鐨勬暟鎹繘琛岀粯鍒�
- }
-
- var isSos = _this.playMark[i][_this.playMark[i].length - 3];
- if (isSos) {
- if (sosType) {
- can.drawImage(sos, 0, 0, images[key].naturalWidth, images[key].naturalHeight, x_cor_now - (images[key].naturalWidth * _this.imgScaleList[key] * _this.rateNumList[key]) / 2 + 3, y_cor_now - (images[key].naturalHeight * _this.imgScaleList[key] * _this.rateNumList[key]) + 2, images[key].naturalWidth * _this.imgScaleList[key] * _this.rateNumList[key], images[key].naturalHeight * _this.imgScaleList[key] * _this.rateNumList[key]);
- } else {
- can.drawImage(sos1, 0, 0, images[key].naturalWidth, images[key].naturalHeight, x_cor_now - (images[key].naturalWidth * _this.imgScaleList[key] * _this.rateNumList[key]) / 2 + 3, y_cor_now - (images[key].naturalHeight * _this.imgScaleList[key] * _this.rateNumList[key]) + 2, images[key].naturalWidth * _this.imgScaleList[key] * _this.rateNumList[key], images[key].naturalHeight * _this.imgScaleList[key] * _this.rateNumList[key]);
- }
- sosType = !sosType;
- } else {
- can.drawImage(images[key], 0, 0, images[key].naturalWidth, images[key].naturalHeight, x_cor_now - (images[key].naturalWidth * _this.imgScaleList[key] * _this.rateNumList[key]) / 2, y_cor_now - (images[key].naturalHeight * _this.imgScaleList[key] * _this.rateNumList[key]), images[key].naturalWidth * _this.imgScaleList[key] * _this.rateNumList[key], images[key].naturalHeight * _this.imgScaleList[key] * _this.rateNumList[key]);
- }
- //鐢诲湪鐩稿簲浣嶇疆涓�
- // can.drawImage(images[key], 0, 0, images[key].naturalWidth, images[key].naturalHeight, x_cor_now - (images[key].naturalWidth * _this.imgScaleList[key] * _this.rateNumList[key]) / 2, y_cor_now - (images[key].naturalHeight * _this.imgScaleList[key] * _this.rateNumList[key]), images[key].naturalWidth * _this.imgScaleList[key] * _this.rateNumList[key], images[key].naturalHeight * _this.imgScaleList[key] * _this.rateNumList[key]);
-
- can.font = '13px sans-serif';
- can.fillStyle = 'white';
- if (_this.tagZb == '1') { //鏄惁鏄剧ず鏍囩鍧愭爣
- can.fillStyle = 'red';
- can.font = '10px sans-serif';
- //var f = 8*( _this.imgScaleList['map']);
- //can.font=f+"px Arial";
-
- tagzuobiao = _this.playMark[i][4] + ',' + _this.playMark[i][5];
- can.fillText(tagzuobiao, x_cor_now - 20, y_cor_now + 10);
- };
- if (_this.viewName == '1') { //鏄惁鏄剧ず浜哄憳鍚嶇О
- can.font = '13px sans-serif';
- if (_this.viewTagid == '1') { //鏄惁鏄剧ず鏍囩id
- fillRoundRect(can, x_cor_now - 40, y_cor_now - images[key].naturalHeight * _this.imgScaleList[key] * _this.rateNumList[key] - 18, images[key].naturalHeight * 2, 20, 4, '#32CD32');
- can.fillStyle = 'white';
- can.fillText(_this.playMark[i][1], x_cor_now - 38, y_cor_now - images[key].naturalHeight * _this.imgScaleList[key] * _this.rateNumList[key] - 3);
- can.fillText(_this.playMark[i][0], x_cor_now + 5, y_cor_now - images[key].naturalHeight * _this.imgScaleList[key] * _this.rateNumList[key] - 3);
- } else {
- fillRoundRect(can, x_cor_now - 20, y_cor_now - images[key].naturalHeight * _this.imgScaleList[key] * _this.rateNumList[key] - 18, images[key].naturalHeight * 1.1, 20, 4, '#32CD32');
- can.fillStyle = 'white';
- can.fillText(_this.playMark[i][1], x_cor_now - 19, y_cor_now - images[key].naturalHeight * _this.imgScaleList[key] * _this.rateNumList[key] - 3);
- }
- } else {
- can.font = '13px sans-serif';
- if (_this.viewTagid == '1') {
- fillRoundRect(can, x_cor_now - 20, y_cor_now - images[key].naturalHeight * _this.imgScaleList[key] * _this.rateNumList[key] - 18, images[key].naturalHeight * 1.1, 20, 4, '#32CD32');
- can.fillStyle = 'white';
- can.fillText(_this.playMark[i][0], x_cor_now - 14, y_cor_now - images[key].naturalHeight * _this.imgScaleList[key] * _this.rateNumList[key] - 3);
- }
- }
- if (_this.viewPower == '1') { //鏄惁鏄剧ず鐢甸噺
- can.font = '10px sans-serif';
- can.fillStyle = 'red';
- can.fillText("鐢甸噺:" + _this.playMark[i][2], x_cor_now - 20, y_cor_now + 20);
- };
- can.font = '10px sans-serif';
- };
- }
- } else if (key == 'anchor_online') {
- can.font = '10px sans-serif';
- if (_this.anckicon == '1') { //鏄惁鏄剧ず鍩虹珯鍥炬爣
- //_this.onlineAnchorList = [anchorid, posx,posy,posz,layer,greatetime]
- for (var i = 0; i < _this.onlineAnchorList.length; i++) {
- var cor_x = new Number(_this.onlineAnchorList[i][1]);
- var cor_y = new Number(_this.onlineAnchorList[i][2]);
- var x_cor = new Number(_this.imgXList['map'] + _this.imgScaleList['map'] * _this.rateNumList['map'] * _this.x_ratio * (cor_x - _this.x_x0));
- var y_cor = new Number(_this.imgYList['map'] + _this.imgScaleList['map'] * _this.rateNumList['map'] * _this.y_ratio * (cor_y - _this.y_y0));
- can.drawImage(images[key], 0, 0, images[key].naturalWidth, images[key].naturalHeight, x_cor - (images[key].naturalWidth * _this.imgScaleList[key] * _this.rateNumList[key]) / 2, y_cor - (images[key].naturalHeight * _this.imgScaleList[key] * _this.rateNumList[key]), images[key].naturalWidth * _this.imgScaleList[key] * _this.rateNumList[key] + 10, images[key].naturalHeight * _this.imgScaleList[key] * _this.rateNumList[key] + 10);
- if (_this.viewAnckzb == '1') { //鏄惁鏄剧ず鍩虹珯鍧愭爣
- can.fillStyle = 'red'
- var anchorzuobiao = _this.onlineAnchorList[i][1] + ',' + _this.onlineAnchorList[i][2] + ',' + _this.onlineAnchorList[i][3];
- can.fillText(anchorzuobiao, x_cor - 20, y_cor + 20);
- };
- if (_this.viewAnckid == '1') { //鏄惁鏄剧ず鍩虹珯id
- can.fillStyle = 'red';
- can.fillText(_this.onlineAnchorList[i][0], x_cor - 7, y_cor - 5);
- };
- };
- };
- } else if (key == 'anchor_offline') {
- can.font = '10px sans-serif';
- if (_this.anckicon == '1') { //鏄惁鏄剧ず鍩虹珯鍥炬爣
- //_this.offlineAnchorList = [anchorid, posx,posy,posz,layer,greatetime]
- for (var i = 0; i < _this.offlineAnchorList.length; i++) {
- var cor_x = new Number(_this.offlineAnchorList[i][1]);
- var cor_y = new Number(_this.offlineAnchorList[i][2]);
- var x_cor = new Number(_this.imgXList['map'] + _this.imgScaleList['map'] * _this.rateNumList['map'] * _this.x_ratio * (cor_x - _this.x_x0));
- var y_cor = new Number(_this.imgYList['map'] + _this.imgScaleList['map'] * _this.rateNumList['map'] * _this.y_ratio * (cor_y - _this.y_y0));
- can.drawImage(images[key], 0, 0, images[key].naturalWidth, images[key].naturalHeight, x_cor - (images[key].naturalWidth * _this.imgScaleList[key] * _this.rateNumList[key]) / 2, y_cor - (images[key].naturalHeight * _this.imgScaleList[key] * _this.rateNumList[key]), images[key].naturalWidth * _this.imgScaleList[key] * _this.rateNumList[key] + 10, images[key].naturalHeight * _this.imgScaleList[key] * _this.rateNumList[key] + 10);
- if (_this.viewAnckzb == '1') { //鏄惁鏄剧ず鍩虹珯鍧愭爣
- can.fillStyle = 'red'
- var anchorzuobiao = _this.offlineAnchorList[i][1] + ',' + _this.offlineAnchorList[i][2] + ',' + _this.offlineAnchorList[i][3];
- can.fillText(anchorzuobiao, x_cor - 20, y_cor + 20);
- };
- if (_this.viewAnckid == '1') { //鏄惁鏄剧ず鍩虹珯id
- can.fillStyle = 'red';
- can.fillText(_this.offlineAnchorList[i][0], x_cor - 7, y_cor - 5);
- };
- };
- };
- }
- };
-
- /* var trueMeasure = getTruemap();
- var trueLength = new Number(trueMeasure[0]);
- var trueWidth = new Number(trueMeasure[1]);
- var x_ratio = new Number(_this.img.naturalWidth / trueLength);
- var y_ratio = new Number(_this.img.naturalHeight / trueWidth);
- var x_x0 = new Number(getYuandian()[0]);
- var y_y0 = new Number(getYuandian()[1]); */
-
- //寮�鍚毀閬撳畾浣嶅悗锛岄渶瑕佹樉绀哄綋鍓嶈�冨嫟鍖哄煙鍐呯殑鎬绘爣绛炬暟閲�
- //_this.fenceMarkCount(count)
- //_this.realFenceList([name, type, zuobiao_array])
- //_this.FenceColor(color)
- if (_this.tunlDw == "1") {
- var k = 0;
- can.beginPath();
- for (var i = 0; i < _this.fenceMarkCount.length; i++) {
- // if ((_this.realFenceList[i][1] == "鑰冨嫟鍖哄煙")||(_this.realFenceList[i][1] == "宸℃鍖哄煙")){
-
- //can.fillStyle = getDrawColor(_this.FenceColor[i]);
- //can.fillRect(10,10+50*k,140,30);
-
- fillRoundRect(can, 10, 10 + 50 * k, 140, 30, 5, /*optional*/ getDrawColor(_this.FenceColor[i]))
- //can.fillRoundRect(10,10+50*k,140,30,10)
- can.fillStyle = "white";
- can.font = "15px sans-serif";
-
- can.textAlign = 'center';
- can.fillText(_this.realFenceList[i][0] + "锛�" + _this.fenceMarkCount[i] + "浜�", 80, 30 + 50 * k);
- //can.textBaseline = "middle";
-
- k += 1;
- // };
- };
- can.closePath();
- can.font = "10px sans-serif";
- can.textAlign = "start";
- };
-
- //寮�鍚皵浣撴樉绀�
- if (_this.gas_show == "1") {
- _this.GasList = getGas("zuobiao"); //姘斾綋鍧愭爣
- _this.GasType = getGas("type"); //姘斾綋绫诲瀷
- _this.GasNongdu = getGas("nongdu"); //姘斾綋娴撳害
- for (var i = 0; i < _this.GasList.length; i++) {
- var cor_x = new Number(_this.GasList[i][0]);
- var cor_y = new Number(_this.GasList[i][1]);
- var x_cor = new Number(_this.imgXList['map'] + _this.imgScaleList['map'] * _this.rateNumList['map'] * _this.x_ratio * (cor_x - _this.x_x0));
- var y_cor = new Number(_this.imgYList['map'] + _this.imgScaleList['map'] * _this.rateNumList['map'] * _this.y_ratio * (cor_y - _this.y_y0));
- can.beginPath();
- can.arc(x_cor, y_cor, 6, 0, Math.PI * 2, true);
- can.fillStyle = "green";
- can.fill();
- can.fillStyle = "red";
- can.fillText(_this.GasType[i], x_cor + 10, y_cor);
- can.fillText(_this.GasNongdu[i], x_cor + 10, y_cor + 10);
- can.closePath();
- }
- };
- },
-
- init: function () {
- var _this = this;
-
- //璇诲彇绯荤粺璁剧疆
- _this.sysSetting = getSystemSetting();
- _this.tagZb = _this.sysSetting[0].tagZb;//鏄惁鏄剧ず鏍囩鍧愭爣
- _this.diskaoqin = _this.sysSetting[0].diskaoqing; //鍑鸿�冨嫟鍖哄煙鏄惁娑堝け
- _this.viewAnckid = _this.sysSetting[0].viewAnckid;//鏄惁鏄剧ず鍩虹珯ID
- _this.viewName = _this.sysSetting[0].viewName;//鏄惁鏄剧ず浜哄憳鍚嶇О
- _this.tunlDw = _this.sysSetting[0].tunlDw;//闅ч亾瀹氫綅妯″紡
- _this.guiji_sava = _this.sysSetting[0].guiji_sava;//鏄惁寮�鍚建杩逛繚瀛�
- _this.viewPower = _this.sysSetting[0].viewPower;//鏄惁鏄剧ず鐢甸噺
- _this.viewTagid = _this.sysSetting[0].viewTagid;//鏄惁鏄剧ず鏍囩ID
- _this.viewAnckzb = _this.sysSetting[0].viewAnckzb;//鏄惁鏄剧ず鍩虹珯鍧愭爣
- _this.offView = _this.sysSetting[0].offView;//鏄惁绂荤嚎涓嶆樉绀哄浘鏍�
- _this.anckicon = _this.sysSetting[0].anckicon;//鏄惁鏄剧ず鍩虹珯鍥炬爣
- _this.gas_show = _this.sysSetting[0].gas_show;//鏄剧ず鍏朵粬妫�娴�(姘斾綋鏄剧ず)
- _this.quiet = _this.sysSetting[0].quiet;//闈欐杈撳嚭鍥哄畾鍧愭爣
-
- //璇诲彇鐪熷疄鍦板浘
- //璇诲浘鐗囧疄闄呭昂瀵�
- _this.trueMeasure = getTruemap();
- _this.trueLength = new Number(_this.trueMeasure[0]);
- _this.trueWidth = new Number(_this.trueMeasure[1]);
-
- //璇诲疄闄呭師鐐瑰潗鏍�
- _this.x_x0 = new Number(getYuandian()[0]);
- _this.y_y0 = new Number(getYuandian()[1]);
-
- //璇诲彇褰撳墠鍥存爮淇℃伅
- _this.FenceList = getExistFence("zuobiao");
- _this.FenceColor = getExistFence("color");
- _this.FenceName = getExistFence("name");
- _this.FenceType = getExistFence("type");
-
- _this.realFenceList = [];
- //閬嶅巻鍥存爮淇℃伅骞跺瓨鍌ㄦ垚[鍚嶇О锛岀被鍨嬶紝鍧愭爣]
- for (var m = 0; m < _this.FenceList.length; m++) {
- var tmp_list = [];
- var points = _this.FenceList[m];
- var points_list = _this.FenceList[m].split(",");
-
- //鍥存爮瀹為檯鍧愭爣锛堝姞涓婂亸绉婚噺鐨勶級
- var points_list_sort = [];
- for (var i = 0; i < points_list.length; i++) {
- if (i % 2 == 0) {
- tmp_list = [];
- tmp_list.push(new Number(points_list[i]));
- } else {
- tmp_list.push(new Number(points_list[i]));
- points_list_sort.push(tmp_list);
- }
- }
- //瀛樺尯鍩熷悕绉�+鍖哄煙绫诲瀷+鍖哄煙鍧愭爣锛屾柟渚垮悗缁垽鏂槸鍚﹀湪鏌愬尯鍩熷唴
- _this.realFenceList.push([_this.FenceName[m], _this.FenceType[m], points_list_sort]);
- };
-
- _this.real_trak_time = str_to_time(_this.sysSetting[0].real_trak_time);//瀹炴椂杞ㄨ抗鏄剧ず鏃堕暱
- //褰撳墠浣嶇疆
- _this.playMark = getRealPosition();
- var tagid_str = "";
- for (var i = 0; i < _this.playMark.length; i++) {
- tagid_str += _this.playMark[i][0]
- if (i != _this.playMark.length - 1) {
- tagid_str += ","
- }
- }
- //瀹炴椂杞ㄨ抗
- if (_this.real_trak_time != 0) {
- _this.trackNow = getTracknow(tagid_str, _this.real_trak_time);
- } else {
- _this.trackNow = null;
- }
- _this.real_trak_color = getTrackColor(_this.sysSetting[0].real_trak_color);//瀹炴椂杞ㄨ抗鏄剧ず鐨勯鑹�
-
- _this.canvas.onmousedown = function (event) {
- _this.clickDown(event);
- };
- _this.canvas.onmousemove = function (event) {
- _this.mouseMove(event)
- };
- _this.canvas.onmouseup = function (event) {
- _this.mouseUp(event);
- };
- _this.canvas.onmousewheel = function (event) {
- _this.onmouseWheel(event);
- };
- var t = 300;//300ms
-
- _this.onlineAnchorList = getAnchorInfo()[0];
- _this.offlineAnchorList = getAnchorInfo()[1];
-
- function fn() {
- if (tuodong == true) {
- return false;
- }
- //褰撳墠瀹炴椂鍧愭爣
- _this.playMark = getRealPosition();
- var tagid_str = "";
- for (var i = 0; i < _this.playMark.length; i++) {
- tagid_str += _this.playMark[i][0]
- if (i != _this.playMark.length - 1) {
- tagid_str += ","
- }
- }
-
- if (_this.real_trak_time != 0) {
- //灏嗗綋鍓嶅疄鏃跺潗鏍囨坊鍔犺繘track涓�
- var track_now = Date.parse(new Date()); //timestamp涓烘绉掑崟浣�
- track_now = track_now / 1000;
- var track_now_head = track_now - _this.real_trak_time;
- //褰撳墠track鏈�寮�濮嬬殑鏃堕棿
- var track_head_date = new Date();
- track_head_date.setTime(track_now_head * 1000 + 8 * 3600 * 1000);
- var track_head_date_str = track_head_date.toJSON().substr(0, 19).replace('T', ' ');
-
- for (var i = 0; i < _this.playMark.length; i++) {
- if (_this.trackNow[_this.playMark[i][0]] != null) {
- if (_this.trackNow[_this.playMark[i][0]].length > 1500) {
- _this.trackNow[_this.playMark[i][0]] = _this.trackNow[_this.playMark[i][0]].slice(-1200);
- };
- for (var j = 0; j < _this.trackNow[_this.playMark[i][0]].length; j++) {
- if (_this.trackNow[_this.playMark[i][0]][0][2] < track_head_date_str) {
- _this.trackNow[_this.playMark[i][0]].shift()
- } else {
- break
- }
- };
- };
-
- var now_time = new Date();
- now_time.setTime(track_now * 1000 + 8 * 3600 * 1000);
- var now_time_str = now_time.toJSON().substr(0, 19).replace('T', ' ');
- var tmp = [_this.playMark[i][4], _this.playMark[i][5], now_time_str];
- if (_this.trackNow[_this.playMark[i][0]] == null) {
- _this.trackNow[_this.playMark[i][0]] = []
- }
- _this.trackNow[_this.playMark[i][0]].push(tmp)
- }
- }
- _this.drawImg();
- }
- if (expand == true) {
- clearInterval(timer1)
- timer2 = setInterval(fn, t);
- } else {
- clearInterval(timer2)
- timer1 = setInterval(fn, t);
- }
- //setInterval(fn, t);
-
- },
- /*璁$畻褰撳墠榧犳爣浣嶇疆璺濈canvas鐨勫亸绉婚噺*/
- xyToCanvas: function (ele, x, y) {
- var _this = this;
- var obj = _this.canvas.getBoundingClientRect();
- return {
- x: x - obj.left,
- y: y - obj.top
- };
- },
- /*榧犳爣鍗曞嚮浜嬩欢*/
- clickDown: function (event) {
- var _this = this;
- if (_this.markFlag) {
- _this.canvas.style.cursor = "none";
- if (event.button == 2) {
- _this.markFlag = false;
- _this.dragFlag = true;
- _this.canvas.style.cursor = "normal";
- _this.drawImg();
- return;
- } else {
- var posXY = _this.xyToCanvas(_this.canvas, event.clientX, event.clientY);
- posXY.x = (posXY.x - _this.imgX) / _this.imgScale;
- posXY.y = (posXY.y - _this.imgY) / _this.imgScale;
- _this.CreatLinepoints.push(posXY);
- _this.allMarkLins.pop();
- _this.allMarkLins.push(_this.CreatLinepoints);
- _this.drawImg();
- }
- return;
- }
- if (event.button == 0) {//鐐瑰嚮榧犳爣宸﹂敭
- _this.dragFlag = true;
- tuodong = true;
- _this.canvas.style.cursor = "move";
- _this.pos = _this.xyToCanvas(_this.canvas, event.clientX, event.clientY);
- }
- },
- /*榧犳爣绉诲姩浜嬩欢*/
- mouseMove: function (event) {
- var _this = this;
- /*鎷栨嫿*/
- if (_this.dragFlag) {
- tuodong = true;
- _this.canvas.style.cursor = "move";
- var pos1 = _this.xyToCanvas(_this.canvas, event.clientX, event.clientY);
- var x = pos1.x - _this.pos.x;
- var y = pos1.y - _this.pos.y;
- _this.pos = pos1;
- for (var key in _this.imgXList) {
- _this.imgXList[key] += x;
- _this.imgYList[key] += y;
- }
- _this.cacheCanvas = null;
- _this.drawImg();
- }
- },
- /*榧犳爣鏀惧紑浜嬩欢*/
- mouseUp: function (event) {
- var _this = this;
- _this.dragFlag = false;
- tuodong = false;
- if (_this.markFlag) {
- _this.canvas.style.cursor = "none";
- return;
- }
- _this.canvas.style.cursor = 'default';
-
- },
- /*榧犳爣婊氳疆浜嬩欢*/
- onmouseWheel: function (event) {
- var _this = this;
- _this.cacheCanvas = null;
- var pos = _this.xyToCanvas(_this.canvas, event.clientX, event.clientY);
- event.wheelDelta = event.wheelDelta ? event.wheelDelta : (event.deltaY * (-40));
- //鍙栨秷娴忚鍣ㄩ粯璁よ涓�
- if (event.preventDefault) {
- event.preventDefault();
- } else {
- event.returnValue = false;
- }
- if (event.wheelDelta > 0 && _this.scaleFlag < 9) {
- for (var key in _this.imgScaleList) {
- _this.imgScaleList[key] *= 1.25;
- _this.imgXList[key] = _this.imgXList[key] * 1.25 - 0.25 * pos.x;
- _this.imgYList[key] = _this.imgYList[key] * 1.25 - 0.25 * pos.y;
- }
- _this.scaleFlag += 1;
- }
- if (event.wheelDelta < 0 && _this.scaleFlag > -9) {//缂╁皬
- for (var key in _this.imgScaleList) {
- _this.imgScaleList[key] *= 0.8;
- _this.imgXList[key] = _this.imgXList[key] * 0.8 + pos.x * 0.2;
- _this.imgYList[key] = _this.imgYList[key] * 0.8 + pos.y * 0.2;
- }
- _this.scaleFlag -= 1;
- }
- _this.imgScaleList['icon'] = 0.037;
- _this.drawImg();
- },
-
- }
- /* var timeshow;
- var weizhi;
- setTimeout(function(){
- setshow();
- timeshow = setInterval(setshow, 3000);
- },0)
- function setshow () {
- $.ajax({
- async: false,
- type: "POST",
- url: "/hxzkoa/setshow.do",
- dataType: 'json',
- success (data) {
- $("#ssc1").html('<span class="fonts1">' + data[0].type + '</span><br><span class="fonts">' + data[0].num + '</span>');
- $("#ssc2").html('<span class="fonts1">' + data[1].type + '</span><br><span class="fonts">' + data[1].num + '</span>');
- $("#ssc3").html('<span class="fonts1">' + data[2].type + '</span><br><span class="fonts">' + data[2].num + '</span>');
- weizhi = data[0].num;
- }
- });
- }
- function myStopFunction () {
- clearInterval(timeshow);
- }
- /* window.setInterval(function () {
- getNewSeries(lastDate, {
- min: 10,
- max: 90
- })
-
- chart.updateSeries([{
- data: weizhi
- }])
- }, 1000) */
- /* var timeshow = setInterval(setweizhi, 5000);
- function setweizhi () {
- $.ajax({
- async: false,
- type: "POST",
- url: "/hxzkoa/setweizhi.do",
- dataType: 'json',
- });
- } */
- /* var j = 4;
- var i = 0;
- var shebei = $("#shebei").val(); */
- $.ajax({
- url: "/hxzkoa/setshebei.do",
- type: "post",
- dataType: "JSON",
- success(data) {
- var i = 0;
- shebeido()
- var times = setInterval(shebeido, 5000);
- function shebeido() {
- var html = '';
- var arr = data.slice(i, i + 4)
- for (const key in arr) {
- if (arr[key].zhuangtai == 0) {
- if (arr[key].duixiang == "瀹氫綅鍩虹珯") {
- html += '<tr align="center"><td class="noExl"><img src="hxzk/image/anchor/鍩虹珯绂荤嚎.png" /></td><td>' + arr[key].id + '</td><td>' + arr[key].duixiang + '</td><td>' + arr[key].banben + '</td><td>' + arr[key].xiangqing + '</td><td>' + arr[key].time + '</td></tr>';
- } else {
- html += '<tr align="center"><td class="noExl"><img src="hxzk/image/icon/tagoff.png" /></td><td>' + arr[key].id + '</td><td>' + arr[key].duixiang + '</td><td>' + arr[key].banben + '</td><td>' + arr[key].xiangqing + '</td><td>' + arr[key].time + '</td></tr>';
- }
- } else {
- if (arr[key].duixiang == "瀹氫綅鍩虹珯") {
- html += '<tr align="center"><td class="noExl"><img src="hxzk/image/anchor/鍩虹珯鍦ㄧ嚎.png" /></td><td>' + arr[key].id + '</td><td>' + arr[key].duixiang + '</td><td>' + arr[key].banben + '</td><td>' + arr[key].xiangqing + '</td><td>' + arr[key].time + '</td></tr>';
- } else {
- html += '<tr align="center"><td class="noExl"><img src="hxzk/image/icon/tagon.png" /></td><td>' + arr[key].id + '</td><td>' + arr[key].duixiang + '</td><td>' + arr[key].banben + '</td><td>' + arr[key].xiangqing + '</td><td>' + arr[key].time + '</td></tr>';
- }
- }
- }
- $("#nr").html(html);
- i += 4;
- if (i >= data.length) {
- i = 0;
- }
- }
- // function shebeido() {
- // var j = i + 4
- // var html = ''
- // for (i; i < j; i++) {
- // if (data[i] == false) {
- // break;
- // } else {
- // html += '<tr align="center"><td class="noExl">' + data[i].zhuangtai + '</td><td>' + data[i].id + '</td><td>' + data[i].duixiang + '</td><td>' + data[i].banben + '</td><td>' + data[i].xiangqing + '</td><td>' + data[i].time + '</td></tr>'
- // // html += '<tr align="center" class="d"><td>' + item.id + '</td><td>' + item.receive_time + '</td><td>' + item.type + '</td><td>' + item.tagid + '</td><td>' + item.neirong + '</td></tr>'
- // }
- // }
- // $("#nr").html(html)
- // if (i >= data.length) {
- // i = 0;
- // }
- // }
- }
- });
- // var timeshow = setInterval(sos, 4000);
- // function sos() {
- // $.ajax({
- // url: "/hxzkoa/sosfence.do",
- // type: "POST",
- // dataType: "JSON",
- // success(data) {
- // if (data == null) {
-
- // } else {
- // var str = ""
- // alert(str)
- // audio.play()
- // }
- // }
- // })
- // }
- //alert('涓�鑷姩寮�鍚憡璀︽彁閱�')
- var audio1 = new Audio("/hxzkoa/hxzk/image/voice/sos.wav");
- var audio2 = new Audio("/hxzkoa/hxzk/image/voice/warning.wav");
- var current_floor;
- function qufloor(floor) {
- current_floor = floor
- }
- // var zaipan = []
- // var sosgaojing1 = getRealPosition();
- // for (var i = 0; i < sosgaojing1.length; i++) {
- // zaipan.push(false)
- // }
- setInterval(baojing, 1000)
- function baojing() {
- var sosgaojing = getRealPosition();
- for (var i = 0; i < sosgaojing.length; i++) {
- if (sosgaojing[i][7] == 1) {
- if (sosgaojing[i][8] == 1) {
- // if (zaipan[i] == false) {
- var str = '娉ㄦ剰,缂栧彿[' + sosgaojing[i][0] + ']SOS鍛婅'
- // Audio1.click()
- audio1.play()
- //swal(str)
- /* $.ajax({
- url: "/hxzkoa/sosgaojing.do",
- type: "POST",
- dataType: "JSON",
- data: {
- tagid: sosgaojing[i][0]
- }
- }) */
- // }
- } if (sosgaojing[i][9] == 1) {
- // if (zaipan[i] == false) {
- var str = '娉ㄦ剰,缂栧彿[' + sosgaojing[i][0] + ']杩涘叆鍗遍櫓鍖哄煙'
- // audio2.click()
- audio2.play()
- //swal(str)
- /* $.ajax({
- url: "/hxzkoa/fencegaojing.do",
- type: "POST",
- dataType: "JSON",
- data: {
- tagid: sosgaojing[i][0]
- }
- }) */
- // }
- }
- // zaipan[i] = true
- }
- // } else {
- // zaipan[i] = false
- // }
- }
- }
-
- </script>
- <!-- 瀹ゅ唴瀹氫綅鍦板浘鍔熻兘缁撴潫 -->
-
- <!-- END FUNCTION SCRIPTS -->
-
- <script src="/hxzkoa/hxzk/plugins/apex/apexcharts.js"></script>
- <script src="/hxzkoa/hxzk/plugins/apex/custom-apexcharts.js"></script>
- </body>
-
- </html>
\ No newline at end of file
diff --git a/src/main/webapp/hxzk/mapshow/mapShow.jsp b/src/main/webapp/hxzk/mapshow/mapShow.jsp
index 8c0cd4c..b0880b9 100644
--- a/src/main/webapp/hxzk/mapshow/mapShow.jsp
+++ b/src/main/webapp/hxzk/mapshow/mapShow.jsp
@@ -208,786 +208,781 @@
<!-- END CONTENT PART -->
<!-- END MAIN CONTAINER -->
- <%
- String username=(String)session.getAttribute("username");
- if(username==null || username.equals("")){
- request.getRequestDispatcher("/hxzk/login.jsp").forward(request,response);
- return;
- }
- %>
- <!-- BEGIN GLOBAL MANDATORY SCRIPTS -->
- <script src="/hxzkoa/hxzk/assets/js/libs/jquery-3.1.1.min.js"></script>
- <script src="/hxzkoa/hxzk/bootstrap/js/popper.min.js"></script>
- <script src="/hxzkoa/hxzk/bootstrap/js/bootstrap.min.js"></script>
- <script src="/hxzkoa/hxzk/plugins/perfect-scrollbar/perfect-scrollbar.min.js"></script>
- <script src="/hxzkoa/hxzk/assets/js/app.js"></script>
- <script src="/hxzkoa/hxzk/plugins/sweetalerts/promise-polyfill.js"></script>
- <script src="/hxzkoa/hxzk/plugins/sweetalerts/sweetalert2.min.js"></script>
- <script src="/hxzkoa/hxzk/plugins/sweetalerts/custom-sweetalert.js"></script>
- <script src="/hxzkoa/hxzk/plugins/table/datatable/button-ext/dataTables.buttons.min.js"></script>
- <script src="/hxzkoa/hxzk/plugins/table/datatable/button-ext/jszip.min.js"></script>
- <script src="/hxzkoa/hxzk/plugins/table/datatable/button-ext/buttons.html5.min.js"></script>
- <script src="/hxzkoa/hxzk/plugins/table/datatable/button-ext/buttons.print.min.js"></script>
- <script>
- var result;
- $(document).ready(function () {
- App.init(); $.ajax({ async: false, type: "POST", url: "/hxzkoa/getSysSetting_list.do", data: {}, dataType: "json", success: function (data) { /* title = data[0].title; document.title = title; */ }, });
- result = getAllMap(); //result["mapname"]=mapnamelist, ['floor']=floorlist
- diaoyonghuatu(result);
- });
-
- $('.header-page').load('/hxzkoa/hxzk/top.html'); $('.login-page').load('/hxzkoa/hxzk/head.html');
- </script>
- <script src="/hxzkoa/hxzk/assets/js/custom.js"></script>
- <!-- END GLOBAL MANDATORY SCRIPTS -->
-
- <!-- > BEGIN PAGE FUNCTION SCRIPTS -->
-
-
- <script>
- //棣栭〉鍦板浘鎺у埗
- var full_screen = false;
- var timer_list = [];
- function getAllMap() {
- var map = [];
- var floor = [];
- $.ajax({
- async: false,
- type: "POST",
- url: "/hxzkoa/qiehuanditu_option.do",
- dataType: 'json',
- data: {},
- success: function (data) {
- if (data.length == 0) {
- document.getElementById("map0").style.display = "none";
- document.getElementById("map1").style.display = "none";
- document.getElementById("map2").style.display = "none";
- document.getElementById("map3").style.display = "none";
- } else if (data.length == 1) {
- document.getElementById("map0").style.width = "100%";
- document.getElementById("mapname0").innerHTML = data[0].mapname;
- document.getElementById("maphead0").style.height = "800px";
- document.getElementById("wrap0").style.height = "750px";
- document.getElementById("map1").style.display = "none";
- document.getElementById("map2").style.display = "none";
- document.getElementById("map3").style.display = "none";
- full_screen = true;
- } else if (data.length == 2) {
- document.getElementById("map2").style.display = "none";
- document.getElementById("map3").style.display = "none";
- };
- for (var i = 0; i < data.length; i++) {
- str = "mapname" + i;
- document.getElementById(str).innerHTML = data[i].mapname;
- map.push(data[i].mapname);
- floor.push(data[i].floor);
- if (i == 3) {
- break;
- }
- };
- },
+ <% String username=(String)session.getAttribute("username"); if(username==null || username.equals("")){
+ request.getRequestDispatcher("/hxzk/login.jsp").forward(request,response); return; } %>
+ <!-- BEGIN GLOBAL MANDATORY SCRIPTS -->
+ <script src="/hxzkoa/hxzk/assets/js/libs/jquery-3.1.1.min.js"></script>
+ <script src="/hxzkoa/hxzk/bootstrap/js/popper.min.js"></script>
+ <script src="/hxzkoa/hxzk/bootstrap/js/bootstrap.min.js"></script>
+ <script src="/hxzkoa/hxzk/plugins/perfect-scrollbar/perfect-scrollbar.min.js"></script>
+ <script src="/hxzkoa/hxzk/assets/js/app.js"></script>
+ <script src="/hxzkoa/hxzk/plugins/sweetalerts/promise-polyfill.js"></script>
+ <script src="/hxzkoa/hxzk/plugins/sweetalerts/sweetalert2.min.js"></script>
+ <script src="/hxzkoa/hxzk/plugins/sweetalerts/custom-sweetalert.js"></script>
+ <script src="/hxzkoa/hxzk/plugins/table/datatable/button-ext/dataTables.buttons.min.js"></script>
+ <script src="/hxzkoa/hxzk/plugins/table/datatable/button-ext/jszip.min.js"></script>
+ <script src="/hxzkoa/hxzk/plugins/table/datatable/button-ext/buttons.html5.min.js"></script>
+ <script src="/hxzkoa/hxzk/plugins/table/datatable/button-ext/buttons.print.min.js"></script>
+ <script>
+ var result;
+ $(document).ready(function () {
+ App.init(); $.ajax({ async: false, type: "POST", url: "/hxzkoa/getSysSetting_list.do", data: {}, dataType: "json", success: function (data) { /* title = data[0].title; document.title = title; */ }, });
+ result = getAllMap(); //result["mapname"]=mapnamelist, ['floor']=floorlist
+ diaoyonghuatu(result);
});
- var result = [];
- result['map'] = map;
- result['floor'] = floor;
- return result
- }
- </script>
+ $('.header-page').load('/hxzkoa/hxzk/top.html'); $('.login-page').load('/hxzkoa/hxzk/head.html');
+ </script>
+ <script src="/hxzkoa/hxzk/assets/js/custom.js"></script>
+ <!-- END GLOBAL MANDATORY SCRIPTS -->
- <!-- 甯哥敤鍑芥暟 -->
- <script>
- function getTruemap_all() {
- var map_wl = {};
- $.ajax({
- async: false,
- type: "POST",
- url: "/hxzkoa/floornumTomap_all.do",
- dataType: 'json',
- data: {},
- success: function (data) {
- let tmp = new Set();
- for (var i = 0; i < data.length; i++) {
- tmp.add(data[i].floor);
- };
- let tmpl = Array.from(tmp);
- for (i in tmpl) {
- map_wl[tmpl[i]] = [];
- }
- for (var i = 0; i < data.length; i++) {
- map_wl[data[i].floor].push([data[i].x_Truelength, data[i].y_Truewidth]);
- }
- },
- });
- return map_wl;
- };
+ <!-- > BEGIN PAGE FUNCTION SCRIPTS -->
- function getYuandian_all() {
- var yuandian = {};
- $.ajax({
- async: false,
- type: "POST",
- url: "/hxzkoa/floornumTomap_all.do",
- dataType: 'json',
- data: {},
- success: function (data) {
- let tmp = new Set();
- for (var i = 0; i < data.length; i++) {
- tmp.add(data[i].floor);
- };
- let tmpl = Array.from(tmp);
- for (i in tmpl) {
- yuandian[tmpl[i]] = [];
- }
- for (var i = 0; i < data.length; i++) {
- yuandian[data[i].floor].push([data[i].x0_length, data[i].y0_width]);
- }
- }
- });
- return yuandian;
- };
- function getSystemSetting() {
- var sysset = [];
- $.ajax({
- async: false,
- type: 'POST',
- url: "/hxzkoa/getSysSetting_list.do",
- dataType: 'json',
- success: function (data) {
- sysset = data;
- },
- });
- return sysset;
- };
-
- function loadImages(sources, callback) {
- var count = 0,
- images = {},
- imgNum = 0;
- for (src in sources) {
- imgNum++;
- }
- for (src in sources) {
- images[src] = new Image();
-
- images[src].onload = function () {
- if (++count >= imgNum) {
- callback(images);
- }
- }
- images[src].src = sources[src];
- }
- };
-
- function getTrackColor(yanse) {
- var color;
- if (yanse == "绾㈣壊") {
- var color = "red";
- } else if (yanse == "缁胯壊") {
- var color = "green";
- } else if (yanse == "钃濊壊") {
- var color = "blue";
- } else if (yanse == "鐧借壊") {
- var color = "white";
- } else if (yanse == "榛戣壊") {
- var color = "black";
- } else if (yanse == "榛勮壊") {
- var color = "yellow";
- }
- return color
- };
-
- function getExistFence_all(leixing) {
- var fencelist = {};
- var fencecolor = {};
- var fencename = {};
- var fencetype = {};
- $.ajax({
- async: false,
- type: 'POST',
- url: "/hxzkoa/getFloorFence_all.do",
- dataType: 'json',
- data: {},
- success: function (data) {
- let tmp = new Set();
- for (var i = 0; i < data.length; i++) {
- tmp.add(data[i].floor);
- };
- let tmpl = Array.from(tmp);
- for (i in tmpl) {
- fencelist[tmpl[i]] = [];
- fencecolor[tmpl[i]] = [];
- fencename[tmpl[i]] = [];
- fencetype[tmpl[i]] = [];
- }
- for (var i = 0; i < data.length; i++) {
- fencelist[data[i].floor].push(data[i].zuobiao);
- fencecolor[data[i].floor].push(data[i].color);
- fencename[data[i].floor].push(data[i].name);
- fencetype[data[i].floor].push(data[i].type);
- }
- }
- });
- if (leixing == "zuobiao") {
- return fencelist
- } else if (leixing == "color") {
- return fencecolor
- } else if (leixing == "name") {
- return fencename
- } else if (leixing == "type") {
- return fencetype
- };
- };
-
- function getDrawColor(yanse) {
- var color;
- if (yanse == "绾㈣壊") {
- var color = "rgba(255,0,0,0.3)";
- } else if (yanse == "缁胯壊") {
- var color = "rgba(0,255,0,0.3)";
- } else if (yanse == "钃濊壊") {
- var color = "rgba(0,0,255,0.3)";
- } else if (yanse == "鐧借壊") {
- var color = "rgba(255,255,255,0.3)";
- } else if (yanse == "榛戣壊") {
- var color = "rgba(0,0,0,0.3)";
- }
- return color
- };
- function inFenceOrNot(fence_list, node_list) {
- //fence_list[x,y]
- //node_list[x,y]
- if (fence_list.length == 2) { //鐭╁舰
- if (node_list[0] >= Math.min(fence_list[0][0], fence_list[1][0]) && node_list[0] <= Math.max(fence_list[0][0], fence_list[1][0])) {
- if (node_list[1] >= Math.min(fence_list[0][1], fence_list[1][1]) && node_list[1] <= Math.max(fence_list[0][1], fence_list[1][1])) {
- return true //鍦ㄨ�冨嫟鍖哄煙
- }
- }
- return false //涓嶅湪鑰冨嫟鍖哄煙
- } else if (fence_list.length > 2) { //澶氳竟褰�
- for (var c = false, i = -1, l = fence_list.length, j = l - 1; ++i < l; j = i)
- ((fence_list[i][1] <= node_list[1] && node_list[1] < fence_list[j][1]) || (fence_list[j][1] <= node_list[1] && node_list[1] < fence_list[i][1]))
- && (node_list[0] < (fence_list[j][0] - fence_list[i][0]) * (node_list[1] - fence_list[i][1]) / (fence_list[j][1] - fence_list[i][1]) + fence_list[i][0])
- && (c = !c);
- return c;
- }
- };
-
- function getGas(leixing) {
- var gaslist = [];
- var gasnongdu = [];
- var gastype = [];
- $.ajax({
- async: false,
- type: 'POST',
- url: "/hxzkoa/getGas_list.do",
- dataType: 'json',
- data: {},
- success: function (data) {
- for (var i = 0; i < data.length; i++) {
- gaslist.push([data[i].x, data[i].y]);
- gasnongdu.push(data[i].nong_du);
- gastype.push(data[i].gas_type);
- }
- }
- });
- if (leixing == "zuobiao") {
- return gaslist
- } else if (leixing == "type") {
- return gastype
- } else if (leixing == "nongdu") {
- return gasnongdu
- };
- };
-
- function getRealPosition(current_floor) {
- var realposition = [];
- $.ajax({
- async: false,
- type: 'POST',
- url: "/hxzkoa/getRealPosition.do",
- dataType: 'json',
- data: {
- floor: current_floor,
- },
- success: function (data) {
- for (var i = 0; i < data.length; i++) {
- //playMark[id,name,power,life,x,y,time]
- realposition.push([data[i].tagid, data[i].name, data[i].power, data[i].life, data[i].posx, data[i].posy, data[i].time, data[i].fence == 1 || data[i].sos == 1, data[i].sousuo, data[i].shipin])
- }
- },
- });
- return realposition
- };
-
- function str_to_time(str) {
- //鏍规嵁瀛楃涓茶浆鎹㈡垚瀵瑰簲鐨勬椂闂达紙绉掞級
- if (str == "涓嶆樉绀哄疄鏃惰建杩�") {
- return 0;
- } else if (str == "10绉掗挓") {
- return 10;
- } else if (str == "30绉掗挓") {
- return 30;
- } else if (str == "1鍒嗛挓") {
- return 60;
- } else if (str == "10鍒嗛挓") {
- return 600;
- } else if (str == "30鍒嗛挓") {
- return 1800;
- } else if (str == "1灏忔椂") {
- return 3600;
- };
- };
-
- function getTracknow(current_floor, tagid_str, time) {
- var finalrealtrack = {};
- $.ajax({
- async: false,
- type: 'POST',
- url: "/hxzkoa/getRealTrack.do",
- dataType: 'json',
- data: {
- time: time,
- floor: current_floor,
- tagid: tagid_str,
- },
- success: function (data) {
- for (var i = 0; i < data.length; i++) {
- finalrealtrack[data[i][0].tagid] = [];
- for (var j = 0; j < data[i].length; j++) {
- finalrealtrack[data[i][0].tagid].push([data[i][j].x, data[i][j].y, data[i][j].time])
- }
- }
- },
- });
- return finalrealtrack;
- };
-
- function getAnchorInfo_all() {
- var anchorList_on = {};
- var anchorList_off = {};
- $.ajax({
- async: false,
- type: 'POST',
- url: "/hxzkoa/getAnchorInfo_all.do",
- dataType: 'json',
- data: {},
- success: function (data) {
- let tmp = new Set();
- for (var i = 0; i < data.length; i++) {
- tmp.add(data[i].layer);
- };
- let tmpl = Array.from(tmp);
- for (i in tmpl) {
- anchorList_on[tmpl[i]] = [];
- anchorList_off[tmpl[i]] = [];
- }
- for (var i = 0; i < data.length; i++) {
- if (data[i].anchormode == "1") {
- anchorList_on[data[i].layer].push([data[i].anchorid, data[i].posx, data[i].posy, data[i].posz, data[i].GreateTime]);
- } else if (data[i].anchormode == "0") {
- anchorList_off[data[i].layer].push([data[i].anchorid, data[i].posx, data[i].posy, data[i].posz, data[i].GreateTime]);
-
- }
- }
- }
- });
- return [anchorList_on, anchorList_off]
- };
-
- /**璇ユ柟娉曠敤鏉ョ粯鍒朵竴涓湁濉厖鑹茬殑鍦嗚鐭╁舰
- *@param cxt:canvas鐨勪笂涓嬫枃鐜
- *@param x:宸︿笂瑙抶杞村潗鏍�
- *@param y:宸︿笂瑙抷杞村潗鏍�
- *@param width:鐭╁舰鐨勫搴�
- *@param height:鐭╁舰鐨勯珮搴�
- *@param radius:鍦嗙殑鍗婂緞
- *@param fillColor:濉厖棰滆壊
- **/
- function fillRoundRect(cxt, x, y, width, height, radius, /*optional*/ fillColor) {
- //鍦嗙殑鐩村緞蹇呯劧瑕佸皬浜庣煩褰㈢殑瀹介珮
- if (2 * radius > width || 2 * radius > height) { return false; }
-
- cxt.save();
- cxt.translate(x, y);
- //缁樺埗鍦嗚鐭╁舰鐨勫悇涓竟
- drawRoundRectPath(cxt, width, height, radius);
- cxt.fillStyle = fillColor || "#000"; //鑻ユ槸缁欏畾浜嗗�煎氨鐢ㄧ粰瀹氱殑鍊煎惁鍒欑粰浜堥粯璁ゅ��
- cxt.fill();
- cxt.restore();
- }
-
- function drawRoundRectPath(cxt, width, height, radius) {
- cxt.beginPath(0);
- //浠庡彸涓嬭椤烘椂閽堢粯鍒讹紝寮у害浠�0鍒�1/2PI
- cxt.arc(width - radius, height - radius, radius, 0, Math.PI / 2);
-
- //鐭╁舰涓嬭竟绾�
- cxt.lineTo(radius, height);
-
- //宸︿笅瑙掑渾寮э紝寮у害浠�1/2PI鍒癙I
- cxt.arc(radius, height - radius, radius, Math.PI / 2, Math.PI);
-
- //鐭╁舰宸﹁竟绾�
- cxt.lineTo(0, radius);
-
- //宸︿笂瑙掑渾寮э紝寮у害浠嶱I鍒�3/2PI
- cxt.arc(radius, radius, radius, Math.PI, Math.PI * 3 / 2);
-
- //涓婅竟绾�
- cxt.lineTo(width - radius, 0);
-
- //鍙充笂瑙掑渾寮�
- cxt.arc(width - radius, radius, radius, Math.PI * 3 / 2, Math.PI * 2);
-
- //鍙宠竟绾�
- cxt.lineTo(width, height - radius);
- cxt.closePath();
- }
- </script>
- <!-- 甯哥敤鍑芥暟缁撴潫 -->
-
- <!-- 璋冪敤瀹ゅ唴瀹氫綅鍦板浘鍔熻兘 -->
- <script>
- function diaoyonghuatu(result) {
-
- var truemap_list = getTruemap_all();
- var yuandian_list = getYuandian_all();
- var fencezuobiao_list = getExistFence_all("zuobiao");
- var fencecolor_list = getExistFence_all("color");
- var fencename_list = getExistFence_all("name");
- var fencetype_list = getExistFence_all("type");
- var onlineAnchorinfo_list = getAnchorInfo_all()[0];
- var offlineAnchorinfo_list = getAnchorInfo_all()[1];
-
- //璇诲彇绯荤粺璁剧疆
- var sysSetting = getSystemSetting();
-
- for (var i = 0; i < result['map'].length; i++) {
- var cf = result['floor'][i];//褰撳墠floor
- var tml = [];
- if (truemap_list[cf]) {
- tml = truemap_list[cf];
- };
- var ydl = [];
- if (yuandian_list[cf]) {
- ydl = yuandian_list[cf];
- };
- var fzbl = [];
- if (fencezuobiao_list[cf]) {
- fzbl = fencezuobiao_list[cf];
- };
- var fcl = [];
- if (fencecolor_list[cf]) {
- fcl = fencecolor_list[cf];
- };
- var fnl = [];
- if (fencename_list[cf]) {
- fnl = fencename_list[cf];
- };
- var ftl = []
- if (fencetype_list[cf]) {
- ftl = fencetype_list[cf];
- };
- var ail_on = [];
- if (onlineAnchorinfo_list[cf]) {
- ail_on = onlineAnchorinfo_list[cf];
- };
- var ail_off = [];
- if (offlineAnchorinfo_list[cf]) {
- ail_off = offlineAnchorinfo_list[cf];
- };
- subgraph(i, result['map'][i], result['floor'][i], tml, ydl, fzbl, fcl, fnl, ftl, ail_on, ail_off, sysSetting, result['map'].length)
- }
-
- };
- //subgraph(i,result['map'][i],result['floor'][i],tml,ydl,fzbl,fcl,fnl,ftl,ail,sysSetting)
- function subgraph(index, mp, fr, tml, ydl, fzbl, fcl, fnl, ftl, ail_on, ail_off, sysSetting, ttm) {
- var imgUrl = '/hxzkoa/hxzk/image/mapfile/' + mp;//鍥剧墖璺緞
- //var imgUrl = '/hxzkoa/hxzk/image/mapfile/office.jpg';//鍥剧墖璺緞
- var imgList = new Array();
- imgList['map'] = imgUrl;
- var iconUrl = '/hxzkoa/hxzk/image/targeticon/default.png';
- imgList['icon'] = iconUrl;
-
- // var anckicon = '/hxzkoa/hxzk/image/anchor/lingjin.png';
- // imgList['anchor']=anckicon;
- var anckicon_on = '/hxzkoa/hxzk/image/anchor/鍩虹珯鍦ㄧ嚎.png';
- //var anckicon_on = '/hxzkoa/hxzk/image/anchor/lingjin.png';
- imgList['anchor_online'] = anckicon_on;
-
- var anckicon_off = '/hxzkoa/hxzk/image/anchor/鍩虹珯绂荤嚎.png'
- //var anckicon_off = '/hxzkoa/hxzk/image/anchor/ceju.png';
- imgList['anchor_offline'] = anckicon_off;
-
- new MarkPoints(index, fr, imgList, tml, ydl, fzbl, fcl, fnl, ftl, ail_on, ail_off, sysSetting, ttm);
- };
- var serial;
- var code;
- var isDelete = false;
- var shipinka = true;
- var tuodong = false;
- var colorbbb = "rgba(255,0,0,0.3)";
- var sosType = [];
- var sousuoType = true;
- for (var i = 0; i < 500; i++) {
- sosType[i] = true;
- }
- var sos = document.createElement('img');
- sos.src = '/hxzkoa/hxzk/image/icon/SOS.png';
- var sos1 = document.createElement('img');
- sos1.src = '/hxzkoa/hxzk/image/icon/SOS1.png';
- var sousuo0 = document.createElement('img');
- sousuo0.src = '/hxzkoa/hxzk/image/icon/sousuo0.png';
- function MarkPoints(index, current_floor, imgList, tml, ydl, fzbl, fcl, fnl, ftl, ail_on, ail_off, sysSetting, ttm) {
- this.imgX = 0;//鍦ㄧ敾甯冧笂鍥剧墖鐨刋鍋忕Щ閲�
- this.imgY = 0;//鍦ㄧ敾甯冧笂鍥剧墖鐨刌鍋忕Щ閲�
- this.imgScale = 1;//鍥剧墖鐨勭缉鏀炬瘮渚�
- this.rateNum;//鍥剧墖楂樺害鑷�傚簲姣斾緥,鍥剧墖绛夋瘮灞呬腑灞曠ず鍦╟anvas
- this.scaleFlag = 0;//缂╂斁鍥犲瓙锛屾渶澶х缉鏀�9,鏈�灏忕缉鏀�-9
- this.context;
- this.img; //鍦板浘
- this.playIndex = 0;
- this.pos = {};//姣忔鎷栨嫿鍓嶅潗鏍囦繚瀛�
-
- this.imgLoadList = new Array();
- this.rateNumList = new Array();
- this.imgXList = new Array();
- this.imgYList = new Array();
- this.imgScaleList = new Array();
-
- //鑾峰彇鐪熷疄鍦板浘
- this.trueMeasure;
- this.trueLength;
- this.trueWidth;
- this.x_ratio;
- this.y_ratio;
- this.x_x0;
- this.y_y0;
- this.expand = false;
-
- //system setting
- this.sysSetting;
- this.tagZb = '0';//鏄惁鏄剧ず鏍囩鍧愭爣
- this.diskaoqin = '0'; //鍑鸿�冨嫟鍖哄煙鏄惁娑堝け
- this.viewAnckid = '0';//鏄惁鏄剧ず鍩虹珯ID
- this.viewName = '0';//鏄惁鏄剧ず浜哄憳鍚嶇О
- this.tunlDw = '0'//闅ч亾瀹氫綅妯″紡
- this.guiji_sava = '0'//鏄惁寮�鍚建杩逛繚瀛�
- this.viewPower = '0';//鏄惁鏄剧ず鐢甸噺
- this.viewTagid = '0';//鏄惁鏄剧ず鏍囩ID
- this.viewAnckzb = '0';//鏄惁鏄剧ず鍩虹珯鍧愭爣
- this.offView = '0'//鏄惁绂荤嚎涓嶆樉绀哄浘鏍�
- this.anckicon = '0'//鏄惁鏄剧ず鍩虹珯鍥炬爣
- this.gas_show = '0'//鏄剧ず鍏朵粬妫�娴�(姘斾綋鏄剧ず)
- this.quiet = '0'//闈欐杈撳嚭鍥哄畾鍧愭爣
- this.real_trak_time = 0//瀹炴椂杞ㄨ抗鏄剧ず鏃堕暱
- this.real_trak_color = '绾㈣壊'//瀹炴椂杞ㄨ抗鏄剧ず鐨勯鑹�
- this.fence_show = '0'//鏄惁鏄剧ず鍥存爮
-
- this.playFlag = false;//鏄惁鎾斁
- this.dragFlag = false;//鏄惁鍙嫋鎷藉綋鍓峣mg锛岄粯璁や笉鑳�
- this.markFlag = false;//鏍囪鍖哄煙寮�鍚叧闂璮lag
- this.CreatLinepoints = [];//姣忔鍒涘缓鏂板尯鍩熺殑鍧愭爣闆嗗悎
- this.playMark; //姝e湪灞曠ず鐨勬爣璁�
- this.playMarkInKaoQin;//褰撳墠鏍囪鏄惁鍦ㄨ�冨嫟鍖哄煙鍐�
- this.trackNow; //褰撳墠杞ㄨ抗
-
- this.onlineAnchorList;//褰撳墠鍩虹珯鍒楄〃
- this.offlineAnchorList;
-
- this.allMarkLins = [];//宸插垱寤虹殑鍖哄煙闆嗗悎锛屼緥濡俒[{x,y},{x,y},{x,y}],[{n,m},{n,m},{n,m}]]鐩墠鍙渶瑕佷竴涓尯鍩燂紝鎵�浠ユ暟缁勫唴閮ㄥ彧鏈変竴椤�
- this.allFenceColor = [];//宸插垱寤虹殑鍖哄煙棰滆壊
-
- this.FenceList; //鍥存爮鍧愭爣
- this.FenceColor; //鍥存爮棰滆壊
- this.FenceName; //鍥存爮鍚嶇О
- this.realFenceList = []; // [鍚嶇О锛岀被鍨嬶紝瀹為檯鍧愭爣]
- this.fenceMarkCount; //鍖哄煙鍐呯殑鍧愭爣鏁伴噺
- this.cacheCanvas = null; //缂撳瓨鍥存爮缁樺浘
-
- this.GasList; //姘斾綋鍧愭爣
- this.GasType; //姘斾綋绫诲瀷
- this.GasNongdu; //姘斾綋娴撳害
-
- this.ttm;
- this.timer;
-
- this.getImgLoad(index, imgList, current_floor);
- this.init(current_floor, tml, ydl, fzbl, fcl, fnl, ftl, ail_on, ail_off, sysSetting, ttm);
-
- document.oncontextmenu = new Function("event.returnValue=false;");
- document.onselectstart = new Function("event.returnValue=false;");
- };
-
- MarkPoints.prototype = {
- getImgLoad: function (index, imgList, current_floor) {
- var _this = this;
- var str = "wrap" + index;
- var wrap = document.getElementById(str);
- var str2 = "draw" + index;
- _this.canvas = document.getElementById(str2);
- _this.context = _this.canvas.getContext('2d');
- _this.canvas.height = wrap.offsetHeight;
- _this.canvas.width = wrap.offsetWidth;
-
- loadImages(imgList, function (images) {
- for (var key in images) {
- if (key == 'map') {
- _this.imgScaleList[key] = 1;
- _this.img = images[key];
- } else if (key == 'icon') {
- _this.imgScaleList[key] = 0.03;
- } else {
- _this.imgScaleList[key] = images[key].naturalWidth / images['map'].naturalWidth;
+ <script>
+ //棣栭〉鍦板浘鎺у埗
+ var full_screen = false;
+ var timer_list = [];
+ function getAllMap() {
+ var map = [];
+ var floor = [];
+ $.ajax({
+ async: false,
+ type: "POST",
+ url: "/hxzkoa/qiehuanditu_option.do",
+ dataType: 'json',
+ data: {},
+ success: function (data) {
+ if (data.length == 0) {
+ document.getElementById("map0").style.display = "none";
+ document.getElementById("map1").style.display = "none";
+ document.getElementById("map2").style.display = "none";
+ document.getElementById("map3").style.display = "none";
+ } else if (data.length == 1) {
+ document.getElementById("map0").style.width = "100%";
+ document.getElementById("mapname0").innerHTML = data[0].mapname;
+ document.getElementById("maphead0").style.height = "800px";
+ document.getElementById("wrap0").style.height = "750px";
+ document.getElementById("map1").style.display = "none";
+ document.getElementById("map2").style.display = "none";
+ document.getElementById("map3").style.display = "none";
+ full_screen = true;
+ } else if (data.length == 2) {
+ document.getElementById("map2").style.display = "none";
+ document.getElementById("map3").style.display = "none";
};
- _this.rateNumList[key] = _this.canvas.width / images[key].naturalWidth;
- _this.imgXList[key] = (_this.canvas.width - images[key].naturalWidth * _this.imgScaleList[key] * _this.rateNumList[key]) / 2;
- _this.imgYList[key] = (_this.canvas.height - images[key].naturalHeight * _this.imgScaleList[key] * _this.rateNumList[key]) / 2;//榛樿杩涙潵褰撳墠鍥惧儚灞呬腑鏄剧ず
- _this.imgLoadList[key] = images[key];
- }
- /*鐢诲嚭褰撳墠鍥剧墖*/
- //_this.drawImg(current_floor);
+ for (var i = 0; i < data.length; i++) {
+ str = "mapname" + i;
+ document.getElementById(str).innerHTML = data[i].mapname;
+ map.push(data[i].mapname);
+ floor.push(data[i].floor);
+ if (i == 3) {
+ break;
+ }
+ };
+ },
});
- },
+ var result = [];
+ result['map'] = map;
+ result['floor'] = floor;
+ return result
+ }
- drawImg: function (current_floor) {
- var _this = this;
- var can = _this.context;
- can.clearRect(0, 0, _this.canvas.width, _this.canvas.height);
+ </script>
- can.globalCompositeOperation = "source-over";
- var images = _this.imgLoadList;
+ <!-- 甯哥敤鍑芥暟 -->
+ <script>
+ function getTruemap_all() {
+ var map_wl = {};
+ $.ajax({
+ async: false,
+ type: "POST",
+ url: "/hxzkoa/floornumTomap_all.do",
+ dataType: 'json',
+ data: {},
+ success: function (data) {
+ let tmp = new Set();
+ for (var i = 0; i < data.length; i++) {
+ tmp.add(data[i].floor);
+ };
+ let tmpl = Array.from(tmp);
+ for (i in tmpl) {
+ map_wl[tmpl[i]] = [];
+ }
+ for (var i = 0; i < data.length; i++) {
+ map_wl[data[i].floor].push([data[i].x_Truelength, data[i].y_Truewidth]);
+ }
+ },
+ });
+ return map_wl;
+ };
- //鐢诲湴鍥�
- can.drawImage(_this.img, 0, 0, _this.img.naturalWidth, _this.img.naturalHeight, _this.imgXList['map'], _this.imgYList['map'], _this.img.naturalWidth * _this.imgScaleList['map'] * _this.rateNumList['map'], _this.img.naturalHeight * _this.imgScaleList['map'] * _this.rateNumList['map']);
+ function getYuandian_all() {
+ var yuandian = {};
+ $.ajax({
+ async: false,
+ type: "POST",
+ url: "/hxzkoa/floornumTomap_all.do",
+ dataType: 'json',
+ data: {},
+ success: function (data) {
+ let tmp = new Set();
+ for (var i = 0; i < data.length; i++) {
+ tmp.add(data[i].floor);
+ };
+ let tmpl = Array.from(tmp);
+ for (i in tmpl) {
+ yuandian[tmpl[i]] = [];
+ }
+ for (var i = 0; i < data.length; i++) {
+ yuandian[data[i].floor].push([data[i].x0_length, data[i].y0_width]);
+ }
+ }
+ });
+ return yuandian;
+ };
- $("#jiazai0").remove()
- $("#jiazai1").remove()
- $("#jiazai2").remove()
- $("#jiazai3").remove()
+ function getSystemSetting() {
+ var sysset = [];
+ $.ajax({
+ async: false,
+ type: 'POST',
+ url: "/hxzkoa/getSysSetting_list.do",
+ dataType: 'json',
+ success: function (data) {
+ sysset = data;
+ },
+ });
+ return sysset;
+ };
- //瀹為檯涓庡浘鐗囩殑姣斾緥灏�
- _this.x_ratio = new Number(_this.imgLoadList['map'].naturalWidth / _this.trueLength);
- _this.y_ratio = new Number(_this.imgLoadList['map'].naturalHeight / _this.trueWidth);
+ function loadImages(sources, callback) {
+ var count = 0,
+ images = {},
+ imgNum = 0;
+ for (src in sources) {
+ imgNum++;
+ }
+ for (src in sources) {
+ images[src] = new Image();
- if (tuodong == true) {
- return false;
+ images[src].onload = function () {
+ if (++count >= imgNum) {
+ callback(images);
+ }
+ }
+ images[src].src = sources[src];
+ }
+ };
+
+ function getTrackColor(yanse) {
+ var color;
+ if (yanse == "绾㈣壊") {
+ var color = "red";
+ } else if (yanse == "缁胯壊") {
+ var color = "green";
+ } else if (yanse == "钃濊壊") {
+ var color = "blue";
+ } else if (yanse == "鐧借壊") {
+ var color = "white";
+ } else if (yanse == "榛戣壊") {
+ var color = "black";
+ } else if (yanse == "榛勮壊") {
+ var color = "yellow";
+ }
+ return color
+ };
+
+ function getExistFence_all(leixing) {
+ var fencelist = {};
+ var fencecolor = {};
+ var fencename = {};
+ var fencetype = {};
+ $.ajax({
+ async: false,
+ type: 'POST',
+ url: "/hxzkoa/getFloorFence_all.do",
+ dataType: 'json',
+ data: {},
+ success: function (data) {
+ let tmp = new Set();
+ for (var i = 0; i < data.length; i++) {
+ tmp.add(data[i].floor);
+ };
+ let tmpl = Array.from(tmp);
+ for (i in tmpl) {
+ fencelist[tmpl[i]] = [];
+ fencecolor[tmpl[i]] = [];
+ fencename[tmpl[i]] = [];
+ fencetype[tmpl[i]] = [];
+ }
+ for (var i = 0; i < data.length; i++) {
+ fencelist[data[i].floor].push(data[i].zuobiao);
+ fencecolor[data[i].floor].push(data[i].color);
+ fencename[data[i].floor].push(data[i].name);
+ fencetype[data[i].floor].push(data[i].type);
+ }
+ }
+ });
+ if (leixing == "zuobiao") {
+ return fencelist
+ } else if (leixing == "color") {
+ return fencecolor
+ } else if (leixing == "name") {
+ return fencename
+ } else if (leixing == "type") {
+ return fencetype
+ };
+ };
+
+ function getDrawColor(yanse) {
+ var color;
+ if (yanse == "绾㈣壊") {
+ var color = "rgba(255,0,0,0.3)";
+ } else if (yanse == "缁胯壊") {
+ var color = "rgba(0,255,0,0.3)";
+ } else if (yanse == "钃濊壊") {
+ var color = "rgba(0,0,255,0.3)";
+ } else if (yanse == "鐧借壊") {
+ var color = "rgba(255,255,255,0.3)";
+ } else if (yanse == "榛戣壊") {
+ var color = "rgba(0,0,0,0.3)";
+ }
+ return color
+ };
+ function inFenceOrNot(fence_list, node_list) {
+ //fence_list[x,y]
+ //node_list[x,y]
+ if (fence_list.length == 2) { //鐭╁舰
+ if (node_list[0] >= Math.min(fence_list[0][0], fence_list[1][0]) && node_list[0] <= Math.max(fence_list[0][0], fence_list[1][0])) {
+ if (node_list[1] >= Math.min(fence_list[0][1], fence_list[1][1]) && node_list[1] <= Math.max(fence_list[0][1], fence_list[1][1])) {
+ return true //鍦ㄨ�冨嫟鍖哄煙
+ }
+ }
+ return false //涓嶅湪鑰冨嫟鍖哄煙
+ } else if (fence_list.length > 2) { //澶氳竟褰�
+ for (var c = false, i = -1, l = fence_list.length, j = l - 1; ++i < l; j = i)
+ ((fence_list[i][1] <= node_list[1] && node_list[1] < fence_list[j][1]) || (fence_list[j][1] <= node_list[1] && node_list[1] < fence_list[i][1]))
+ && (node_list[0] < (fence_list[j][0] - fence_list[i][0]) * (node_list[1] - fence_list[i][1]) / (fence_list[j][1] - fence_list[i][1]) + fence_list[i][0])
+ && (c = !c);
+ return c;
+ }
+ };
+
+ function getGas(leixing) {
+ var gaslist = [];
+ var gasnongdu = [];
+ var gastype = [];
+ $.ajax({
+ async: false,
+ type: 'POST',
+ url: "/hxzkoa/getGas_list.do",
+ dataType: 'json',
+ data: {},
+ success: function (data) {
+ for (var i = 0; i < data.length; i++) {
+ gaslist.push([data[i].x, data[i].y]);
+ gasnongdu.push(data[i].nong_du);
+ gastype.push(data[i].gas_type);
+ }
+ }
+ });
+ if (leixing == "zuobiao") {
+ return gaslist
+ } else if (leixing == "type") {
+ return gastype
+ } else if (leixing == "nongdu") {
+ return gasnongdu
+ };
+ };
+
+ function getRealPosition(current_floor) {
+ var realposition = [];
+ $.ajax({
+ async: false,
+ type: 'POST',
+ url: "/hxzkoa/getRealPosition.do",
+ dataType: 'json',
+ data: {
+ floor: current_floor,
+ },
+ success: function (data) {
+ for (var i = 0; i < data.length; i++) {
+ //playMark[id,name,power,life,x,y,time]
+ realposition.push([data[i].tagid, data[i].name, data[i].power, data[i].life, data[i].posx, data[i].posy, data[i].time, data[i].fence == 1 || data[i].sos == 1, data[i].sousuo, data[i].shipin])
+ }
+ },
+ });
+ return realposition
+ };
+
+ function str_to_time(str) {
+ //鏍规嵁瀛楃涓茶浆鎹㈡垚瀵瑰簲鐨勬椂闂达紙绉掞級
+ if (str == "涓嶆樉绀哄疄鏃惰建杩�") {
+ return 0;
+ } else if (str == "10绉掗挓") {
+ return 10;
+ } else if (str == "30绉掗挓") {
+ return 30;
+ } else if (str == "1鍒嗛挓") {
+ return 60;
+ } else if (str == "10鍒嗛挓") {
+ return 600;
+ } else if (str == "30鍒嗛挓") {
+ return 1800;
+ } else if (str == "1灏忔椂") {
+ return 3600;
+ };
+ };
+
+ function getTracknow(current_floor, tagid_str, time) {
+ var finalrealtrack = {};
+ $.ajax({
+ async: false,
+ type: 'POST',
+ url: "/hxzkoa/getRealTrack.do",
+ dataType: 'json',
+ data: {
+ time: time,
+ floor: current_floor,
+ tagid: tagid_str,
+ },
+ success: function (data) {
+ for (var i = 0; i < data.length; i++) {
+ finalrealtrack[data[i][0].tagid] = [];
+ for (var j = 0; j < data[i].length; j++) {
+ finalrealtrack[data[i][0].tagid].push([data[i][j].x, data[i][j].y, data[i][j].time])
+ }
+ }
+ },
+ });
+ return finalrealtrack;
+ };
+
+ function getAnchorInfo_all() {
+ var anchorList_on = {};
+ var anchorList_off = {};
+ $.ajax({
+ async: false,
+ type: 'POST',
+ url: "/hxzkoa/getAnchorInfo_all.do",
+ dataType: 'json',
+ data: {},
+ success: function (data) {
+ let tmp = new Set();
+ for (var i = 0; i < data.length; i++) {
+ tmp.add(data[i].layer);
+ };
+ let tmpl = Array.from(tmp);
+ for (i in tmpl) {
+ anchorList_on[tmpl[i]] = [];
+ anchorList_off[tmpl[i]] = [];
+ }
+ for (var i = 0; i < data.length; i++) {
+ if (data[i].anchormode == "1") {
+ anchorList_on[data[i].layer].push([data[i].anchorid, data[i].posx, data[i].posy, data[i].posz, data[i].GreateTime]);
+ } else if (data[i].anchormode == "0") {
+ anchorList_off[data[i].layer].push([data[i].anchorid, data[i].posx, data[i].posy, data[i].posz, data[i].GreateTime]);
+
+ }
+ }
+ }
+ });
+ return [anchorList_on, anchorList_off]
+ };
+
+ /**璇ユ柟娉曠敤鏉ョ粯鍒朵竴涓湁濉厖鑹茬殑鍦嗚鐭╁舰
+ *@param cxt:canvas鐨勪笂涓嬫枃鐜
+ *@param x:宸︿笂瑙抶杞村潗鏍�
+ *@param y:宸︿笂瑙抷杞村潗鏍�
+ *@param width:鐭╁舰鐨勫搴�
+ *@param height:鐭╁舰鐨勯珮搴�
+ *@param radius:鍦嗙殑鍗婂緞
+ *@param fillColor:濉厖棰滆壊
+ **/
+ function fillRoundRect(cxt, x, y, width, height, radius, /*optional*/ fillColor) {
+ //鍦嗙殑鐩村緞蹇呯劧瑕佸皬浜庣煩褰㈢殑瀹介珮
+ if (2 * radius > width || 2 * radius > height) { return false; }
+
+ cxt.save();
+ cxt.translate(x, y);
+ //缁樺埗鍦嗚鐭╁舰鐨勫悇涓竟
+ drawRoundRectPath(cxt, width, height, radius);
+ cxt.fillStyle = fillColor || "#000"; //鑻ユ槸缁欏畾浜嗗�煎氨鐢ㄧ粰瀹氱殑鍊煎惁鍒欑粰浜堥粯璁ゅ��
+ cxt.fill();
+ cxt.restore();
+ }
+
+ function drawRoundRectPath(cxt, width, height, radius) {
+ cxt.beginPath(0);
+ //浠庡彸涓嬭椤烘椂閽堢粯鍒讹紝寮у害浠�0鍒�1/2PI
+ cxt.arc(width - radius, height - radius, radius, 0, Math.PI / 2);
+
+ //鐭╁舰涓嬭竟绾�
+ cxt.lineTo(radius, height);
+
+ //宸︿笅瑙掑渾寮э紝寮у害浠�1/2PI鍒癙I
+ cxt.arc(radius, height - radius, radius, Math.PI / 2, Math.PI);
+
+ //鐭╁舰宸﹁竟绾�
+ cxt.lineTo(0, radius);
+
+ //宸︿笂瑙掑渾寮э紝寮у害浠嶱I鍒�3/2PI
+ cxt.arc(radius, radius, radius, Math.PI, Math.PI * 3 / 2);
+
+ //涓婅竟绾�
+ cxt.lineTo(width - radius, 0);
+
+ //鍙充笂瑙掑渾寮�
+ cxt.arc(width - radius, radius, radius, Math.PI * 3 / 2, Math.PI * 2);
+
+ //鍙宠竟绾�
+ cxt.lineTo(width, height - radius);
+ cxt.closePath();
+ }
+ </script>
+ <!-- 甯哥敤鍑芥暟缁撴潫 -->
+
+ <!-- 璋冪敤瀹ゅ唴瀹氫綅鍦板浘鍔熻兘 -->
+ <script>
+ function diaoyonghuatu(result) {
+
+ var truemap_list = getTruemap_all();
+ var yuandian_list = getYuandian_all();
+ var fencezuobiao_list = getExistFence_all("zuobiao");
+ var fencecolor_list = getExistFence_all("color");
+ var fencename_list = getExistFence_all("name");
+ var fencetype_list = getExistFence_all("type");
+ var onlineAnchorinfo_list = getAnchorInfo_all()[0];
+ var offlineAnchorinfo_list = getAnchorInfo_all()[1];
+
+ //璇诲彇绯荤粺璁剧疆
+ var sysSetting = getSystemSetting();
+
+ for (var i = 0; i < result['map'].length; i++) {
+ var cf = result['floor'][i];//褰撳墠floor
+ var tml = [];
+ if (truemap_list[cf]) {
+ tml = truemap_list[cf];
+ };
+ var ydl = [];
+ if (yuandian_list[cf]) {
+ ydl = yuandian_list[cf];
+ };
+ var fzbl = [];
+ if (fencezuobiao_list[cf]) {
+ fzbl = fencezuobiao_list[cf];
+ };
+ var fcl = [];
+ if (fencecolor_list[cf]) {
+ fcl = fencecolor_list[cf];
+ };
+ var fnl = [];
+ if (fencename_list[cf]) {
+ fnl = fencename_list[cf];
+ };
+ var ftl = []
+ if (fencetype_list[cf]) {
+ ftl = fencetype_list[cf];
+ };
+ var ail_on = [];
+ if (onlineAnchorinfo_list[cf]) {
+ ail_on = onlineAnchorinfo_list[cf];
+ };
+ var ail_off = [];
+ if (offlineAnchorinfo_list[cf]) {
+ ail_off = offlineAnchorinfo_list[cf];
+ };
+ subgraph(i, result['map'][i], result['floor'][i], tml, ydl, fzbl, fcl, fnl, ftl, ail_on, ail_off, sysSetting, result['map'].length)
}
- if (_this.cacheCanvas == null) {
- _this.cacheCanvas = document.createElement("canvas");
- _this.cacheCanvas.width = _this.canvas.width;
- _this.cacheCanvas.height = _this.canvas.height;
- var cacheCtx = _this.cacheCanvas.getContext("2d");
- //鐢诲嚭褰撳墠宸叉湁鐨勫洿鏍忓尯鍩�
- if (_this.fence_show == "1") {
- if (_this.FenceList.length) {
- //閬嶅巻姣忎釜fence锛屽苟鐢诲嚭
- for (var m = 0; m < _this.FenceList.length; m++) {
- var draw_points_list = [];
- var points_list = _this.FenceList[m].split(",");
- //瀹為檯鍧愭爣杞垚鍥句笂鍧愭爣
- for (var i = 0; i < points_list.length; i++) {
- if (i % 2 == 0) {
- //鍋舵暟鍧愭爣锛屽嵆x鍧愭爣
- tmp_list = [];
- var tmp_point = new Number(_this.imgXList['map'] + _this.imgScaleList['map'] * _this.rateNumList['map'] * _this.x_ratio * (points_list[i] - _this.x_x0));
- tmp_list.push(tmp_point);
- } else {
- var tmp_point = new Number(_this.imgYList['map'] + _this.imgScaleList['map'] * _this.rateNumList['map'] * _this.y_ratio * (points_list[i] - _this.y_y0));
- tmp_list.push(tmp_point);
- draw_points_list.push(tmp_list);
- };
- };
+ };
+ //subgraph(i,result['map'][i],result['floor'][i],tml,ydl,fzbl,fcl,fnl,ftl,ail,sysSetting)
+ function subgraph(index, mp, fr, tml, ydl, fzbl, fcl, fnl, ftl, ail_on, ail_off, sysSetting, ttm) {
+ var imgUrl = '/hxzkoa/hxzk/image/mapfile/' + mp;//鍥剧墖璺緞
+ //var imgUrl = '/hxzkoa/hxzk/image/mapfile/office.jpg';//鍥剧墖璺緞
+ var imgList = new Array();
+ imgList['map'] = imgUrl;
+ var iconUrl = '/hxzkoa/hxzk/image/targeticon/default.png';
+ imgList['icon'] = iconUrl;
- var color = getDrawColor(_this.FenceColor[m]);
- var name = _this.FenceName[m];
+ // var anckicon = '/hxzkoa/hxzk/image/anchor/lingjin.png';
+ // imgList['anchor']=anckicon;
+ var anckicon_on = '/hxzkoa/hxzk/image/anchor/鍩虹珯鍦ㄧ嚎.png';
+ //var anckicon_on = '/hxzkoa/hxzk/image/anchor/lingjin.png';
+ imgList['anchor_online'] = anckicon_on;
- if (draw_points_list.length == 2) {
- cacheCtx.beginPath();
- cacheCtx.fillStyle = color;
- cacheCtx.fillRect(draw_points_list[0][0], draw_points_list[0][1], draw_points_list[1][0] - draw_points_list[0][0], draw_points_list[1][1] - draw_points_list[0][1]);
- cacheCtx.stroke();
- cacheCtx.fillStyle = "red";
- cacheCtx.fillText(name, (draw_points_list[0][0] + draw_points_list[1][0]) / 2, (draw_points_list[0][1] + draw_points_list[1][1]) / 2);
- cacheCtx.closePath();
- } else {
- cacheCtx.beginPath();
- cacheCtx.fillStyle = color;
- cacheCtx.lineWidth = 1;
- var text_x = new Number(0);
- var text_y = new Number(0);
- for (var j = 0; j < draw_points_list.length; j++) {
- if (j == 0) {
- cacheCtx.moveTo(draw_points_list[j][0], draw_points_list[j][1]);
+ var anckicon_off = '/hxzkoa/hxzk/image/anchor/鍩虹珯绂荤嚎.png'
+ //var anckicon_off = '/hxzkoa/hxzk/image/anchor/ceju.png';
+ imgList['anchor_offline'] = anckicon_off;
+
+ new MarkPoints(index, fr, imgList, tml, ydl, fzbl, fcl, fnl, ftl, ail_on, ail_off, sysSetting, ttm);
+ };
+ var serial;
+ var code;
+ var isDelete = false;
+ var shipinka = true;
+ var tuodong = false;
+ var colorbbb = "rgba(255,0,0,0.3)";
+ var sosType = [];
+ var sousuoType = true;
+ for (var i = 0; i < 500; i++) {
+ sosType[i] = true;
+ }
+ var sos = document.createElement('img');
+ sos.src = '/hxzkoa/hxzk/image/icon/SOS.png';
+ var sos1 = document.createElement('img');
+ sos1.src = '/hxzkoa/hxzk/image/icon/SOS1.png';
+ var sousuo0 = document.createElement('img');
+ sousuo0.src = '/hxzkoa/hxzk/image/icon/sousuo0.png';
+ function MarkPoints(index, current_floor, imgList, tml, ydl, fzbl, fcl, fnl, ftl, ail_on, ail_off, sysSetting, ttm) {
+ this.imgX = 0;//鍦ㄧ敾甯冧笂鍥剧墖鐨刋鍋忕Щ閲�
+ this.imgY = 0;//鍦ㄧ敾甯冧笂鍥剧墖鐨刌鍋忕Щ閲�
+ this.imgScale = 1;//鍥剧墖鐨勭缉鏀炬瘮渚�
+ this.rateNum;//鍥剧墖楂樺害鑷�傚簲姣斾緥,鍥剧墖绛夋瘮灞呬腑灞曠ず鍦╟anvas
+ this.scaleFlag = 0;//缂╂斁鍥犲瓙锛屾渶澶х缉鏀�9,鏈�灏忕缉鏀�-9
+ this.context;
+ this.img; //鍦板浘
+ this.playIndex = 0;
+ this.pos = {};//姣忔鎷栨嫿鍓嶅潗鏍囦繚瀛�
+
+ this.imgLoadList = new Array();
+ this.rateNumList = new Array();
+ this.imgXList = new Array();
+ this.imgYList = new Array();
+ this.imgScaleList = new Array();
+
+ //鑾峰彇鐪熷疄鍦板浘
+ this.trueMeasure;
+ this.trueLength;
+ this.trueWidth;
+ this.x_ratio;
+ this.y_ratio;
+ this.x_x0;
+ this.y_y0;
+ this.expand = false;
+
+ //system setting
+ this.sysSetting;
+ this.tagZb = '0';//鏄惁鏄剧ず鏍囩鍧愭爣
+ this.diskaoqin = '0'; //鍑鸿�冨嫟鍖哄煙鏄惁娑堝け
+ this.viewAnckid = '0';//鏄惁鏄剧ず鍩虹珯ID
+ this.viewName = '0';//鏄惁鏄剧ず浜哄憳鍚嶇О
+ this.tunlDw = '0'//闅ч亾瀹氫綅妯″紡
+ this.guiji_sava = '0'//鏄惁寮�鍚建杩逛繚瀛�
+ this.viewPower = '0';//鏄惁鏄剧ず鐢甸噺
+ this.viewTagid = '0';//鏄惁鏄剧ず鏍囩ID
+ this.viewAnckzb = '0';//鏄惁鏄剧ず鍩虹珯鍧愭爣
+ this.offView = '0'//鏄惁绂荤嚎涓嶆樉绀哄浘鏍�
+ this.anckicon = '0'//鏄惁鏄剧ず鍩虹珯鍥炬爣
+ this.gas_show = '0'//鏄剧ず鍏朵粬妫�娴�(姘斾綋鏄剧ず)
+ this.quiet = '0'//闈欐杈撳嚭鍥哄畾鍧愭爣
+ this.real_trak_time = 0//瀹炴椂杞ㄨ抗鏄剧ず鏃堕暱
+ this.real_trak_color = '绾㈣壊'//瀹炴椂杞ㄨ抗鏄剧ず鐨勯鑹�
+ this.fence_show = '0'//鏄惁鏄剧ず鍥存爮
+
+ this.playFlag = false;//鏄惁鎾斁
+ this.dragFlag = false;//鏄惁鍙嫋鎷藉綋鍓峣mg锛岄粯璁や笉鑳�
+ this.markFlag = false;//鏍囪鍖哄煙寮�鍚叧闂璮lag
+ this.CreatLinepoints = [];//姣忔鍒涘缓鏂板尯鍩熺殑鍧愭爣闆嗗悎
+ this.playMark; //姝e湪灞曠ず鐨勬爣璁�
+ this.playMarkInKaoQin;//褰撳墠鏍囪鏄惁鍦ㄨ�冨嫟鍖哄煙鍐�
+ this.trackNow; //褰撳墠杞ㄨ抗
+
+ this.onlineAnchorList;//褰撳墠鍩虹珯鍒楄〃
+ this.offlineAnchorList;
+
+ this.allMarkLins = [];//宸插垱寤虹殑鍖哄煙闆嗗悎锛屼緥濡俒[{x,y},{x,y},{x,y}],[{n,m},{n,m},{n,m}]]鐩墠鍙渶瑕佷竴涓尯鍩燂紝鎵�浠ユ暟缁勫唴閮ㄥ彧鏈変竴椤�
+ this.allFenceColor = [];//宸插垱寤虹殑鍖哄煙棰滆壊
+
+ this.FenceList; //鍥存爮鍧愭爣
+ this.FenceColor; //鍥存爮棰滆壊
+ this.FenceName; //鍥存爮鍚嶇О
+ this.realFenceList = []; // [鍚嶇О锛岀被鍨嬶紝瀹為檯鍧愭爣]
+ this.fenceMarkCount; //鍖哄煙鍐呯殑鍧愭爣鏁伴噺
+ this.cacheCanvas = null; //缂撳瓨鍥存爮缁樺浘
+
+ this.GasList; //姘斾綋鍧愭爣
+ this.GasType; //姘斾綋绫诲瀷
+ this.GasNongdu; //姘斾綋娴撳害
+
+ this.ttm;
+ this.timer;
+
+ this.getImgLoad(index, imgList, current_floor);
+ this.init(current_floor, tml, ydl, fzbl, fcl, fnl, ftl, ail_on, ail_off, sysSetting, ttm);
+
+ document.oncontextmenu = new Function("event.returnValue=false;");
+ document.onselectstart = new Function("event.returnValue=false;");
+ };
+
+ MarkPoints.prototype = {
+ getImgLoad: function (index, imgList, current_floor) {
+ var _this = this;
+ var str = "wrap" + index;
+ var wrap = document.getElementById(str);
+ var str2 = "draw" + index;
+ _this.canvas = document.getElementById(str2);
+ _this.context = _this.canvas.getContext('2d');
+ _this.canvas.height = wrap.offsetHeight;
+ _this.canvas.width = wrap.offsetWidth;
+
+ loadImages(imgList, function (images) {
+ for (var key in images) {
+ if (key == 'map') {
+ _this.imgScaleList[key] = 1;
+ _this.img = images[key];
+ } else if (key == 'icon') {
+ _this.imgScaleList[key] = 0.03;
+ } else {
+ _this.imgScaleList[key] = images[key].naturalWidth / images['map'].naturalWidth;
+ };
+ _this.rateNumList[key] = _this.canvas.width / images[key].naturalWidth;
+ _this.imgXList[key] = (_this.canvas.width - images[key].naturalWidth * _this.imgScaleList[key] * _this.rateNumList[key]) / 2;
+ _this.imgYList[key] = (_this.canvas.height - images[key].naturalHeight * _this.imgScaleList[key] * _this.rateNumList[key]) / 2;//榛樿杩涙潵褰撳墠鍥惧儚灞呬腑鏄剧ず
+ _this.imgLoadList[key] = images[key];
+ }
+ /*鐢诲嚭褰撳墠鍥剧墖*/
+ //_this.drawImg(current_floor);
+ });
+ },
+
+ drawImg: function (current_floor) {
+ var _this = this;
+ var can = _this.context;
+ can.clearRect(0, 0, _this.canvas.width, _this.canvas.height);
+
+ can.globalCompositeOperation = "source-over";
+ var images = _this.imgLoadList;
+
+ //鐢诲湴鍥�
+ can.drawImage(_this.img, 0, 0, _this.img.naturalWidth, _this.img.naturalHeight, _this.imgXList['map'], _this.imgYList['map'], _this.img.naturalWidth * _this.imgScaleList['map'] * _this.rateNumList['map'], _this.img.naturalHeight * _this.imgScaleList['map'] * _this.rateNumList['map']);
+
+ $("#jiazai0").remove()
+ $("#jiazai1").remove()
+ $("#jiazai2").remove()
+ $("#jiazai3").remove()
+
+ //瀹為檯涓庡浘鐗囩殑姣斾緥灏�
+ _this.x_ratio = new Number(_this.imgLoadList['map'].naturalWidth / _this.trueLength);
+ _this.y_ratio = new Number(_this.imgLoadList['map'].naturalHeight / _this.trueWidth);
+
+ if (tuodong == true) {
+ return false;
+ }
+
+ if (_this.cacheCanvas == null) {
+ _this.cacheCanvas = document.createElement("canvas");
+ _this.cacheCanvas.width = _this.canvas.width;
+ _this.cacheCanvas.height = _this.canvas.height;
+ var cacheCtx = _this.cacheCanvas.getContext("2d");
+ //鐢诲嚭褰撳墠宸叉湁鐨勫洿鏍忓尯鍩�
+ if (_this.fence_show == "1") {
+ if (_this.FenceList.length) {
+ //閬嶅巻姣忎釜fence锛屽苟鐢诲嚭
+ for (var m = 0; m < _this.FenceList.length; m++) {
+ var draw_points_list = [];
+ var points_list = _this.FenceList[m].split(",");
+ //瀹為檯鍧愭爣杞垚鍥句笂鍧愭爣
+ for (var i = 0; i < points_list.length; i++) {
+ if (i % 2 == 0) {
+ //鍋舵暟鍧愭爣锛屽嵆x鍧愭爣
+ tmp_list = [];
+ var tmp_point = new Number(_this.imgXList['map'] + _this.imgScaleList['map'] * _this.rateNumList['map'] * _this.x_ratio * (points_list[i] - _this.x_x0));
+ tmp_list.push(tmp_point);
} else {
- cacheCtx.lineTo(draw_points_list[j][0], draw_points_list[j][1]);
- }
- if (j == draw_points_list.length - 1) {
- cacheCtx.lineTo(draw_points_list[0][0], draw_points_list[0][1]);
- cacheCtx.fill();
- }
- text_x = text_x + draw_points_list[j][0];
- text_y = text_y + draw_points_list[j][1];
+ var tmp_point = new Number(_this.imgYList['map'] + _this.imgScaleList['map'] * _this.rateNumList['map'] * _this.y_ratio * (points_list[i] - _this.y_y0));
+ tmp_list.push(tmp_point);
+ draw_points_list.push(tmp_list);
+ };
+ };
- }
- text_x = text_x / draw_points_list.length;
- text_y = text_y / draw_points_list.length;
+ var color = getDrawColor(_this.FenceColor[m]);
+ var name = _this.FenceName[m];
- cacheCtx.fillStyle = color;
- cacheCtx.fill();
- cacheCtx.strokeStyle = color;
- cacheCtx.stroke();
- cacheCtx.fillStyle = "red";
- cacheCtx.fillText(name, text_x, text_y);
- cacheCtx.closePath();
+ if (draw_points_list.length == 2) {
+ cacheCtx.beginPath();
+ cacheCtx.fillStyle = color;
+ cacheCtx.fillRect(draw_points_list[0][0], draw_points_list[0][1], draw_points_list[1][0] - draw_points_list[0][0], draw_points_list[1][1] - draw_points_list[0][1]);
+ cacheCtx.stroke();
+ cacheCtx.fillStyle = "red";
+ cacheCtx.fillText(name, (draw_points_list[0][0] + draw_points_list[1][0]) / 2, (draw_points_list[0][1] + draw_points_list[1][1]) / 2);
+ cacheCtx.closePath();
+ } else {
+ cacheCtx.beginPath();
+ cacheCtx.fillStyle = color;
+ cacheCtx.lineWidth = 1;
+ var text_x = new Number(0);
+ var text_y = new Number(0);
+ for (var j = 0; j < draw_points_list.length; j++) {
+ if (j == 0) {
+ cacheCtx.moveTo(draw_points_list[j][0], draw_points_list[j][1]);
+ } else {
+ cacheCtx.lineTo(draw_points_list[j][0], draw_points_list[j][1]);
+ }
+ if (j == draw_points_list.length - 1) {
+ cacheCtx.lineTo(draw_points_list[0][0], draw_points_list[0][1]);
+ cacheCtx.fill();
+ }
+ text_x = text_x + draw_points_list[j][0];
+ text_y = text_y + draw_points_list[j][1];
+
+ }
+ text_x = text_x / draw_points_list.length;
+ text_y = text_y / draw_points_list.length;
+
+ cacheCtx.fillStyle = color;
+ cacheCtx.fill();
+ cacheCtx.strokeStyle = color;
+ cacheCtx.stroke();
+ cacheCtx.fillStyle = "red";
+ cacheCtx.fillText(name, text_x, text_y);
+ cacheCtx.closePath();
+ };
};
};
};
+ can.drawImage(_this.cacheCanvas, 0, 0);
+ } else {
+ can.drawImage(_this.cacheCanvas, 0, 0);
};
- can.drawImage(_this.cacheCanvas, 0, 0);
- } else {
- can.drawImage(_this.cacheCanvas, 0, 0);
- };
- //鍒ゆ柇褰撳墠鍧愭爣鏄惁鍦ㄨ�冨嫟鍖哄煙鍐�
- _this.playMarkInKaoQin = [];
- for (var n in _this.playMark) { //_this.playMark涓哄綋鍓嶅疄鏃跺湪绾跨偣浣嶇疆锛屼负[array[id,name,power,life,x,y,time]]
- node_list = [Number(_this.playMark[n][4]), Number(_this.playMark[n][5])];
- for (var f in _this.realFenceList) {
- if (_this.realFenceList[f][1] == "鑰冨嫟鍖哄煙") {
- if (inFenceOrNot(_this.realFenceList[f][2], node_list)) {
- //inFenceOrNot(fence_list, node_list) return true/false
- _this.playMarkInKaoQin.push(true);
- break;
- }
- }
- };
- if (_this.playMarkInKaoQin.length == n) {
- _this.playMarkInKaoQin.push(false);
- }
- };
-
-
- //璁$畻鍖哄煙鍐呯殑鍧愭爣鏁伴噺锛堥毀閬撳畾浣嶏級
- _this.fenceMarkCount = [];
- for (var f in _this.realFenceList) {
- //f[name, type, zuobiao_array]
- var tmp_count = new Number(0);
- for (var n in _this.playMark) {//_this.playMark涓哄綋鍓嶅疄鏃跺湪绾跨偣浣嶇疆锛屼负[array[.x, .y]]
+ //鍒ゆ柇褰撳墠鍧愭爣鏄惁鍦ㄨ�冨嫟鍖哄煙鍐�
+ _this.playMarkInKaoQin = [];
+ for (var n in _this.playMark) { //_this.playMark涓哄綋鍓嶅疄鏃跺湪绾跨偣浣嶇疆锛屼负[array[id,name,power,life,x,y,time]]
node_list = [Number(_this.playMark[n][4]), Number(_this.playMark[n][5])];
- if (inFenceOrNot(_this.realFenceList[f][2], node_list)) {//inFenceOrNot(fence_list, node_list) return true/false
- tmp_count += 1;
- //break;
+ for (var f in _this.realFenceList) {
+ if (_this.realFenceList[f][1] == "鑰冨嫟鍖哄煙") {
+ if (inFenceOrNot(_this.realFenceList[f][2], node_list)) {
+ //inFenceOrNot(fence_list, node_list) return true/false
+ _this.playMarkInKaoQin.push(true);
+ break;
+ }
+ }
+ };
+ if (_this.playMarkInKaoQin.length == n) {
+ _this.playMarkInKaoQin.push(false);
}
};
- _this.fenceMarkCount.push(tmp_count);
- };
- // if (shipinka) {
+
+ //璁$畻鍖哄煙鍐呯殑鍧愭爣鏁伴噺锛堥毀閬撳畾浣嶏級
+ _this.fenceMarkCount = [];
+ for (var f in _this.realFenceList) {
+ //f[name, type, zuobiao_array]
+ var tmp_count = new Number(0);
+ for (var n in _this.playMark) {//_this.playMark涓哄綋鍓嶅疄鏃跺湪绾跨偣浣嶇疆锛屼负[array[.x, .y]]
+ node_list = [Number(_this.playMark[n][4]), Number(_this.playMark[n][5])];
+ if (inFenceOrNot(_this.realFenceList[f][2], node_list)) {//inFenceOrNot(fence_list, node_list) return true/false
+ tmp_count += 1;
+ //break;
+ }
+ };
+ _this.fenceMarkCount.push(tmp_count);
+ };
+
+ // if (shipinka) {
//鐢绘爣绛惧強鍩虹珯
for (var key in images) {
if (key == "icon" && _this.playMark) {
@@ -1198,493 +1193,495 @@
};
}
};
- // }
+ // }
- //寮�鍚毀閬撳畾浣嶅悗锛岄渶瑕佹樉绀哄綋鍓嶈�冨嫟鍖哄煙鍐呯殑鎬绘爣绛炬暟閲�
- if (_this.tunlDw == "1") {
- var k = 0;
- fillRoundRect(can, 10, 10, 140, 40 * _this.fenceMarkCount.length, 10, colorbbb);
- for (var i = 0; i < _this.fenceMarkCount.length; i++) {
- can.beginPath();
- can.fillStyle = getDrawColor(_this.FenceColor[i]);
- can.fillStyle = "rgba(255,255,0,0.7)";
- can.font = "15px Verdana";
- can.fillText(_this.realFenceList[i][0] + ":" + _this.fenceMarkCount[i], 34, 36 + 40 * k);
- can.closePath();
- k += 1;
+ //寮�鍚毀閬撳畾浣嶅悗锛岄渶瑕佹樉绀哄綋鍓嶈�冨嫟鍖哄煙鍐呯殑鎬绘爣绛炬暟閲�
+ if (_this.tunlDw == "1") {
+ var k = 0;
+ fillRoundRect(can, 10, 10, 140, 40 * _this.fenceMarkCount.length, 10, colorbbb);
+ for (var i = 0; i < _this.fenceMarkCount.length; i++) {
+ can.beginPath();
+ can.fillStyle = getDrawColor(_this.FenceColor[i]);
+ can.fillStyle = "rgba(255,255,0,0.7)";
+ can.font = "15px Verdana";
+ can.fillText(_this.realFenceList[i][0] + ":" + _this.fenceMarkCount[i], 34, 36 + 40 * k);
+ can.closePath();
+ k += 1;
+ };
};
- };
- //寮�鍚皵浣撴樉绀�
- if (_this.gas_show == "1") {
- _this.GasList = getGas("zuobiao"); //姘斾綋鍧愭爣
- _this.GasType = getGas("type"); //姘斾綋绫诲瀷
- _this.GasNongdu = getGas("nongdu"); //姘斾綋娴撳害
- for (var i = 0; i < _this.GasList.length; i++) {
- var cor_x = new Number(_this.GasList[i][0]);
- var cor_y = new Number(_this.GasList[i][1]);
- var x_cor = new Number(_this.imgXList['map'] + _this.imgScaleList['map'] * _this.rateNumList['map'] * _this.x_ratio * (cor_x - _this.x_x0));
- var y_cor = new Number(_this.imgYList['map'] + _this.imgScaleList['map'] * _this.rateNumList['map'] * _this.y_ratio * (cor_y - _this.y_y0));
- can.beginPath();
- can.arc(x_cor, y_cor, 6, 0, Math.PI * 2, true);
- can.fillStyle = "green";
- can.fill();
- can.fillStyle = "red";
- can.fillText(_this.GasType[i], x_cor + 10, y_cor);
- can.fillText(_this.GasNongdu[i], x_cor + 10, y_cor + 10);
- can.closePath();
- }
- };
- },
-
- init: function (current_floor, tml, ydl, fzbl, fcl, fnl, ftl, ail_on, ail_off, sysSetting, ttm) {
- var _this = this;
-
- //璇诲彇绯荤粺璁剧疆
- _this.tagZb = sysSetting[0].tagZb;//鏄惁鏄剧ず鏍囩鍧愭爣
- _this.diskaoqin = sysSetting[0].diskaoqing; //鍑鸿�冨嫟鍖哄煙鏄惁娑堝け
- _this.viewAnckid = sysSetting[0].viewAnckid;//鏄惁鏄剧ず鍩虹珯ID
- _this.viewName = sysSetting[0].viewName;//鏄惁鏄剧ず浜哄憳鍚嶇О
- _this.tunlDw = sysSetting[0].tunlDw;//闅ч亾瀹氫綅妯″紡
- _this.guiji_sava = sysSetting[0].guiji_sava;//鏄惁寮�鍚建杩逛繚瀛�
- _this.viewPower = sysSetting[0].viewPower;//鏄惁鏄剧ず鐢甸噺
- _this.viewTagid = sysSetting[0].viewTagid;//鏄惁鏄剧ず鏍囩ID
- _this.viewAnckzb = sysSetting[0].viewAnckzb;//鏄惁鏄剧ず鍩虹珯鍧愭爣
- _this.offView = sysSetting[0].offView;//鏄惁绂荤嚎涓嶆樉绀哄浘鏍�
- _this.anckicon = sysSetting[0].anckicon;//鏄惁鏄剧ず鍩虹珯鍥炬爣
- _this.gas_show = sysSetting[0].gas_show;//鏄剧ず鍏朵粬妫�娴�(姘斾綋鏄剧ず)
- _this.quiet = sysSetting[0].quiet;//闈欐杈撳嚭鍥哄畾鍧愭爣
- _this.fence_show = sysSetting[0].fence_show;//鏄惁鏄剧ず鍥存爮
-
- //璇诲彇鐪熷疄鍦板浘
- //璇诲浘鐗囧疄闄呭昂瀵�
- _this.trueLength = new Number(tml[0][0]);
- _this.trueWidth = new Number(tml[0][1]);
-
- //璇诲疄闄呭師鐐瑰潗鏍�
- _this.x_x0 = new Number(ydl[0][0]);
- _this.y_y0 = new Number(ydl[0][1]);
-
- //璇诲彇褰撳墠鍥存爮淇℃伅
- _this.FenceList = fzbl;
- _this.FenceColor = fcl;
- _this.FenceName = fnl;
- _this.FenceType = ftl;
-
- _this.realFenceList = [];
- //閬嶅巻鍥存爮淇℃伅骞跺瓨鍌ㄦ垚[鍚嶇О锛岀被鍨嬶紝鍧愭爣]
- for (var m = 0; m < _this.FenceList.length; m++) {
- var tmp_list = [];
- var points = _this.FenceList[m];
- var points_list = _this.FenceList[m].split(",");
-
- //鍥存爮瀹為檯鍧愭爣锛堝姞涓婂亸绉婚噺鐨勶級
- var points_list_sort = [];
- for (var i = 0; i < points_list.length; i++) {
- if (i % 2 == 0) {
- tmp_list = [];
- tmp_list.push(new Number(points_list[i]));
- } else {
- tmp_list.push(new Number(points_list[i]));
- points_list_sort.push(tmp_list);
+ //寮�鍚皵浣撴樉绀�
+ if (_this.gas_show == "1") {
+ _this.GasList = getGas("zuobiao"); //姘斾綋鍧愭爣
+ _this.GasType = getGas("type"); //姘斾綋绫诲瀷
+ _this.GasNongdu = getGas("nongdu"); //姘斾綋娴撳害
+ for (var i = 0; i < _this.GasList.length; i++) {
+ var cor_x = new Number(_this.GasList[i][0]);
+ var cor_y = new Number(_this.GasList[i][1]);
+ var x_cor = new Number(_this.imgXList['map'] + _this.imgScaleList['map'] * _this.rateNumList['map'] * _this.x_ratio * (cor_x - _this.x_x0));
+ var y_cor = new Number(_this.imgYList['map'] + _this.imgScaleList['map'] * _this.rateNumList['map'] * _this.y_ratio * (cor_y - _this.y_y0));
+ can.beginPath();
+ can.arc(x_cor, y_cor, 6, 0, Math.PI * 2, true);
+ can.fillStyle = "green";
+ can.fill();
+ can.fillStyle = "red";
+ can.fillText(_this.GasType[i], x_cor + 10, y_cor);
+ can.fillText(_this.GasNongdu[i], x_cor + 10, y_cor + 10);
+ can.closePath();
}
- }
- //瀛樺尯鍩熷悕绉�+鍖哄煙绫诲瀷+鍖哄煙鍧愭爣锛屾柟渚垮悗缁垽鏂槸鍚﹀湪鏌愬尯鍩熷唴
- _this.realFenceList.push([_this.FenceName[m], _this.FenceType[m], points_list_sort]);
- };
+ };
+ },
- _this.real_trak_time = str_to_time(sysSetting[0].real_trak_time);//瀹炴椂杞ㄨ抗鏄剧ず鏃堕暱
- //褰撳墠浣嶇疆
- _this.playMark = getRealPosition(current_floor);
- var tagid_str = "";
- for (var i = 0; i < _this.playMark.length; i++) {
- tagid_str += _this.playMark[i][0]
- if (i != _this.playMark.length - 1) {
- tagid_str += ","
- }
- }
- //瀹炴椂杞ㄨ抗
- if (_this.real_trak_time != 0) {
- _this.trackNow = getTracknow(current_floor, tagid_str, _this.real_trak_time);
- } else {
- _this.trackNow = null;
- }
+ init: function (current_floor, tml, ydl, fzbl, fcl, fnl, ftl, ail_on, ail_off, sysSetting, ttm) {
+ var _this = this;
- _this.real_trak_color = getTrackColor(sysSetting[0].real_trak_color);//瀹炴椂杞ㄨ抗鏄剧ず鐨勯鑹�
+ //璇诲彇绯荤粺璁剧疆
+ _this.tagZb = sysSetting[0].tagZb;//鏄惁鏄剧ず鏍囩鍧愭爣
+ _this.diskaoqin = sysSetting[0].diskaoqing; //鍑鸿�冨嫟鍖哄煙鏄惁娑堝け
+ _this.viewAnckid = sysSetting[0].viewAnckid;//鏄惁鏄剧ず鍩虹珯ID
+ _this.viewName = sysSetting[0].viewName;//鏄惁鏄剧ず浜哄憳鍚嶇О
+ _this.tunlDw = sysSetting[0].tunlDw;//闅ч亾瀹氫綅妯″紡
+ _this.guiji_sava = sysSetting[0].guiji_sava;//鏄惁寮�鍚建杩逛繚瀛�
+ _this.viewPower = sysSetting[0].viewPower;//鏄惁鏄剧ず鐢甸噺
+ _this.viewTagid = sysSetting[0].viewTagid;//鏄惁鏄剧ず鏍囩ID
+ _this.viewAnckzb = sysSetting[0].viewAnckzb;//鏄惁鏄剧ず鍩虹珯鍧愭爣
+ _this.offView = sysSetting[0].offView;//鏄惁绂荤嚎涓嶆樉绀哄浘鏍�
+ _this.anckicon = sysSetting[0].anckicon;//鏄惁鏄剧ず鍩虹珯鍥炬爣
+ _this.gas_show = sysSetting[0].gas_show;//鏄剧ず鍏朵粬妫�娴�(姘斾綋鏄剧ず)
+ _this.quiet = sysSetting[0].quiet;//闈欐杈撳嚭鍥哄畾鍧愭爣
+ _this.fence_show = sysSetting[0].fence_show;//鏄惁鏄剧ず鍥存爮
- _this.canvas.onmousedown = function (event) {
- _this.clickDown(event);
- };
- _this.canvas.onmousemove = function (event) {
- _this.mouseMove(event)
- };
- _this.canvas.onmouseup = function (event) {
- _this.mouseUp(event);
- };
- _this.canvas.onmousewheel = function (event) {
- _this.onmouseWheel(event);
- };
- _this.ttm = ttm;
+ //璇诲彇鐪熷疄鍦板浘
+ //璇诲浘鐗囧疄闄呭昂瀵�
+ _this.trueLength = new Number(tml[0][0]);
+ _this.trueWidth = new Number(tml[0][1]);
- //褰撳墠鍦板浘澶т簬1涓椂鎵嶅彲浠ヨ皟鐢╠bclick
- if (_this.ttm > 1) {
- _this.canvas.ondblclick = function (event) {
- _this.doubleClick(event);
- }
- }
+ //璇诲疄闄呭師鐐瑰潗鏍�
+ _this.x_x0 = new Number(ydl[0][0]);
+ _this.y_y0 = new Number(ydl[0][1]);
- _this.onlineAnchorList = ail_on;
- _this.offlineAnchorList = ail_off;
+ //璇诲彇褰撳墠鍥存爮淇℃伅
+ _this.FenceList = fzbl;
+ _this.FenceColor = fcl;
+ _this.FenceName = fnl;
+ _this.FenceType = ftl;
- var t = 300;//300ms
+ _this.realFenceList = [];
+ //閬嶅巻鍥存爮淇℃伅骞跺瓨鍌ㄦ垚[鍚嶇О锛岀被鍨嬶紝鍧愭爣]
+ for (var m = 0; m < _this.FenceList.length; m++) {
+ var tmp_list = [];
+ var points = _this.FenceList[m];
+ var points_list = _this.FenceList[m].split(",");
- // function fn(){
- // //褰撳墠闇�瑕佺敾鐨勫潗鏍�
- // var realposition_list = getRealPosition_all()
- // _this.playMark = realposition_list[current_floor];
- // _this.drawImg(current_floor);
- // }
- function fn() {
- if (tuodong == true) {
- return false;
- }
- if (shipinka == false) {
- return false;
- }
- //褰撳墠瀹炴椂鍧愭爣
- _this.playMark = getRealPosition(current_floor);
- // var tagid_str = "";
- // for (var i=0;i<_this.playMark.length;i++){
- // tagid_str += _this.playMark[i][0]
- // if (i!= _this.playMark.length-1){
- // tagid_str += ","
- // }
- // }
-
- if (_this.real_trak_time != 0) {
- //灏嗗綋鍓嶅疄鏃跺潗鏍囨坊鍔犺繘track涓�
- var track_now = Date.parse(new Date()); //timestamp涓烘绉掑崟浣�
- track_now = track_now / 1000;
- var track_now_head = track_now - _this.real_trak_time;
- //褰撳墠track鏈�寮�濮嬬殑鏃堕棿
- var track_head_date = new Date();
- track_head_date.setTime(track_now_head * 1000 + 8 * 3600 * 1000);
- var track_head_date_str = track_head_date.toJSON().substr(0, 19).replace('T', ' ');
-
- for (var i = 0; i < _this.playMark.length; i++) {
- if (_this.trackNow[_this.playMark[i][0]] != null) {
- if (_this.trackNow[_this.playMark[i][0]].length > 1500) {
- _this.trackNow[_this.playMark[i][0]] = _this.trackNow[_this.playMark[i][0]].slice(-1200);
- };
- for (var j = 0; j < _this.trackNow[_this.playMark[i][0]].length; j++) {
- if (_this.trackNow[_this.playMark[i][0]][0][2] < track_head_date_str) {
- _this.trackNow[_this.playMark[i][0]].shift()
- } else {
- break
- }
- };
- };
- var now_time = new Date();
- now_time.setTime(track_now * 1000 + 8 * 3600 * 1000);
- var now_time_str = now_time.toJSON().substr(0, 19).replace('T', ' ');
- var tmp = [_this.playMark[i][4], _this.playMark[i][5], now_time_str];
- if (_this.trackNow[_this.playMark[i][0]] == null) {
- _this.trackNow[_this.playMark[i][0]] = []
+ //鍥存爮瀹為檯鍧愭爣锛堝姞涓婂亸绉婚噺鐨勶級
+ var points_list_sort = [];
+ for (var i = 0; i < points_list.length; i++) {
+ if (i % 2 == 0) {
+ tmp_list = [];
+ tmp_list.push(new Number(points_list[i]));
+ } else {
+ tmp_list.push(new Number(points_list[i]));
+ points_list_sort.push(tmp_list);
}
- _this.trackNow[_this.playMark[i][0]].push(tmp)
+ }
+ //瀛樺尯鍩熷悕绉�+鍖哄煙绫诲瀷+鍖哄煙鍧愭爣锛屾柟渚垮悗缁垽鏂槸鍚﹀湪鏌愬尯鍩熷唴
+ _this.realFenceList.push([_this.FenceName[m], _this.FenceType[m], points_list_sort]);
+ };
+
+ _this.real_trak_time = str_to_time(sysSetting[0].real_trak_time);//瀹炴椂杞ㄨ抗鏄剧ず鏃堕暱
+ //褰撳墠浣嶇疆
+ _this.playMark = getRealPosition(current_floor);
+ var tagid_str = "";
+ for (var i = 0; i < _this.playMark.length; i++) {
+ tagid_str += _this.playMark[i][0]
+ if (i != _this.playMark.length - 1) {
+ tagid_str += ","
}
}
- _this.drawImg(current_floor);
- }
- // if (full_screen==true){
- // clearInterval(timer);
- // timer_screen= setInterval(fn, t);
- // } else {
- // clearInterval(timer_screen);
- // timer = setInterval(fn, t);
- // }
- // var mapa0 = document.getElementById("wrap0")
- // mapa0.value = "姝e湪鍔犺浇鍦板浘......"
- // var mapa0 = document.getElementById("wrap0")
- // var tt = document.createElement("p");
- // tt.value="姝e湪鍔犺浇鍦板浘......"
- // tt.style=""
- // mapa0.appendChild(tt)
- setTimeout(fnnn, 3000)
- function fnnn(){
- _this.timer = setInterval(fn, t);
- }
- // _this.timer = setInterval(fn, t);
- timer_list.push(_this.timer);
- },
- /*璁$畻褰撳墠榧犳爣浣嶇疆璺濈canvas鐨勫亸绉婚噺*/
- xyToCanvas: function (ele, x, y) {
- var _this = this;
- var obj = _this.canvas.getBoundingClientRect();
- return {
- x: x - obj.left,
- y: y - obj.top
- };
- },
- /*榧犳爣鍙屽嚮浜嬩欢*/
- doubleClick: function (event) {
- var _this = this;
+ //瀹炴椂杞ㄨ抗
+ if (_this.real_trak_time != 0) {
+ _this.trackNow = getTracknow(current_floor, tagid_str, _this.real_trak_time);
+ } else {
+ _this.trackNow = null;
+ }
- if ((event.type == "dblclick") && (full_screen == false)) {
- _this.expand = true;
- full_screen = true;
+ _this.real_trak_color = getTrackColor(sysSetting[0].real_trak_color);//瀹炴椂杞ㄨ抗鏄剧ず鐨勯鑹�
- var targ = event.target;
- var tid = targ.id;
- var id = tid.substr(tid.length - 1, 1)
- var str = "map" + id;
- document.getElementById(str).style.width = "100%";
- document.getElementById(str).style.height = "800px";
- var str = "draw" + id;
- document.getElementById(str).style.width = "100%";
- document.getElementById(str).style.height = "750px";
- var str = "wrap" + id;
- document.getElementById(str).style.width = "100%";
- document.getElementById(str).style.height = "750px";
- for (var i = 0; i < 4; i++) {
- if (String(i) != id) {
+ _this.canvas.onmousedown = function (event) {
+ _this.clickDown(event);
+ };
+ _this.canvas.onmousemove = function (event) {
+ _this.mouseMove(event)
+ };
+ _this.canvas.onmouseup = function (event) {
+ _this.mouseUp(event);
+ };
+ _this.canvas.onmousewheel = function (event) {
+ _this.onmouseWheel(event);
+ };
+ _this.ttm = ttm;
+
+ //褰撳墠鍦板浘澶т簬1涓椂鎵嶅彲浠ヨ皟鐢╠bclick
+ if (_this.ttm > 1) {
+ _this.canvas.ondblclick = function (event) {
+ _this.doubleClick(event);
+ }
+ }
+
+ _this.onlineAnchorList = ail_on;
+ _this.offlineAnchorList = ail_off;
+
+ var t = 300;//300ms
+
+ // function fn(){
+ // //褰撳墠闇�瑕佺敾鐨勫潗鏍�
+ // var realposition_list = getRealPosition_all()
+ // _this.playMark = realposition_list[current_floor];
+ // _this.drawImg(current_floor);
+ // }
+ function fn() {
+ if (tuodong == true) {
+ return false;
+ }
+ if (shipinka == false) {
+ return false;
+ }
+ //褰撳墠瀹炴椂鍧愭爣
+ _this.playMark = getRealPosition(current_floor);
+ // var tagid_str = "";
+ // for (var i=0;i<_this.playMark.length;i++){
+ // tagid_str += _this.playMark[i][0]
+ // if (i!= _this.playMark.length-1){
+ // tagid_str += ","
+ // }
+ // }
+
+ if (_this.real_trak_time != 0) {
+ //灏嗗綋鍓嶅疄鏃跺潗鏍囨坊鍔犺繘track涓�
+ var track_now = Date.parse(new Date()); //timestamp涓烘绉掑崟浣�
+ track_now = track_now / 1000;
+ var track_now_head = track_now - _this.real_trak_time;
+ //褰撳墠track鏈�寮�濮嬬殑鏃堕棿
+ var track_head_date = new Date();
+ track_head_date.setTime(track_now_head * 1000 + 8 * 3600 * 1000);
+ var track_head_date_str = track_head_date.toJSON().substr(0, 19).replace('T', ' ');
+
+ for (var i = 0; i < _this.playMark.length; i++) {
+ if (_this.trackNow[_this.playMark[i][0]] != null) {
+ if (_this.trackNow[_this.playMark[i][0]].length > 1500) {
+ _this.trackNow[_this.playMark[i][0]] = _this.trackNow[_this.playMark[i][0]].slice(-1200);
+ };
+ for (var j = 0; j < _this.trackNow[_this.playMark[i][0]].length; j++) {
+ if (_this.trackNow[_this.playMark[i][0]][0][2] < track_head_date_str) {
+ _this.trackNow[_this.playMark[i][0]].shift()
+ } else {
+ break
+ }
+ };
+ };
+ var now_time = new Date();
+ now_time.setTime(track_now * 1000 + 8 * 3600 * 1000);
+ var now_time_str = now_time.toJSON().substr(0, 19).replace('T', ' ');
+ var tmp = [_this.playMark[i][4], _this.playMark[i][5], now_time_str];
+ if (_this.trackNow[_this.playMark[i][0]] == null) {
+ _this.trackNow[_this.playMark[i][0]] = []
+ }
+ _this.trackNow[_this.playMark[i][0]].push(tmp)
+ }
+ }
+ _this.drawImg(current_floor);
+ }
+ // if (full_screen==true){
+ // clearInterval(timer);
+ // timer_screen= setInterval(fn, t);
+ // } else {
+ // clearInterval(timer_screen);
+ // timer = setInterval(fn, t);
+ // }
+ // var mapa0 = document.getElementById("wrap0")
+ // mapa0.value = "姝e湪鍔犺浇鍦板浘......"
+ // var mapa0 = document.getElementById("wrap0")
+ // var tt = document.createElement("p");
+ // tt.value="姝e湪鍔犺浇鍦板浘......"
+ // tt.style=""
+ // mapa0.appendChild(tt)
+ setTimeout(fnnn, 3000)
+ function fnnn() {
+ _this.timer = setInterval(fn, t);
+ timer_list.push(_this.timer);
+
+ }
+
+ // _this.timer = setInterval(fn, t);
+ },
+ /*璁$畻褰撳墠榧犳爣浣嶇疆璺濈canvas鐨勫亸绉婚噺*/
+ xyToCanvas: function (ele, x, y) {
+ var _this = this;
+ var obj = _this.canvas.getBoundingClientRect();
+ return {
+ x: x - obj.left,
+ y: y - obj.top
+ };
+ },
+ /*榧犳爣鍙屽嚮浜嬩欢*/
+ doubleClick: function (event) {
+ var _this = this;
+
+ if ((event.type == "dblclick") && (full_screen == false)) {
+ _this.expand = true;
+ full_screen = true;
+
+ var targ = event.target;
+ var tid = targ.id;
+ var id = tid.substr(tid.length - 1, 1)
+ var str = "map" + id;
+ document.getElementById(str).style.width = "100%";
+ document.getElementById(str).style.height = "800px";
+ var str = "draw" + id;
+ document.getElementById(str).style.width = "100%";
+ document.getElementById(str).style.height = "750px";
+ var str = "wrap" + id;
+ document.getElementById(str).style.width = "100%";
+ document.getElementById(str).style.height = "750px";
+ for (var i = 0; i < 4; i++) {
+ if (String(i) != id) {
+ var str = "map" + i;
+ // document.getElementById(str).style.position = "fixed";
+ // document.getElementById(str).style.left = "100%";
+ document.getElementById(str).style.display = "none";
+ }
+ };
+ //_this.drawImg(current_floor);
+ clearInterval(_this.timer);
+ var can = _this.context;
+ can.clearRect(0, 0, _this.canvas.width, _this.canvas.height);
+ for (var i = 0; i < timer_list.length; i++) {
+ clearInterval(timer_list[i]);
+ }
+ timer_list = [];
+ console.log(result)
+ diaoyonghuatu(result);
+ } else if ((event.type == "dblclick") && (full_screen == true)) {
+ _this.expand = false;
+ full_screen = false;
+
+ var targ = event.target;
+ var tid = targ.id;
+ var id = tid.substr(tid.length - 1, 1)
+ var str = "map" + id;
+ document.getElementById(str).style.width = "49.5%";
+ document.getElementById(str).style.height = null;
+ var str = "draw" + id;
+ document.getElementById(str).style.width = null;
+ document.getElementById(str).style.height = null;
+ var str = "wrap" + id;
+ document.getElementById(str).style.width = "100%";
+ document.getElementById(str).style.height = "400px";
+
+ for (var i = 0; i < _this.ttm; i++) {
var str = "map" + i;
- // document.getElementById(str).style.position = "fixed";
- // document.getElementById(str).style.left = "100%";
- document.getElementById(str).style.display = "none";
+ document.getElementById(str).style.display = "";
+ };
+ //_this.drawImg(current_floor);
+ clearInterval(_this.timer);
+ var can = _this.context;
+ can.clearRect(0, 0, _this.canvas.width, _this.canvas.height);
+ for (var i = 0; i < timer_list.length; i++) {
+ clearInterval(timer_list[i]);
}
- };
- //_this.drawImg(current_floor);
- clearInterval(_this.timer);
- var can = _this.context;
- can.clearRect(0, 0, _this.canvas.width, _this.canvas.height);
- for (var i = 0; i < timer_list.length; i++) {
- clearInterval(timer_list[i]);
- }
- timer_list = [];
- console.log(result)
- diaoyonghuatu(result);
- } else if ((event.type == "dblclick") && (full_screen == true)) {
- _this.expand = false;
- full_screen = false;
-
- var targ = event.target;
- var tid = targ.id;
- var id = tid.substr(tid.length - 1, 1)
- var str = "map" + id;
- document.getElementById(str).style.width = "49.5%";
- document.getElementById(str).style.height = null;
- var str = "draw" + id;
- document.getElementById(str).style.width = null;
- document.getElementById(str).style.height = null;
- var str = "wrap" + id;
- document.getElementById(str).style.width = "100%";
- document.getElementById(str).style.height = "400px";
-
- for (var i = 0; i < _this.ttm; i++) {
- var str = "map" + i;
- document.getElementById(str).style.display = "";
- };
- //_this.drawImg(current_floor);
- clearInterval(_this.timer);
- var can = _this.context;
- can.clearRect(0, 0, _this.canvas.width, _this.canvas.height);
- for (var i = 0; i < timer_list.length; i++) {
- clearInterval(timer_list[i]);
- }
- timer_list = [];
- diaoyonghuatu(result);
- }
- },
- /*榧犳爣鍗曞嚮浜嬩欢*/
- clickDown: function (event) {
- var _this = this;
- if ((event.button == 0)) {//鐐瑰嚮榧犳爣宸﹂敭
- _this.dragFlag = true;
- tuodong = true;
- //_this.canvas.style.cursor = "move";
- _this.pos = _this.xyToCanvas(_this.canvas, event.clientX, event.clientY);
-
- }
- },
- /*榧犳爣绉诲姩浜嬩欢*/
- mouseMove: function (event) {
- var _this = this;
- /*鎷栨嫿*/
- if (_this.dragFlag) {
- tuodong = true;
- _this.canvas.style.cursor = "move";
- var pos1 = _this.xyToCanvas(_this.canvas, event.clientX, event.clientY);
- var x = pos1.x - _this.pos.x;
- var y = pos1.y - _this.pos.y;
- _this.pos = pos1;
- for (var key in _this.imgXList) {
- _this.imgXList[key] += x;
- _this.imgYList[key] += y;
- }
- //clearInterval(_this.timer);
- _this.cacheCanvas = null;
- _this.drawImg();
- }
- //diaoyonghuatu(result);
- },
- /*榧犳爣鏀惧紑浜嬩欢*/
- mouseUp: function (event) {
- var _this = this;
- _this.dragFlag = false;
- tuodong = false;
- if (_this.markFlag) {
- _this.canvas.style.cursor = "none";
- return;
- }
- _this.canvas.style.cursor = 'default';
-
- },
- /*榧犳爣婊氳疆浜嬩欢*/
- onmouseWheel: function (event) {
- var _this = this;
- _this.cacheCanvas = null;
- var pos = _this.xyToCanvas(_this.canvas, event.clientX, event.clientY);
- event.wheelDelta = event.wheelDelta ? event.wheelDelta : (event.deltaY * (-40));
- //鍙栨秷娴忚鍣ㄩ粯璁よ涓�
- if (event.preventDefault) {
- event.preventDefault();
- } else {
- event.returnValue = false;
- }
- if (event.wheelDelta > 0 && _this.scaleFlag < 9) {
- for (var key in _this.imgScaleList) {
- _this.imgScaleList[key] *= 1.25;
- _this.imgXList[key] = _this.imgXList[key] * 1.25 - 0.25 * pos.x;
- _this.imgYList[key] = _this.imgYList[key] * 1.25 - 0.25 * pos.y;
- }
- _this.scaleFlag += 1;
- }
- if (event.wheelDelta < 0 && _this.scaleFlag > -9) {//缂╁皬
- for (var key in _this.imgScaleList) {
- _this.imgScaleList[key] *= 0.8;
- _this.imgXList[key] = _this.imgXList[key] * 0.8 + pos.x * 0.2;
- _this.imgYList[key] = _this.imgYList[key] * 0.8 + pos.y * 0.2;
- }
- _this.scaleFlag -= 1;
- }
- _this.imgScaleList['icon'] = 0.03;
- _this.drawImg();
- },
- };
-
- function getRealPosition_all() {
- var realposition = [];
- $.ajax({
- async: false,
- type: 'POST',
- url: "/hxzkoa/getRealPosition_all.do",
- dataType: 'json',
- success: function (data) {
- for (var i = 0; i < data.length; i++) {
- //playMark[id,name,power,life,x,y,time]
- realposition.push([data[i].tagid, data[i].name, data[i].power, data[i].life, data[i].posx, data[i].posy, data[i].time, data[i].fence == 1 || data[i].sos == 1, data[i].sos, data[i].fence])
+ timer_list = [];
+ diaoyonghuatu(result);
}
},
- });
- return realposition
- };
- var audio1 = new Audio("/hxzkoa/hxzk/image/voice/sos.wav");
- var audio2 = new Audio("/hxzkoa/hxzk/image/voice/warning.wav");
- // var zaipan = []
- // var sosgaojing1 = getRealPosition();
- // for (var i = 0; i < sosgaojing1.length; i++) {
- // zaipan.push(false)
- // }
- // setInterval(baojing, 1000)
- function baojing() {
- var sosgaojing = getRealPosition_all();
- for (var i = 0; i < sosgaojing.length; i++) {
- if (sosgaojing[i][7] == 1) {
- if (sosgaojing[i][8] == 1) {
- // if (zaipan[i] == false) {
- var str = '娉ㄦ剰,缂栧彿[' + sosgaojing[i][0] + ']SOS鍛婅'
- // Audio1.click()
- audio1.play()
- // swal(str)
- // $.ajax({
- // url: "/hxzkoa/sosgaojing.do",
- // type: "POST",
- // dataType: "JSON",
- // data: {
- // tagid: sosgaojing[i][0]
- // }
- // })
- // }
- } if (sosgaojing[i][9] == 1) {
- // if (zaipan[i] == false) {
- var str = '娉ㄦ剰,缂栧彿[' + sosgaojing[i][0] + ']杩涘叆鍗遍櫓鍖哄煙'
- // audio2.click()
- audio2.play()
- // swal(str)
- // $.ajax({
- // url: "/hxzkoa/fencegaojing.do",
- // type: "POST",
- // dataType: "JSON",
- // data: {
- // tagid: sosgaojing[i][0]
- // }
- // })
- // }
+ /*榧犳爣鍗曞嚮浜嬩欢*/
+ clickDown: function (event) {
+ var _this = this;
+ if ((event.button == 0)) {//鐐瑰嚮榧犳爣宸﹂敭
+ _this.dragFlag = true;
+ tuodong = true;
+ //_this.canvas.style.cursor = "move";
+ _this.pos = _this.xyToCanvas(_this.canvas, event.clientX, event.clientY);
+
}
- // zaipan[i] = true
- }
- // } else {
- // zaipan[i] = false
- // }
- }
- }
+ },
+ /*榧犳爣绉诲姩浜嬩欢*/
+ mouseMove: function (event) {
+ var _this = this;
+ /*鎷栨嫿*/
+ if (_this.dragFlag) {
+ tuodong = true;
+ _this.canvas.style.cursor = "move";
+ var pos1 = _this.xyToCanvas(_this.canvas, event.clientX, event.clientY);
+ var x = pos1.x - _this.pos.x;
+ var y = pos1.y - _this.pos.y;
+ _this.pos = pos1;
+ for (var key in _this.imgXList) {
+ _this.imgXList[key] += x;
+ _this.imgYList[key] += y;
+ }
+ //clearInterval(_this.timer);
+ _this.cacheCanvas = null;
+ _this.drawImg();
+ }
+ //diaoyonghuatu(result);
+ },
+ /*榧犳爣鏀惧紑浜嬩欢*/
+ mouseUp: function (event) {
+ var _this = this;
+ _this.dragFlag = false;
+ tuodong = false;
+ if (_this.markFlag) {
+ _this.canvas.style.cursor = "none";
+ return;
+ }
+ _this.canvas.style.cursor = 'default';
- document.getElementById("stop").style.display = 'none';
- $("#search").click(function () {
- var input = document.getElementById("tagidaaa").value;
- $.ajax({
- async: false,
- url: "/hxzkoa/sousuo.do",
- type: "POST",
- dataType: "JSON",
- data: {
- tagid: input
+ },
+ /*榧犳爣婊氳疆浜嬩欢*/
+ onmouseWheel: function (event) {
+ var _this = this;
+ _this.cacheCanvas = null;
+ var pos = _this.xyToCanvas(_this.canvas, event.clientX, event.clientY);
+ event.wheelDelta = event.wheelDelta ? event.wheelDelta : (event.deltaY * (-40));
+ //鍙栨秷娴忚鍣ㄩ粯璁よ涓�
+ if (event.preventDefault) {
+ event.preventDefault();
+ } else {
+ event.returnValue = false;
+ }
+ if (event.wheelDelta > 0 && _this.scaleFlag < 9) {
+ for (var key in _this.imgScaleList) {
+ _this.imgScaleList[key] *= 1.25;
+ _this.imgXList[key] = _this.imgXList[key] * 1.25 - 0.25 * pos.x;
+ _this.imgYList[key] = _this.imgYList[key] * 1.25 - 0.25 * pos.y;
+ }
+ _this.scaleFlag += 1;
+ }
+ if (event.wheelDelta < 0 && _this.scaleFlag > -9) {//缂╁皬
+ for (var key in _this.imgScaleList) {
+ _this.imgScaleList[key] *= 0.8;
+ _this.imgXList[key] = _this.imgXList[key] * 0.8 + pos.x * 0.2;
+ _this.imgYList[key] = _this.imgYList[key] * 0.8 + pos.y * 0.2;
+ }
+ _this.scaleFlag -= 1;
+ }
+ _this.imgScaleList['icon'] = 0.03;
+ _this.drawImg();
+ },
+ };
+
+ function getRealPosition_all() {
+ var realposition = [];
+ $.ajax({
+ async: false,
+ type: 'POST',
+ url: "/hxzkoa/getRealPosition_all.do",
+ dataType: 'json',
+ success: function (data) {
+ for (var i = 0; i < data.length; i++) {
+ //playMark[id,name,power,life,x,y,time]
+ realposition.push([data[i].tagid, data[i].name, data[i].power, data[i].life, data[i].posx, data[i].posy, data[i].time, data[i].fence == 1 || data[i].sos == 1, data[i].sos, data[i].fence])
+ }
+ },
+ });
+ return realposition
+ };
+ var audio1 = new Audio("/hxzkoa/hxzk/image/voice/sos.wav");
+ var audio2 = new Audio("/hxzkoa/hxzk/image/voice/warning.wav");
+ // var zaipan = []
+ // var sosgaojing1 = getRealPosition();
+ // for (var i = 0; i < sosgaojing1.length; i++) {
+ // zaipan.push(false)
+ // }
+ // setInterval(baojing, 1000)
+ function baojing() {
+ var sosgaojing = getRealPosition_all();
+ for (var i = 0; i < sosgaojing.length; i++) {
+ if (sosgaojing[i][7] == 1) {
+ if (sosgaojing[i][8] == 1) {
+ // if (zaipan[i] == false) {
+ var str = '娉ㄦ剰,缂栧彿[' + sosgaojing[i][0] + ']SOS鍛婅'
+ // Audio1.click()
+ audio1.play()
+ // swal(str)
+ // $.ajax({
+ // url: "/hxzkoa/sosgaojing.do",
+ // type: "POST",
+ // dataType: "JSON",
+ // data: {
+ // tagid: sosgaojing[i][0]
+ // }
+ // })
+ // }
+ } if (sosgaojing[i][9] == 1) {
+ // if (zaipan[i] == false) {
+ var str = '娉ㄦ剰,缂栧彿[' + sosgaojing[i][0] + ']杩涘叆鍗遍櫓鍖哄煙'
+ // audio2.click()
+ audio2.play()
+ // swal(str)
+ // $.ajax({
+ // url: "/hxzkoa/fencegaojing.do",
+ // type: "POST",
+ // dataType: "JSON",
+ // data: {
+ // tagid: sosgaojing[i][0]
+ // }
+ // })
+ // }
+ }
+ // zaipan[i] = true
+ }
+ // } else {
+ // zaipan[i] = false
+ // }
}
- })
- document.getElementById("search").style.display = 'none';
- document.getElementById("stop").style.display = '';
- document.getElementById("tagidaaa").value = "";
- });
- $("#stop").click(function () {
- $.ajax({
- async: false,
- url: "/hxzkoa/sousuoquxiao.do",
- type: "POST",
- dataType: "JSON"
- })
- document.getElementById("search").style.display = '';
+ }
+
document.getElementById("stop").style.display = 'none';
- });
- function hidePopup(x, e) {
- if (e != undefined) {
- e.cancelBubble = true;
+ $("#search").click(function () {
+ var input = document.getElementById("tagidaaa").value;
+ $.ajax({
+ async: false,
+ url: "/hxzkoa/sousuo.do",
+ type: "POST",
+ dataType: "JSON",
+ data: {
+ tagid: input
+ }
+ })
+ document.getElementById("search").style.display = 'none';
+ document.getElementById("stop").style.display = '';
+ document.getElementById("tagidaaa").value = "";
+ });
+ $("#stop").click(function () {
+ $.ajax({
+ async: false,
+ url: "/hxzkoa/sousuoquxiao.do",
+ type: "POST",
+ dataType: "JSON"
+ })
+ document.getElementById("search").style.display = '';
+ document.getElementById("stop").style.display = 'none';
+ });
+ function hidePopup(x, e) {
+ if (e != undefined) {
+ e.cancelBubble = true;
+ }
+ document.getElementById("popup").style.display = "none";
+ isDelete = x;
+ shipinka = true;
+ document.getElementById("tanchuang").innerHTML = "";
}
- document.getElementById("popup").style.display = "none";
- isDelete = x;
- shipinka = true;
- document.getElementById("tanchuang").innerHTML = "";
- }
- </script>
- <!-- 缁撴潫璋冪敤瀹ゅ唴瀹氫綅鍦板浘鍔熻兘 -->
- <!-- > END PAGE FUNCTION SCRIPTS -->
+ </script>
+ <!-- 缁撴潫璋冪敤瀹ゅ唴瀹氫綅鍦板浘鍔熻兘 -->
+ <!-- > END PAGE FUNCTION SCRIPTS -->
- <!-- BEGIN PAGE LEVEL PLUGINS/CUSTOM SCRIPTS -->
- <script src="/hxzkoa/hxzk/plugins/apex/apexcharts.min.js"></script>
- <script src="/hxzkoa/hxzk/assets/js/dashboard/dash_2.js"></script>
- <!-- BEGIN PAGE LEVEL PLUGINS/CUSTOM SCRIPTS -->
+ <!-- BEGIN PAGE LEVEL PLUGINS/CUSTOM SCRIPTS -->
+ <script src="/hxzkoa/hxzk/plugins/apex/apexcharts.min.js"></script>
+ <script src="/hxzkoa/hxzk/assets/js/dashboard/dash_2.js"></script>
+ <!-- BEGIN PAGE LEVEL PLUGINS/CUSTOM SCRIPTS -->
</body>
diff --git a/src/main/webapp/hxzk/mapshow/mapShow2.jsp b/src/main/webapp/hxzk/mapshow/mapShow2.jsp
new file mode 100644
index 0000000..8c0cd4c
--- /dev/null
+++ b/src/main/webapp/hxzk/mapshow/mapShow2.jsp
@@ -0,0 +1,1691 @@
+<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" %>
+ <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
+ <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
+ <html lang="en">
+
+ <head>
+ <meta charset="utf-8">
+ <meta http-equiv="X-UA-Compatible" content="IE=edge">
+ <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, shrink-to-fit=no">
+ <title>鍒囨崲鍦板浘</title>
+ <link rel="icon" type="image/x-icon" href="/hxzkoa/hxzk/assets/img/favicon.ico" />
+ <link href="/hxzkoa/hxzk/assets/css/loader.css" rel="stylesheet" type="text/css" />
+ <script src="/hxzkoa/hxzk/assets/js/loader.js"></script>
+
+ <!-- BEGIN GLOBAL MANDATORY STYLES -->
+ <link href="https://fonts.googleapis.com/css?family=Quicksand:400,500,600,700&display=swap"
+ rel="stylesheet">
+ <link href="/hxzkoa/hxzk/assets/css/components/custom-sweetalert.css" rel="stylesheet"
+ type="text/css" />
+ <link href="/hxzkoa/hxzk/plugins/sweetalerts/sweetalert2.min.css" rel="stylesheet" type="text/css" />
+ <link href="/hxzkoa/hxzk/plugins/sweetalerts/sweetalert.css" rel="stylesheet" type="text/css" />
+ <link href="/hxzkoa/hxzk/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
+ <link href="/hxzkoa/hxzk/assets/css/main.css" rel="stylesheet" type="text/css" />
+ <link href="/hxzkoa/hxzk/plugins/perfect-scrollbar/perfect-scrollbar.css" rel="stylesheet"
+ type="text/css" />
+ <link href="/hxzkoa/hxzk/assets/css/structure.css" rel="stylesheet" type="text/css" />
+ <link href="/hxzkoa/hxzk/plugins/highlight/styles/monokai-sublime.css" rel="stylesheet"
+ type="text/css" />
+ <!-- END GLOBAL MANDATORY STYLES -->
+
+ <!-- BEGIN PAGE LEVEL PLUGINS/CUSTOM STYLES -->
+ <link href="/hxzkoa/hxzk/assets/css/elements/search.css" rel="stylesheet" type="text/css" />
+ <link href="/hxzkoa/hxzk/plugins/apex/apexcharts.css" rel="stylesheet" type="text/css">
+ <link href="/hxzkoa/hxzk/assets/css/dashboard/dash_2.css" rel="stylesheet" type="text/css" />
+ <link href="/hxzkoa/hxzk/assets/css/elements/custom-pagination.css" rel="stylesheet" type="text/css" />
+ <link href="/hxzkoa/hxzk/assets/css/components/custom-modal.css" rel="stylesheet" type="text/css" />
+ <!-- END PAGE LEVEL PLUGINS/CUSTOM STYLES -->
+ <link rel="preconnect" href="https://fonts.gstatic.com">
+ <link href="https://fonts.googleapis.com/css2?family=Ma+Shan+Zheng&display=swap" rel="stylesheet">
+ <link rel="stylesheet" type="text/css" href="/hxzkoa/hxzk/plugins/table/datatable/datatables.css">
+ <link rel="stylesheet" type="text/css" href="/hxzkoa/hxzk/plugins/table/datatable/custom_dt_html5.css">
+ <link rel="stylesheet" type="text/css" href="/hxzkoa/hxzk/plugins/table/datatable/dt-global_style.css">
+ <style>
+ .panel-head {
+ font-size: 1rem;
+ color: rgba(255, 255, 255, .7);
+ line-height: 2rem;
+ text-align: center;
+ background: linear-gradient(rgb(0, 20, 30), rgb(0, 40, 70));
+ border: 2px solid rgba(0, 90, 120, .3);
+ }
+
+ .table-bordered td,
+ .table-bordered th {
+ border: 1px solid #ebedf2;
+ }
+
+
+ .canvasWrap {
+ width: 100%;
+ height: 100%
+ }
+
+ .mark_list {
+ position: absolute;
+ top: 20px;
+ right: 10px;
+ }
+
+ .mark_list li {
+ float: left;
+ width: 100px;
+ border-radius: 4px;
+ border: 1px solid #ccc;
+ list-style: none;
+ line-height: 30px;
+ text-align: center;
+ color: #333;
+ background: #fff;
+ cursor: pointer;
+ }
+
+ .mark_list li:hover {
+ background: #009a8f;
+ color: #fff;
+ }
+
+ .popup {
+ width: 100vw;
+ height: 100vh;
+ background-color: rgba(0, 0, 0, .5);
+ position: fixed;
+ left: 0;
+ top: 0;
+ bottom: 0;
+ right: 0;
+ display: none;
+ justify-content: center;
+ align-items: center;
+ z-index: 9999锛�
+ }
+
+ .popup-content {
+ width: 640px;
+ height: 360px;
+ background-color: #fff;
+ box-sizing: border-box;
+ /*padding: 10px 30px;*/
+ color: black;
+ }
+ </style>
+ </head>
+
+ <body class="alt-menu sidebar-noneoverflow" style="position: relative;">
+
+ <!-- BEGIN LOADER -->
+ <div id="load_screen">
+ <div class="loader">
+ <div class="loader-content">
+ <div class="spinner-grow align-self-center"></div>
+ </div>
+ </div>
+ </div>
+ <!-- END LOADER -->
+ <div class="border-left"
+ style="opacity:0.4;float:left;position:absolute;z-index:1;left:120px;height:20px;"><img alt=""
+ src="/hxzkoa/resources/images/border.png" class="img-left"></div>
+ <div class="border-right" style="opacity:0.4;float:right;position:absolute;z-index:2;right:120px;"><img
+ alt="" src="/hxzkoa/resources/images/border2.png" class="img-right"></div>
+ <!-- <div>
+ <input style="width: 200px;position: fixed;top: 50px;right: 230px;z-index: 9999;" type="text"
+ id="tagidaaa" class="form-control" placeholder="璇疯緭鍏ユ爣绛綢D">
+ <button style="width: 80px;position: fixed;top: 50px;right: 130px;z-index: 9999;" type="button"
+ class="btn btn-secondary" id="search">鎼滅储</button>
+ <button style="width: 80px;position: fixed;top: 50px;right: 130px;z-index: 9999;" type="button"
+ class="btn btn-secondary" id="stop">鍙栨秷</button>
+ </div> -->
+ <div
+ style="width: 300px;display:flex;justify-content: space-between; position: absolute;top: 50px;right: 28px;z-index: 9999;">
+ <input style="width: 200px;" type="text" id="tagidaaa" class="form-control" placeholder="璇疯緭鍏ユ爣绛綢D">
+ <button style="width: 80px;" type="button" class="btn btn-secondary" id="search">鎼滅储</button>
+ <button style="width: 80px;" type="button" class="btn btn-secondary" id="stop">鍙栨秷</button>
+ <!-- <button type="button" onclick="showPopup()">寮圭獥</button> -->
+ </div>
+ <!-- BEGIN NAVBAR -->
+ <div class="login-page"></div>
+ <!-- END NAVBAR -->
+
+ <!-- BEGIN TOPBAR -->
+ <div class="header-page"></div>
+ <!-- END TOPBAR -->
+
+ <!-- BEGIN CONTENT PART -->
+ <div id="content" class="main-content">
+ <div class="layout-px-spacing">
+ <div class="row layout-top-spacing" id="cancel-row">
+ <div class="col-xl-12 col-lg-12 col-sm-12 layout-spacing">
+ <div class="widget widget-one_hybrid widget-engagement" id="map0"
+ style="width:49.5%;float:left;" ondblclick="changemap0()">
+ <div class="widget-heading" style="height:450px;width:100%" id="maphead0">
+ <div class='panel-head' id="mapname0">鍦板浘0</div>
+ <div style="width:100%; height:400px; float:left" id="wrap0">
+ <canvas id="draw0"></canvas>
+ <p style="z-index: 9999;" id="jiazai0">姝e湪鍔犺浇鍦板浘......</p>
+ </div>
+ </div>
+ </div>
+ <div class="widget widget-one_hybrid widget-engagement"
+ style="margin-left:1%;width:49.5%;float:left;" id="map1" ondblclick="changemap1()">
+ <div class="widget-heading" style="height:450px;width:100%" id="maphead1">
+ <div class='panel-head' id="mapname1">鍦板浘1</div>
+ <div style="width:100%; height:400px;float:left" id="wrap1">
+ <canvas id="draw1"></canvas>
+ <p style="z-index: 9999;" id="jiazai1">姝e湪鍔犺浇鍦板浘......</p>
+ </div>
+ </div>
+ </div>
+ <div class="widget widget-one_hybrid widget-engagement"
+ style="width:49.5%;float:left;margin-top:1%" id="map2" ondblclick="changemap2()">
+ <div class="widget-heading" style="height:450px;width:100%" id="maphead2">
+ <div class='panel-head' id="mapname2">鍦板浘2</div>
+ <div style="width:100%; height:400px;float:left" id="wrap2">
+ <canvas id="draw2"></canvas>
+ <p style="z-index: 9999;" id="jiazai2">姝e湪鍔犺浇鍦板浘......</p>
+ </div>
+ </div>
+ </div>
+ <div class="widget widget-one_hybrid widget-engagement"
+ style="width:49.5%;margin-left:1%;float:left;margin-top:1%" id="map3"
+ ondblclick="changemap3()">
+ <div class="widget-heading" style="height:450px;width:100%" id="maphead3">
+ <div class='panel-head' id="mapname3">鍦板浘4</div>
+ <div style="width:100%; height:400px;float:left" id="wrap3">
+ <canvas id="draw3"></canvas>
+ <p style="z-index: 9999;" id="jiazai3">姝e湪鍔犺浇鍦板浘......</p>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="popup" id="popup" onclick="hidePopup(false)">
+ <div class="popup-content" id="tanchuang">
+ <!-- <iframe src="http://192.168.1.100:10000/play.html?serial=34020000001320000003&code=34020000001310000002&aspect=fullscreen" width="640" height="360" allowfullscreen allow="autoplay; fullscreen"></iframe> -->
+ </div>
+ </div>
+ <!-- END CONTENT PART -->
+
+ <!-- END MAIN CONTAINER -->
+ <%
+ String username=(String)session.getAttribute("username");
+ if(username==null || username.equals("")){
+ request.getRequestDispatcher("/hxzk/login.jsp").forward(request,response);
+ return;
+ }
+ %>
+ <!-- BEGIN GLOBAL MANDATORY SCRIPTS -->
+ <script src="/hxzkoa/hxzk/assets/js/libs/jquery-3.1.1.min.js"></script>
+ <script src="/hxzkoa/hxzk/bootstrap/js/popper.min.js"></script>
+ <script src="/hxzkoa/hxzk/bootstrap/js/bootstrap.min.js"></script>
+ <script src="/hxzkoa/hxzk/plugins/perfect-scrollbar/perfect-scrollbar.min.js"></script>
+ <script src="/hxzkoa/hxzk/assets/js/app.js"></script>
+ <script src="/hxzkoa/hxzk/plugins/sweetalerts/promise-polyfill.js"></script>
+ <script src="/hxzkoa/hxzk/plugins/sweetalerts/sweetalert2.min.js"></script>
+ <script src="/hxzkoa/hxzk/plugins/sweetalerts/custom-sweetalert.js"></script>
+ <script src="/hxzkoa/hxzk/plugins/table/datatable/button-ext/dataTables.buttons.min.js"></script>
+ <script src="/hxzkoa/hxzk/plugins/table/datatable/button-ext/jszip.min.js"></script>
+ <script src="/hxzkoa/hxzk/plugins/table/datatable/button-ext/buttons.html5.min.js"></script>
+ <script src="/hxzkoa/hxzk/plugins/table/datatable/button-ext/buttons.print.min.js"></script>
+ <script>
+ var result;
+ $(document).ready(function () {
+ App.init(); $.ajax({ async: false, type: "POST", url: "/hxzkoa/getSysSetting_list.do", data: {}, dataType: "json", success: function (data) { /* title = data[0].title; document.title = title; */ }, });
+ result = getAllMap(); //result["mapname"]=mapnamelist, ['floor']=floorlist
+ diaoyonghuatu(result);
+ });
+
+ $('.header-page').load('/hxzkoa/hxzk/top.html'); $('.login-page').load('/hxzkoa/hxzk/head.html');
+ </script>
+ <script src="/hxzkoa/hxzk/assets/js/custom.js"></script>
+ <!-- END GLOBAL MANDATORY SCRIPTS -->
+
+ <!-- > BEGIN PAGE FUNCTION SCRIPTS -->
+
+
+ <script>
+ //棣栭〉鍦板浘鎺у埗
+ var full_screen = false;
+ var timer_list = [];
+ function getAllMap() {
+ var map = [];
+ var floor = [];
+ $.ajax({
+ async: false,
+ type: "POST",
+ url: "/hxzkoa/qiehuanditu_option.do",
+ dataType: 'json',
+ data: {},
+ success: function (data) {
+ if (data.length == 0) {
+ document.getElementById("map0").style.display = "none";
+ document.getElementById("map1").style.display = "none";
+ document.getElementById("map2").style.display = "none";
+ document.getElementById("map3").style.display = "none";
+ } else if (data.length == 1) {
+ document.getElementById("map0").style.width = "100%";
+ document.getElementById("mapname0").innerHTML = data[0].mapname;
+ document.getElementById("maphead0").style.height = "800px";
+ document.getElementById("wrap0").style.height = "750px";
+ document.getElementById("map1").style.display = "none";
+ document.getElementById("map2").style.display = "none";
+ document.getElementById("map3").style.display = "none";
+ full_screen = true;
+ } else if (data.length == 2) {
+ document.getElementById("map2").style.display = "none";
+ document.getElementById("map3").style.display = "none";
+ };
+ for (var i = 0; i < data.length; i++) {
+ str = "mapname" + i;
+ document.getElementById(str).innerHTML = data[i].mapname;
+ map.push(data[i].mapname);
+ floor.push(data[i].floor);
+ if (i == 3) {
+ break;
+ }
+ };
+ },
+ });
+ var result = [];
+ result['map'] = map;
+ result['floor'] = floor;
+ return result
+ }
+
+ </script>
+
+ <!-- 甯哥敤鍑芥暟 -->
+ <script>
+ function getTruemap_all() {
+ var map_wl = {};
+ $.ajax({
+ async: false,
+ type: "POST",
+ url: "/hxzkoa/floornumTomap_all.do",
+ dataType: 'json',
+ data: {},
+ success: function (data) {
+ let tmp = new Set();
+ for (var i = 0; i < data.length; i++) {
+ tmp.add(data[i].floor);
+ };
+ let tmpl = Array.from(tmp);
+ for (i in tmpl) {
+ map_wl[tmpl[i]] = [];
+ }
+ for (var i = 0; i < data.length; i++) {
+ map_wl[data[i].floor].push([data[i].x_Truelength, data[i].y_Truewidth]);
+ }
+ },
+ });
+ return map_wl;
+ };
+
+ function getYuandian_all() {
+ var yuandian = {};
+ $.ajax({
+ async: false,
+ type: "POST",
+ url: "/hxzkoa/floornumTomap_all.do",
+ dataType: 'json',
+ data: {},
+ success: function (data) {
+ let tmp = new Set();
+ for (var i = 0; i < data.length; i++) {
+ tmp.add(data[i].floor);
+ };
+ let tmpl = Array.from(tmp);
+ for (i in tmpl) {
+ yuandian[tmpl[i]] = [];
+ }
+ for (var i = 0; i < data.length; i++) {
+ yuandian[data[i].floor].push([data[i].x0_length, data[i].y0_width]);
+ }
+ }
+ });
+ return yuandian;
+ };
+
+ function getSystemSetting() {
+ var sysset = [];
+ $.ajax({
+ async: false,
+ type: 'POST',
+ url: "/hxzkoa/getSysSetting_list.do",
+ dataType: 'json',
+ success: function (data) {
+ sysset = data;
+ },
+ });
+ return sysset;
+ };
+
+ function loadImages(sources, callback) {
+ var count = 0,
+ images = {},
+ imgNum = 0;
+ for (src in sources) {
+ imgNum++;
+ }
+ for (src in sources) {
+ images[src] = new Image();
+
+ images[src].onload = function () {
+ if (++count >= imgNum) {
+ callback(images);
+ }
+ }
+ images[src].src = sources[src];
+ }
+ };
+
+ function getTrackColor(yanse) {
+ var color;
+ if (yanse == "绾㈣壊") {
+ var color = "red";
+ } else if (yanse == "缁胯壊") {
+ var color = "green";
+ } else if (yanse == "钃濊壊") {
+ var color = "blue";
+ } else if (yanse == "鐧借壊") {
+ var color = "white";
+ } else if (yanse == "榛戣壊") {
+ var color = "black";
+ } else if (yanse == "榛勮壊") {
+ var color = "yellow";
+ }
+ return color
+ };
+
+ function getExistFence_all(leixing) {
+ var fencelist = {};
+ var fencecolor = {};
+ var fencename = {};
+ var fencetype = {};
+ $.ajax({
+ async: false,
+ type: 'POST',
+ url: "/hxzkoa/getFloorFence_all.do",
+ dataType: 'json',
+ data: {},
+ success: function (data) {
+ let tmp = new Set();
+ for (var i = 0; i < data.length; i++) {
+ tmp.add(data[i].floor);
+ };
+ let tmpl = Array.from(tmp);
+ for (i in tmpl) {
+ fencelist[tmpl[i]] = [];
+ fencecolor[tmpl[i]] = [];
+ fencename[tmpl[i]] = [];
+ fencetype[tmpl[i]] = [];
+ }
+ for (var i = 0; i < data.length; i++) {
+ fencelist[data[i].floor].push(data[i].zuobiao);
+ fencecolor[data[i].floor].push(data[i].color);
+ fencename[data[i].floor].push(data[i].name);
+ fencetype[data[i].floor].push(data[i].type);
+ }
+ }
+ });
+ if (leixing == "zuobiao") {
+ return fencelist
+ } else if (leixing == "color") {
+ return fencecolor
+ } else if (leixing == "name") {
+ return fencename
+ } else if (leixing == "type") {
+ return fencetype
+ };
+ };
+
+ function getDrawColor(yanse) {
+ var color;
+ if (yanse == "绾㈣壊") {
+ var color = "rgba(255,0,0,0.3)";
+ } else if (yanse == "缁胯壊") {
+ var color = "rgba(0,255,0,0.3)";
+ } else if (yanse == "钃濊壊") {
+ var color = "rgba(0,0,255,0.3)";
+ } else if (yanse == "鐧借壊") {
+ var color = "rgba(255,255,255,0.3)";
+ } else if (yanse == "榛戣壊") {
+ var color = "rgba(0,0,0,0.3)";
+ }
+ return color
+ };
+ function inFenceOrNot(fence_list, node_list) {
+ //fence_list[x,y]
+ //node_list[x,y]
+ if (fence_list.length == 2) { //鐭╁舰
+ if (node_list[0] >= Math.min(fence_list[0][0], fence_list[1][0]) && node_list[0] <= Math.max(fence_list[0][0], fence_list[1][0])) {
+ if (node_list[1] >= Math.min(fence_list[0][1], fence_list[1][1]) && node_list[1] <= Math.max(fence_list[0][1], fence_list[1][1])) {
+ return true //鍦ㄨ�冨嫟鍖哄煙
+ }
+ }
+ return false //涓嶅湪鑰冨嫟鍖哄煙
+ } else if (fence_list.length > 2) { //澶氳竟褰�
+ for (var c = false, i = -1, l = fence_list.length, j = l - 1; ++i < l; j = i)
+ ((fence_list[i][1] <= node_list[1] && node_list[1] < fence_list[j][1]) || (fence_list[j][1] <= node_list[1] && node_list[1] < fence_list[i][1]))
+ && (node_list[0] < (fence_list[j][0] - fence_list[i][0]) * (node_list[1] - fence_list[i][1]) / (fence_list[j][1] - fence_list[i][1]) + fence_list[i][0])
+ && (c = !c);
+ return c;
+ }
+ };
+
+ function getGas(leixing) {
+ var gaslist = [];
+ var gasnongdu = [];
+ var gastype = [];
+ $.ajax({
+ async: false,
+ type: 'POST',
+ url: "/hxzkoa/getGas_list.do",
+ dataType: 'json',
+ data: {},
+ success: function (data) {
+ for (var i = 0; i < data.length; i++) {
+ gaslist.push([data[i].x, data[i].y]);
+ gasnongdu.push(data[i].nong_du);
+ gastype.push(data[i].gas_type);
+ }
+ }
+ });
+ if (leixing == "zuobiao") {
+ return gaslist
+ } else if (leixing == "type") {
+ return gastype
+ } else if (leixing == "nongdu") {
+ return gasnongdu
+ };
+ };
+
+ function getRealPosition(current_floor) {
+ var realposition = [];
+ $.ajax({
+ async: false,
+ type: 'POST',
+ url: "/hxzkoa/getRealPosition.do",
+ dataType: 'json',
+ data: {
+ floor: current_floor,
+ },
+ success: function (data) {
+ for (var i = 0; i < data.length; i++) {
+ //playMark[id,name,power,life,x,y,time]
+ realposition.push([data[i].tagid, data[i].name, data[i].power, data[i].life, data[i].posx, data[i].posy, data[i].time, data[i].fence == 1 || data[i].sos == 1, data[i].sousuo, data[i].shipin])
+ }
+ },
+ });
+ return realposition
+ };
+
+ function str_to_time(str) {
+ //鏍规嵁瀛楃涓茶浆鎹㈡垚瀵瑰簲鐨勬椂闂达紙绉掞級
+ if (str == "涓嶆樉绀哄疄鏃惰建杩�") {
+ return 0;
+ } else if (str == "10绉掗挓") {
+ return 10;
+ } else if (str == "30绉掗挓") {
+ return 30;
+ } else if (str == "1鍒嗛挓") {
+ return 60;
+ } else if (str == "10鍒嗛挓") {
+ return 600;
+ } else if (str == "30鍒嗛挓") {
+ return 1800;
+ } else if (str == "1灏忔椂") {
+ return 3600;
+ };
+ };
+
+ function getTracknow(current_floor, tagid_str, time) {
+ var finalrealtrack = {};
+ $.ajax({
+ async: false,
+ type: 'POST',
+ url: "/hxzkoa/getRealTrack.do",
+ dataType: 'json',
+ data: {
+ time: time,
+ floor: current_floor,
+ tagid: tagid_str,
+ },
+ success: function (data) {
+ for (var i = 0; i < data.length; i++) {
+ finalrealtrack[data[i][0].tagid] = [];
+ for (var j = 0; j < data[i].length; j++) {
+ finalrealtrack[data[i][0].tagid].push([data[i][j].x, data[i][j].y, data[i][j].time])
+ }
+ }
+ },
+ });
+ return finalrealtrack;
+ };
+
+ function getAnchorInfo_all() {
+ var anchorList_on = {};
+ var anchorList_off = {};
+ $.ajax({
+ async: false,
+ type: 'POST',
+ url: "/hxzkoa/getAnchorInfo_all.do",
+ dataType: 'json',
+ data: {},
+ success: function (data) {
+ let tmp = new Set();
+ for (var i = 0; i < data.length; i++) {
+ tmp.add(data[i].layer);
+ };
+ let tmpl = Array.from(tmp);
+ for (i in tmpl) {
+ anchorList_on[tmpl[i]] = [];
+ anchorList_off[tmpl[i]] = [];
+ }
+ for (var i = 0; i < data.length; i++) {
+ if (data[i].anchormode == "1") {
+ anchorList_on[data[i].layer].push([data[i].anchorid, data[i].posx, data[i].posy, data[i].posz, data[i].GreateTime]);
+ } else if (data[i].anchormode == "0") {
+ anchorList_off[data[i].layer].push([data[i].anchorid, data[i].posx, data[i].posy, data[i].posz, data[i].GreateTime]);
+
+ }
+ }
+ }
+ });
+ return [anchorList_on, anchorList_off]
+ };
+
+ /**璇ユ柟娉曠敤鏉ョ粯鍒朵竴涓湁濉厖鑹茬殑鍦嗚鐭╁舰
+ *@param cxt:canvas鐨勪笂涓嬫枃鐜
+ *@param x:宸︿笂瑙抶杞村潗鏍�
+ *@param y:宸︿笂瑙抷杞村潗鏍�
+ *@param width:鐭╁舰鐨勫搴�
+ *@param height:鐭╁舰鐨勯珮搴�
+ *@param radius:鍦嗙殑鍗婂緞
+ *@param fillColor:濉厖棰滆壊
+ **/
+ function fillRoundRect(cxt, x, y, width, height, radius, /*optional*/ fillColor) {
+ //鍦嗙殑鐩村緞蹇呯劧瑕佸皬浜庣煩褰㈢殑瀹介珮
+ if (2 * radius > width || 2 * radius > height) { return false; }
+
+ cxt.save();
+ cxt.translate(x, y);
+ //缁樺埗鍦嗚鐭╁舰鐨勫悇涓竟
+ drawRoundRectPath(cxt, width, height, radius);
+ cxt.fillStyle = fillColor || "#000"; //鑻ユ槸缁欏畾浜嗗�煎氨鐢ㄧ粰瀹氱殑鍊煎惁鍒欑粰浜堥粯璁ゅ��
+ cxt.fill();
+ cxt.restore();
+ }
+
+ function drawRoundRectPath(cxt, width, height, radius) {
+ cxt.beginPath(0);
+ //浠庡彸涓嬭椤烘椂閽堢粯鍒讹紝寮у害浠�0鍒�1/2PI
+ cxt.arc(width - radius, height - radius, radius, 0, Math.PI / 2);
+
+ //鐭╁舰涓嬭竟绾�
+ cxt.lineTo(radius, height);
+
+ //宸︿笅瑙掑渾寮э紝寮у害浠�1/2PI鍒癙I
+ cxt.arc(radius, height - radius, radius, Math.PI / 2, Math.PI);
+
+ //鐭╁舰宸﹁竟绾�
+ cxt.lineTo(0, radius);
+
+ //宸︿笂瑙掑渾寮э紝寮у害浠嶱I鍒�3/2PI
+ cxt.arc(radius, radius, radius, Math.PI, Math.PI * 3 / 2);
+
+ //涓婅竟绾�
+ cxt.lineTo(width - radius, 0);
+
+ //鍙充笂瑙掑渾寮�
+ cxt.arc(width - radius, radius, radius, Math.PI * 3 / 2, Math.PI * 2);
+
+ //鍙宠竟绾�
+ cxt.lineTo(width, height - radius);
+ cxt.closePath();
+ }
+ </script>
+ <!-- 甯哥敤鍑芥暟缁撴潫 -->
+
+ <!-- 璋冪敤瀹ゅ唴瀹氫綅鍦板浘鍔熻兘 -->
+ <script>
+ function diaoyonghuatu(result) {
+
+ var truemap_list = getTruemap_all();
+ var yuandian_list = getYuandian_all();
+ var fencezuobiao_list = getExistFence_all("zuobiao");
+ var fencecolor_list = getExistFence_all("color");
+ var fencename_list = getExistFence_all("name");
+ var fencetype_list = getExistFence_all("type");
+ var onlineAnchorinfo_list = getAnchorInfo_all()[0];
+ var offlineAnchorinfo_list = getAnchorInfo_all()[1];
+
+ //璇诲彇绯荤粺璁剧疆
+ var sysSetting = getSystemSetting();
+
+ for (var i = 0; i < result['map'].length; i++) {
+ var cf = result['floor'][i];//褰撳墠floor
+ var tml = [];
+ if (truemap_list[cf]) {
+ tml = truemap_list[cf];
+ };
+ var ydl = [];
+ if (yuandian_list[cf]) {
+ ydl = yuandian_list[cf];
+ };
+ var fzbl = [];
+ if (fencezuobiao_list[cf]) {
+ fzbl = fencezuobiao_list[cf];
+ };
+ var fcl = [];
+ if (fencecolor_list[cf]) {
+ fcl = fencecolor_list[cf];
+ };
+ var fnl = [];
+ if (fencename_list[cf]) {
+ fnl = fencename_list[cf];
+ };
+ var ftl = []
+ if (fencetype_list[cf]) {
+ ftl = fencetype_list[cf];
+ };
+ var ail_on = [];
+ if (onlineAnchorinfo_list[cf]) {
+ ail_on = onlineAnchorinfo_list[cf];
+ };
+ var ail_off = [];
+ if (offlineAnchorinfo_list[cf]) {
+ ail_off = offlineAnchorinfo_list[cf];
+ };
+ subgraph(i, result['map'][i], result['floor'][i], tml, ydl, fzbl, fcl, fnl, ftl, ail_on, ail_off, sysSetting, result['map'].length)
+ }
+
+ };
+ //subgraph(i,result['map'][i],result['floor'][i],tml,ydl,fzbl,fcl,fnl,ftl,ail,sysSetting)
+ function subgraph(index, mp, fr, tml, ydl, fzbl, fcl, fnl, ftl, ail_on, ail_off, sysSetting, ttm) {
+ var imgUrl = '/hxzkoa/hxzk/image/mapfile/' + mp;//鍥剧墖璺緞
+ //var imgUrl = '/hxzkoa/hxzk/image/mapfile/office.jpg';//鍥剧墖璺緞
+ var imgList = new Array();
+ imgList['map'] = imgUrl;
+ var iconUrl = '/hxzkoa/hxzk/image/targeticon/default.png';
+ imgList['icon'] = iconUrl;
+
+ // var anckicon = '/hxzkoa/hxzk/image/anchor/lingjin.png';
+ // imgList['anchor']=anckicon;
+ var anckicon_on = '/hxzkoa/hxzk/image/anchor/鍩虹珯鍦ㄧ嚎.png';
+ //var anckicon_on = '/hxzkoa/hxzk/image/anchor/lingjin.png';
+ imgList['anchor_online'] = anckicon_on;
+
+ var anckicon_off = '/hxzkoa/hxzk/image/anchor/鍩虹珯绂荤嚎.png'
+ //var anckicon_off = '/hxzkoa/hxzk/image/anchor/ceju.png';
+ imgList['anchor_offline'] = anckicon_off;
+
+ new MarkPoints(index, fr, imgList, tml, ydl, fzbl, fcl, fnl, ftl, ail_on, ail_off, sysSetting, ttm);
+ };
+ var serial;
+ var code;
+ var isDelete = false;
+ var shipinka = true;
+ var tuodong = false;
+ var colorbbb = "rgba(255,0,0,0.3)";
+ var sosType = [];
+ var sousuoType = true;
+ for (var i = 0; i < 500; i++) {
+ sosType[i] = true;
+ }
+ var sos = document.createElement('img');
+ sos.src = '/hxzkoa/hxzk/image/icon/SOS.png';
+ var sos1 = document.createElement('img');
+ sos1.src = '/hxzkoa/hxzk/image/icon/SOS1.png';
+ var sousuo0 = document.createElement('img');
+ sousuo0.src = '/hxzkoa/hxzk/image/icon/sousuo0.png';
+ function MarkPoints(index, current_floor, imgList, tml, ydl, fzbl, fcl, fnl, ftl, ail_on, ail_off, sysSetting, ttm) {
+ this.imgX = 0;//鍦ㄧ敾甯冧笂鍥剧墖鐨刋鍋忕Щ閲�
+ this.imgY = 0;//鍦ㄧ敾甯冧笂鍥剧墖鐨刌鍋忕Щ閲�
+ this.imgScale = 1;//鍥剧墖鐨勭缉鏀炬瘮渚�
+ this.rateNum;//鍥剧墖楂樺害鑷�傚簲姣斾緥,鍥剧墖绛夋瘮灞呬腑灞曠ず鍦╟anvas
+ this.scaleFlag = 0;//缂╂斁鍥犲瓙锛屾渶澶х缉鏀�9,鏈�灏忕缉鏀�-9
+ this.context;
+ this.img; //鍦板浘
+ this.playIndex = 0;
+ this.pos = {};//姣忔鎷栨嫿鍓嶅潗鏍囦繚瀛�
+
+ this.imgLoadList = new Array();
+ this.rateNumList = new Array();
+ this.imgXList = new Array();
+ this.imgYList = new Array();
+ this.imgScaleList = new Array();
+
+ //鑾峰彇鐪熷疄鍦板浘
+ this.trueMeasure;
+ this.trueLength;
+ this.trueWidth;
+ this.x_ratio;
+ this.y_ratio;
+ this.x_x0;
+ this.y_y0;
+ this.expand = false;
+
+ //system setting
+ this.sysSetting;
+ this.tagZb = '0';//鏄惁鏄剧ず鏍囩鍧愭爣
+ this.diskaoqin = '0'; //鍑鸿�冨嫟鍖哄煙鏄惁娑堝け
+ this.viewAnckid = '0';//鏄惁鏄剧ず鍩虹珯ID
+ this.viewName = '0';//鏄惁鏄剧ず浜哄憳鍚嶇О
+ this.tunlDw = '0'//闅ч亾瀹氫綅妯″紡
+ this.guiji_sava = '0'//鏄惁寮�鍚建杩逛繚瀛�
+ this.viewPower = '0';//鏄惁鏄剧ず鐢甸噺
+ this.viewTagid = '0';//鏄惁鏄剧ず鏍囩ID
+ this.viewAnckzb = '0';//鏄惁鏄剧ず鍩虹珯鍧愭爣
+ this.offView = '0'//鏄惁绂荤嚎涓嶆樉绀哄浘鏍�
+ this.anckicon = '0'//鏄惁鏄剧ず鍩虹珯鍥炬爣
+ this.gas_show = '0'//鏄剧ず鍏朵粬妫�娴�(姘斾綋鏄剧ず)
+ this.quiet = '0'//闈欐杈撳嚭鍥哄畾鍧愭爣
+ this.real_trak_time = 0//瀹炴椂杞ㄨ抗鏄剧ず鏃堕暱
+ this.real_trak_color = '绾㈣壊'//瀹炴椂杞ㄨ抗鏄剧ず鐨勯鑹�
+ this.fence_show = '0'//鏄惁鏄剧ず鍥存爮
+
+ this.playFlag = false;//鏄惁鎾斁
+ this.dragFlag = false;//鏄惁鍙嫋鎷藉綋鍓峣mg锛岄粯璁や笉鑳�
+ this.markFlag = false;//鏍囪鍖哄煙寮�鍚叧闂璮lag
+ this.CreatLinepoints = [];//姣忔鍒涘缓鏂板尯鍩熺殑鍧愭爣闆嗗悎
+ this.playMark; //姝e湪灞曠ず鐨勬爣璁�
+ this.playMarkInKaoQin;//褰撳墠鏍囪鏄惁鍦ㄨ�冨嫟鍖哄煙鍐�
+ this.trackNow; //褰撳墠杞ㄨ抗
+
+ this.onlineAnchorList;//褰撳墠鍩虹珯鍒楄〃
+ this.offlineAnchorList;
+
+ this.allMarkLins = [];//宸插垱寤虹殑鍖哄煙闆嗗悎锛屼緥濡俒[{x,y},{x,y},{x,y}],[{n,m},{n,m},{n,m}]]鐩墠鍙渶瑕佷竴涓尯鍩燂紝鎵�浠ユ暟缁勫唴閮ㄥ彧鏈変竴椤�
+ this.allFenceColor = [];//宸插垱寤虹殑鍖哄煙棰滆壊
+
+ this.FenceList; //鍥存爮鍧愭爣
+ this.FenceColor; //鍥存爮棰滆壊
+ this.FenceName; //鍥存爮鍚嶇О
+ this.realFenceList = []; // [鍚嶇О锛岀被鍨嬶紝瀹為檯鍧愭爣]
+ this.fenceMarkCount; //鍖哄煙鍐呯殑鍧愭爣鏁伴噺
+ this.cacheCanvas = null; //缂撳瓨鍥存爮缁樺浘
+
+ this.GasList; //姘斾綋鍧愭爣
+ this.GasType; //姘斾綋绫诲瀷
+ this.GasNongdu; //姘斾綋娴撳害
+
+ this.ttm;
+ this.timer;
+
+ this.getImgLoad(index, imgList, current_floor);
+ this.init(current_floor, tml, ydl, fzbl, fcl, fnl, ftl, ail_on, ail_off, sysSetting, ttm);
+
+ document.oncontextmenu = new Function("event.returnValue=false;");
+ document.onselectstart = new Function("event.returnValue=false;");
+ };
+
+ MarkPoints.prototype = {
+ getImgLoad: function (index, imgList, current_floor) {
+ var _this = this;
+ var str = "wrap" + index;
+ var wrap = document.getElementById(str);
+ var str2 = "draw" + index;
+ _this.canvas = document.getElementById(str2);
+ _this.context = _this.canvas.getContext('2d');
+ _this.canvas.height = wrap.offsetHeight;
+ _this.canvas.width = wrap.offsetWidth;
+
+ loadImages(imgList, function (images) {
+ for (var key in images) {
+ if (key == 'map') {
+ _this.imgScaleList[key] = 1;
+ _this.img = images[key];
+ } else if (key == 'icon') {
+ _this.imgScaleList[key] = 0.03;
+ } else {
+ _this.imgScaleList[key] = images[key].naturalWidth / images['map'].naturalWidth;
+ };
+ _this.rateNumList[key] = _this.canvas.width / images[key].naturalWidth;
+ _this.imgXList[key] = (_this.canvas.width - images[key].naturalWidth * _this.imgScaleList[key] * _this.rateNumList[key]) / 2;
+ _this.imgYList[key] = (_this.canvas.height - images[key].naturalHeight * _this.imgScaleList[key] * _this.rateNumList[key]) / 2;//榛樿杩涙潵褰撳墠鍥惧儚灞呬腑鏄剧ず
+ _this.imgLoadList[key] = images[key];
+ }
+ /*鐢诲嚭褰撳墠鍥剧墖*/
+ //_this.drawImg(current_floor);
+ });
+ },
+
+ drawImg: function (current_floor) {
+ var _this = this;
+ var can = _this.context;
+ can.clearRect(0, 0, _this.canvas.width, _this.canvas.height);
+
+ can.globalCompositeOperation = "source-over";
+ var images = _this.imgLoadList;
+
+ //鐢诲湴鍥�
+ can.drawImage(_this.img, 0, 0, _this.img.naturalWidth, _this.img.naturalHeight, _this.imgXList['map'], _this.imgYList['map'], _this.img.naturalWidth * _this.imgScaleList['map'] * _this.rateNumList['map'], _this.img.naturalHeight * _this.imgScaleList['map'] * _this.rateNumList['map']);
+
+ $("#jiazai0").remove()
+ $("#jiazai1").remove()
+ $("#jiazai2").remove()
+ $("#jiazai3").remove()
+
+ //瀹為檯涓庡浘鐗囩殑姣斾緥灏�
+ _this.x_ratio = new Number(_this.imgLoadList['map'].naturalWidth / _this.trueLength);
+ _this.y_ratio = new Number(_this.imgLoadList['map'].naturalHeight / _this.trueWidth);
+
+ if (tuodong == true) {
+ return false;
+ }
+
+ if (_this.cacheCanvas == null) {
+ _this.cacheCanvas = document.createElement("canvas");
+ _this.cacheCanvas.width = _this.canvas.width;
+ _this.cacheCanvas.height = _this.canvas.height;
+ var cacheCtx = _this.cacheCanvas.getContext("2d");
+ //鐢诲嚭褰撳墠宸叉湁鐨勫洿鏍忓尯鍩�
+ if (_this.fence_show == "1") {
+ if (_this.FenceList.length) {
+ //閬嶅巻姣忎釜fence锛屽苟鐢诲嚭
+ for (var m = 0; m < _this.FenceList.length; m++) {
+ var draw_points_list = [];
+ var points_list = _this.FenceList[m].split(",");
+ //瀹為檯鍧愭爣杞垚鍥句笂鍧愭爣
+ for (var i = 0; i < points_list.length; i++) {
+ if (i % 2 == 0) {
+ //鍋舵暟鍧愭爣锛屽嵆x鍧愭爣
+ tmp_list = [];
+ var tmp_point = new Number(_this.imgXList['map'] + _this.imgScaleList['map'] * _this.rateNumList['map'] * _this.x_ratio * (points_list[i] - _this.x_x0));
+ tmp_list.push(tmp_point);
+ } else {
+ var tmp_point = new Number(_this.imgYList['map'] + _this.imgScaleList['map'] * _this.rateNumList['map'] * _this.y_ratio * (points_list[i] - _this.y_y0));
+ tmp_list.push(tmp_point);
+ draw_points_list.push(tmp_list);
+ };
+ };
+
+ var color = getDrawColor(_this.FenceColor[m]);
+ var name = _this.FenceName[m];
+
+ if (draw_points_list.length == 2) {
+ cacheCtx.beginPath();
+ cacheCtx.fillStyle = color;
+ cacheCtx.fillRect(draw_points_list[0][0], draw_points_list[0][1], draw_points_list[1][0] - draw_points_list[0][0], draw_points_list[1][1] - draw_points_list[0][1]);
+ cacheCtx.stroke();
+ cacheCtx.fillStyle = "red";
+ cacheCtx.fillText(name, (draw_points_list[0][0] + draw_points_list[1][0]) / 2, (draw_points_list[0][1] + draw_points_list[1][1]) / 2);
+ cacheCtx.closePath();
+ } else {
+ cacheCtx.beginPath();
+ cacheCtx.fillStyle = color;
+ cacheCtx.lineWidth = 1;
+ var text_x = new Number(0);
+ var text_y = new Number(0);
+ for (var j = 0; j < draw_points_list.length; j++) {
+ if (j == 0) {
+ cacheCtx.moveTo(draw_points_list[j][0], draw_points_list[j][1]);
+ } else {
+ cacheCtx.lineTo(draw_points_list[j][0], draw_points_list[j][1]);
+ }
+ if (j == draw_points_list.length - 1) {
+ cacheCtx.lineTo(draw_points_list[0][0], draw_points_list[0][1]);
+ cacheCtx.fill();
+ }
+ text_x = text_x + draw_points_list[j][0];
+ text_y = text_y + draw_points_list[j][1];
+
+ }
+ text_x = text_x / draw_points_list.length;
+ text_y = text_y / draw_points_list.length;
+
+ cacheCtx.fillStyle = color;
+ cacheCtx.fill();
+ cacheCtx.strokeStyle = color;
+ cacheCtx.stroke();
+ cacheCtx.fillStyle = "red";
+ cacheCtx.fillText(name, text_x, text_y);
+ cacheCtx.closePath();
+ };
+ };
+ };
+ };
+ can.drawImage(_this.cacheCanvas, 0, 0);
+ } else {
+ can.drawImage(_this.cacheCanvas, 0, 0);
+ };
+
+
+ //鍒ゆ柇褰撳墠鍧愭爣鏄惁鍦ㄨ�冨嫟鍖哄煙鍐�
+ _this.playMarkInKaoQin = [];
+ for (var n in _this.playMark) { //_this.playMark涓哄綋鍓嶅疄鏃跺湪绾跨偣浣嶇疆锛屼负[array[id,name,power,life,x,y,time]]
+ node_list = [Number(_this.playMark[n][4]), Number(_this.playMark[n][5])];
+ for (var f in _this.realFenceList) {
+ if (_this.realFenceList[f][1] == "鑰冨嫟鍖哄煙") {
+ if (inFenceOrNot(_this.realFenceList[f][2], node_list)) {
+ //inFenceOrNot(fence_list, node_list) return true/false
+ _this.playMarkInKaoQin.push(true);
+ break;
+ }
+ }
+ };
+ if (_this.playMarkInKaoQin.length == n) {
+ _this.playMarkInKaoQin.push(false);
+ }
+ };
+
+
+ //璁$畻鍖哄煙鍐呯殑鍧愭爣鏁伴噺锛堥毀閬撳畾浣嶏級
+ _this.fenceMarkCount = [];
+ for (var f in _this.realFenceList) {
+ //f[name, type, zuobiao_array]
+ var tmp_count = new Number(0);
+ for (var n in _this.playMark) {//_this.playMark涓哄綋鍓嶅疄鏃跺湪绾跨偣浣嶇疆锛屼负[array[.x, .y]]
+ node_list = [Number(_this.playMark[n][4]), Number(_this.playMark[n][5])];
+ if (inFenceOrNot(_this.realFenceList[f][2], node_list)) {//inFenceOrNot(fence_list, node_list) return true/false
+ tmp_count += 1;
+ //break;
+ }
+ };
+ _this.fenceMarkCount.push(tmp_count);
+ };
+
+ // if (shipinka) {
+ //鐢绘爣绛惧強鍩虹珯
+ for (var key in images) {
+ if (key == "icon" && _this.playMark) {
+ for (var i = 0; i < _this.playMark.length; i++) {
+ var tagzhuangtai = _this.playMark[i][3]; //鍦ㄧ嚎鐘舵��
+ var shipinzhuangtai = _this.playMark[i][9];
+ if (shipinka) {
+ if (shipinzhuangtai == "1") {
+ $.ajax({
+ async: false,
+ url: "/hxzkoa/shipinzhuangtai.do",
+ type: 'POST',
+ dataType: 'JSON',
+ data: {
+ tagid: _this.playMark[i][0],
+ },
+ success: function (data) {
+ serial = data[0].shebeiid;
+ code = data[0].tongdaoid;
+ }
+ });
+ document.getElementById("popup").style.display = "flex";
+ var tanchuang = document.getElementById("tanchuang")
+ var rr = document.createElement("iframe")
+ rr.src = "http://39.106.210.13:10000/play.html?serial=" + serial + "&code=" + code + "&aspect=fullscreen";
+ rr.width = "640";
+ rr.height = "360";
+ rr.allowFullscreen = "true";
+ var object = tanchuang.appendChild(rr);
+ shipinka = false;
+ }
+ }
+ //var playMarkInKaoQin = true;
+ if (((_this.offView == '1' && tagzhuangtai == '1') || (_this.offView == '0')) && ((_this.diskaoqin == "1" && _this.playMarkInKaoQin[i]) || (_this.diskaoqin == "0"))) {
+ //鏄惁寮�鍚绾挎秷澶憋紝骞跺垽鏂姸鎬侊紙鍦ㄧ嚎1/绂荤嚎0锛夛紱褰撳紑鍚绾挎秷澶辨椂锛堜粎鏄剧ず鍦ㄧ嚎鏍囩锛夛紝褰撴湭寮�鍚绾挎秷澶辨椂锛堝叏閮ㄦ樉绀猴級
+ //鏄惁寮�鍚嚭鑰冨嫟鍖哄煙娑堝け锛屽苟鍒ゆ柇鏄惁鍦ㄨ�冨嫟鍖哄煙鍐咃紱褰撳紑鍚嚭鑰冨嫟鍖哄煙娑堝け鏃讹紙闇�瑕佸湪鑰冨嫟鍖哄煙鍐咃級锛屽綋鏈紑鍚椂锛堝叏閮ㄦ樉绀猴級
+
+ //璇诲彇褰撳墠瀹為檯鍧愭爣
+ var cor_x = new Number(_this.playMark[i][4]); // 姝ゅ_this.playMark鏄暟鎹簱閲屽彇鍒扮殑褰撳墠鐐瑰潗鏍�,4鏄痯osx,5鏄痯osy
+ var cor_y = new Number(_this.playMark[i][5]);
+
+ //杞负鍥句笂鍧愭爣
+ var x_cor_now = new Number(_this.imgXList['map'] + _this.imgScaleList['map'] * _this.rateNumList['map'] * _this.x_ratio * (cor_x - _this.x_x0));
+ var y_cor_now = new Number(_this.imgYList['map'] + _this.imgScaleList['map'] * _this.rateNumList['map'] * _this.y_ratio * (cor_y - _this.y_y0));
+
+ //鏄惁鏈夎建杩规嫋灏�
+ if (_this.real_trak_time != 0) {
+ var trackNow;
+ var pm = _this.playMark;
+
+ function ftn(current_floor, pm, tn, rtk, ctt, rtc, igxm, igym, igslm, rnlm, xr, yr, xx0, yy0) {
+ //trackNow = getTracknow(current_floor, pm[0], rtk)
+ if (tn.length == 0) {
+ trackNow = [];
+ } else if (pm[0] in tn) {
+ trackNow = tn[pm[0]];
+ } else {
+ trackNow = [];
+ };
+ var can = ctt;
+ can.beginPath();
+ can.strokeStyle = rtc;
+ can.fillStyle = rtc;
+ for (var i = 0; i < trackNow.length; i++) {
+ var cor_x = new Number(trackNow[i][0]);
+ var cor_y = new Number(trackNow[i][1]);
+ var x_cor = new Number(igxm + igslm * rnlm * xr * (cor_x - xx0));
+ var y_cor = new Number(igym + igslm * rnlm * yr * (cor_y - yy0));
+
+ // var cor_x2 = new Number(trackNow[i+1][0]);
+ // var cor_y2 = new Number(trackNow[i+1][1]);
+ // var x_cor2 = new Number(igxm + igslm * rnlm * xr * (cor_x2 - xx0));
+ // var y_cor2 = new Number(igym + igslm * rnlm * yr * (cor_y2 - yy0));
+
+ // can.moveTo(x_cor, y_cor);
+ // can.lineTo(x_cor2, y_cor2);
+ // can.stroke();
+ // can.fill();
+ can.moveTo(x_cor, y_cor);
+ can.arc(x_cor, y_cor, 1, 0, Math.PI * 2, true);
+ can.fill();
+ };
+ can.closePath();
+ can.stroke();
+ trackNow = null;
+ }
+ setTimeout(ftn(current_floor, _this.playMark[i], _this.trackNow, _this.real_trak_time, _this.context, _this.real_trak_color, _this.imgXList['map'], _this.imgYList['map'], _this.imgScaleList['map'], _this.rateNumList['map'], _this.x_ratio, _this.y_ratio, _this.x_x0, _this.y_y0), 5);
+ //var trackNow = getTracknow( _this.playMark[i][0], _this.real_trak_time);//鑾峰彇鎸囧畾鏃堕棿娈靛唴璇agid鐨勬暟鎹繘琛岀粯鍒�
+ } else {
+ _this.trackNow = [];
+ }
+ var isSos = _this.playMark[i][7];
+ if (_this.playMark[i][8] == "1") {
+ if (sousuoType) {
+ can.drawImage(images[key], 0, 0, images[key].naturalWidth, images[key].naturalHeight, x_cor_now - (images[key].naturalWidth * _this.imgScaleList[key] * _this.rateNumList[key]) / 2, y_cor_now - (images[key].naturalHeight * _this.imgScaleList[key] * _this.rateNumList[key]), images[key].naturalWidth * _this.imgScaleList[key] * _this.rateNumList[key], images[key].naturalHeight * _this.imgScaleList[key] * _this.rateNumList[key]);
+ } else {
+ can.drawImage(sousuo0, 0, 0, images[key].naturalWidth, images[key].naturalHeight, x_cor_now - (images[key].naturalWidth * _this.imgScaleList[key] * _this.rateNumList[key]) / 2, y_cor_now - (images[key].naturalHeight * _this.imgScaleList[key] * _this.rateNumList[key]), images[key].naturalWidth * _this.imgScaleList[key] * _this.rateNumList[key], images[key].naturalHeight * _this.imgScaleList[key] * _this.rateNumList[key]);
+ }
+ sousuoType = !sousuoType;
+ } else {
+ if (isSos) {
+ if (sosType[i]) {
+ can.drawImage(sos, 0, 0, images[key].naturalWidth, images[key].naturalHeight, x_cor_now - (images[key].naturalWidth * _this.imgScaleList[key] * _this.rateNumList[key]) / 2 + 3, y_cor_now - (images[key].naturalHeight * _this.imgScaleList[key] * _this.rateNumList[key]) + 2, images[key].naturalWidth * _this.imgScaleList[key] * _this.rateNumList[key], images[key].naturalHeight * _this.imgScaleList[key] * _this.rateNumList[key]);
+ } else {
+ can.drawImage(sos1, 0, 0, images[key].naturalWidth, images[key].naturalHeight, x_cor_now - (images[key].naturalWidth * _this.imgScaleList[key] * _this.rateNumList[key]) / 2 + 3, y_cor_now - (images[key].naturalHeight * _this.imgScaleList[key] * _this.rateNumList[key]) + 2, images[key].naturalWidth * _this.imgScaleList[key] * _this.rateNumList[key], images[key].naturalHeight * _this.imgScaleList[key] * _this.rateNumList[key]);
+ }
+ sosType[i] = !sosType[i];
+ } else {
+ can.drawImage(images[key], 0, 0, images[key].naturalWidth, images[key].naturalHeight, x_cor_now - (images[key].naturalWidth * _this.imgScaleList[key] * _this.rateNumList[key]) / 2, y_cor_now - (images[key].naturalHeight * _this.imgScaleList[key] * _this.rateNumList[key]), images[key].naturalWidth * _this.imgScaleList[key] * _this.rateNumList[key], images[key].naturalHeight * _this.imgScaleList[key] * _this.rateNumList[key]);
+ }
+ }
+
+ //鐢诲湪鐩稿簲浣嶇疆涓�
+ // can.drawImage(images[key], 0, 0, images[key].naturalWidth, images[key].naturalHeight, x_cor_now - (images[key].naturalWidth * _this.imgScaleList[key] * _this.rateNumList[key]) / 2, y_cor_now - (images[key].naturalHeight * _this.imgScaleList[key] * _this.rateNumList[key]), images[key].naturalWidth * _this.imgScaleList[key] * _this.rateNumList[key], images[key].naturalHeight * _this.imgScaleList[key] * _this.rateNumList[key]);
+
+ if (_this.tagZb == '1') { //鏄惁鏄剧ず鏍囩鍧愭爣
+ can.fillStyle = 'red';
+ //var f = 8*( _this.imgScaleList['map']);
+ can.font = "11px Arial";
+
+ tagzuobiao = _this.playMark[i][4] + ',' + _this.playMark[i][5];
+ can.fillText(tagzuobiao, x_cor_now - 20, y_cor_now + 10);
+ };
+ if (_this.viewName == '1') { //鏄惁鏄剧ず浜哄憳鍚嶇О
+ can.fillStyle = 'white';
+ can.font = '13px sans-serif';
+ if (_this.viewTagid == '1') { //鏄惁鏄剧ず鏍囩id
+ if (_this.playMark[i][2] <= 10) {
+ fillRoundRect(can, x_cor_now - 40, y_cor_now - images[key].naturalHeight * _this.imgScaleList[key] * _this.rateNumList[key] - 18, images[key].naturalHeight * 2, 20, 4, '#FF0000');
+ } else {
+ fillRoundRect(can, x_cor_now - 40, y_cor_now - images[key].naturalHeight * _this.imgScaleList[key] * _this.rateNumList[key] - 18, images[key].naturalHeight * 2, 20, 4, '#32CD32');
+ }
+ can.fillStyle = 'white';
+ can.fillText(_this.playMark[i][1], x_cor_now - 38, y_cor_now - images[key].naturalHeight * _this.imgScaleList[key] * _this.rateNumList[key] - 3);
+ can.fillText(_this.playMark[i][0], x_cor_now + 5, y_cor_now - images[key].naturalHeight * _this.imgScaleList[key] * _this.rateNumList[key] - 3);
+ } else {
+ if (_this.playMark[i][2] <= 10) {
+ fillRoundRect(can, x_cor_now - 20, y_cor_now - images[key].naturalHeight * _this.imgScaleList[key] * _this.rateNumList[key] - 18, images[key].naturalHeight * 1.1, 20, 4, '#FF0000');
+ } else {
+ fillRoundRect(can, x_cor_now - 20, y_cor_now - images[key].naturalHeight * _this.imgScaleList[key] * _this.rateNumList[key] - 18, images[key].naturalHeight * 1.1, 20, 4, '#32CD32');
+ }
+ can.fillStyle = 'white';
+ can.fillText(_this.playMark[i][1], x_cor_now - 19, y_cor_now - images[key].naturalHeight * _this.imgScaleList[key] * _this.rateNumList[key] - 3);
+ }
+ } else {
+ can.font = '13px sans-serif';
+ can.fillStyle = 'white';
+ if (_this.viewTagid == '1') {
+ if (_this.playMark[i][2] <= 10) {
+ fillRoundRect(can, x_cor_now - 20, y_cor_now - images[key].naturalHeight * _this.imgScaleList[key] * _this.rateNumList[key] - 18, images[key].naturalHeight * 1.1, 20, 4, '#FF0000');
+ } else {
+ fillRoundRect(can, x_cor_now - 20, y_cor_now - images[key].naturalHeight * _this.imgScaleList[key] * _this.rateNumList[key] - 18, images[key].naturalHeight * 1.1, 20, 4, '#32CD32');
+ }
+ can.fillStyle = 'white';
+ can.fillText(_this.playMark[i][0], x_cor_now - 14, y_cor_now - images[key].naturalHeight * _this.imgScaleList[key] * _this.rateNumList[key] - 3);
+ }
+ }
+
+ if (_this.viewPower == '1') { //鏄惁鏄剧ず鐢甸噺
+ can.font = '10px sans-serif';
+ can.fillStyle = 'red';
+ can.fillText("鐢甸噺:" + _this.playMark[i][2], x_cor_now - 20, y_cor_now + 20);
+ };
+ };
+ }
+ } else if (key == 'anchor_online') {
+ can.font = '10px sans-serif';
+ if (_this.anckicon == '1') { //鏄惁鏄剧ず鍩虹珯鍥炬爣
+ //_this.anchorList = [anchorid, posx,posy,posz,layer,greatetime]
+ for (var i = 0; i < _this.onlineAnchorList.length; i++) {
+ var cor_x = new Number(_this.onlineAnchorList[i][1]);
+ var cor_y = new Number(_this.onlineAnchorList[i][2]);
+ var x_cor = new Number(_this.imgXList['map'] + _this.imgScaleList['map'] * _this.rateNumList['map'] * _this.x_ratio * (cor_x - _this.x_x0));
+ var y_cor = new Number(_this.imgYList['map'] + _this.imgScaleList['map'] * _this.rateNumList['map'] * _this.y_ratio * (cor_y - _this.y_y0));
+ can.drawImage(images[key], 0, 0, images[key].naturalWidth, images[key].naturalHeight, x_cor - (images[key].naturalWidth * _this.imgScaleList[key] * _this.rateNumList[key]) / 2, y_cor - (images[key].naturalHeight * _this.imgScaleList[key] * _this.rateNumList[key]), images[key].naturalWidth, images[key].naturalHeight);
+ if (_this.viewAnckzb == '1') { //鏄惁鏄剧ず鍩虹珯鍧愭爣
+ can.fillStyle = 'red'
+ var anchorzuobiao = _this.onlineAnchorList[i][1] + ',' + _this.onlineAnchorList[i][2] + ',' + _this.onlineAnchorList[i][3];
+ can.fillText(anchorzuobiao, x_cor - 15, y_cor + 30);
+ };
+ if (_this.viewAnckid == '1') { //鏄惁鏄剧ず鍩虹珯id
+ can.fillStyle = 'red';
+ var tigidd = _this.onlineAnchorList[i][0];
+ can.fillText(tigidd, x_cor - 2, y_cor - (images[key].naturalHeight * _this.imgScaleList[key] * _this.rateNumList[key] + 10) / 2);
+ };
+ };
+ };
+ } else if (key == 'anchor_offline') {
+ can.font = '10px sans-serif';
+ if (_this.anckicon == '1') { //鏄惁鏄剧ず鍩虹珯鍥炬爣
+ //_this.anchorList = [anchorid, posx,posy,posz,layer,greatetime]
+ for (var i = 0; i < _this.offlineAnchorList.length; i++) {
+ var cor_x = new Number(_this.offlineAnchorList[i][1]);
+ var cor_y = new Number(_this.offlineAnchorList[i][2]);
+ var x_cor = new Number(_this.imgXList['map'] + _this.imgScaleList['map'] * _this.rateNumList['map'] * _this.x_ratio * (cor_x - _this.x_x0));
+ var y_cor = new Number(_this.imgYList['map'] + _this.imgScaleList['map'] * _this.rateNumList['map'] * _this.y_ratio * (cor_y - _this.y_y0));
+ can.drawImage(images[key], 0, 0, images[key].naturalWidth, images[key].naturalHeight, x_cor - (images[key].naturalWidth * _this.imgScaleList[key] * _this.rateNumList[key]) / 2, y_cor - (images[key].naturalHeight * _this.imgScaleList[key] * _this.rateNumList[key]), images[key].naturalWidth, images[key].naturalHeight);
+ if (_this.viewAnckzb == '1') { //鏄惁鏄剧ず鍩虹珯鍧愭爣
+ can.fillStyle = 'red'
+ var anchorzuobiao = _this.offlineAnchorList[i][1] + ',' + _this.offlineAnchorList[i][2] + ',' + _this.offlineAnchorList[i][3];
+ can.fillText(anchorzuobiao, x_cor - 15, y_cor + 30);
+ };
+ if (_this.viewAnckid == '1') { //鏄惁鏄剧ず鍩虹珯id
+ can.fillStyle = 'red';
+ can.fillText(_this.offlineAnchorList[i][0], x_cor - 2, y_cor - (images[key].naturalHeight * _this.imgScaleList[key] * _this.rateNumList[key] + 10) / 2);
+ };
+ };
+ };
+ }
+ };
+ // }
+
+ //寮�鍚毀閬撳畾浣嶅悗锛岄渶瑕佹樉绀哄綋鍓嶈�冨嫟鍖哄煙鍐呯殑鎬绘爣绛炬暟閲�
+ if (_this.tunlDw == "1") {
+ var k = 0;
+ fillRoundRect(can, 10, 10, 140, 40 * _this.fenceMarkCount.length, 10, colorbbb);
+ for (var i = 0; i < _this.fenceMarkCount.length; i++) {
+ can.beginPath();
+ can.fillStyle = getDrawColor(_this.FenceColor[i]);
+ can.fillStyle = "rgba(255,255,0,0.7)";
+ can.font = "15px Verdana";
+ can.fillText(_this.realFenceList[i][0] + ":" + _this.fenceMarkCount[i], 34, 36 + 40 * k);
+ can.closePath();
+ k += 1;
+ };
+ };
+
+ //寮�鍚皵浣撴樉绀�
+ if (_this.gas_show == "1") {
+ _this.GasList = getGas("zuobiao"); //姘斾綋鍧愭爣
+ _this.GasType = getGas("type"); //姘斾綋绫诲瀷
+ _this.GasNongdu = getGas("nongdu"); //姘斾綋娴撳害
+ for (var i = 0; i < _this.GasList.length; i++) {
+ var cor_x = new Number(_this.GasList[i][0]);
+ var cor_y = new Number(_this.GasList[i][1]);
+ var x_cor = new Number(_this.imgXList['map'] + _this.imgScaleList['map'] * _this.rateNumList['map'] * _this.x_ratio * (cor_x - _this.x_x0));
+ var y_cor = new Number(_this.imgYList['map'] + _this.imgScaleList['map'] * _this.rateNumList['map'] * _this.y_ratio * (cor_y - _this.y_y0));
+ can.beginPath();
+ can.arc(x_cor, y_cor, 6, 0, Math.PI * 2, true);
+ can.fillStyle = "green";
+ can.fill();
+ can.fillStyle = "red";
+ can.fillText(_this.GasType[i], x_cor + 10, y_cor);
+ can.fillText(_this.GasNongdu[i], x_cor + 10, y_cor + 10);
+ can.closePath();
+ }
+ };
+ },
+
+ init: function (current_floor, tml, ydl, fzbl, fcl, fnl, ftl, ail_on, ail_off, sysSetting, ttm) {
+ var _this = this;
+
+ //璇诲彇绯荤粺璁剧疆
+ _this.tagZb = sysSetting[0].tagZb;//鏄惁鏄剧ず鏍囩鍧愭爣
+ _this.diskaoqin = sysSetting[0].diskaoqing; //鍑鸿�冨嫟鍖哄煙鏄惁娑堝け
+ _this.viewAnckid = sysSetting[0].viewAnckid;//鏄惁鏄剧ず鍩虹珯ID
+ _this.viewName = sysSetting[0].viewName;//鏄惁鏄剧ず浜哄憳鍚嶇О
+ _this.tunlDw = sysSetting[0].tunlDw;//闅ч亾瀹氫綅妯″紡
+ _this.guiji_sava = sysSetting[0].guiji_sava;//鏄惁寮�鍚建杩逛繚瀛�
+ _this.viewPower = sysSetting[0].viewPower;//鏄惁鏄剧ず鐢甸噺
+ _this.viewTagid = sysSetting[0].viewTagid;//鏄惁鏄剧ず鏍囩ID
+ _this.viewAnckzb = sysSetting[0].viewAnckzb;//鏄惁鏄剧ず鍩虹珯鍧愭爣
+ _this.offView = sysSetting[0].offView;//鏄惁绂荤嚎涓嶆樉绀哄浘鏍�
+ _this.anckicon = sysSetting[0].anckicon;//鏄惁鏄剧ず鍩虹珯鍥炬爣
+ _this.gas_show = sysSetting[0].gas_show;//鏄剧ず鍏朵粬妫�娴�(姘斾綋鏄剧ず)
+ _this.quiet = sysSetting[0].quiet;//闈欐杈撳嚭鍥哄畾鍧愭爣
+ _this.fence_show = sysSetting[0].fence_show;//鏄惁鏄剧ず鍥存爮
+
+ //璇诲彇鐪熷疄鍦板浘
+ //璇诲浘鐗囧疄闄呭昂瀵�
+ _this.trueLength = new Number(tml[0][0]);
+ _this.trueWidth = new Number(tml[0][1]);
+
+ //璇诲疄闄呭師鐐瑰潗鏍�
+ _this.x_x0 = new Number(ydl[0][0]);
+ _this.y_y0 = new Number(ydl[0][1]);
+
+ //璇诲彇褰撳墠鍥存爮淇℃伅
+ _this.FenceList = fzbl;
+ _this.FenceColor = fcl;
+ _this.FenceName = fnl;
+ _this.FenceType = ftl;
+
+ _this.realFenceList = [];
+ //閬嶅巻鍥存爮淇℃伅骞跺瓨鍌ㄦ垚[鍚嶇О锛岀被鍨嬶紝鍧愭爣]
+ for (var m = 0; m < _this.FenceList.length; m++) {
+ var tmp_list = [];
+ var points = _this.FenceList[m];
+ var points_list = _this.FenceList[m].split(",");
+
+ //鍥存爮瀹為檯鍧愭爣锛堝姞涓婂亸绉婚噺鐨勶級
+ var points_list_sort = [];
+ for (var i = 0; i < points_list.length; i++) {
+ if (i % 2 == 0) {
+ tmp_list = [];
+ tmp_list.push(new Number(points_list[i]));
+ } else {
+ tmp_list.push(new Number(points_list[i]));
+ points_list_sort.push(tmp_list);
+ }
+ }
+ //瀛樺尯鍩熷悕绉�+鍖哄煙绫诲瀷+鍖哄煙鍧愭爣锛屾柟渚垮悗缁垽鏂槸鍚﹀湪鏌愬尯鍩熷唴
+ _this.realFenceList.push([_this.FenceName[m], _this.FenceType[m], points_list_sort]);
+ };
+
+ _this.real_trak_time = str_to_time(sysSetting[0].real_trak_time);//瀹炴椂杞ㄨ抗鏄剧ず鏃堕暱
+ //褰撳墠浣嶇疆
+ _this.playMark = getRealPosition(current_floor);
+ var tagid_str = "";
+ for (var i = 0; i < _this.playMark.length; i++) {
+ tagid_str += _this.playMark[i][0]
+ if (i != _this.playMark.length - 1) {
+ tagid_str += ","
+ }
+ }
+ //瀹炴椂杞ㄨ抗
+ if (_this.real_trak_time != 0) {
+ _this.trackNow = getTracknow(current_floor, tagid_str, _this.real_trak_time);
+ } else {
+ _this.trackNow = null;
+ }
+
+ _this.real_trak_color = getTrackColor(sysSetting[0].real_trak_color);//瀹炴椂杞ㄨ抗鏄剧ず鐨勯鑹�
+
+ _this.canvas.onmousedown = function (event) {
+ _this.clickDown(event);
+ };
+ _this.canvas.onmousemove = function (event) {
+ _this.mouseMove(event)
+ };
+ _this.canvas.onmouseup = function (event) {
+ _this.mouseUp(event);
+ };
+ _this.canvas.onmousewheel = function (event) {
+ _this.onmouseWheel(event);
+ };
+ _this.ttm = ttm;
+
+ //褰撳墠鍦板浘澶т簬1涓椂鎵嶅彲浠ヨ皟鐢╠bclick
+ if (_this.ttm > 1) {
+ _this.canvas.ondblclick = function (event) {
+ _this.doubleClick(event);
+ }
+ }
+
+ _this.onlineAnchorList = ail_on;
+ _this.offlineAnchorList = ail_off;
+
+ var t = 300;//300ms
+
+ // function fn(){
+ // //褰撳墠闇�瑕佺敾鐨勫潗鏍�
+ // var realposition_list = getRealPosition_all()
+ // _this.playMark = realposition_list[current_floor];
+ // _this.drawImg(current_floor);
+ // }
+ function fn() {
+ if (tuodong == true) {
+ return false;
+ }
+ if (shipinka == false) {
+ return false;
+ }
+ //褰撳墠瀹炴椂鍧愭爣
+ _this.playMark = getRealPosition(current_floor);
+ // var tagid_str = "";
+ // for (var i=0;i<_this.playMark.length;i++){
+ // tagid_str += _this.playMark[i][0]
+ // if (i!= _this.playMark.length-1){
+ // tagid_str += ","
+ // }
+ // }
+
+ if (_this.real_trak_time != 0) {
+ //灏嗗綋鍓嶅疄鏃跺潗鏍囨坊鍔犺繘track涓�
+ var track_now = Date.parse(new Date()); //timestamp涓烘绉掑崟浣�
+ track_now = track_now / 1000;
+ var track_now_head = track_now - _this.real_trak_time;
+ //褰撳墠track鏈�寮�濮嬬殑鏃堕棿
+ var track_head_date = new Date();
+ track_head_date.setTime(track_now_head * 1000 + 8 * 3600 * 1000);
+ var track_head_date_str = track_head_date.toJSON().substr(0, 19).replace('T', ' ');
+
+ for (var i = 0; i < _this.playMark.length; i++) {
+ if (_this.trackNow[_this.playMark[i][0]] != null) {
+ if (_this.trackNow[_this.playMark[i][0]].length > 1500) {
+ _this.trackNow[_this.playMark[i][0]] = _this.trackNow[_this.playMark[i][0]].slice(-1200);
+ };
+ for (var j = 0; j < _this.trackNow[_this.playMark[i][0]].length; j++) {
+ if (_this.trackNow[_this.playMark[i][0]][0][2] < track_head_date_str) {
+ _this.trackNow[_this.playMark[i][0]].shift()
+ } else {
+ break
+ }
+ };
+ };
+ var now_time = new Date();
+ now_time.setTime(track_now * 1000 + 8 * 3600 * 1000);
+ var now_time_str = now_time.toJSON().substr(0, 19).replace('T', ' ');
+ var tmp = [_this.playMark[i][4], _this.playMark[i][5], now_time_str];
+ if (_this.trackNow[_this.playMark[i][0]] == null) {
+ _this.trackNow[_this.playMark[i][0]] = []
+ }
+ _this.trackNow[_this.playMark[i][0]].push(tmp)
+ }
+ }
+ _this.drawImg(current_floor);
+ }
+ // if (full_screen==true){
+ // clearInterval(timer);
+ // timer_screen= setInterval(fn, t);
+ // } else {
+ // clearInterval(timer_screen);
+ // timer = setInterval(fn, t);
+ // }
+ // var mapa0 = document.getElementById("wrap0")
+ // mapa0.value = "姝e湪鍔犺浇鍦板浘......"
+ // var mapa0 = document.getElementById("wrap0")
+ // var tt = document.createElement("p");
+ // tt.value="姝e湪鍔犺浇鍦板浘......"
+ // tt.style=""
+ // mapa0.appendChild(tt)
+ setTimeout(fnnn, 3000)
+ function fnnn(){
+ _this.timer = setInterval(fn, t);
+ }
+ // _this.timer = setInterval(fn, t);
+ timer_list.push(_this.timer);
+ },
+ /*璁$畻褰撳墠榧犳爣浣嶇疆璺濈canvas鐨勫亸绉婚噺*/
+ xyToCanvas: function (ele, x, y) {
+ var _this = this;
+ var obj = _this.canvas.getBoundingClientRect();
+ return {
+ x: x - obj.left,
+ y: y - obj.top
+ };
+ },
+ /*榧犳爣鍙屽嚮浜嬩欢*/
+ doubleClick: function (event) {
+ var _this = this;
+
+ if ((event.type == "dblclick") && (full_screen == false)) {
+ _this.expand = true;
+ full_screen = true;
+
+ var targ = event.target;
+ var tid = targ.id;
+ var id = tid.substr(tid.length - 1, 1)
+ var str = "map" + id;
+ document.getElementById(str).style.width = "100%";
+ document.getElementById(str).style.height = "800px";
+ var str = "draw" + id;
+ document.getElementById(str).style.width = "100%";
+ document.getElementById(str).style.height = "750px";
+ var str = "wrap" + id;
+ document.getElementById(str).style.width = "100%";
+ document.getElementById(str).style.height = "750px";
+ for (var i = 0; i < 4; i++) {
+ if (String(i) != id) {
+ var str = "map" + i;
+ // document.getElementById(str).style.position = "fixed";
+ // document.getElementById(str).style.left = "100%";
+ document.getElementById(str).style.display = "none";
+ }
+ };
+ //_this.drawImg(current_floor);
+ clearInterval(_this.timer);
+ var can = _this.context;
+ can.clearRect(0, 0, _this.canvas.width, _this.canvas.height);
+ for (var i = 0; i < timer_list.length; i++) {
+ clearInterval(timer_list[i]);
+ }
+ timer_list = [];
+ console.log(result)
+ diaoyonghuatu(result);
+ } else if ((event.type == "dblclick") && (full_screen == true)) {
+ _this.expand = false;
+ full_screen = false;
+
+ var targ = event.target;
+ var tid = targ.id;
+ var id = tid.substr(tid.length - 1, 1)
+ var str = "map" + id;
+ document.getElementById(str).style.width = "49.5%";
+ document.getElementById(str).style.height = null;
+ var str = "draw" + id;
+ document.getElementById(str).style.width = null;
+ document.getElementById(str).style.height = null;
+ var str = "wrap" + id;
+ document.getElementById(str).style.width = "100%";
+ document.getElementById(str).style.height = "400px";
+
+ for (var i = 0; i < _this.ttm; i++) {
+ var str = "map" + i;
+ document.getElementById(str).style.display = "";
+ };
+ //_this.drawImg(current_floor);
+ clearInterval(_this.timer);
+ var can = _this.context;
+ can.clearRect(0, 0, _this.canvas.width, _this.canvas.height);
+ for (var i = 0; i < timer_list.length; i++) {
+ clearInterval(timer_list[i]);
+ }
+ timer_list = [];
+ diaoyonghuatu(result);
+ }
+ },
+ /*榧犳爣鍗曞嚮浜嬩欢*/
+ clickDown: function (event) {
+ var _this = this;
+ if ((event.button == 0)) {//鐐瑰嚮榧犳爣宸﹂敭
+ _this.dragFlag = true;
+ tuodong = true;
+ //_this.canvas.style.cursor = "move";
+ _this.pos = _this.xyToCanvas(_this.canvas, event.clientX, event.clientY);
+
+ }
+ },
+ /*榧犳爣绉诲姩浜嬩欢*/
+ mouseMove: function (event) {
+ var _this = this;
+ /*鎷栨嫿*/
+ if (_this.dragFlag) {
+ tuodong = true;
+ _this.canvas.style.cursor = "move";
+ var pos1 = _this.xyToCanvas(_this.canvas, event.clientX, event.clientY);
+ var x = pos1.x - _this.pos.x;
+ var y = pos1.y - _this.pos.y;
+ _this.pos = pos1;
+ for (var key in _this.imgXList) {
+ _this.imgXList[key] += x;
+ _this.imgYList[key] += y;
+ }
+ //clearInterval(_this.timer);
+ _this.cacheCanvas = null;
+ _this.drawImg();
+ }
+ //diaoyonghuatu(result);
+ },
+ /*榧犳爣鏀惧紑浜嬩欢*/
+ mouseUp: function (event) {
+ var _this = this;
+ _this.dragFlag = false;
+ tuodong = false;
+ if (_this.markFlag) {
+ _this.canvas.style.cursor = "none";
+ return;
+ }
+ _this.canvas.style.cursor = 'default';
+
+ },
+ /*榧犳爣婊氳疆浜嬩欢*/
+ onmouseWheel: function (event) {
+ var _this = this;
+ _this.cacheCanvas = null;
+ var pos = _this.xyToCanvas(_this.canvas, event.clientX, event.clientY);
+ event.wheelDelta = event.wheelDelta ? event.wheelDelta : (event.deltaY * (-40));
+ //鍙栨秷娴忚鍣ㄩ粯璁よ涓�
+ if (event.preventDefault) {
+ event.preventDefault();
+ } else {
+ event.returnValue = false;
+ }
+ if (event.wheelDelta > 0 && _this.scaleFlag < 9) {
+ for (var key in _this.imgScaleList) {
+ _this.imgScaleList[key] *= 1.25;
+ _this.imgXList[key] = _this.imgXList[key] * 1.25 - 0.25 * pos.x;
+ _this.imgYList[key] = _this.imgYList[key] * 1.25 - 0.25 * pos.y;
+ }
+ _this.scaleFlag += 1;
+ }
+ if (event.wheelDelta < 0 && _this.scaleFlag > -9) {//缂╁皬
+ for (var key in _this.imgScaleList) {
+ _this.imgScaleList[key] *= 0.8;
+ _this.imgXList[key] = _this.imgXList[key] * 0.8 + pos.x * 0.2;
+ _this.imgYList[key] = _this.imgYList[key] * 0.8 + pos.y * 0.2;
+ }
+ _this.scaleFlag -= 1;
+ }
+ _this.imgScaleList['icon'] = 0.03;
+ _this.drawImg();
+ },
+ };
+
+ function getRealPosition_all() {
+ var realposition = [];
+ $.ajax({
+ async: false,
+ type: 'POST',
+ url: "/hxzkoa/getRealPosition_all.do",
+ dataType: 'json',
+ success: function (data) {
+ for (var i = 0; i < data.length; i++) {
+ //playMark[id,name,power,life,x,y,time]
+ realposition.push([data[i].tagid, data[i].name, data[i].power, data[i].life, data[i].posx, data[i].posy, data[i].time, data[i].fence == 1 || data[i].sos == 1, data[i].sos, data[i].fence])
+ }
+ },
+ });
+ return realposition
+ };
+ var audio1 = new Audio("/hxzkoa/hxzk/image/voice/sos.wav");
+ var audio2 = new Audio("/hxzkoa/hxzk/image/voice/warning.wav");
+ // var zaipan = []
+ // var sosgaojing1 = getRealPosition();
+ // for (var i = 0; i < sosgaojing1.length; i++) {
+ // zaipan.push(false)
+ // }
+ // setInterval(baojing, 1000)
+ function baojing() {
+ var sosgaojing = getRealPosition_all();
+ for (var i = 0; i < sosgaojing.length; i++) {
+ if (sosgaojing[i][7] == 1) {
+ if (sosgaojing[i][8] == 1) {
+ // if (zaipan[i] == false) {
+ var str = '娉ㄦ剰,缂栧彿[' + sosgaojing[i][0] + ']SOS鍛婅'
+ // Audio1.click()
+ audio1.play()
+ // swal(str)
+ // $.ajax({
+ // url: "/hxzkoa/sosgaojing.do",
+ // type: "POST",
+ // dataType: "JSON",
+ // data: {
+ // tagid: sosgaojing[i][0]
+ // }
+ // })
+ // }
+ } if (sosgaojing[i][9] == 1) {
+ // if (zaipan[i] == false) {
+ var str = '娉ㄦ剰,缂栧彿[' + sosgaojing[i][0] + ']杩涘叆鍗遍櫓鍖哄煙'
+ // audio2.click()
+ audio2.play()
+ // swal(str)
+ // $.ajax({
+ // url: "/hxzkoa/fencegaojing.do",
+ // type: "POST",
+ // dataType: "JSON",
+ // data: {
+ // tagid: sosgaojing[i][0]
+ // }
+ // })
+ // }
+ }
+ // zaipan[i] = true
+ }
+ // } else {
+ // zaipan[i] = false
+ // }
+ }
+ }
+
+ document.getElementById("stop").style.display = 'none';
+ $("#search").click(function () {
+ var input = document.getElementById("tagidaaa").value;
+ $.ajax({
+ async: false,
+ url: "/hxzkoa/sousuo.do",
+ type: "POST",
+ dataType: "JSON",
+ data: {
+ tagid: input
+ }
+ })
+ document.getElementById("search").style.display = 'none';
+ document.getElementById("stop").style.display = '';
+ document.getElementById("tagidaaa").value = "";
+ });
+ $("#stop").click(function () {
+ $.ajax({
+ async: false,
+ url: "/hxzkoa/sousuoquxiao.do",
+ type: "POST",
+ dataType: "JSON"
+ })
+ document.getElementById("search").style.display = '';
+ document.getElementById("stop").style.display = 'none';
+ });
+ function hidePopup(x, e) {
+ if (e != undefined) {
+ e.cancelBubble = true;
+ }
+ document.getElementById("popup").style.display = "none";
+ isDelete = x;
+ shipinka = true;
+ document.getElementById("tanchuang").innerHTML = "";
+ }
+ </script>
+ <!-- 缁撴潫璋冪敤瀹ゅ唴瀹氫綅鍦板浘鍔熻兘 -->
+ <!-- > END PAGE FUNCTION SCRIPTS -->
+
+
+
+ <!-- BEGIN PAGE LEVEL PLUGINS/CUSTOM SCRIPTS -->
+ <script src="/hxzkoa/hxzk/plugins/apex/apexcharts.min.js"></script>
+ <script src="/hxzkoa/hxzk/assets/js/dashboard/dash_2.js"></script>
+ <!-- BEGIN PAGE LEVEL PLUGINS/CUSTOM SCRIPTS -->
+
+ </body>
+
+ </html>
\ No newline at end of file
--
Gitblit v1.10.0