Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
micro-customization-system
/
e-shield-h5
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit c970a609
authored
Dec 27, 2024
by
chenwq
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
百度点
1 parent
018410ed
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
52 additions
and
52 deletions
src/utils/mapgeo.js
src/views/fence.vue
src/views/index.vue
src/views/monitor.vue
src/views/replay.vue
src/utils/mapgeo.js
View file @
c970a60
...
...
@@ -35,16 +35,16 @@ const MAPGEO = {
let
initIdx
=
i
*
20
;
let
maxIdx
=
i
===
obj
.
times
-
1
?
obj
.
len
:
(
i
+
1
)
*
20
;
for
(
let
idx
=
initIdx
;
idx
<
maxIdx
;
idx
++
)
{
let
_lng
=
data
[
idx
].
lastlng
||
data
[
idx
].
e
lng
;
let
_lat
=
data
[
idx
].
lastlat
||
data
[
idx
].
e
lat
;
let
_lng
=
data
[
idx
].
lastlng
||
data
[
idx
].
b
lng
;
let
_lat
=
data
[
idx
].
lastlat
||
data
[
idx
].
b
lat
;
// 防止出现gps点:.00000的错误
if
(
Number
(
_lng
)
>
0
&&
Number
(
_lat
)
>
0
)
{
lnglatArr
.
push
([
_lng
,
_lat
]);
obj
.
realNum
++
;
}
// lnglatArr.push([
// data[idx].lastlng || data[idx].
e
lng,
// data[idx].lastlat || data[idx].
e
lat,
// data[idx].lastlng || data[idx].
b
lng,
// data[idx].lastlat || data[idx].
b
lat,
// ]);
}
(
function
(
initIdx
)
{
...
...
src/views/fence.vue
View file @
c970a60
...
...
@@ -147,12 +147,12 @@ export default defineComponent({
if
(
res
.
data
.
length
>
0
)
{
res
.
data
.
forEach
((
val
)
=>
{
currLnglat
.
value
=
mapContentRefs
.
value
.
getLngLat
(
val
[
"gpsLocation"
].
e
lng
,
val
[
"gpsLocation"
].
e
lat
val
[
"gpsLocation"
].
b
lng
,
val
[
"gpsLocation"
].
b
lat
);
// currLnglat.value = new window.AMap.LngLat(
// val["gpsLocation"].
e
lng,
// val["gpsLocation"].
e
lat
// val["gpsLocation"].
b
lng,
// val["gpsLocation"].
b
lat
// );
drawMarker
(
currLnglat
.
value
);
});
...
...
src/views/index.vue
View file @
c970a60
...
...
@@ -374,35 +374,35 @@ export default defineComponent({
res
.
data
.
forEach
((
item
)
=>
{
item
.
locationType
=
"gpsLocation"
;
// 如果gps信息没有,则展示基站信息
if
(
!
item
.
gpsLocation
||
!
item
.
gpsLocation
.
e
lng
)
{
if
(
!
item
.
gpsLocation
||
!
item
.
gpsLocation
.
b
lng
)
{
item
.
locationType
=
"bsLocation"
;
}
if
(
item
.
gpsLocation
&&
item
.
gpsLocation
.
e
lng
&&
item
.
gpsLocation
.
e
lat
&&
Number
(
item
.
gpsLocation
.
e
lng
)
>
0
&&
Number
(
item
.
gpsLocation
.
e
lat
)
>
0
item
.
gpsLocation
.
b
lng
&&
item
.
gpsLocation
.
b
lat
&&
Number
(
item
.
gpsLocation
.
b
lng
)
>
0
&&
Number
(
item
.
gpsLocation
.
b
lat
)
>
0
)
{
locates
.
push
(
item
.
gpsLocation
);
item
.
gpsLocation
.
transferAddress
=
""
;
}
if
(
item
.
bsLocation
&&
item
.
bsLocation
.
e
lng
&&
item
.
bsLocation
.
e
lat
&&
Number
(
item
.
bsLocation
.
e
lng
)
>
0
&&
Number
(
item
.
bsLocation
.
e
lat
)
>
0
item
.
bsLocation
.
b
lng
&&
item
.
bsLocation
.
b
lat
&&
Number
(
item
.
bsLocation
.
b
lng
)
>
0
&&
Number
(
item
.
bsLocation
.
b
lat
)
>
0
)
{
locates
.
push
(
item
.
bsLocation
);
item
.
bsLocation
.
transferAddress
=
""
;
}
if
(
item
.
wifiLocation
&&
item
.
wifiLocation
.
e
lng
&&
item
.
wifiLocation
.
e
lat
&&
Number
(
item
.
wifiLocation
.
e
lng
)
>
0
&&
Number
(
item
.
wifiLocation
.
e
lat
)
>
0
item
.
wifiLocation
.
b
lng
&&
item
.
wifiLocation
.
b
lat
&&
Number
(
item
.
wifiLocation
.
b
lng
)
>
0
&&
Number
(
item
.
wifiLocation
.
b
lat
)
>
0
)
{
locates
.
push
(
item
.
wifiLocation
);
item
.
wifiLocation
.
transferAddress
=
""
;
...
...
@@ -433,15 +433,15 @@ export default defineComponent({
//修改数据格式方便获取
locates
.
forEach
((
val
)
=>
{
if
(
val
.
elat
===
item
[
item
.
locationType
].
e
lat
&&
val
.
elng
===
item
[
item
.
locationType
].
e
lng
val
.
blat
===
item
[
item
.
locationType
].
b
lat
&&
val
.
blng
===
item
[
item
.
locationType
].
b
lng
)
{
item
[
item
.
locationType
].
transferAddress
=
val
.
transferAddress
;
}
});
var
lnglat
=
mapContentRefs
.
value
.
getLngLat
(
item
[
item
.
locationType
].
e
lng
,
item
[
item
.
locationType
].
e
lat
item
[
item
.
locationType
].
b
lng
,
item
[
item
.
locationType
].
b
lat
);
var
marker
=
mapContentRefs
.
value
.
mapMarker
({
point
:
lnglat
,
...
...
@@ -453,8 +453,8 @@ export default defineComponent({
});
// mapContentRefs.value.mapMarker({point: lnglat, icon: item.source == "0" ? require("@/assets/images/curr-marker.gif") : require("@/assets/images/curr-marker.gif"), sizeW: 24, sizeH: 24, imgW: 24, imgH: 24})
// var lnglat = new window.AMap.LngLat(
// item[item.locationType].
e
lng,
// item[item.locationType].
e
lat
// item[item.locationType].
b
lng,
// item[item.locationType].
b
lat
// );
// console.log(lnglat)
// var marker = window.mapapi.invoke('Marker', lnglat, {
...
...
@@ -617,8 +617,8 @@ export default defineComponent({
let
gpsObj
=
item
[
"gpsLocation"
];
if
(
gpsObj
)
{
var
newLnglat
=
mapContentRefs
.
value
.
getLngLat
(
gpsObj
.
e
lng
,
gpsObj
.
e
lat
gpsObj
.
b
lng
,
gpsObj
.
b
lat
);
GPSIcon
&&
GPSIcon
.
classList
.
add
(
"active"
);
GPRSIcon
&&
GPRSIcon
.
classList
.
remove
(
"active"
);
...
...
@@ -643,8 +643,8 @@ export default defineComponent({
WIFIIcon
&&
WIFIIcon
.
classList
.
remove
(
"active"
);
item
.
locationType
=
"bsLocation"
;
var
newLnglat
=
mapContentRefs
.
value
.
getLngLat
(
gprsObj
.
e
lng
,
gprsObj
.
e
lat
gprsObj
.
b
lng
,
gprsObj
.
b
lat
);
setAddress
();
setOnlineTime
();
...
...
@@ -661,12 +661,12 @@ export default defineComponent({
let
wifiObj
=
item
[
"wifiLocation"
];
if
(
wifiObj
)
{
// var newLnglat = new window.AMap.LngLat(
// wifiObj.
e
lng,
// wifiObj.
e
lat
// wifiObj.
b
lng,
// wifiObj.
b
lat
// );
var
newLnglat
=
mapContentRefs
.
value
.
getLngLat
(
wifiObj
.
e
lng
,
wifiObj
.
e
lat
wifiObj
.
b
lng
,
wifiObj
.
b
lat
);
WIFIIcon
&&
WIFIIcon
.
classList
.
add
(
"active"
);
GPSIcon
&&
GPSIcon
.
classList
.
remove
(
"active"
);
...
...
@@ -775,8 +775,8 @@ export default defineComponent({
// 跳转小程序
const
jumpToMiniProgram
=
(
page
,
tabItem
,
item
)
=>
{
if
(
page
==
"tracking"
)
{
let
lng
=
item
[
item
.
locationType
].
e
lng
;
let
lat
=
item
[
item
.
locationType
].
e
lat
;
let
lng
=
item
[
item
.
locationType
].
b
lng
;
let
lat
=
item
[
item
.
locationType
].
b
lat
;
let
address
=
item
[
item
.
locationType
].
transferAddress
;
wx
.
miniProgram
.
navigateTo
({
url
:
`../../mapPackage/pages/tracking?lat=
${
lat
}
&lng=
${
lng
}
&address=
${
address
}
`
,
...
...
src/views/monitor.vue
View file @
c970a60
...
...
@@ -144,10 +144,10 @@ export default {
// marker渲染
const
init
=
(
currentMap
,
data
)
=>
{
data
.
forEach
((
val
)
=>
{
(
val
.
e
lat
=
val
[
routeQuery
.
locationType
]
&&
val
[
routeQuery
.
locationType
].
e
lat
),
(
val
.
e
lng
=
val
[
routeQuery
.
locationType
]
&&
val
[
routeQuery
.
locationType
].
e
lng
);
(
val
.
b
lat
=
val
[
routeQuery
.
locationType
]
&&
val
[
routeQuery
.
locationType
].
b
lat
),
(
val
.
b
lng
=
val
[
routeQuery
.
locationType
]
&&
val
[
routeQuery
.
locationType
].
b
lng
);
val
.
time
=
val
[
routeQuery
.
locationType
]
&&
val
[
routeQuery
.
locationType
].
dateTime
;
});
...
...
@@ -158,16 +158,16 @@ export default {
},
()
=>
{
data
.
forEach
((
val
)
=>
{
// val.
elng = +val.e
lng + Math.random(0,9) * 0.0001 * iii.value
// val.
elat = +val.e
lat + Math.random(0,9) * 0.0001 * iii.value
// val.
blng = +val.b
lng + Math.random(0,9) * 0.0001 * iii.value
// val.
blat = +val.b
lat + Math.random(0,9) * 0.0001 * iii.value
// iii.value = iii.value + 1
// var lnglat = new window.AMap.LngLat(val.
elng, val.e
lat);
var
lnglat
=
mapContentRefs
.
value
.
getLngLat
(
val
.
elng
,
val
.
e
lat
);
// var lnglat = new window.AMap.LngLat(val.
blng, val.b
lat);
var
lnglat
=
mapContentRefs
.
value
.
getLngLat
(
val
.
blng
,
val
.
b
lat
);
polyLineArr
.
value
.
push
(
lnglat
);
locationList
.
value
.
push
(
val
);
if
(
!
carMarker
)
{
firstPosLng
=
val
.
e
lng
;
firstPosLat
=
val
.
e
lat
;
firstPosLng
=
val
.
b
lng
;
firstPosLat
=
val
.
b
lat
;
carMarker
=
mapContentRefs
.
value
.
mapMarker
({
point
:
lnglat
,
icon
:
require
(
"@/assets/images/car.png"
),
...
...
@@ -204,7 +204,7 @@ export default {
}
else
{
// carMarker.setPosition(lnglat);
window
.
mapapi
.
invoke
(
"markerSetPosition"
,
carMarker
,
lnglat
);
if
(
firstPosLng
!==
val
.
elng
||
firstPosLat
!==
val
.
e
lat
)
{
if
(
firstPosLng
!==
val
.
blng
||
firstPosLat
!==
val
.
b
lat
)
{
// beginMarker.show();
window
.
mapapi
.
invoke
(
"addOverlay"
,
beginMarker
);
}
...
...
src/views/replay.vue
View file @
c970a60
...
...
@@ -199,8 +199,8 @@ export default defineComponent({
var
replayData
=
[];
res
.
data
.
forEach
((
item
)
=>
{
var
arr
=
[];
arr
.
push
(
item
.
e
lng
);
arr
.
push
(
item
.
e
lat
);
arr
.
push
(
item
.
b
lng
);
arr
.
push
(
item
.
b
lat
);
replayData
.
push
(
arr
);
});
replayList
.
value
=
replayData
;
...
...
@@ -455,8 +455,8 @@ export default defineComponent({
// return `<div class="navg-info-window">
// <div class="tit">${item.dateTime}</div>
// <div class="main">
// <p><span class="lb">经度</span>${item.
e
lng}</p>
// <p><span class="lb">纬度</span>${item.
e
lat}</p>
// <p><span class="lb">经度</span>${item.
b
lng}</p>
// <p><span class="lb">纬度</span>${item.
b
lat}</p>
// <p><span class="lb">速度</span>${item.speed} km/h</p>
// </div>
// </div>`;
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment