Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
SuperMan
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
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
罗超
SuperMan
Commits
c9f92deb
Commit
c9f92deb
authored
Sep 14, 2023
by
youjie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
4a450458
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
38 deletions
+25
-38
tripmap.vue
...omponents/newTravelmanager/TravelGroupControl/tripmap.vue
+25
-38
No files found.
src/components/newTravelmanager/TravelGroupControl/tripmap.vue
View file @
c9f92deb
...
...
@@ -67,8 +67,7 @@
<span
class=
"MapImgButtom CancelMapImg"
@
click=
"Cancel"
>
取消
</span>
</div>
<div
style=
"margin-left: 20px;"
>
<!-- setLoading=true, -->
<span
class=
"MapImgButtom setMapImg"
@
click=
"getResultImg"
>
生成图片
</span>
<span
class=
"MapImgButtom setMapImg"
@
click=
"setLoading=true,getResultImg"
>
生成图片
</span>
</div>
</div>
</div>
...
...
@@ -122,11 +121,12 @@ export default {
watch
:
{
citiesData
:
{
handler
(
val
,
oldVal
)
{
this
.
TripMapList
.
forEach
(
x
=>
{
this
.
TripMapList
.
length
>
0
&&
this
.
TripMapList
.
forEach
(
x
=>
{
x
.
CityList
.
forEach
(
y
=>
{
this
.
citiesData
.
forEach
(
z
=>
{
if
(
y
.
MName
==
z
.
name
&&
y
.
PositionStr
.
Left
){
z
.
PositionStr
=
JSON
.
parse
(
JSON
.
stringify
(
y
.
PositionStr
))
if
(
y
.
MName
==
z
.
name
&&
y
.
Lng
){
z
.
Lng
=
y
.
Lng
z
.
Lat
=
y
.
Lat
}
})
})
...
...
@@ -160,6 +160,8 @@ export default {
MapLevel
:
0
,
MapUrl
:
""
,
ParentId
:
0
,
Lng
:
""
,
Lat
:
""
,
PositionStr
:
{
Bottom
:
0
,
Left
:
0
,
...
...
@@ -232,13 +234,13 @@ export default {
x
.
CityList
.
forEach
(
y
=>
{
this
.
citiesData
.
forEach
(
z
=>
{
if
(
y
.
MName
==
z
.
name
){
y
.
PositionStr
=
JSON
.
parse
(
JSON
.
stringify
(
z
.
PositionStr
))
y
.
Lng
=
z
.
Lng
y
.
Lat
=
z
.
Lat
}
})
})
})
this
.
dataAll
.
TripMapList
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
TripMapList
))
// this.$forceUpdate()
},
// 导出地图片
getResultImg
()
{
...
...
@@ -262,25 +264,14 @@ export default {
let
allPath
=
that
.
domainManager
().
ViittoFileUrl
+
x
.
data
.
FilePath
;
that
.
dataAll
.
Mapurl
=
allPath
that
.
$emit
(
'Success'
,
allPath
)
}
else
{
that
.
setLoading
=
false
}
})
return
image
.
download
=
"map.png"
;
image
.
click
();
that
.
setLoading
=
false
that
.
deviceMarkers
.
forEach
((
x
,
index
)
=>
{
var
currentMarkerLngLat
=
x
.
getLngLat
();
this
.
citiesData
.
forEach
(
y
=>
{
if
(
y
.
longitude
!=
currentMarkerLngLat
.
lng
||
y
.
latitude
!=
currentMarkerLngLat
.
lat
){
y
.
PositionStr
.
Left
=
currentMarkerLngLat
.
lng
y
.
PositionStr
.
Right
=
currentMarkerLngLat
.
lat
}
else
{
y
.
PositionStr
.
Top
=
currentMarkerLngLat
.
lng
y
.
PositionStr
.
Bottom
=
currentMarkerLngLat
.
lat
}
})
})
});
},
Cancel
(){
...
...
@@ -335,8 +326,9 @@ export default {
this
.
TripMapList
.
forEach
(
x
=>
{
x
.
CityList
.
forEach
(
y
=>
{
this
.
citiesData
.
forEach
(
z
=>
{
if
(
y
.
MName
==
z
.
name
&&
y
.
PositionStr
.
Left
!=
0
){
z
.
PositionStr
=
JSON
.
parse
(
JSON
.
stringify
(
y
.
PositionStr
))
if
(
y
.
MName
==
z
.
name
&&
y
.
Lng
){
z
.
Lng
=
y
.
Lng
z
.
Lat
=
y
.
Lat
}
})
})
...
...
@@ -393,6 +385,8 @@ export default {
MapLevel
:
0
,
MapUrl
:
""
,
ParentId
:
null
,
Lng
:
""
,
Lat
:
""
,
PositionStr
:
{
Bottom
:
0
,
Left
:
0
,
...
...
@@ -434,6 +428,8 @@ export default {
MapLevel
:
0
,
MapUrl
:
""
,
ParentId
:
x
.
MId
,
Lng
:
""
,
Lat
:
""
,
PositionStr
:
{
Bottom
:
0
,
Left
:
0
,
...
...
@@ -526,8 +522,8 @@ export default {
var
marker
=
new
mapboxgl
.
Marker
({
color
:
"#d73b33"
,
scale
:
0.5
})
.
setLngLat
([
item
.
longitude
,
item
.
latitude
])
.
addTo
(
this
.
map
);
if
(
item
.
PositionStr
.
Left
&&
item
.
PositionStr
.
Righ
t
){
this
.
addLabel
(
item
,
i
,
item
.
PositionStr
);
if
(
item
.
Lng
&&
item
.
La
t
){
this
.
addLabel
(
item
,
i
,
item
);
}
else
{
this
.
addLabel
(
item
,
i
);
}
...
...
@@ -550,19 +546,16 @@ export default {
draggable: true
})
if(PositionStr){
marker.setLngLat([PositionStr.L
eft, PositionStr.Righ
t])
marker.setLngLat([PositionStr.L
ng, PositionStr.La
t])
}else{
marker.setLngLat([item.longitude, item.latitude])
}
// marker.setLngLat([item.PositionStr.Left?item.PositionStr.Left:item.longitude, item.PositionStr.Right?item.PositionStr.Right:item.latitude])
marker.addTo(this.map);
let currentMarkerLngLat = marker.getLngLat();
// that.citiesData[i].PositionStr.Left = currentMarkerLngLat.lng
// that.citiesData[i].PositionStr.Right = currentMarkerLngLat.lat
marker.on('dragend', function() {
currentMarkerLngLat = marker.getLngLat();
that.citiesData[i].
PositionStr.Left
= currentMarkerLngLat.lng
that.citiesData[i].
PositionStr.Righ
t = currentMarkerLngLat.lat
let
currentMarkerLngLat = marker.getLngLat();
that.citiesData[i].
Lng
= currentMarkerLngLat.lng
that.citiesData[i].
La
t = currentMarkerLngLat.lat
that.SavePositionStr()
});
...
...
@@ -581,13 +574,7 @@ export default {
const
data
=
await
response
.
json
();
if
(
data
.
features
.
length
>
0
)
{
const
[
longitude
,
latitude
]
=
data
.
features
[
0
].
center
;
this
.
citiesData
.
push
({
name
:
cityName
,
longitude
,
latitude
,
PositionStr
:{
Left
:
0
,
Top
:
0
,
Right
:
0
,
Bottom
:
0
,
}
this
.
citiesData
.
push
({
name
:
cityName
,
longitude
,
latitude
,
Lng
:
""
,
Lat
:
""
});
}
else
{
this
.
coordinates
=
null
;
...
...
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