Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
Athena
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
华国豪
Athena
Commits
08669180
Commit
08669180
authored
Jan 10, 2020
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
c0b56598
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
2 deletions
+17
-2
tripMap.vue
src/components/global/tripMap.vue
+17
-2
No files found.
src/components/global/tripMap.vue
View file @
08669180
...
...
@@ -157,7 +157,7 @@
var
nextItem
=
waypoints
[
i
+
1
];
if
(
currentItem
&&
currentItem
.
trafficType
==
4
)
{
this
.
drawWalkRoute
(
currentItem
.
location
,
nextItem
.
location
);
this
.
addMarker
(
currentItem
,
i
+
1
),
this
.
addMarker
(
currentItem
,
i
+
1
),
this
.
addMarker
(
nextItem
,
i
+
2
);
}
else
{
var
newArray
=
[];
...
...
@@ -174,7 +174,7 @@
var
form_loc
=
array
[
i
].
location
.
split
(
','
);
var
path
=
this
.
polyline
.
getPath
();
//获取线条的坐标
path
.
push
(
new
google
.
maps
.
LatLng
(
form_loc
[
0
],
form_loc
[
1
]));
//为线条添加标记坐标
this
.
addMarker
(
array
[
i
],
i
+
1
);
this
.
addMarker
(
array
[
i
],
i
+
1
);
}
},
addMarker
(
obj
,
title
)
{
...
...
@@ -268,6 +268,21 @@
renderer
.
setMap
(
null
);
}
});
},
//计算两点之间的距离
CalcDistance
(
sX
,
sY
,
eX
,
eY
)
{
var
lat
=
[
sX
,
eX
]
var
lng
=
[
sY
,
sY
]
//var R = 6371; // km (change this constant to get miles)
var
R
=
6378137
;
//地球半径
var
dLat
=
(
lat
[
1
]
-
lat
[
0
])
*
Math
.
PI
/
180
;
var
dLng
=
(
lng
[
1
]
-
lng
[
0
])
*
Math
.
PI
/
180
;
var
dLat1
=
lat
[
0
]
*
Math
.
PI
/
180
;
var
dLat2
=
lat
[
1
]
*
Math
.
PI
/
180
;
var
a
=
Math
.
sin
(
dLat
/
2
)
*
Math
.
sin
(
dLat
/
2
)
+
Math
.
cos
(
dLat1
)
*
Math
.
cos
(
dLat1
)
*
Math
.
sin
(
dLng
/
2
)
*
Math
.
sin
(
dLng
/
2
);
var
c
=
2
*
Math
.
atan2
(
Math
.
sqrt
(
a
),
Math
.
sqrt
(
1
-
a
));
var
d
=
R
*
c
;
return
Math
.
round
(
d
);
}
},
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment