From dcd6950354c8d9f474b662d0338b8c0a0722e0f2 Mon Sep 17 00:00:00 2001 From: jjLv <1981429112@qq.com> Date: Wed, 3 Apr 2024 16:15:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=BA=E5=91=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- js/operEnvironment/operEnvironment.js | 18 ++++++++++-------- js/personnelControl/DrawingManager_min.css | 1 + js/personnelControl/DrawingManager_min.js | 4 ++++ js/personnelControl/personnelControl.js | 19 +++++++++++-------- pages/personnelControl/personnelControl.html | 9 ++++++--- 5 files changed, 32 insertions(+), 19 deletions(-) create mode 100644 js/personnelControl/DrawingManager_min.css create mode 100644 js/personnelControl/DrawingManager_min.js diff --git a/js/operEnvironment/operEnvironment.js b/js/operEnvironment/operEnvironment.js index e1aa547..f66b622 100644 --- a/js/operEnvironment/operEnvironment.js +++ b/js/operEnvironment/operEnvironment.js @@ -188,10 +188,12 @@ function DaylightDisplacement(environmentData) { //和风天气API调用 function zephyrineWeather() { - if (navigator.geolocation) { - navigator.geolocation.getCurrentPosition(function (position) { - let latitude = position.coords.latitude; - let longitude = position.coords.longitude; + // if (navigator.geolocation) { + // navigator.geolocation.getCurrentPosition(function (position) { + // let latitude = position.coords.latitude; + // let longitude = position.coords.longitude; + let latitude = '31.93566198931321'; + let longitude = '117.16010067578883'; console.log("经度:" + longitude + ", 纬度:" + latitude); let latLon = longitude + ',' + latitude; @@ -294,10 +296,10 @@ function zephyrineWeather() { console.error('获取天气数据时发生错误:', error); }); - }); - } else { - console.log("浏览器不支持 Geolocation API"); - } + // }); + // } else { + // console.log("浏览器不支持 Geolocation API"); + // } } function getWeatherIcon(weatherText) { diff --git a/js/personnelControl/DrawingManager_min.css b/js/personnelControl/DrawingManager_min.css new file mode 100644 index 0000000..6a29d3b --- /dev/null +++ b/js/personnelControl/DrawingManager_min.css @@ -0,0 +1 @@ +.BMapLib_Drawing_panel{height:47px;border:1px solid #666;border-radius:5px;overflow:hidden;box-shadow:1px 1px 3px rgba(0,0,0,0.3);float:left}.BMapLib_Drawing .BMapLib_box{border-right:1px solid #d2d2d2;float:left;height:100%;width:64px;height:100%;background-image:url(http://api.map.baidu.com/library/DrawingManager/1.4/src/bg_drawing_tool.png);cursor:pointer}.BMapLib_Drawing .BMapLib_last{border-right:0}.BMapLib_Drawing .BMapLib_hander{background-position:0 0}.BMapLib_Drawing .BMapLib_hander_hover{background-position:0 -52px}.BMapLib_Drawing .BMapLib_marker{background-position:-65px 0}.BMapLib_Drawing .BMapLib_marker_hover{background-position:-65px -52px}.BMapLib_Drawing .BMapLib_circle{background-position:-130px 0}.BMapLib_Drawing .BMapLib_circle_hover{background-position:-130px -52px}.BMapLib_Drawing .BMapLib_polyline{background-position:-195px 0}.BMapLib_Drawing .BMapLib_polyline_hover{background-position:-195px -52px}.BMapLib_Drawing .BMapLib_polygon{background-position:-260px 0}.BMapLib_Drawing .BMapLib_polygon_hover{background-position:-260px -52px}.BMapLib_Drawing .BMapLib_rectangle{background-position:-325px 0}.BMapLib_Drawing .BMapLib_rectangle_hover{background-position:-325px -52px} \ No newline at end of file diff --git a/js/personnelControl/DrawingManager_min.js b/js/personnelControl/DrawingManager_min.js new file mode 100644 index 0000000..bdaa605 --- /dev/null +++ b/js/personnelControl/DrawingManager_min.js @@ -0,0 +1,4 @@ +var BMapLib=window.BMapLib=BMapLib||{};var BMAP_DRAWING_MARKER="marker",BMAP_DRAWING_POLYLINE="polyline",BMAP_DRAWING_CIRCLE="circle",BMAP_DRAWING_RECTANGLE="rectangle",BMAP_DRAWING_POLYGON="polygon";(function(){var b=b||{guid:"$BAIDU$"};(function(){window[b.guid]={};b.extend=function(i,g){for(var h in g){if(g.hasOwnProperty(h)){i[h]=g[h]}}return i};b.lang=b.lang||{};b.lang.guid=function(){return"TANGRAM__"+(window[b.guid]._counter++).toString(36)};window[b.guid]._counter=window[b.guid]._counter||1;window[b.guid]._instances=window[b.guid]._instances||{};b.lang.Class=function(g){this.guid=g||b.lang.guid();window[b.guid]._instances[this.guid]=this};window[b.guid]._instances=window[b.guid]._instances||{};b.lang.isString=function(g){return"[object String]"==Object.prototype.toString.call(g)};b.lang.isFunction=function(g){return"[object Function]"==Object.prototype.toString.call(g)};b.lang.Class.prototype.toString=function(){return"[object "+(this._className||"Object")+"]"};b.lang.Class.prototype.dispose=function(){delete window[b.guid]._instances[this.guid];for(var g in this){if(!b.lang.isFunction(this[g])){delete this[g]}}this.disposed=true};b.lang.Event=function(g,h){this.type=g;this.returnValue=true;this.target=h||null;this.currentTarget=null};b.lang.Class.prototype.addEventListener=function(j,i,h){if(!b.lang.isFunction(i)){return}!this.__listeners&&(this.__listeners={});var g=this.__listeners,k;if(typeof h=="string"&&h){if(/[^\w\-]/.test(h)){throw ("nonstandard key:"+h)}else{i.hashCode=h;k=h}}j.indexOf("on")!=0&&(j="on"+j);typeof g[j]!="object"&&(g[j]={});k=k||b.lang.guid();i.hashCode=k;g[j][k]=i};b.lang.Class.prototype.removeEventListener=function(i,h){if(b.lang.isFunction(h)){h=h.hashCode}else{if(!b.lang.isString(h)){return}}!this.__listeners&&(this.__listeners={});i.indexOf("on")!=0&&(i="on"+i);var g=this.__listeners;if(!g[i]){return}g[i][h]&&delete g[i][h]};b.lang.Class.prototype.dispatchEvent=function(k,g){if(b.lang.isString(k)){k=new b.lang.Event(k)}!this.__listeners&&(this.__listeners={});g=g||{};for(var j in g){k[j]=g[j]}var j,h=this.__listeners,l=k.type;k.target=k.target||this;k.currentTarget=this;l.indexOf("on")!=0&&(l="on"+l);b.lang.isFunction(this[l])&&this[l].apply(this,arguments);if(typeof h[l]=="object"){for(j in h[l]){h[l][j].apply(this,arguments)}}return k.returnValue};b.lang.inherits=function(m,k,j){var i,l,g=m.prototype,h=new Function();h.prototype=k.prototype;l=m.prototype=new h();for(i in g){l[i]=g[i]}m.prototype.constructor=m;m.superClass=k.prototype;if("string"==typeof j){l._className=j}};b.dom=b.dom||{};b._g=b.dom._g=function(g){if(b.lang.isString(g)){return document.getElementById(g)}return g};b.g=b.dom.g=function(g){if("string"==typeof g||g instanceof String){return document.getElementById(g)}else{if(g&&g.nodeName&&(g.nodeType==1||g.nodeType==9)){return g}}return null};b.insertHTML=b.dom.insertHTML=function(j,g,i){j=b.dom.g(j);var h,k;if(j.insertAdjacentHTML){j.insertAdjacentHTML(g,i)}else{h=j.ownerDocument.createRange();g=g.toUpperCase();if(g=="AFTERBEGIN"||g=="BEFOREEND"){h.selectNodeContents(j);h.collapse(g=="AFTERBEGIN")}else{k=g=="BEFOREBEGIN";h[k?"setStartBefore":"setEndAfter"](j);h.collapse(k)}h.insertNode(h.createContextualFragment(i))}return j};b.ac=b.dom.addClass=function(n,o){n=b.dom.g(n);var h=o.split(/\s+/),g=n.className,m=" "+g+" ",k=0,j=h.length;for(;k=h.width-20||i.y<=50||i.y>=h.height-10){if(i.x<=20){this._panByX=8}else{if(i.x>=h.width-20){this._panByX=-8}}if(i.y<=50){this._panByY=8}else{if(i.y>=h.height-10){this._panByY=-8}}if(!this._edgeMoveTimer){this._edgeMoveTimer=setInterval(function(){h.panBy(o._panByX,o._panByY,{"noAnimation":true})},30)}}else{if(this._edgeMoveTimer){clearInterval(this._edgeMoveTimer);this._edgeMoveTimer=null}}};e.prototype._adjustSize=function(g){this.container.style.width=g.width+"px";this.container.style.height=g.height+"px"};e.prototype.getDrawPoint=function(l){var k=this._map,j=b.getTarget(l),h=l.offsetX||l.layerX||0,m=l.offsetY||l.layerY||0;if(j.nodeType!=1){j=j.parentNode}while(j&&j!=k.getContainer()){if(!(j.clientWidth==0&&j.clientHeight==0&&j.offsetParent&&j.offsetParent.nodeName=="TD")){h+=j.offsetLeft||0;m+=j.offsetTop||0}j=j.offsetParent}var i=new BMap.Pixel(h,m);var g=k.pixelToPoint(i);return g};function a(h,g){this.drawingManager=h;g=this.drawingToolOptions=g||{};this.defaultAnchor=BMAP_ANCHOR_TOP_LEFT;this.defaultOffset=new BMap.Size(10,10);this.defaultDrawingModes=[BMAP_DRAWING_MARKER,BMAP_DRAWING_CIRCLE,BMAP_DRAWING_POLYLINE,BMAP_DRAWING_POLYGON,BMAP_DRAWING_RECTANGLE];if(g.drawingModes){this.drawingModes=g.drawingModes}else{this.drawingModes=this.defaultDrawingModes}if(g.anchor){this.setAnchor(g.anchor)}if(g.offset){this.setOffset(g.offset)}}a.prototype=new BMap.Control();a.prototype.initialize=function(i){var h=this.container=document.createElement("div");h.className="BMapLib_Drawing";var g=this.panel=document.createElement("div");g.className="BMapLib_Drawing_panel";if(this.drawingToolOptions&&this.drawingToolOptions.scale){this._setScale(this.drawingToolOptions.scale)}h.appendChild(g);g.innerHTML=this._generalHtml();this._bind(g);i.getContainer().appendChild(h);return h};a.prototype._generalHtml=function(m){var h={};h["hander"]="鎷栧姩鍦板浘";h[BMAP_DRAWING_MARKER]="鐢荤偣";h[BMAP_DRAWING_CIRCLE]="鐢诲渾";h[BMAP_DRAWING_POLYLINE]="鐢绘姌绾�";h[BMAP_DRAWING_POLYGON]="鐢诲杈瑰舰";h[BMAP_DRAWING_RECTANGLE]="鐢荤煩褰�";var n=function(o,i){return''};var k=[];k.push(n("BMapLib_box BMapLib_hander","hander"));for(var j=0,g=this.drawingModes.length; + j + - - - + + + + + 人员管控