自绘路线
This commit is contained in:
@ -1,10 +1,12 @@
|
||||
<script setup>
|
||||
// import HelloWorld from "./components/HelloWorld.vue";
|
||||
import Map from "./components/Map.vue";
|
||||
import AddFence from "./components/AddFence.vue";
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Map />
|
||||
<!-- <AddFence /> -->
|
||||
</template>
|
||||
|
||||
<style scoped></style>
|
||||
|
BIN
src/assets/end.png
Normal file
BIN
src/assets/end.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.1 KiB |
BIN
src/assets/endRoute.png
Normal file
BIN
src/assets/endRoute.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.7 KiB |
BIN
src/assets/mark_bs.png
Normal file
BIN
src/assets/mark_bs.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.4 KiB |
BIN
src/assets/start.png
Normal file
BIN
src/assets/start.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 910 B |
BIN
src/assets/startRoute.png
Normal file
BIN
src/assets/startRoute.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.4 KiB |
87
src/components/AddFence.vue
Normal file
87
src/components/AddFence.vue
Normal file
@ -0,0 +1,87 @@
|
||||
<template>
|
||||
<div id="map-container"></div>
|
||||
</template>
|
||||
<script setup name="AddFence">
|
||||
import AMapLoader from "@amap/amap-jsapi-loader";
|
||||
import { onMounted, ref, shallowRef } from "vue";
|
||||
const map = shallowRef(null);
|
||||
const AMap = shallowRef(null);
|
||||
const fencePaths = ref([]);
|
||||
const fencePolygon = shallowRef(null);
|
||||
const turningPointMarkerList = ref([]);
|
||||
// 初始化地图
|
||||
const initMap = async () => {
|
||||
try {
|
||||
AMap.value = await AMapLoader.load({
|
||||
key: "377d7c36dd385e2a722f29d4c6e1ffbf", // 申请好的Web端开发者Key,首次调用 load 时必填
|
||||
// key: "7891f1238368a895ff1967c79643102d", // 申请好的Web端开发者Key,首次调用 load 时必填
|
||||
version: "2.0", // 指定要加载的 JSAPI 的版本,缺省时默认为 1.4.15
|
||||
plugins: [
|
||||
// "AMap.Driving",
|
||||
"AMap.Scale",
|
||||
// "AMap.PlaceSearch",
|
||||
// "AMap.AutoComplete",
|
||||
// "AMap.Geocoder",
|
||||
// "AMap.TruckDriving",
|
||||
], // 需要使用的的插件列表,如比例尺'AMap.Scale'等
|
||||
AMapUI: {
|
||||
// 是否加载 AMapUI,缺省不加载
|
||||
version: "1.1", // AMapUI 版本
|
||||
plugins: ["overlay/SimpleMarker"], // 需要加载的 AMapUI ui插件
|
||||
},
|
||||
Loca: {
|
||||
// 是否加载 Loca, 缺省不加载
|
||||
version: "2.0", // Loca 版本
|
||||
},
|
||||
});
|
||||
|
||||
map.value = new AMap.value.Map("map-container", {
|
||||
zoom: 16, // 缩放级别
|
||||
center: [117.290345, 31.797813], // 中心点
|
||||
});
|
||||
fencePolygon.value = new AMap.value.Polygon({});
|
||||
map.value.add(fencePolygon.value);
|
||||
map.value.on("click", handleMapClick);
|
||||
// city: "010", //城市设为北京,默认:“全国”
|
||||
// radius: 1000, //范围,默认:500
|
||||
// AMap.value.Event.addListener(placeSearch.value, "markerClick", (e) => {
|
||||
// //添加事件
|
||||
// console.log(e); //获取点标注位置
|
||||
// });
|
||||
|
||||
map.value.addControl(new AMap.value.Scale());
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
};
|
||||
const handleMapClick = (ev) => {
|
||||
console.log(ev);
|
||||
// console.log(AMap.value.GeometryUtil);
|
||||
fencePaths.value.push(ev.lnglat);
|
||||
|
||||
console.log(
|
||||
JSON.stringify(
|
||||
fencePaths.value.map((el) => new AMap.value.LngLat(el.lng, el.lat))
|
||||
)
|
||||
);
|
||||
// console.log(
|
||||
// AMap.value.GeometryUtil.makesureClockwise(
|
||||
// fencePaths.value.map((el) => new AMap.value.LngLat(el.lng, el.lat))
|
||||
// )
|
||||
// );
|
||||
fencePolygon.value.setPath(
|
||||
// AMap.value.GeometryUtil.makesureClockwise(
|
||||
fencePaths.value.map((el) => new AMap.value.LngLat(el.lng, el.lat))
|
||||
// )
|
||||
);
|
||||
};
|
||||
onMounted(() => {
|
||||
initMap();
|
||||
});
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
#map-container {
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
}
|
||||
</style>
|
@ -40,7 +40,7 @@
|
||||
v-for="item in searchTips"
|
||||
:key="item.id"
|
||||
class="suggestion-item"
|
||||
@click="searchPoint(item.name)"
|
||||
@click="searchPoint(item.name, 'start')"
|
||||
>
|
||||
{{ item.name }}
|
||||
</div>
|
||||
@ -48,11 +48,10 @@
|
||||
<el-input
|
||||
v-model="formData.startName"
|
||||
size="small"
|
||||
@keydown.enter="searchPoint(formData.startName)"
|
||||
@input="getAutoComplete"
|
||||
@keydown.enter="searchPoint(formData.startName, 'start')"
|
||||
@input="handleInput('start', $event)"
|
||||
@focus="
|
||||
nowSearch = 'start';
|
||||
// map.clearMap();
|
||||
showStartSuggestion = true;
|
||||
"
|
||||
@blur="
|
||||
@ -78,7 +77,7 @@
|
||||
v-for="item in searchTips"
|
||||
:key="item.id"
|
||||
class="suggestion-item"
|
||||
@click="searchPoint(item.name)"
|
||||
@click="searchPoint(item.name, 'end')"
|
||||
>
|
||||
{{ item.name }}
|
||||
</div>
|
||||
@ -86,8 +85,8 @@
|
||||
<el-input
|
||||
v-model="formData.endName"
|
||||
size="small"
|
||||
@input="map.clearMap(), getAutoComplete"
|
||||
@keydown.enter="searchPoint(formData.endName)"
|
||||
@input="getAutoComplete"
|
||||
@keydown.enter="searchPoint(formData.endName, 'end')"
|
||||
@focus="
|
||||
nowSearch = 'end';
|
||||
// map.clearMap();
|
||||
@ -127,24 +126,31 @@
|
||||
<el-button type="primary" @click="searchRoute" size="small"
|
||||
>查询</el-button
|
||||
>
|
||||
<!-- <ElButton type="success" @click="searchStartPoint">搜索</ElButton> -->
|
||||
</el-row>
|
||||
<el-tabs v-model="activeTabName" @tab-click="handleTabClick">
|
||||
<el-tabs
|
||||
v-if="showStepPane"
|
||||
v-model="activeTabName"
|
||||
@tab-click="handleTabClick"
|
||||
>
|
||||
<!-- :disabled="!stepsList.length" -->
|
||||
<el-tab-pane label="费用最低" name="LEAST_FEE">
|
||||
<div v-for="item in routeList" :key="item.start_location.lng">
|
||||
{{ item.instruction }}
|
||||
</div>
|
||||
<div id="panel"></div>
|
||||
</el-tab-pane>
|
||||
<!-- :disabled="!stepsList.length" -->
|
||||
<el-tab-pane label="时间最短" name="LEAST_TIME">
|
||||
<route-step-list
|
||||
:steps-list="stepsList"
|
||||
:route-ext-data="routeExtData"
|
||||
@step-click="handleRouteClick"
|
||||
/></el-tab-pane>
|
||||
<!-- :disabled="!stepsList.length" -->
|
||||
<el-tab-pane label="距离最短" name="LEAST_DISTANCE">
|
||||
<route-step-list
|
||||
:steps-list="stepsList"
|
||||
:route-ext-data="routeExtData"
|
||||
@step-click="handleRouteClick"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="时间最短" name="LEAST_TIME"
|
||||
><div v-for="item in routeList" :key="item.start_location.lng">
|
||||
{{ item.instruction }}
|
||||
</div></el-tab-pane
|
||||
>
|
||||
<el-tab-pane label="距离最短" name="LEAST_DISTANCE"
|
||||
><div v-for="item in routeList" :key="item.start_location.lng">
|
||||
{{ item.instruction }}
|
||||
</div></el-tab-pane
|
||||
>
|
||||
</el-tabs>
|
||||
</el-drawer>
|
||||
<el-button
|
||||
@ -157,24 +163,39 @@
|
||||
</template>
|
||||
<script setup>
|
||||
import AMapLoader from "@amap/amap-jsapi-loader";
|
||||
import startPng from "../assets/start.png";
|
||||
import endPng from "../assets/end.png";
|
||||
import startRoutePng from "../assets/startRoute.png";
|
||||
import endRoutePng from "../assets/endRoute.png";
|
||||
import { ArrowLeftBold, ArrowRightBold } from "@element-plus/icons-vue";
|
||||
import markBsPng from "../assets/mark_bs.png";
|
||||
import { ElMessage } from "element-plus";
|
||||
import { computed, onMounted, reactive, ref, shallowRef, toRefs } from "vue";
|
||||
import RouteStepList from "./RouteStepList.vue";
|
||||
|
||||
import { onMounted, reactive, ref, shallowRef, toRefs } from "vue";
|
||||
const carType = ref("car"); // car: 小车, truck: 卡车
|
||||
const map = shallowRef(null);
|
||||
const driving = shallowRef(null);
|
||||
const truckDriving = shallowRef(null);
|
||||
const startMarker = shallowRef(null);
|
||||
const endMarker = shallowRef(null);
|
||||
const geocoder = shallowRef(null);
|
||||
const routeList = ref([]);
|
||||
const AMap = shallowRef(null);
|
||||
const carType = ref("car"); // car: 小车, truck: 卡车
|
||||
const driving = shallowRef(null); // 驾车路线规划插件
|
||||
const truckDriving = shallowRef(null); // 卡车路线规划插件
|
||||
const geocoder = shallowRef(null); // 经纬度转地址插件
|
||||
const placeSearch = shallowRef(null); // 地点搜索插件
|
||||
const autoComplete = shallowRef(null); // 搜索建议插件
|
||||
const startMarker = shallowRef(null); // 起点标记
|
||||
const endMarker = shallowRef(null); // 终点标记
|
||||
|
||||
const searchResultMarkers = ref([]); // 搜索结果表笔列表
|
||||
const stepsPolylines = ref([]); // 路线步骤标记列表
|
||||
const stepsList = ref([]);
|
||||
const showStepPane = computed(
|
||||
() =>
|
||||
formData.value.startLngLat.length === 2 &&
|
||||
formData.value.endLngLat.length === 2
|
||||
);
|
||||
const routePlugins = {
|
||||
car: driving,
|
||||
truck: truckDriving,
|
||||
};
|
||||
const placeSearch = shallowRef(null);
|
||||
const autoComplete = shallowRef(null);
|
||||
const drawer = ref(true);
|
||||
const routeFormRef = ref(null);
|
||||
const searchTips = ref([]);
|
||||
@ -182,7 +203,7 @@ const nowSearch = ref("");
|
||||
const showStartSuggestion = ref(false);
|
||||
const showEndSuggestion = ref(false);
|
||||
const activeTabName = ref("LEAST_FEE");
|
||||
const routePolicy = ref("LEAST_FEE");
|
||||
|
||||
const data = reactive({
|
||||
formData: {
|
||||
startLngLat: [],
|
||||
@ -190,11 +211,19 @@ const data = reactive({
|
||||
endName: "",
|
||||
endLngLat: [],
|
||||
},
|
||||
routeExtData: {
|
||||
distance: 0,
|
||||
time: 0,
|
||||
policy: "",
|
||||
},
|
||||
});
|
||||
|
||||
const { formData } = toRefs(data);
|
||||
const initMap = () => {
|
||||
AMapLoader.load({
|
||||
const { formData, routeExtData } = toRefs(data);
|
||||
|
||||
// 初始化地图
|
||||
const initMap = async () => {
|
||||
try {
|
||||
AMap.value = await AMapLoader.load({
|
||||
key: "377d7c36dd385e2a722f29d4c6e1ffbf", // 申请好的Web端开发者Key,首次调用 load 时必填
|
||||
// key: "7891f1238368a895ff1967c79643102d", // 申请好的Web端开发者Key,首次调用 load 时必填
|
||||
version: "2.0", // 指定要加载的 JSAPI 的版本,缺省时默认为 1.4.15
|
||||
@ -204,6 +233,7 @@ const initMap = () => {
|
||||
"AMap.PlaceSearch",
|
||||
"AMap.AutoComplete",
|
||||
"AMap.Geocoder",
|
||||
"AMap.TruckDriving",
|
||||
], // 需要使用的的插件列表,如比例尺'AMap.Scale'等
|
||||
AMapUI: {
|
||||
// 是否加载 AMapUI,缺省不加载
|
||||
@ -214,49 +244,76 @@ const initMap = () => {
|
||||
// 是否加载 Loca, 缺省不加载
|
||||
version: "2.0", // Loca 版本
|
||||
},
|
||||
})
|
||||
.then((AMap) => {
|
||||
console.log(AMap.DrivingPolicy);
|
||||
|
||||
map.value = new AMap.Map("map-container", {
|
||||
zoom: 16, //级别
|
||||
center: [117.290345, 31.797813],
|
||||
});
|
||||
|
||||
// 加载插件
|
||||
driving.value = new AMap.Driving({
|
||||
map.value = new AMap.value.Map("map-container", {
|
||||
zoom: 16, // 缩放级别
|
||||
center: [117.290345, 31.797813], // 中心点
|
||||
city: "合肥",
|
||||
});
|
||||
window.mapins = map.value;
|
||||
/** 加载插件 */
|
||||
// 驾车路线规划插件
|
||||
driving.value = new AMap.value.Driving({
|
||||
// 驾车路线规划策略,AMap.DrivingPolicy.LEAST_TIME是最快捷模式
|
||||
policy: AMap.DrivingPolicy.LEAST_TIME,
|
||||
map: map.value,
|
||||
// policy: AMap.DrivingPolicy.MULTI_POLICIES,
|
||||
// map: map.value,
|
||||
panel: "panel",
|
||||
});
|
||||
placeSearch.value = new AMap.PlaceSearch({
|
||||
map: map.value,
|
||||
});
|
||||
autoComplete.value = new AMap.AutoComplete({});
|
||||
|
||||
startMarker.value = new AMap.Marker();
|
||||
endMarker.value = new AMap.Marker();
|
||||
geocoder.value = new AMap.Geocoder();
|
||||
// 卡车路线规划插件 TODO:
|
||||
truckDriving.value = new AMap.value.TruckDriving({ map: map.value });
|
||||
// 地点搜索插件
|
||||
placeSearch.value = new AMap.value.PlaceSearch({
|
||||
// map: map.value,
|
||||
});
|
||||
geocoder.value = new AMap.value.Geocoder();
|
||||
// 搜索建议插件
|
||||
autoComplete.value = new AMap.value.AutoComplete({});
|
||||
/** 加载插件结束 */
|
||||
|
||||
startMarker.value = new AMap.value.Marker({
|
||||
icon: startPng,
|
||||
anchor: "bottom-center",
|
||||
});
|
||||
endMarker.value = new AMap.value.Marker({
|
||||
icon: endPng,
|
||||
anchor: "bottom-center",
|
||||
});
|
||||
// city: "010", //城市设为北京,默认:“全国”
|
||||
// radius: 1000, //范围,默认:500
|
||||
AMap.Event.addListener(placeSearch.value, "markerClick", (e) => {
|
||||
AMap.value.Event.addListener(placeSearch.value, "markerClick", (e) => {
|
||||
//添加事件
|
||||
console.log(e); //获取点标注位置
|
||||
if (nowSearch.value === "start") {
|
||||
formData.value.startName = e.data.name;
|
||||
formData.value.startLngLat = [
|
||||
e.data.location.lng,
|
||||
e.data.location.lat,
|
||||
];
|
||||
formData.value.startLngLat = [e.data.location.lng, e.data.location.lat];
|
||||
} else if (nowSearch.value === "end") {
|
||||
formData.value.endName = e.data.name;
|
||||
formData.value.endLngLat = [e.data.location.lng, e.data.location.lat];
|
||||
}
|
||||
});
|
||||
map.value.on("click", (ev) => {
|
||||
map.value.on("click", handleMapClick);
|
||||
map.value.addControl(new AMap.value.Scale());
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
};
|
||||
|
||||
const handleInput = (type, data) => {
|
||||
getAutoComplete(data);
|
||||
};
|
||||
|
||||
// 地图点击
|
||||
const handleMapClick = (ev) => {
|
||||
// 起点输入框 focus 时
|
||||
if (nowSearch.value === "start") {
|
||||
map.value.clearMap();
|
||||
if (formData.value.endLngLat.length === 2) {
|
||||
map.value.add(endMarker.value);
|
||||
}
|
||||
startMarker.value.setPosition(
|
||||
new AMap.LngLat(ev.lnglat.lng, ev.lnglat.lat)
|
||||
new AMap.value.LngLat(ev.lnglat.lng, ev.lnglat.lat)
|
||||
);
|
||||
map.value.add(startMarker.value);
|
||||
regeoCode([ev.lnglat.lng, ev.lnglat.lat])
|
||||
@ -267,9 +324,15 @@ const initMap = () => {
|
||||
formData.value.startName = `${ev.lnglat.lng}, ${ev.lnglat.lat}`;
|
||||
});
|
||||
formData.value.startLngLat = [ev.lnglat.lng, ev.lnglat.lat];
|
||||
} else if (nowSearch.value === "end") {
|
||||
}
|
||||
// 终点输入框 focus 时
|
||||
else if (nowSearch.value === "end") {
|
||||
map.value.clearMap();
|
||||
if (formData.value.startLngLat.length === 2) {
|
||||
map.value.add(startMarker.value);
|
||||
}
|
||||
endMarker.value.setPosition(
|
||||
new AMap.LngLat(ev.lnglat.lng, ev.lnglat.lat)
|
||||
new AMap.value.LngLat(ev.lnglat.lng, ev.lnglat.lat)
|
||||
);
|
||||
map.value.add(endMarker.value);
|
||||
regeoCode([ev.lnglat.lng, ev.lnglat.lat])
|
||||
@ -277,22 +340,46 @@ const initMap = () => {
|
||||
formData.value.endName = address;
|
||||
})
|
||||
.catch(() => {
|
||||
// formData.value.startName = `${ev.lnglat.lng}, ${ev.lnglat.lat}`;
|
||||
formData.value.endName = `${ev.lnglat.lng}, ${ev.lnglat.lat}`;
|
||||
});
|
||||
formData.value.endLngLat = [ev.lnglat.lng, ev.lnglat.lat];
|
||||
}
|
||||
});
|
||||
map.value.addControl(new AMap.Scale());
|
||||
console.log(map.value.getAllOverlays());
|
||||
} else {
|
||||
map.value.add(
|
||||
new AMap.value.Marker({
|
||||
position: new AMap.value.LngLat(ev.lnglat.lng, ev.lnglat.lat),
|
||||
// icon: markBsPng,
|
||||
content: `
|
||||
<div
|
||||
style="
|
||||
background-image: url(${markBsPng});
|
||||
width: 19px;
|
||||
height: 31px;
|
||||
background-size: cover;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
font-size: 12px;
|
||||
padding-top: 3px;
|
||||
"
|
||||
>
|
||||
1
|
||||
</div>
|
||||
`,
|
||||
anchor: "bottom-center",
|
||||
})
|
||||
.catch((e) => {
|
||||
console.error(e); //加载错误提示
|
||||
});
|
||||
);
|
||||
}
|
||||
};
|
||||
const handleRouteClick = (data, index) => {
|
||||
console.log(data, index);
|
||||
map.value.setFitView([stepsPolylines.value[index]]);
|
||||
};
|
||||
const routeFixView = (idx) => {
|
||||
console.log(idx);
|
||||
map.value.setFitView(stepsPolylines.value[idx]);
|
||||
};
|
||||
|
||||
// 根据经纬度获取地址
|
||||
const regeoCode = (lnglat) => {
|
||||
const regeoCode = (lnglat /** [lng, lat] */) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
geocoder.value.getAddress(lnglat, (status, result) => {
|
||||
if (status === "complete" && result.regeocode) {
|
||||
@ -304,15 +391,8 @@ const regeoCode = (lnglat) => {
|
||||
});
|
||||
});
|
||||
};
|
||||
const addMark = (data) => {
|
||||
const marker = new AMap.Marker({
|
||||
position: new AMap.LngLat(data.lng, data.lat), // 经纬度对象,也可以是经纬度构成的一维数组[116.39, 39.9]
|
||||
// title: "北京",
|
||||
// content: "<b>起</b>",
|
||||
});
|
||||
map.value.add(marker);
|
||||
};
|
||||
|
||||
// tab点击事件
|
||||
const handleTabClick = (tab, ev) => {
|
||||
activeTabName.value = tab.paneName;
|
||||
if (formData.value.startLngLat.length && formData.value.endLngLat.length) {
|
||||
@ -327,6 +407,11 @@ const clearRoute = () => {
|
||||
if (routeFormRef.value) {
|
||||
routeFormRef.value.resetFields();
|
||||
}
|
||||
formData.value.startLngLat = [];
|
||||
formData.value.endLngLat = [];
|
||||
stepsList.value = [];
|
||||
routeExtData.value = {};
|
||||
map.value.clearMap();
|
||||
};
|
||||
|
||||
// 搜索路线
|
||||
@ -334,14 +419,18 @@ const searchRoute = () => {
|
||||
if (!driving.value) return;
|
||||
return new Promise((resolve, reject) => {
|
||||
map.value.clearMap();
|
||||
driving.value.opt.policy = AMap.DrivingPolicy[activeTabName.value];
|
||||
driving.value.opt.policy = AMap.value.DrivingPolicy[activeTabName.value];
|
||||
const startLngLat = formData.value.startLngLat;
|
||||
const endLngLat = formData.value.endLngLat;
|
||||
driving.value.search(startLngLat, endLngLat, (status, result) => {
|
||||
// 未出错时,result即是对应的路线规划方案
|
||||
if (status === "complete") {
|
||||
routeList.value = result.routes[0].steps;
|
||||
console.log(result.routes);
|
||||
stepsList.value = result.routes[0].steps;
|
||||
routeExtData.value.distance = result.routes[0].distance;
|
||||
routeExtData.value.time = result.routes[0].time;
|
||||
routeExtData.value.policy = result.routes[0].policy;
|
||||
console.log(result);
|
||||
drawRoute(result);
|
||||
resolve(result);
|
||||
} else {
|
||||
reject("获取路线失败");
|
||||
@ -349,6 +438,60 @@ const searchRoute = () => {
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
// 绘制路线
|
||||
const drawRoute = (result) => {
|
||||
const startLngLat = formData.value.startLngLat;
|
||||
const endLngLat = formData.value.endLngLat;
|
||||
map.value.add(startMarker.value);
|
||||
new AMap.value.Polyline({
|
||||
map: map.value,
|
||||
strokeWeight: 8,
|
||||
strokeOpacity: 1,
|
||||
strokeColor: "#808080",
|
||||
strokeStyle: "dashed",
|
||||
path: [
|
||||
new AMap.value.LngLat(...startLngLat),
|
||||
new AMap.value.LngLat(
|
||||
result.routes[0].steps[0].start_location.lng,
|
||||
result.routes[0].steps[0].start_location.lat
|
||||
),
|
||||
],
|
||||
});
|
||||
new AMap.value.Polyline({
|
||||
map: map.value,
|
||||
strokeWeight: 8,
|
||||
strokeOpacity: 1,
|
||||
strokeColor: "#808080",
|
||||
strokeStyle: "dashed",
|
||||
path: [
|
||||
new AMap.value.LngLat(
|
||||
result.routes[0].steps[
|
||||
result.routes[0].steps.length - 1
|
||||
].end_location.lng,
|
||||
result.routes[0].steps[
|
||||
result.routes[0].steps.length - 1
|
||||
].end_location.lat
|
||||
),
|
||||
new AMap.value.LngLat(...endLngLat),
|
||||
],
|
||||
});
|
||||
|
||||
stepsPolylines.value = result.routes[0].steps.map((el) => {
|
||||
return new AMap.value.Polyline({
|
||||
map: map.value,
|
||||
strokeWeight: 8,
|
||||
strokeOpacity: 1,
|
||||
strokeColor: "#1bac2e",
|
||||
showDir: true,
|
||||
path: el.path.map((item) => new AMap.value.LngLat(item.lng, item.lat)),
|
||||
});
|
||||
});
|
||||
map.value.add(endMarker.value);
|
||||
map.value.setFitView(stepsPolylines.value);
|
||||
};
|
||||
|
||||
// 切换左侧面板显示隐藏
|
||||
const switchDrawer = () => {
|
||||
drawer.value = !drawer.value;
|
||||
if (drawer.value) {
|
||||
@ -361,7 +504,9 @@ const switchDrawer = () => {
|
||||
"translate(0, -50%)";
|
||||
}
|
||||
};
|
||||
const searchPoint = (val /** 搜索建议选项 */) => {
|
||||
|
||||
// 根据名称搜索地图标点
|
||||
const searchPoint = (val /** 搜索建议选项 */, type) => {
|
||||
if (val) {
|
||||
if (nowSearch.value === "start") {
|
||||
formData.value.startName = val;
|
||||
@ -373,8 +518,16 @@ const searchPoint = (val /** 搜索建议选项 */) => {
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
||||
map.value.clearMap();
|
||||
if (type === "start" && formData.value.endLngLat.length === 2) {
|
||||
map.value.add(endMarker.value);
|
||||
} else if (type === "end" && formData.value.startLngLat.length === 2) {
|
||||
map.value.add(startMarker.value);
|
||||
}
|
||||
placeSearch.value.search(val, (status, result) => {
|
||||
console.log(status, result);
|
||||
// TODO: 添加搜索结果标记
|
||||
});
|
||||
};
|
||||
|
||||
|
101
src/components/RouteStepList.vue
Normal file
101
src/components/RouteStepList.vue
Normal file
@ -0,0 +1,101 @@
|
||||
<template>
|
||||
<div class="title"></div>
|
||||
<div class="steps-item start" v-if="stepsList.length">
|
||||
<div
|
||||
class="icon"
|
||||
:style="{
|
||||
backgroundPosition: stepIconMap.get('起点'),
|
||||
}"
|
||||
></div>
|
||||
<div class="content">起点</div>
|
||||
</div>
|
||||
<div
|
||||
v-for="(item, index) in stepsList"
|
||||
:key="item.start_location.lng"
|
||||
class="steps-item"
|
||||
@click="handleRouteClick(item, index)"
|
||||
>
|
||||
<div
|
||||
class="icon"
|
||||
:style="{
|
||||
backgroundPosition: stepIconMap.get(item.action) ?? '-46px -23px',
|
||||
}"
|
||||
></div>
|
||||
<div class="content">
|
||||
{{ item.instruction }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="steps-item start" v-if="stepsList.length">
|
||||
<div
|
||||
class="icon"
|
||||
:style="{
|
||||
backgroundPosition: stepIconMap.get('终点'),
|
||||
}"
|
||||
></div>
|
||||
<div class="content">终点</div>
|
||||
</div>
|
||||
</template>
|
||||
<script setup name="StepsList">
|
||||
import { toRefs } from "vue";
|
||||
|
||||
const emit = defineEmits(["step-click"]);
|
||||
const props = defineProps({
|
||||
stepsList: {
|
||||
type: Array,
|
||||
required: true,
|
||||
},
|
||||
routeExtData: {
|
||||
type: Object,
|
||||
required: true,
|
||||
},
|
||||
});
|
||||
const { stepsList } = toRefs(props);
|
||||
|
||||
const stepIconMap = new Map([
|
||||
["靠左", "-406px -23px"],
|
||||
["左转", "-87px -23px"],
|
||||
["右转", "-124px -23px"],
|
||||
["左转调头", "-327px -23px"],
|
||||
["向右前方行驶", "-206px -23px"],
|
||||
["向左前方行驶", "-165px -23px"],
|
||||
["减速行驶", "-524px -23px"],
|
||||
["终点", "-126px -104px"],
|
||||
["起点", "-47px -104px"],
|
||||
]);
|
||||
|
||||
const handleRouteClick = (data, index) => {
|
||||
emit("step-click", data, index);
|
||||
};
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
.steps-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
cursor: pointer;
|
||||
padding-bottom: 5px;
|
||||
padding-top: 5px;
|
||||
&:not(:last-child) {
|
||||
// margin-bottom: 10px;
|
||||
border-bottom: 1px solid #f0f0f0;
|
||||
}
|
||||
.icon {
|
||||
margin-right: 8px;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
color: #fff;
|
||||
line-height: 20px;
|
||||
border-radius: 50%;
|
||||
border: 1px solid #ddd;
|
||||
background-color: #fff;
|
||||
// background-position: -47px -104px;
|
||||
background-image: url(https://webapi.amap.com/theme/v1.3/images/newpc/diricon.png);
|
||||
}
|
||||
.content {
|
||||
font-size: 12px;
|
||||
}
|
||||
&.start .content {
|
||||
font-size: 14px;
|
||||
font-weight: 700;
|
||||
}
|
||||
}
|
||||
</style>
|
852
src/components/resp.json
Normal file
852
src/components/resp.json
Normal file
@ -0,0 +1,852 @@
|
||||
{
|
||||
"status": "1",
|
||||
"info": "OK",
|
||||
"infocode": "10000",
|
||||
"count": "1",
|
||||
"route": {
|
||||
"origin": "117.30176,31.799546",
|
||||
"destination": "117.285367,31.795442",
|
||||
"taxi_cost": "29",
|
||||
"paths": [
|
||||
{
|
||||
"distance": "17039",
|
||||
"duration": "1302",
|
||||
"strategy": "费用最低",
|
||||
"tolls": "2",
|
||||
"toll_distance": "4918",
|
||||
"steps": [
|
||||
{
|
||||
"instruction": "沿望湖西路向北行驶198米右转",
|
||||
"orientation": "北",
|
||||
"road": "望湖西路",
|
||||
"distance": "198",
|
||||
"tolls": "0",
|
||||
"toll_distance": "0",
|
||||
"toll_road": [],
|
||||
"duration": "47",
|
||||
"polyline": "117.300842,31.799308;117.300542,31.800146;117.300285,31.801031",
|
||||
"action": "右转",
|
||||
"assistant_action": [],
|
||||
"tmcs": [
|
||||
{
|
||||
"lcode": [],
|
||||
"distance": "97",
|
||||
"status": "畅通",
|
||||
"polyline": "117.300842,31.799308;117.300542,31.800146"
|
||||
},
|
||||
{
|
||||
"lcode": [],
|
||||
"distance": "101",
|
||||
"status": "畅通",
|
||||
"polyline": "117.300542,31.800146;117.300285,31.801031"
|
||||
}
|
||||
],
|
||||
"cities": [
|
||||
{
|
||||
"name": "合肥市",
|
||||
"citycode": "0551",
|
||||
"adcode": "340100",
|
||||
"districts": [{ "name": "包河区", "adcode": "340111" }]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"instruction": "沿太平湖路向东行驶196米靠左进入匝道",
|
||||
"orientation": "东",
|
||||
"road": "太平湖路",
|
||||
"distance": "196",
|
||||
"tolls": "0",
|
||||
"toll_distance": "0",
|
||||
"toll_road": [],
|
||||
"duration": "10",
|
||||
"polyline": "117.300285,31.801031;117.301813,31.80138;117.302301,31.801482",
|
||||
"action": "靠左",
|
||||
"assistant_action": "进入匝道",
|
||||
"tmcs": [
|
||||
{
|
||||
"lcode": [],
|
||||
"distance": "149",
|
||||
"status": "畅通",
|
||||
"polyline": "117.300285,31.801031;117.301813,31.80138"
|
||||
},
|
||||
{
|
||||
"lcode": [],
|
||||
"distance": "47",
|
||||
"status": "畅通",
|
||||
"polyline": "117.301813,31.80138;117.302301,31.801482"
|
||||
}
|
||||
],
|
||||
"cities": [
|
||||
{
|
||||
"name": "合肥市",
|
||||
"citycode": "0551",
|
||||
"adcode": "340100",
|
||||
"districts": [{ "name": "包河区", "adcode": "340111" }]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"instruction": "沿南北一号高架入口途径南北一号高架向北行驶2.1千米向右前方行驶进入匝道",
|
||||
"orientation": "北",
|
||||
"road": "南北一号高架入口",
|
||||
"distance": "2078",
|
||||
"tolls": "0",
|
||||
"toll_distance": "0",
|
||||
"toll_road": [],
|
||||
"duration": "151",
|
||||
"polyline": "117.302301,31.801482;117.302656,31.801616;117.304394,31.802002;117.3053,31.802206;117.305831,31.80233;117.306051,31.802361;117.306271,31.802372;117.306459,31.802367;117.306647,31.802345;117.306931,31.802297;117.307317,31.802206;117.307473,31.80219;117.307575,31.80219;117.307671,31.802206;117.307757,31.802228;117.307865,31.802281;117.307966,31.802345;117.308052,31.802426;117.3081,31.802501;117.308133,31.802571;117.308154,31.802662;117.30816,31.802764;117.308143,31.802876;117.3081,31.803;117.307585,31.80411;117.307328,31.804641;117.307156,31.804958;117.306942,31.805419;117.306877,31.805564;117.306722,31.805709;117.306647,31.805848;117.306577,31.805988;117.306496,31.80617;117.305161,31.809443;117.304667,31.810805;117.303745,31.813273;117.3036,31.813675;117.30324,31.814651;117.303122,31.814963;117.302988,31.815263",
|
||||
"action": "向右前方行驶",
|
||||
"assistant_action": "进入匝道",
|
||||
"tmcs": [
|
||||
{
|
||||
"lcode": [],
|
||||
"distance": "206",
|
||||
"status": "畅通",
|
||||
"polyline": "117.302301,31.801482;117.302656,31.801616;117.304394,31.802002"
|
||||
},
|
||||
{
|
||||
"lcode": [],
|
||||
"distance": "757",
|
||||
"status": "畅通",
|
||||
"polyline": "117.304394,31.802002;117.3053,31.802206;117.305831,31.80233;117.306051,31.802361;117.306271,31.802372;117.306459,31.802367;117.306647,31.802345;117.306931,31.802297;117.307317,31.802206;117.307473,31.80219;117.307575,31.80219;117.307671,31.802206;117.307757,31.802228;117.307865,31.802281;117.307966,31.802345;117.308052,31.802426;117.3081,31.802501;117.308133,31.802571;117.308154,31.802662;117.30816,31.802764;117.308143,31.802876;117.3081,31.803;117.307585,31.80411;117.307328,31.804641;117.307156,31.804958;117.306942,31.805419;117.306877,31.805564;117.306722,31.805709"
|
||||
},
|
||||
{
|
||||
"lcode": [],
|
||||
"distance": "33",
|
||||
"status": "畅通",
|
||||
"polyline": "117.306722,31.805709;117.306647,31.805848;117.306577,31.805988"
|
||||
},
|
||||
{
|
||||
"lcode": [],
|
||||
"distance": "563",
|
||||
"status": "缓行",
|
||||
"polyline": "117.306577,31.805988;117.306496,31.80617;117.305161,31.809443;117.304667,31.810805"
|
||||
},
|
||||
{
|
||||
"lcode": [],
|
||||
"distance": "334",
|
||||
"status": "缓行",
|
||||
"polyline": "117.304667,31.810805;117.303745,31.813273;117.3036,31.813675"
|
||||
},
|
||||
{
|
||||
"lcode": [],
|
||||
"distance": "113",
|
||||
"status": "畅通",
|
||||
"polyline": "117.3036,31.813675;117.30324,31.814651"
|
||||
},
|
||||
{
|
||||
"lcode": [],
|
||||
"distance": "72",
|
||||
"status": "畅通",
|
||||
"polyline": "117.30324,31.814651;117.303122,31.814963;117.302988,31.815263"
|
||||
}
|
||||
],
|
||||
"cities": [
|
||||
{
|
||||
"name": "合肥市",
|
||||
"citycode": "0551",
|
||||
"adcode": "340100",
|
||||
"districts": [{ "name": "包河区", "adcode": "340111" }]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"instruction": "沿二环马鞍山路桥向北行驶136米靠左",
|
||||
"orientation": "北",
|
||||
"road": "二环马鞍山路桥",
|
||||
"distance": "136",
|
||||
"tolls": "0",
|
||||
"toll_distance": "0",
|
||||
"toll_road": [],
|
||||
"duration": "4",
|
||||
"polyline": "117.302988,31.815263;117.303042,31.815413;117.303036,31.815467;117.302956,31.815821;117.302951,31.815982;117.302956,31.816089;117.302988,31.816223;117.303069,31.816384;117.303079,31.816406;117.303106,31.816454",
|
||||
"action": "靠左",
|
||||
"assistant_action": [],
|
||||
"tmcs": [
|
||||
{
|
||||
"lcode": [],
|
||||
"distance": "136",
|
||||
"status": "畅通",
|
||||
"polyline": "117.302988,31.815263;117.303042,31.815413;117.303036,31.815467;117.302956,31.815821;117.302951,31.815982;117.302956,31.816089;117.302988,31.816223;117.303069,31.816384;117.303079,31.816406;117.303106,31.816454"
|
||||
}
|
||||
],
|
||||
"cities": [
|
||||
{
|
||||
"name": "合肥市",
|
||||
"citycode": "0551",
|
||||
"adcode": "340100",
|
||||
"districts": [{ "name": "包河区", "adcode": "340111" }]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"instruction": "沿二环马鞍山路桥途径南二环路向西行驶2.9千米靠左沿主路行驶",
|
||||
"orientation": "西",
|
||||
"road": "二环马鞍山路桥",
|
||||
"distance": "2944",
|
||||
"tolls": "0",
|
||||
"toll_distance": "0",
|
||||
"toll_road": [],
|
||||
"duration": "328",
|
||||
"polyline": "117.303106,31.816454;117.303181,31.816577;117.303331,31.816803;117.30338,31.816899;117.303396,31.816969;117.303401,31.817055;117.303396,31.817125;117.303369,31.817205;117.303315,31.817307;117.303278,31.81735;117.303219,31.817409;117.303117,31.817473;117.302999,31.817521;117.302881,31.817554;117.302752,31.817564;117.302623,31.817548;117.302468,31.817516;117.30198,31.817323;117.301765,31.8172;117.301615,31.817098;117.301454,31.816958;117.301132,31.816663;117.300971,31.816534;117.300837,31.816406;117.300832,31.8164;117.298021,31.815681;117.297769,31.815547;117.297028,31.815413;117.295795,31.815054;117.295167,31.814898;117.294212,31.814657;117.293509,31.814469;117.293021,31.814346;117.292919,31.814324;117.292506,31.814217;117.291873,31.814067;117.291471,31.813976;117.291079,31.813911;117.290564,31.813874;117.290231,31.813874;117.290038,31.813879;117.289255,31.81389;117.288622,31.813906;117.288402,31.813916;117.288048,31.813922;117.287367,31.813933;117.284063,31.814008;117.279728,31.814147;117.279251,31.814174;117.278237,31.814211;117.276601,31.81426;117.274256,31.814346",
|
||||
"action": "靠左",
|
||||
"assistant_action": "沿主路行驶",
|
||||
"tmcs": [
|
||||
{
|
||||
"lcode": [],
|
||||
"distance": "393",
|
||||
"status": "畅通",
|
||||
"polyline": "117.303106,31.816454;117.303181,31.816577;117.303331,31.816803;117.30338,31.816899;117.303396,31.816969;117.303401,31.817055;117.303396,31.817125;117.303369,31.817205;117.303315,31.817307;117.303278,31.81735;117.303219,31.817409;117.303117,31.817473;117.302999,31.817521;117.302881,31.817554;117.302752,31.817564;117.302623,31.817548;117.302468,31.817516;117.30198,31.817323;117.301765,31.8172;117.301615,31.817098;117.301454,31.816958;117.301132,31.816663;117.300971,31.816534;117.300837,31.816406;117.300832,31.8164"
|
||||
},
|
||||
{
|
||||
"lcode": [],
|
||||
"distance": "305",
|
||||
"status": "畅通",
|
||||
"polyline": "117.300832,31.8164;117.298021,31.815681;117.297769,31.815547"
|
||||
},
|
||||
{
|
||||
"lcode": [],
|
||||
"distance": "72",
|
||||
"status": "畅通",
|
||||
"polyline": "117.297769,31.815547;117.297028,31.815413"
|
||||
},
|
||||
{
|
||||
"lcode": [],
|
||||
"distance": "184",
|
||||
"status": "畅通",
|
||||
"polyline": "117.297028,31.815413;117.295795,31.815054;117.295167,31.814898"
|
||||
},
|
||||
{
|
||||
"lcode": [],
|
||||
"distance": "94",
|
||||
"status": "畅通",
|
||||
"polyline": "117.295167,31.814898;117.294212,31.814657"
|
||||
},
|
||||
{
|
||||
"lcode": [],
|
||||
"distance": "69",
|
||||
"status": "畅通",
|
||||
"polyline": "117.294212,31.814657;117.293509,31.814469"
|
||||
},
|
||||
{
|
||||
"lcode": [],
|
||||
"distance": "48",
|
||||
"status": "畅通",
|
||||
"polyline": "117.293509,31.814469;117.293021,31.814346"
|
||||
},
|
||||
{
|
||||
"lcode": [],
|
||||
"distance": "10",
|
||||
"status": "畅通",
|
||||
"polyline": "117.293021,31.814346;117.292919,31.814324"
|
||||
},
|
||||
{
|
||||
"lcode": [],
|
||||
"distance": "40",
|
||||
"status": "畅通",
|
||||
"polyline": "117.292919,31.814324;117.292506,31.814217"
|
||||
},
|
||||
{
|
||||
"lcode": [],
|
||||
"distance": "62",
|
||||
"status": "畅通",
|
||||
"polyline": "117.292506,31.814217;117.291873,31.814067"
|
||||
},
|
||||
{
|
||||
"lcode": [],
|
||||
"distance": "39",
|
||||
"status": "畅通",
|
||||
"polyline": "117.291873,31.814067;117.291471,31.813976"
|
||||
},
|
||||
{
|
||||
"lcode": [],
|
||||
"distance": "118",
|
||||
"status": "缓行",
|
||||
"polyline": "117.291471,31.813976;117.291079,31.813911;117.290564,31.813874;117.290231,31.813874"
|
||||
},
|
||||
{
|
||||
"lcode": [],
|
||||
"distance": "152",
|
||||
"status": "拥堵",
|
||||
"polyline": "117.290231,31.813874;117.290038,31.813879;117.289255,31.81389;117.288622,31.813906"
|
||||
},
|
||||
{
|
||||
"lcode": [],
|
||||
"distance": "21",
|
||||
"status": "拥堵",
|
||||
"polyline": "117.288622,31.813906;117.288402,31.813916"
|
||||
},
|
||||
{
|
||||
"lcode": [],
|
||||
"distance": "33",
|
||||
"status": "拥堵",
|
||||
"polyline": "117.288402,31.813916;117.288048,31.813922"
|
||||
},
|
||||
{
|
||||
"lcode": [],
|
||||
"distance": "64",
|
||||
"status": "拥堵",
|
||||
"polyline": "117.288048,31.813922;117.287367,31.813933"
|
||||
},
|
||||
{
|
||||
"lcode": [],
|
||||
"distance": "723",
|
||||
"status": "拥堵",
|
||||
"polyline": "117.287367,31.813933;117.284063,31.814008;117.279728,31.814147"
|
||||
},
|
||||
{
|
||||
"lcode": [],
|
||||
"distance": "45",
|
||||
"status": "拥堵",
|
||||
"polyline": "117.279728,31.814147;117.279251,31.814174"
|
||||
},
|
||||
{
|
||||
"lcode": [],
|
||||
"distance": "96",
|
||||
"status": "拥堵",
|
||||
"polyline": "117.279251,31.814174;117.278237,31.814211"
|
||||
},
|
||||
{
|
||||
"lcode": [],
|
||||
"distance": "155",
|
||||
"status": "缓行",
|
||||
"polyline": "117.278237,31.814211;117.276601,31.81426"
|
||||
},
|
||||
{
|
||||
"lcode": [],
|
||||
"distance": "221",
|
||||
"status": "缓行",
|
||||
"polyline": "117.276601,31.81426;117.274256,31.814346"
|
||||
}
|
||||
],
|
||||
"cities": [
|
||||
{
|
||||
"name": "合肥市",
|
||||
"citycode": "0551",
|
||||
"adcode": "340100",
|
||||
"districts": [{ "name": "包河区", "adcode": "340111" }]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"instruction": "沿南二环路向西行驶1.2千米向右前方行驶进入匝道",
|
||||
"orientation": "西",
|
||||
"road": "南二环路",
|
||||
"distance": "1167",
|
||||
"tolls": "0",
|
||||
"toll_distance": "0",
|
||||
"toll_road": [],
|
||||
"duration": "84",
|
||||
"polyline": "117.274256,31.814346;117.273811,31.814356;117.272346,31.814405;117.271048,31.814448;117.270383,31.81448;117.269879,31.814517;117.269573,31.81455;117.268098,31.814786;117.268066,31.814791;117.267653,31.814855;117.267578,31.814871;117.267497,31.814882;117.266558,31.815032;117.265625,31.815183;117.264697,31.815333;117.26445,31.81537;117.264386,31.815381;117.263066,31.81558;117.26254,31.815665;117.262009,31.815756",
|
||||
"action": "向右前方行驶",
|
||||
"assistant_action": "进入匝道",
|
||||
"tmcs": [
|
||||
{
|
||||
"lcode": [],
|
||||
"distance": "42",
|
||||
"status": "畅通",
|
||||
"polyline": "117.274256,31.814346;117.273811,31.814356"
|
||||
},
|
||||
{
|
||||
"lcode": [],
|
||||
"distance": "138",
|
||||
"status": "畅通",
|
||||
"polyline": "117.273811,31.814356;117.272346,31.814405"
|
||||
},
|
||||
{
|
||||
"lcode": [],
|
||||
"distance": "186",
|
||||
"status": "畅通",
|
||||
"polyline": "117.272346,31.814405;117.271048,31.814448;117.270383,31.81448"
|
||||
},
|
||||
{
|
||||
"lcode": [],
|
||||
"distance": "47",
|
||||
"status": "畅通",
|
||||
"polyline": "117.270383,31.81448;117.269879,31.814517"
|
||||
},
|
||||
{
|
||||
"lcode": [],
|
||||
"distance": "29",
|
||||
"status": "畅通",
|
||||
"polyline": "117.269879,31.814517;117.269573,31.81455"
|
||||
},
|
||||
{
|
||||
"lcode": [],
|
||||
"distance": "184",
|
||||
"status": "畅通",
|
||||
"polyline": "117.269573,31.81455;117.268098,31.814786;117.268066,31.814791;117.267653,31.814855"
|
||||
},
|
||||
{
|
||||
"lcode": [],
|
||||
"distance": "15",
|
||||
"status": "畅通",
|
||||
"polyline": "117.267653,31.814855;117.267578,31.814871;117.267497,31.814882"
|
||||
},
|
||||
{
|
||||
"lcode": [],
|
||||
"distance": "180",
|
||||
"status": "畅通",
|
||||
"polyline": "117.267497,31.814882;117.266558,31.815032;117.265625,31.815183"
|
||||
},
|
||||
{
|
||||
"lcode": [],
|
||||
"distance": "89",
|
||||
"status": "畅通",
|
||||
"polyline": "117.265625,31.815183;117.264697,31.815333"
|
||||
},
|
||||
{
|
||||
"lcode": [],
|
||||
"distance": "23",
|
||||
"status": "畅通",
|
||||
"polyline": "117.264697,31.815333;117.26445,31.81537"
|
||||
},
|
||||
{
|
||||
"lcode": [],
|
||||
"distance": "6",
|
||||
"status": "畅通",
|
||||
"polyline": "117.26445,31.81537;117.264386,31.815381"
|
||||
},
|
||||
{
|
||||
"lcode": [],
|
||||
"distance": "126",
|
||||
"status": "畅通",
|
||||
"polyline": "117.264386,31.815381;117.263066,31.81558"
|
||||
},
|
||||
{
|
||||
"lcode": [],
|
||||
"distance": "102",
|
||||
"status": "畅通",
|
||||
"polyline": "117.263066,31.81558;117.26254,31.815665;117.262009,31.815756"
|
||||
}
|
||||
],
|
||||
"cities": [
|
||||
{
|
||||
"name": "合肥市",
|
||||
"citycode": "0551",
|
||||
"adcode": "340100",
|
||||
"districts": [{ "name": "包河区", "adcode": "340111" }]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"instruction": "沿南二环路出口向西行驶202米靠左",
|
||||
"orientation": "西",
|
||||
"road": "南二环路出口",
|
||||
"distance": "202",
|
||||
"tolls": "0",
|
||||
"toll_distance": "0",
|
||||
"toll_road": [],
|
||||
"duration": "8",
|
||||
"polyline": "117.262009,31.815756;117.261913,31.815805;117.261806,31.815832;117.260969,31.815982;117.260303,31.816111;117.260105,31.816153;117.259933,31.816175",
|
||||
"action": "靠左",
|
||||
"assistant_action": [],
|
||||
"tmcs": [
|
||||
{
|
||||
"lcode": [],
|
||||
"distance": "202",
|
||||
"status": "畅通",
|
||||
"polyline": "117.262009,31.815756;117.261913,31.815805;117.261806,31.815832;117.260969,31.815982;117.260303,31.816111;117.260105,31.816153;117.259933,31.816175"
|
||||
}
|
||||
],
|
||||
"cities": [
|
||||
{
|
||||
"name": "合肥市",
|
||||
"citycode": "0551",
|
||||
"adcode": "340100",
|
||||
"districts": [{ "name": "包河区", "adcode": "340111" }]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"instruction": "沿南二环路出口途径金寨路高架向西南行驶3.5千米向右前方行驶",
|
||||
"orientation": "西南",
|
||||
"road": "南二环路出口",
|
||||
"distance": "3540",
|
||||
"tolls": "0",
|
||||
"toll_distance": "0",
|
||||
"toll_road": [],
|
||||
"duration": "310",
|
||||
"polyline": "117.259933,31.816175;117.259697,31.816207;117.258608,31.816373;117.258399,31.816406;117.256146,31.816754;117.255481,31.816862;117.254945,31.816921;117.254376,31.816894;117.253555,31.816921;117.253389,31.816899;117.253196,31.81683;117.253067,31.81676;117.252911,31.816652;117.25282,31.816513;117.252761,31.816406;117.252729,31.816341;117.252697,31.816239;117.252697,31.8161;117.25274,31.815842;117.25281,31.81514;117.25281,31.815;117.252772,31.814861;117.252659,31.814625;117.252552,31.814448;117.252439,31.814313;117.252193,31.81404;117.251833,31.813621;117.251774,31.81353;117.251629,31.813348;117.251479,31.813176;117.25127,31.812897;117.251248,31.812844;117.251248,31.812753;117.251157,31.812651;117.251061,31.812549;117.250556,31.811985;117.250385,31.811776;117.250267,31.811631;117.248636,31.809738;117.248132,31.809126;117.246093,31.806481;117.245278,31.805419;117.24112,31.800033;117.240729,31.799535;117.239602,31.79807;117.238449,31.796584;117.238272,31.796359;117.237837,31.795801;117.237151,31.794921",
|
||||
"action": "向右前方行驶",
|
||||
"assistant_action": [],
|
||||
"tmcs": [
|
||||
{
|
||||
"lcode": [],
|
||||
"distance": "428",
|
||||
"status": "畅通",
|
||||
"polyline": "117.259933,31.816175;117.259697,31.816207;117.258608,31.816373;117.258399,31.816406;117.256146,31.816754;117.255481,31.816862"
|
||||
},
|
||||
{
|
||||
"lcode": [],
|
||||
"distance": "51",
|
||||
"status": "畅通",
|
||||
"polyline": "117.255481,31.816862;117.254945,31.816921"
|
||||
},
|
||||
{
|
||||
"lcode": [],
|
||||
"distance": "455",
|
||||
"status": "缓行",
|
||||
"polyline": "117.254945,31.816921;117.254376,31.816894;117.253555,31.816921;117.253389,31.816899;117.253196,31.81683;117.253067,31.81676;117.252911,31.816652;117.25282,31.816513;117.252761,31.816406;117.252729,31.816341;117.252697,31.816239;117.252697,31.8161;117.25274,31.815842;117.25281,31.81514;117.25281,31.815;117.252772,31.814861;117.252659,31.814625;117.252552,31.814448"
|
||||
},
|
||||
{
|
||||
"lcode": [],
|
||||
"distance": "18",
|
||||
"status": "缓行",
|
||||
"polyline": "117.252552,31.814448;117.252439,31.814313"
|
||||
},
|
||||
{
|
||||
"lcode": [],
|
||||
"distance": "96",
|
||||
"status": "缓行",
|
||||
"polyline": "117.252439,31.814313;117.252193,31.81404;117.251833,31.813621"
|
||||
},
|
||||
{
|
||||
"lcode": [],
|
||||
"distance": "112",
|
||||
"status": "畅通",
|
||||
"polyline": "117.251833,31.813621;117.251774,31.81353;117.251629,31.813348;117.251479,31.813176;117.25127,31.812897;117.251248,31.812844;117.251248,31.812753"
|
||||
},
|
||||
{
|
||||
"lcode": [],
|
||||
"distance": "28",
|
||||
"status": "畅通",
|
||||
"polyline": "117.251248,31.812753;117.251157,31.812651;117.251061,31.812549"
|
||||
},
|
||||
{
|
||||
"lcode": [],
|
||||
"distance": "78",
|
||||
"status": "畅通",
|
||||
"polyline": "117.251061,31.812549;117.250556,31.811985"
|
||||
},
|
||||
{
|
||||
"lcode": [],
|
||||
"distance": "28",
|
||||
"status": "畅通",
|
||||
"polyline": "117.250556,31.811985;117.250385,31.811776"
|
||||
},
|
||||
{
|
||||
"lcode": [],
|
||||
"distance": "19",
|
||||
"status": "畅通",
|
||||
"polyline": "117.250385,31.811776;117.250267,31.811631"
|
||||
},
|
||||
{
|
||||
"lcode": [],
|
||||
"distance": "343",
|
||||
"status": "畅通",
|
||||
"polyline": "117.250267,31.811631;117.248636,31.809738;117.248132,31.809126"
|
||||
},
|
||||
{
|
||||
"lcode": [],
|
||||
"distance": "1273",
|
||||
"status": "畅通",
|
||||
"polyline": "117.248132,31.809126;117.246093,31.806481;117.245278,31.805419;117.24112,31.800033;117.240729,31.799535"
|
||||
},
|
||||
{
|
||||
"lcode": [],
|
||||
"distance": "194",
|
||||
"status": "畅通",
|
||||
"polyline": "117.240729,31.799535;117.239602,31.79807"
|
||||
},
|
||||
{
|
||||
"lcode": [],
|
||||
"distance": "197",
|
||||
"status": "畅通",
|
||||
"polyline": "117.239602,31.79807;117.238449,31.796584"
|
||||
},
|
||||
{
|
||||
"lcode": [],
|
||||
"distance": "104",
|
||||
"status": "畅通",
|
||||
"polyline": "117.238449,31.796584;117.238272,31.796359;117.237837,31.795801"
|
||||
},
|
||||
{
|
||||
"lcode": [],
|
||||
"distance": "116",
|
||||
"status": "畅通",
|
||||
"polyline": "117.237837,31.795801;117.237151,31.794921"
|
||||
}
|
||||
],
|
||||
"cities": [
|
||||
{
|
||||
"name": "合肥市",
|
||||
"citycode": "0551",
|
||||
"adcode": "340100",
|
||||
"districts": [
|
||||
{ "name": "包河区", "adcode": "340111" },
|
||||
{ "name": "蜀山区", "adcode": "340104" }
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"instruction": "沿金寨路高架出口途径金寨路辅路向西南行驶990米向右前方行驶进入匝道",
|
||||
"orientation": "西南",
|
||||
"road": "金寨路高架出口",
|
||||
"distance": "990",
|
||||
"tolls": "0",
|
||||
"toll_distance": "0",
|
||||
"toll_road": [],
|
||||
"duration": "86",
|
||||
"polyline": "117.237151,31.794921;117.236963,31.794835;117.236657,31.794433;117.235772,31.79328;117.234683,31.791912;117.234345,31.791601;117.234211,31.791423;117.233449,31.79027;117.232859,31.789299;117.232703,31.789053;117.23243,31.788634;117.232269,31.788393;117.232028,31.788039;117.231904,31.787845;117.231684,31.78754;117.231566,31.787379",
|
||||
"action": "向右前方行驶",
|
||||
"assistant_action": "进入匝道",
|
||||
"tmcs": [
|
||||
{
|
||||
"lcode": [],
|
||||
"distance": "456",
|
||||
"status": "畅通",
|
||||
"polyline": "117.237151,31.794921;117.236963,31.794835;117.236657,31.794433;117.235772,31.79328;117.234683,31.791912;117.234345,31.791601"
|
||||
},
|
||||
{
|
||||
"lcode": [],
|
||||
"distance": "23",
|
||||
"status": "畅通",
|
||||
"polyline": "117.234345,31.791601;117.234211,31.791423"
|
||||
},
|
||||
{
|
||||
"lcode": [],
|
||||
"distance": "267",
|
||||
"status": "畅通",
|
||||
"polyline": "117.234211,31.791423;117.233449,31.79027;117.232859,31.789299"
|
||||
},
|
||||
{
|
||||
"lcode": [],
|
||||
"distance": "31",
|
||||
"status": "畅通",
|
||||
"polyline": "117.232859,31.789299;117.232703,31.789053"
|
||||
},
|
||||
{
|
||||
"lcode": [],
|
||||
"distance": "52",
|
||||
"status": "畅通",
|
||||
"polyline": "117.232703,31.789053;117.23243,31.788634"
|
||||
},
|
||||
{
|
||||
"lcode": [],
|
||||
"distance": "31",
|
||||
"status": "畅通",
|
||||
"polyline": "117.23243,31.788634;117.232269,31.788393"
|
||||
},
|
||||
{
|
||||
"lcode": [],
|
||||
"distance": "45",
|
||||
"status": "畅通",
|
||||
"polyline": "117.232269,31.788393;117.232028,31.788039"
|
||||
},
|
||||
{
|
||||
"lcode": [],
|
||||
"distance": "64",
|
||||
"status": "畅通",
|
||||
"polyline": "117.232028,31.788039;117.231904,31.787845;117.231684,31.78754"
|
||||
},
|
||||
{
|
||||
"lcode": [],
|
||||
"distance": "21",
|
||||
"status": "畅通",
|
||||
"polyline": "117.231684,31.78754;117.231566,31.787379"
|
||||
}
|
||||
],
|
||||
"cities": [
|
||||
{
|
||||
"name": "合肥市",
|
||||
"citycode": "0551",
|
||||
"adcode": "340100",
|
||||
"districts": [{ "name": "蜀山区", "adcode": "340104" }]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"instruction": "沿G4001合肥绕城高速入口向东行驶670米减速行驶到达收费站",
|
||||
"orientation": "东",
|
||||
"road": "G4001合肥绕城高速入口",
|
||||
"distance": "670",
|
||||
"tolls": "0",
|
||||
"toll_distance": "0",
|
||||
"toll_road": [],
|
||||
"duration": "68",
|
||||
"polyline": "117.231566,31.787379;117.231218,31.787121;117.231083,31.787078;117.230955,31.787062;117.230805,31.787068;117.230649,31.787116;117.23051,31.787191;117.230418,31.787298;117.23037,31.787411;117.230359,31.78754;117.230397,31.787695;117.23045,31.78777;117.230579,31.787867;117.230735,31.787942;117.230955,31.78798;117.231207,31.787974;117.23147,31.787931;117.231786,31.787856;117.23302,31.787529;117.233717,31.787346;117.234506,31.78703;117.234721,31.786939;117.234967,31.786853;117.235118,31.786816;117.235284,31.786778",
|
||||
"action": "减速行驶",
|
||||
"assistant_action": "到达收费站",
|
||||
"tmcs": [
|
||||
{
|
||||
"lcode": [],
|
||||
"distance": "319",
|
||||
"status": "畅通",
|
||||
"polyline": "117.231566,31.787379;117.231218,31.787121;117.231083,31.787078;117.230955,31.787062;117.230805,31.787068;117.230649,31.787116;117.23051,31.787191;117.230418,31.787298;117.23037,31.787411;117.230359,31.78754;117.230397,31.787695;117.23045,31.78777;117.230579,31.787867;117.230735,31.787942;117.230955,31.78798;117.231207,31.787974;117.23147,31.787931;117.231786,31.787856"
|
||||
},
|
||||
{
|
||||
"lcode": [],
|
||||
"distance": "191",
|
||||
"status": "畅通",
|
||||
"polyline": "117.231786,31.787856;117.23302,31.787529;117.233717,31.787346"
|
||||
},
|
||||
{
|
||||
"lcode": [],
|
||||
"distance": "82",
|
||||
"status": "畅通",
|
||||
"polyline": "117.233717,31.787346;117.234506,31.78703"
|
||||
},
|
||||
{
|
||||
"lcode": [],
|
||||
"distance": "47",
|
||||
"status": "畅通",
|
||||
"polyline": "117.234506,31.78703;117.234721,31.786939;117.234967,31.786853"
|
||||
},
|
||||
{
|
||||
"lcode": [],
|
||||
"distance": "31",
|
||||
"status": "畅通",
|
||||
"polyline": "117.234967,31.786853;117.235118,31.786816;117.235284,31.786778"
|
||||
}
|
||||
],
|
||||
"cities": [
|
||||
{
|
||||
"name": "合肥市",
|
||||
"citycode": "0551",
|
||||
"adcode": "340100",
|
||||
"districts": [{ "name": "蜀山区", "adcode": "340104" }]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"instruction": "沿G4001合肥绕城高速入口向东行驶360米靠右",
|
||||
"orientation": "东",
|
||||
"road": "G4001合肥绕城高速入口",
|
||||
"distance": "360",
|
||||
"tolls": "1",
|
||||
"toll_distance": "360",
|
||||
"toll_road": "G4001合肥绕城高速入口",
|
||||
"duration": "41",
|
||||
"polyline": "117.235284,31.786778;117.235686,31.786719;117.23619,31.786665;117.236695,31.786628;117.236845,31.786622;117.23706,31.786633;117.237236,31.786655;117.237317,31.786665;117.23751,31.786735;117.23758,31.786778;117.237757,31.786907;117.237848,31.786987;117.238068,31.787229;117.238191,31.787373;117.238476,31.787754",
|
||||
"action": "靠右",
|
||||
"assistant_action": [],
|
||||
"tmcs": [
|
||||
{
|
||||
"lcode": [],
|
||||
"distance": "360",
|
||||
"status": "畅通",
|
||||
"polyline": "117.235284,31.786778;117.235686,31.786719;117.23619,31.786665;117.236695,31.786628;117.236845,31.786622;117.23706,31.786633;117.237236,31.786655;117.237317,31.786665;117.23751,31.786735;117.23758,31.786778;117.237757,31.786907;117.237848,31.786987;117.238068,31.787229;117.238191,31.787373;117.238476,31.787754"
|
||||
}
|
||||
],
|
||||
"cities": [
|
||||
{
|
||||
"name": "合肥市",
|
||||
"citycode": "0551",
|
||||
"adcode": "340100",
|
||||
"districts": [{ "name": "蜀山区", "adcode": "340104" }]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"instruction": "沿G4001合肥绕城高速入口途径G4001合肥绕城高速向东行驶4.6千米到达目的地",
|
||||
"orientation": "东",
|
||||
"road": "G4001合肥绕城高速入口",
|
||||
"distance": "4558",
|
||||
"tolls": "1",
|
||||
"toll_distance": "4558",
|
||||
"toll_road": "G4001合肥绕城高速",
|
||||
"duration": "165",
|
||||
"polyline": "117.238476,31.787754;117.238696,31.788017;117.238926,31.788253;117.239109,31.788393;117.239302,31.788489;117.239591,31.788607;117.239763,31.788666;117.240278,31.78879;117.24075,31.788886;117.241179,31.788935;117.241941,31.788977;117.242123,31.788999;117.242172,31.789015;117.242258,31.789053;117.244457,31.789026;117.245128,31.789031;117.245911,31.789042;117.246093,31.789047;117.246324,31.789053;117.248073,31.789122;117.248861,31.789176;117.250556,31.789315;117.251999,31.789455;117.25231,31.789492;117.25399,31.789718;117.255476,31.789948;117.256725,31.790163;117.25863,31.790544;117.260674,31.79101;117.262535,31.791504;117.263275,31.791719;117.263881,31.791874;117.2654,31.79225;117.267368,31.792722;117.268066,31.792899;117.26887,31.793108;117.269729,31.793306;117.271478,31.793676;117.273237,31.794031;117.274369,31.79424;117.275501,31.794433;117.275785,31.794481;117.276928,31.794648;117.277652,31.794782;117.27843,31.794878;117.279181,31.794953;117.280855,31.795055;117.285366,31.79544",
|
||||
"action": [],
|
||||
"assistant_action": "到达目的地",
|
||||
"tmcs": [
|
||||
{
|
||||
"lcode": [],
|
||||
"distance": "403",
|
||||
"status": "畅通",
|
||||
"polyline": "117.238476,31.787754;117.238696,31.788017;117.238926,31.788253;117.239109,31.788393;117.239302,31.788489;117.239591,31.788607;117.239763,31.788666;117.240278,31.78879;117.24075,31.788886;117.241179,31.788935;117.241941,31.788977;117.242123,31.788999;117.242172,31.789015;117.242258,31.789053"
|
||||
},
|
||||
{
|
||||
"lcode": [],
|
||||
"distance": "271",
|
||||
"status": "畅通",
|
||||
"polyline": "117.242258,31.789053;117.244457,31.789026;117.245128,31.789031"
|
||||
},
|
||||
{
|
||||
"lcode": [],
|
||||
"distance": "113",
|
||||
"status": "畅通",
|
||||
"polyline": "117.245128,31.789031;117.245911,31.789042;117.246093,31.789047;117.246324,31.789053"
|
||||
},
|
||||
{
|
||||
"lcode": [],
|
||||
"distance": "539",
|
||||
"status": "畅通",
|
||||
"polyline": "117.246324,31.789053;117.248073,31.789122;117.248861,31.789176;117.250556,31.789315;117.251999,31.789455"
|
||||
},
|
||||
{
|
||||
"lcode": [],
|
||||
"distance": "29",
|
||||
"status": "畅通",
|
||||
"polyline": "117.251999,31.789455;117.25231,31.789492"
|
||||
},
|
||||
{
|
||||
"lcode": [],
|
||||
"distance": "304",
|
||||
"status": "畅通",
|
||||
"polyline": "117.25231,31.789492;117.25399,31.789718;117.255476,31.789948"
|
||||
},
|
||||
{
|
||||
"lcode": [],
|
||||
"distance": "690",
|
||||
"status": "畅通",
|
||||
"polyline": "117.255476,31.789948;117.256725,31.790163;117.25863,31.790544;117.260674,31.79101;117.262535,31.791504"
|
||||
},
|
||||
{
|
||||
"lcode": [],
|
||||
"distance": "74",
|
||||
"status": "畅通",
|
||||
"polyline": "117.262535,31.791504;117.263275,31.791719"
|
||||
},
|
||||
{
|
||||
"lcode": [],
|
||||
"distance": "59",
|
||||
"status": "畅通",
|
||||
"polyline": "117.263275,31.791719;117.263881,31.791874"
|
||||
},
|
||||
{
|
||||
"lcode": [],
|
||||
"distance": "343",
|
||||
"status": "畅通",
|
||||
"polyline": "117.263881,31.791874;117.2654,31.79225;117.267368,31.792722"
|
||||
},
|
||||
{
|
||||
"lcode": [],
|
||||
"distance": "148",
|
||||
"status": "畅通",
|
||||
"polyline": "117.267368,31.792722;117.268066,31.792899;117.26887,31.793108"
|
||||
},
|
||||
{
|
||||
"lcode": [],
|
||||
"distance": "426",
|
||||
"status": "畅通",
|
||||
"polyline": "117.26887,31.793108;117.269729,31.793306;117.271478,31.793676;117.273237,31.794031"
|
||||
},
|
||||
{
|
||||
"lcode": [],
|
||||
"distance": "1159",
|
||||
"status": "畅通",
|
||||
"polyline": "117.273237,31.794031;117.274369,31.79424;117.275501,31.794433;117.275785,31.794481;117.276928,31.794648;117.277652,31.794782;117.27843,31.794878;117.279181,31.794953;117.280855,31.795055;117.285366,31.79544"
|
||||
}
|
||||
],
|
||||
"cities": [
|
||||
{
|
||||
"name": "合肥市",
|
||||
"citycode": "0551",
|
||||
"adcode": "340100",
|
||||
"districts": [
|
||||
{ "name": "蜀山区", "adcode": "340104" },
|
||||
{ "name": "包河区", "adcode": "340111" }
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"restriction": "0",
|
||||
"traffic_lights": "1"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user