添加搜索条件

master
夜笙歌 1 year ago
parent a10e60718b
commit 7aa5e3e485

@ -46,6 +46,8 @@ const dateRange = ref([])
let map = null
let polyline = null
let polylinePath = ref([])
let distance = null
let text = null
let mouseTool = null
@ -108,6 +110,7 @@ const convertFrom = (LngLatArray, success) =>{
const handleQuery = () => {
polyline ? map.remove([polyline]) : ''
getTrack(proxy.addDateRange(queryParams.value, dateRange.value)).then(e => {
text&&text.remove()
let pathRow = e.data.map(val => [val.longitude, val.latitude])
convertFrom(pathRow,(result)=>{
let lnglats = result.map(e => [e.lng, e.lat]);
@ -118,8 +121,8 @@ const handleQuery = () => {
strokeWeight: 6 // 线
})
map.add(polyline);
let distance = Math.round(AMap.GeometryUtil.distanceOfLine(lnglats));
let text = new AMap.Text({
distance = Math.round(AMap.GeometryUtil.distanceOfLine(lnglats));
text = new AMap.Text({
position: lnglats.at(-1),
text: '行驶路径' + distance + '米',
offset: new AMap.Pixel(-20, -20)

Loading…
Cancel
Save