|
|
@@ -129,7 +129,7 @@
|
|
|
</div>
|
|
|
<script src="../js/mui.min.js"></script>
|
|
|
<script src="../js/jquery-2.1.0.js"></script>
|
|
|
- <script src="../js/coordOffset.js"></script><!--坐标偏移 -->
|
|
|
+ <script src="../js/coordtransform_utils.js"></script><!--坐标偏移 -->
|
|
|
<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=La58N63t7hPhafQ7Eror2kon"></script>
|
|
|
<script type="text/javascript">
|
|
|
var em = null,
|
|
|
@@ -160,7 +160,7 @@
|
|
|
}
|
|
|
$.ajax({
|
|
|
type: "post",
|
|
|
- url: "http://120.27.222.26/home_map/map_locat",
|
|
|
+ url: "http://192.168.1.11:8000/home_map/map_locat",
|
|
|
data: {
|
|
|
req: dtype
|
|
|
},
|
|
|
@@ -183,7 +183,7 @@
|
|
|
} else {
|
|
|
$.ajax({
|
|
|
type: "post",
|
|
|
- url: "http://120.27.222.26/home_map/map_locat",
|
|
|
+ url: "http://192.168.1.11:8000/home_map/map_locat",
|
|
|
data: {
|
|
|
req: 'scd'
|
|
|
},
|
|
|
@@ -205,7 +205,7 @@
|
|
|
});
|
|
|
$.ajax({
|
|
|
type: "post",
|
|
|
- url: "http://120.27.222.26/home_map/map_locat",
|
|
|
+ url: "http://192.168.1.11:8000/home_map/map_locat",
|
|
|
data: {
|
|
|
req: 'cbd'
|
|
|
},
|
|
|
@@ -227,7 +227,7 @@
|
|
|
});
|
|
|
$.ajax({
|
|
|
type: "post",
|
|
|
- url: "http://120.27.222.26/home_map/map_locat",
|
|
|
+ url: "http://192.168.1.11:8000/home_map/map_locat",
|
|
|
data: {
|
|
|
req: 'qxz'
|
|
|
},
|
|
|
@@ -249,7 +249,7 @@
|
|
|
});
|
|
|
$.ajax({
|
|
|
type: "post",
|
|
|
- url: "http://120.27.222.26/home_map/map_locat",
|
|
|
+ url: "http://192.168.1.11:8000/home_map/map_locat",
|
|
|
data: {
|
|
|
req: 'bzy'
|
|
|
},
|
|
|
@@ -271,7 +271,7 @@
|
|
|
});
|
|
|
$.ajax({
|
|
|
type: "post",
|
|
|
- url: "http://120.27.222.26/home_map/map_locat",
|
|
|
+ url: "http://192.168.1.11:8000/home_map/map_locat",
|
|
|
data: {
|
|
|
req: 'xyq'
|
|
|
},
|
|
|
@@ -315,13 +315,18 @@
|
|
|
if(data[i].gps == 0){
|
|
|
var point = new plus.maps.Point(data[i].lng, data[i].lat);
|
|
|
}else if(data[i].gps == 1){
|
|
|
- var GCj02 = wgs84togcj02(data[i].lng, data[i].lat); //gps转火星定位
|
|
|
- var baidulnglat = gcj02tobd09(GCj02[0],GCj02[1]) //火星转百度定位
|
|
|
- var point = new plus.maps.Point(baidulnglat[0], baidulnglat[1]);
|
|
|
+ //convert wgs84 to cj02
|
|
|
+ var cj02 = coordtransform.wgs84togcj02(data[i].lng, data[i].lat);//gps转火星定位
|
|
|
+ //convert cj02 to bd09
|
|
|
+ var bd09 = coordtransform.gcj02tobd09(cj02[0], cj02[1]);//火星转百度定位
|
|
|
+ var point = new plus.maps.Point(bd09[0], bd09[1]);
|
|
|
}else if(data[i].gps == 2){
|
|
|
- var baidulnglat = gcj02tobd09(data[i].lng, data[i].lat) //火星转百度定位
|
|
|
+ var baidulnglat = coordtransform.gcj02tobd09(data[i].lng, data[i].lat) //火星转百度定位
|
|
|
var point = new plus.maps.Point(baidulnglat[0], baidulnglat[1]);
|
|
|
}
|
|
|
+ }else if(data[i].equip_type == 5){
|
|
|
+ var bd09 = coordtransform.gcj02tobd09(data[i].lng, data[i].lat);//火星转百度定位
|
|
|
+ var point = new plus.maps.Point(bd09[0], bd09[1]);
|
|
|
}else{
|
|
|
var point = new plus.maps.Point(data[i].lng, data[i].lat);
|
|
|
}
|
|
|
@@ -385,9 +390,9 @@
|
|
|
var keycode = e.keyCode;
|
|
|
var searchName = $(this).val();
|
|
|
if(keycode=='13') {
|
|
|
- e.preventDefault();
|
|
|
- //请求搜索接口
|
|
|
+ //请求搜索接口
|
|
|
searchFun(searchName)
|
|
|
+ e.preventDefault();
|
|
|
}
|
|
|
});
|
|
|
document.getElementById('searchBtn').addEventListener('tap', function() {
|
|
|
@@ -396,10 +401,11 @@
|
|
|
})
|
|
|
|
|
|
function searchFun(imei){
|
|
|
+ map.clearOverlays(); //清除全部
|
|
|
if(imei) {
|
|
|
$.ajax({
|
|
|
type: "post",
|
|
|
- url: "http://120.27.222.26/home_map/map_locat",
|
|
|
+ url: "http://192.168.1.11:8000/home_map/map_locat",
|
|
|
data: {
|
|
|
req: "imei",
|
|
|
equip_id: imei
|
|
|
@@ -415,9 +421,7 @@
|
|
|
success: function(data) {
|
|
|
if(data == '0') {
|
|
|
mui.toast("没有找到该设备,请核对设备id!");
|
|
|
- map.clearOverlays(); //清除全部
|
|
|
} else {
|
|
|
- map.clearOverlays(); //清除全部
|
|
|
setmarker(data)
|
|
|
}
|
|
|
},
|