|
@@ -478,11 +478,10 @@
|
478
|
478
|
<div class="geo_location_main" v-if="deviceDetailInfo.show">
|
479
|
479
|
<baidu-map
|
480
|
480
|
class="baidu_map"
|
481
|
|
- ak="2xUGaxSQ2TXTsPoiAtT9jZ88tsAl8qw2"
|
|
481
|
+ ak="lLhDEKNUgqLGxogN0Nf9WPWSbzkMl6ph"
|
482
|
482
|
:center="baiduMapInfo.center"
|
483
|
483
|
:zoom="baiduMapInfo.zoom"
|
484
|
484
|
:scroll-wheel-zoom="false"
|
485
|
|
- @ready="baiduMapReady"
|
486
|
485
|
>
|
487
|
486
|
<!--缩放-->
|
488
|
487
|
<bm-navigation anchor="BMAP_ANCHOR_TOP_LEFT"></bm-navigation>
|
|
@@ -514,8 +513,8 @@
|
514
|
513
|
>
|
515
|
514
|
<div v-if="item.address">地址:{{ item.address }}</div>
|
516
|
515
|
<div>时间:{{ item.createtime }}</div>
|
517
|
|
- <div>经度:{{ item.lng }}</div>
|
518
|
|
- <div>维度:{{ item.lat }}</div>
|
|
516
|
+ <!-- <div>经度:{{ item.lng }}</div>
|
|
517
|
+ <div>维度:{{ item.lat }}</div> -->
|
519
|
518
|
</bm-info-window>
|
520
|
519
|
</bm-marker>
|
521
|
520
|
</baidu-map>
|
|
@@ -1147,22 +1146,22 @@ export default {
|
1147
|
1146
|
this.deviceDetailInfo.username = row.username;
|
1148
|
1147
|
this.deviceDetailInfo.detail = data.obj;
|
1149
|
1148
|
let _positions = this.deviceDetailInfo.detail.positions;
|
|
1149
|
+ this.baiduMapInfo.positions = _positions.map((item, index) => {
|
|
1150
|
+ return {
|
|
1151
|
+ show: index === 0 ? true : false,
|
|
1152
|
+ address: item.address,
|
|
1153
|
+ lng: item.lon,
|
|
1154
|
+ lat: item.lat,
|
|
1155
|
+ createtime: item.createtime
|
|
1156
|
+ };
|
|
1157
|
+ });
|
1150
|
1158
|
if (_positions.length > 0) {
|
1151
|
|
- this.baiduMapInfo.positions = _positions.map((item) => {
|
1152
|
|
- return {
|
1153
|
|
- show: false,
|
1154
|
|
- address: "",
|
1155
|
|
- lng: item.lon,
|
1156
|
|
- lat: item.lat,
|
1157
|
|
- createtime: item.createtime
|
1158
|
|
- };
|
1159
|
|
- });
|
|
1159
|
+ let _firstItem = this.baiduMapInfo.positions[0];
|
1160
|
1160
|
this.baiduMapInfo.center = {
|
1161
|
|
- lng: this.baiduMapInfo.positions[0].lng,
|
1162
|
|
- lat: this.baiduMapInfo.positions[0].lat
|
|
1161
|
+ lng: _firstItem.lng,
|
|
1162
|
+ lat: _firstItem.lat
|
1163
|
1163
|
};
|
1164
|
1164
|
} else {
|
1165
|
|
- this.baiduMapInfo.positions = [];
|
1166
|
1165
|
this.baiduMapInfo.center = "郑州市";
|
1167
|
1166
|
}
|
1168
|
1167
|
this.initMemoryDetailEcharts();
|
|
@@ -1171,22 +1170,6 @@ export default {
|
1171
|
1170
|
}
|
1172
|
1171
|
});
|
1173
|
1172
|
},
|
1174
|
|
- baiduMapReady({ BMap }) {
|
1175
|
|
- const geocoder = new BMap.Geocoder();
|
1176
|
|
- this.baiduMapInfo.positions.forEach((pItem, pIndex) => {
|
1177
|
|
- let point = new BMap.Point(pItem.lng, pItem.lat);
|
1178
|
|
- geocoder.getLocation(point, (data) => {
|
1179
|
|
- if (pIndex === 0) {
|
1180
|
|
- pItem.show = true;
|
1181
|
|
- } else {
|
1182
|
|
- pItem.show = false;
|
1183
|
|
- }
|
1184
|
|
- if (data) {
|
1185
|
|
- pItem.address = data.address;
|
1186
|
|
- }
|
1187
|
|
- });
|
1188
|
|
- });
|
1189
|
|
- },
|
1190
|
1173
|
bmMarkerClick(item) {
|
1191
|
1174
|
this.baiduMapInfo.positions.forEach((pItem) => {
|
1192
|
1175
|
pItem.show = false;
|