...
|
...
|
@@ -113,6 +113,11 @@ |
|
|
// 获取车辆位置信息
|
|
|
const vehicle = res.data.data.firstVcl;
|
|
|
// 在获取车辆位置成功的部分,创建信息窗口或者自定义标记
|
|
|
|
|
|
if (vehicle.lon && vehicle.lat) {
|
|
|
const lon = parseFloat(vehicle.lon) / 600000.0; // 将经度字符串转换为数值并除以 600000.0
|
|
|
const lat = parseFloat(vehicle.lat) / 600000.0; // 将纬度字符串转换为数值并除以 600000.0
|
|
|
//const coords = wgs84togcj02(lon, lat);
|
|
|
const markerContent = document.createElement('div');
|
|
|
markerContent.innerHTML = `
|
|
|
<div class="rounded-corner" STYLE="width: 200px;background-color: rgba(255,255,255,0.7);text-align: center">
|
...
|
...
|
@@ -121,10 +126,6 @@ |
|
|
<p>剩余距离:${vehicle.remainDistance}公里</p >
|
|
|
</div>
|
|
|
`;
|
|
|
if (vehicle.lon && vehicle.lat) {
|
|
|
const lon = parseFloat(vehicle.lon) / 600000.0; // 将经度字符串转换为数值并除以 600000.0
|
|
|
const lat = parseFloat(vehicle.lat) / 600000.0; // 将纬度字符串转换为数值并除以 600000.0
|
|
|
//const coords = wgs84togcj02(lon, lat);
|
|
|
// 添加车辆位置标记
|
|
|
const marker = new AMap.Marker({
|
|
|
position: [lon, lat],
|
...
|
...
|
|