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
4459abf6
Commit
4459abf6
authored
Oct 16, 2023
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
56d1057c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
15 deletions
+34
-15
tripmap.vue
...omponents/newTravelmanager/TravelGroupControl/tripmap.vue
+34
-15
No files found.
src/components/newTravelmanager/TravelGroupControl/tripmap.vue
View file @
4459abf6
...
...
@@ -35,7 +35,9 @@
mapboxgl
.
accessToken
=
"pk.eyJ1IjoiYWxleDkwMTIiLCJhIjoiY2xtOGw4NHdkMGFndTNjcnFkeWZncGc2dyJ9.lVrAdPHE0Dg5zoWFidfj4Q"
;
import
html2Canvas
from
"html2canvas"
;
import
{
continueRobotMsg
}
from
'../../../store/actions/msgs'
;
import
{
continueRobotMsg
}
from
'../../../store/actions/msgs'
;
export
default
{
props
:
[
"PostConfig"
],
data
()
{
...
...
@@ -95,7 +97,7 @@ import { continueRobotMsg } from '../../../store/actions/msgs';
deviceMarkers
:
[],
//城市Markers
allMapCityList
:
[],
//地图显示所有城市
countriesMarkers
:
[],
//国家的Markers
chooseCountry
:
[],
//选中的国家
chooseCity
:
[],
//选中的城市
};
...
...
@@ -213,10 +215,11 @@ import { continueRobotMsg } from '../../../store/actions/msgs';
this
.
map
.
fitBounds
(
bounds
,
{
padding
:
150
,
// 可选:在地图边界周围添加一些内边距
});
if
(
this
.
countriesData
&&
this
.
countriesData
.
length
>
0
&&
this
.
countriesData
.
length
==
1
)
{
this
.
map
.
setCenter
(
bounds
.
getCenter
());
}
}
if
(
this
.
countriesData
&&
this
.
countriesData
.
length
>
0
&&
this
.
countriesData
.
length
==
1
)
{
this
.
map
.
setCenter
(
bounds
.
getCenter
());
}
this
.
addMarker
();
//标记
this
.
createLineHandler
();
await
this
.
addCountriesMaker
();
//标记国家
...
...
@@ -232,17 +235,25 @@ import { continueRobotMsg } from '../../../store/actions/msgs';
return
cItem
.
ID
===
countryItem
;
});
if
(
tempCountry
&&
tempCountry
.
ID
>
0
)
{
var
countryLng
=
""
;
var
countryLat
=
""
;
if
(
tempCountry
.
Lng
)
{
countryLng
=
Number
(
tempCountry
.
Lng
);
}
if
(
tempCountry
.
Lng
)
{
countryLat
=
Number
(
tempCountry
.
Lat
);
}
let
countryObj
=
{
Id
:
0
,
MName
:
tempCountry
.
Name
,
name
:
tempCountry
.
Name
,
MId
:
tempCountry
.
ID
,
ColorStr
:
this
.
PostConfig
.
TripColor
?
this
.
PostConfig
.
TripColor
:
"#409eff"
,
Lng
:
tempCountry
.
Lng
,
Lat
:
tempCountry
.
Lat
,
longitude
:
tempCountry
.
Lng
,
latitude
:
tempCountry
.
Lat
,
MType
:
1
,
Lng
:
country
Lng
,
Lat
:
country
Lat
,
longitude
:
country
Lng
,
latitude
:
country
Lat
,
MType
:
1
,
};
//判断是否存在国家
let
tempCountryIndex
=
this
.
countriesData
.
findIndex
(
y
=>
y
.
MName
==
countryObj
.
MName
)
...
...
@@ -259,6 +270,14 @@ import { continueRobotMsg } from '../../../store/actions/msgs';
var
tempCity
=
this
.
SourceCityList
.
find
((
cItem
)
=>
{
return
cItem
.
ID
===
qcity
;
});
var
cityLng
=
""
;
var
cityLat
=
""
;
if
(
tempCity
.
Lng
)
{
cityLng
=
Number
(
tempCity
.
Lng
);
}
if
(
tempCity
.
Lng
)
{
cityLat
=
Number
(
tempCity
.
Lat
);
}
var
cityObj
=
{
Id
:
0
,
MName
:
tempCity
.
Name
,
...
...
@@ -266,12 +285,12 @@ import { continueRobotMsg } from '../../../store/actions/msgs';
MId
:
tempCity
.
ID
,
PMName
:
tempCity
.
CountryName
,
ColorStr
:
this
.
PostConfig
.
TripColor
?
this
.
PostConfig
.
TripColor
:
"#409eff"
,
Lng
:
tempCity
.
Lng
,
Lat
:
tempCity
.
Lat
,
longitude
:
tempCity
.
Lng
,
latitude
:
tempCity
.
Lat
,
Lng
:
city
Lng
,
Lat
:
city
Lat
,
longitude
:
city
Lng
,
latitude
:
city
Lat
,
ParentId
:
tempCity
.
CountryId
,
MType
:
2
,
MType
:
2
,
}
//判断城市是否存在
let
tempCityIndex
=
this
.
citiesData
.
findIndex
(
y
=>
y
.
MName
==
cityObj
.
MName
)
...
...
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