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
c8e58b43
Commit
c8e58b43
authored
Jan 10, 2020
by
zhengke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改
parent
08669180
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
3 deletions
+23
-3
tripMap.vue
src/components/global/tripMap.vue
+23
-3
No files found.
src/components/global/tripMap.vue
View file @
c8e58b43
...
@@ -48,7 +48,8 @@
...
@@ -48,7 +48,8 @@
hotelImage
:
"http://imgfile.oytour.com/static/location_hotel.png"
,
hotelImage
:
"http://imgfile.oytour.com/static/location_hotel.png"
,
scenicImage
:
"http://imgfile.oytour.com/static/location_scenic.png"
,
scenicImage
:
"http://imgfile.oytour.com/static/location_scenic.png"
,
planeImage
:
"http://imgfile.oytour.com/static/location_plane.png"
planeImage
:
"http://imgfile.oytour.com/static/location_plane.png"
}
},
myScenArr
:[]
}
}
},
},
watch
:
{
watch
:
{
...
@@ -152,20 +153,32 @@
...
@@ -152,20 +153,32 @@
//每天
//每天
else
{
else
{
/* 循环标出所有坐标 */
/* 循环标出所有坐标 */
this
.
myScenArr
=
[];
for
(
var
i
=
0
;
i
<
waypoints
.
length
-
1
;
i
++
)
{
for
(
var
i
=
0
;
i
<
waypoints
.
length
-
1
;
i
++
)
{
var
currentItem
=
waypoints
[
i
];
var
currentItem
=
waypoints
[
i
];
var
nextItem
=
waypoints
[
i
+
1
];
var
nextItem
=
waypoints
[
i
+
1
];
if
(
currentItem
&&
currentItem
.
trafficType
==
4
)
{
if
(
currentItem
&&
currentItem
.
trafficType
==
4
)
{
this
.
drawWalkRoute
(
currentItem
.
location
,
nextItem
.
location
);
this
.
drawWalkRoute
(
currentItem
.
location
,
nextItem
.
location
);
this
.
addMarker
(
currentItem
,
i
+
1
),
this
.
addMarker
(
currentItem
,
i
+
1
),
this
.
addMarker
(
nextItem
,
i
+
2
);
this
.
addMarker
(
nextItem
,
i
+
2
);
}
else
{
}
else
{
var
newArray
=
[];
var
newArray
=
[];
newArray
.
push
(
currentItem
);
newArray
.
push
(
currentItem
);
newArray
.
push
(
nextItem
);
newArray
.
push
(
nextItem
);
this
.
drawDrivingRute
(
newArray
);
this
.
drawDrivingRute
(
newArray
);
if
(
waypoints
[
i
].
type
==
2
){
this
.
myScenArr
.
push
(
waypoints
[
i
]);
}
}
}
}
}
for
(
var
i
=
0
;
i
<
this
.
myScenArr
.
length
-
1
;
i
++
){
var
locationStart
=
this
.
myScenArr
[
i
].
location
.
split
(
','
);
var
locationEnd
=
this
.
myScenArr
[
i
+
1
].
location
.
split
(
','
);
let
distance
=
this
.
CalcDistance
(
locationStart
[
0
],
locationStart
[
1
],
locationEnd
[
0
],
locationEnd
[
1
]);
this
.
myScenArr
[
i
].
distance
=
distance
;
}
}
}
},
},
//画驾车路线图
//画驾车路线图
...
@@ -178,6 +191,12 @@
...
@@ -178,6 +191,12 @@
}
}
},
},
addMarker
(
obj
,
title
)
{
addMarker
(
obj
,
title
)
{
console
.
log
(
obj
,
'objjjjj'
);
this
.
myScenArr
.
forEach
(
x
=>
{
if
((
x
.
type
==
obj
.
type
)
&&
(
x
.
name
==
obj
.
name
)){
obj
.
distance
=
x
.
distance
}
})
var
loc
=
obj
.
location
.
split
(
','
);
var
loc
=
obj
.
location
.
split
(
','
);
//生成标记图标
//生成标记图标
var
image
=
{}
var
image
=
{}
...
@@ -232,8 +251,9 @@
...
@@ -232,8 +251,9 @@
});
});
//景点
//景点
if
(
type
==
2
)
{
if
(
type
==
2
)
{
console
.
log
(
obj
,
'objjjjjj'
);
let
infowindow
=
new
google
.
maps
.
InfoWindow
({
let
infowindow
=
new
google
.
maps
.
InfoWindow
({
content
:
'<div>'
+
obj
.
name
+
'</div>'
,
content
:
'<div>'
+
obj
.
name
+
'</div>
<br/><div>'
+
obj
.
distance
+
'<div>
'
,
size
:
new
google
.
maps
.
Size
(
50
,
50
)
size
:
new
google
.
maps
.
Size
(
50
,
50
)
});
});
...
...
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