15832144755
2021-08-27 3516f02277035cdc7ff137422709b16efe97ca4a
src/main/webapp/hxzk/mapshow/mapShow.jsp
@@ -7,7 +7,7 @@
            <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>
            <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>
@@ -161,6 +161,7 @@
                              <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">正在加载地图......</p>
                              </div>
                           </div>
                        </div>
@@ -170,6 +171,7 @@
                              <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">正在加载地图......</p>
                              </div>
                           </div>
                        </div>
@@ -179,6 +181,7 @@
                              <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">正在加载地图......</p>
                              </div>
                           </div>
                        </div>
@@ -189,6 +192,7 @@
                              <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">正在加载地图......</p>
                              </div>
                           </div>
                        </div>
@@ -204,7 +208,13 @@
            <!--  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>
@@ -221,7 +231,7 @@
            <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; }, });
                  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);
               });
@@ -235,7 +245,6 @@
            <script>
               //首页地图控制
               var full_screen = false;
               var timer_list = [];
@@ -822,7 +831,7 @@
                     _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') {
@@ -854,6 +863,11 @@
                     //画地图
                     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);
@@ -978,7 +992,6 @@
                        for (var key in images) {
                           if (key == "icon" && _this.playMark) {
                              for (var i = 0; i < _this.playMark.length; i++) {
                                 //_this.trackNow = [];
                                 var tagzhuangtai = _this.playMark[i][3]; //在线状态
                                 var shipinzhuangtai = _this.playMark[i][9];
                                 if (shipinka) {
@@ -1059,7 +1072,7 @@
                                          };
                                          can.closePath();
                                          can.stroke();
                                          //_this.trackNow.push([trackNow]);
                                          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);//获取指定时间段内该tagid的数据进行绘制
@@ -1102,12 +1115,20 @@
                                       can.fillStyle = 'white';
                                       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');
                                          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 {
                                          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');
                                          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);
                                       }
@@ -1115,7 +1136,11 @@
                                       can.font = '13px sans-serif';
                                       can.fillStyle = 'white';
                                       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');
                                          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);
                                       }
@@ -1182,7 +1207,7 @@
                        for (var i = 0; i < _this.fenceMarkCount.length; i++) {
                           can.beginPath();
                           can.fillStyle = getDrawColor(_this.FenceColor[i]);
                           can.fillStyle = "yellow";
                           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();
@@ -1378,7 +1403,18 @@
                     //                   clearInterval(timer_screen);
                     //                   timer = setInterval(fn, t);
                     //                }
                     _this.timer = setInterval(fn, t);
                     // var mapa0 = document.getElementById("wrap0")
                     // mapa0.value = "正在加载地图......"
                     // var mapa0 = document.getElementById("wrap0")
                     // var tt = document.createElement("p");
                     // tt.value="正在加载地图......"
                     // 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的偏移量*/
@@ -1413,6 +1449,8 @@
                        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";
                           }
                        };
@@ -1424,6 +1462,7 @@
                           clearInterval(timer_list[i]);
                        }
                        timer_list = [];
                        console.log(result)
                        diaoyonghuatu(result);
                     } else if ((event.type == "dblclick") && (full_screen == true)) {
                        _this.expand = false;