From 6093145de266b53fa3ff9cdd3b8ae6a7376eab1e Mon Sep 17 00:00:00 2001 From: YYC <1833023622@qq.com> Date: 星期一, 19 六月 2023 20:08:55 +0800 Subject: [PATCH] 定位 --- igds-app/js/admin/security-patrol.js | 47 +++++++++++++++++++---------------------------- 1 files changed, 19 insertions(+), 28 deletions(-) diff --git a/igds-app/js/admin/security-patrol.js b/igds-app/js/admin/security-patrol.js index 6aaafff..d03d23e 100644 --- a/igds-app/js/admin/security-patrol.js +++ b/igds-app/js/admin/security-patrol.js @@ -3,8 +3,12 @@ var PatrolList = null; var ImgFile = null; var dateTime; -var longitude = null; //鐧惧害鍦板浘(BD-09)缁忓害 -var latitude = null; //鐧惧害鍦板浘(BD-09)绾害 +var longitude; //鐧惧害鍦板浘(BD-09)缁忓害 +var latitude; //鐧惧害鍦板浘(BD-09)绾害 +var x_pi = 3.14159265358979324 * 3000.0 / 180.0; +var pi = 3.1415926535897932384626; +var a = 6378245.0; +var ee = 0.00669342162296594323; //鐢靛瓙宸℃洿璁板綍 var data = { "interfaceId": "5601", @@ -27,7 +31,7 @@ "latitude": "", "longitude": "", "imgName": "", - "userName":"" + "userName": "" } }; //宸℃洿鐓х墖鏌ョ湅 @@ -128,29 +132,6 @@ } }) - // PatrolList = [{ - // "id": "57", - // "userName": "绋嬪", - // "longitude": "34.585", - // "latitude": "114.235", - // "createTime": "1976-03-03 16:41:41" - // }, - // { - // "id": "1", - // "userName": "鍐啗", - // "longitude": "34.585", - // "latitude": "114.235", - // "createTime": "1981-01-06 17:40:24" - // }, - // { - // "id": "99", - // "userName": "榛庢磱", - // "longitude": "114.235", - // "latitude": "34.585", - // "createTime": "1991-04-04 23:06:09" - // } - // ] - } function renderPatrol() { @@ -158,11 +139,13 @@ if (PatrolList && PatrolList.length > 0) { $.each(PatrolList, function(index, item) { html += '<li><div class="item"><div class="top">' - html += '<div class="date">' + item.createTime + '</div><div class="r-btn" id = "' + item.id + '">鏌ョ湅鐓х墖</div></div>'; + html += '<div class="date">' + item.createTime + '</div><div class="r-btn" id = "' + item.id + + '">鏌ョ湅鐓х墖</div></div>'; html += '<div class="cards"><div class="cd"><div class="con user">' html += '<div class="tit">鎵撳崱浜�</div><div class="txt">' + item.userName + '</div></div></div>'; html += '<div class="cd"><div class="con loc"><div class="tit">鍧愭爣</div>' - html += '<div class="txt">' + item.longitude + ', ' + item.latitude + '</div></div></div></div></div></li>' + html += '<div class="txt">' + item.longitude + ', ' + item.latitude + + '</div></div></div></div></div></li>' }) } else { html += '<li><div class="item"><div class="top">' @@ -228,6 +211,11 @@ //浣跨敤鐩告満鎷嶇収 function cameraImg() { + //鑾峰彇瀹氫綅淇℃伅 + getLatLon(); + if (latitude == null || longitude == null) { + return; + } var cmr = plus.camera.getCamera(); cmr.captureImage(function(p) { //鎴愬姛 @@ -277,6 +265,9 @@ //鐢靛瓙宸℃洿鎵撳崱 function patrolClock() { + + console.log(latitude) + console.log(longitude) data1.data.latitude = latitude; data1.data.longitude = longitude mui.ajax(url, { -- Gitblit v1.9.3