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 @@
...
@@ -35,7 +35,9 @@
mapboxgl
.
accessToken
=
mapboxgl
.
accessToken
=
"pk.eyJ1IjoiYWxleDkwMTIiLCJhIjoiY2xtOGw4NHdkMGFndTNjcnFkeWZncGc2dyJ9.lVrAdPHE0Dg5zoWFidfj4Q"
;
"pk.eyJ1IjoiYWxleDkwMTIiLCJhIjoiY2xtOGw4NHdkMGFndTNjcnFkeWZncGc2dyJ9.lVrAdPHE0Dg5zoWFidfj4Q"
;
import
html2Canvas
from
"html2canvas"
;
import
html2Canvas
from
"html2canvas"
;
import
{
continueRobotMsg
}
from
'../../../store/actions/msgs'
;
import
{
continueRobotMsg
}
from
'../../../store/actions/msgs'
;
export
default
{
export
default
{
props
:
[
"PostConfig"
],
props
:
[
"PostConfig"
],
data
()
{
data
()
{
...
@@ -95,7 +97,7 @@ import { continueRobotMsg } from '../../../store/actions/msgs';
...
@@ -95,7 +97,7 @@ import { continueRobotMsg } from '../../../store/actions/msgs';
deviceMarkers
:
[],
//城市Markers
deviceMarkers
:
[],
//城市Markers
allMapCityList
:
[],
//地图显示所有城市
allMapCityList
:
[],
//地图显示所有城市
countriesMarkers
:
[],
//国家的Markers
countriesMarkers
:
[],
//国家的Markers
chooseCountry
:
[],
//选中的国家
chooseCountry
:
[],
//选中的国家
chooseCity
:
[],
//选中的城市
chooseCity
:
[],
//选中的城市
};
};
...
@@ -213,10 +215,11 @@ import { continueRobotMsg } from '../../../store/actions/msgs';
...
@@ -213,10 +215,11 @@ import { continueRobotMsg } from '../../../store/actions/msgs';
this
.
map
.
fitBounds
(
bounds
,
{
this
.
map
.
fitBounds
(
bounds
,
{
padding
:
150
,
// 可选:在地图边界周围添加一些内边距
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
.
addMarker
();
//标记
this
.
createLineHandler
();
this
.
createLineHandler
();
await
this
.
addCountriesMaker
();
//标记国家
await
this
.
addCountriesMaker
();
//标记国家
...
@@ -232,17 +235,25 @@ import { continueRobotMsg } from '../../../store/actions/msgs';
...
@@ -232,17 +235,25 @@ import { continueRobotMsg } from '../../../store/actions/msgs';
return
cItem
.
ID
===
countryItem
;
return
cItem
.
ID
===
countryItem
;
});
});
if
(
tempCountry
&&
tempCountry
.
ID
>
0
)
{
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
=
{
let
countryObj
=
{
Id
:
0
,
Id
:
0
,
MName
:
tempCountry
.
Name
,
MName
:
tempCountry
.
Name
,
name
:
tempCountry
.
Name
,
name
:
tempCountry
.
Name
,
MId
:
tempCountry
.
ID
,
MId
:
tempCountry
.
ID
,
ColorStr
:
this
.
PostConfig
.
TripColor
?
this
.
PostConfig
.
TripColor
:
"#409eff"
,
ColorStr
:
this
.
PostConfig
.
TripColor
?
this
.
PostConfig
.
TripColor
:
"#409eff"
,
Lng
:
tempCountry
.
Lng
,
Lng
:
country
Lng
,
Lat
:
tempCountry
.
Lat
,
Lat
:
country
Lat
,
longitude
:
tempCountry
.
Lng
,
longitude
:
country
Lng
,
latitude
:
tempCountry
.
Lat
,
latitude
:
country
Lat
,
MType
:
1
,
MType
:
1
,
};
};
//判断是否存在国家
//判断是否存在国家
let
tempCountryIndex
=
this
.
countriesData
.
findIndex
(
y
=>
y
.
MName
==
countryObj
.
MName
)
let
tempCountryIndex
=
this
.
countriesData
.
findIndex
(
y
=>
y
.
MName
==
countryObj
.
MName
)
...
@@ -259,6 +270,14 @@ import { continueRobotMsg } from '../../../store/actions/msgs';
...
@@ -259,6 +270,14 @@ import { continueRobotMsg } from '../../../store/actions/msgs';
var
tempCity
=
this
.
SourceCityList
.
find
((
cItem
)
=>
{
var
tempCity
=
this
.
SourceCityList
.
find
((
cItem
)
=>
{
return
cItem
.
ID
===
qcity
;
return
cItem
.
ID
===
qcity
;
});
});
var
cityLng
=
""
;
var
cityLat
=
""
;
if
(
tempCity
.
Lng
)
{
cityLng
=
Number
(
tempCity
.
Lng
);
}
if
(
tempCity
.
Lng
)
{
cityLat
=
Number
(
tempCity
.
Lat
);
}
var
cityObj
=
{
var
cityObj
=
{
Id
:
0
,
Id
:
0
,
MName
:
tempCity
.
Name
,
MName
:
tempCity
.
Name
,
...
@@ -266,12 +285,12 @@ import { continueRobotMsg } from '../../../store/actions/msgs';
...
@@ -266,12 +285,12 @@ import { continueRobotMsg } from '../../../store/actions/msgs';
MId
:
tempCity
.
ID
,
MId
:
tempCity
.
ID
,
PMName
:
tempCity
.
CountryName
,
PMName
:
tempCity
.
CountryName
,
ColorStr
:
this
.
PostConfig
.
TripColor
?
this
.
PostConfig
.
TripColor
:
"#409eff"
,
ColorStr
:
this
.
PostConfig
.
TripColor
?
this
.
PostConfig
.
TripColor
:
"#409eff"
,
Lng
:
tempCity
.
Lng
,
Lng
:
city
Lng
,
Lat
:
tempCity
.
Lat
,
Lat
:
city
Lat
,
longitude
:
tempCity
.
Lng
,
longitude
:
city
Lng
,
latitude
:
tempCity
.
Lat
,
latitude
:
city
Lat
,
ParentId
:
tempCity
.
CountryId
,
ParentId
:
tempCity
.
CountryId
,
MType
:
2
,
MType
:
2
,
}
}
//判断城市是否存在
//判断城市是否存在
let
tempCityIndex
=
this
.
citiesData
.
findIndex
(
y
=>
y
.
MName
==
cityObj
.
MName
)
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