|
|
|
|
|
|
|
|
// 两秒钟获取一次数据 |
|
|
// 两秒钟获取一次数据 |
|
|
data.socket = setInterval(() => { |
|
|
data.socket = setInterval(() => { |
|
|
getTrackData().then(({ trackList }) => { |
|
|
getTrackData().then(({ trackList }) => { |
|
|
const obj = trackList[0] |
|
|
|
|
|
|
|
|
const len = trackList.length |
|
|
|
|
|
const obj = trackList[len - 1] |
|
|
const coordinate = fromLonLat([obj?.lng, obj?.lat]) |
|
|
const coordinate = fromLonLat([obj?.lng, obj?.lat]) |
|
|
if (data.trackInfo) { |
|
|
if (data.trackInfo) { |
|
|
data.trackInfo.route.appendCoordinate(coordinate) |
|
|
data.trackInfo.route.appendCoordinate(coordinate) |