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
3f8dccdc
Commit
3f8dccdc
authored
Sep 13, 2023
by
youjie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
dfbacbb0
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
10 deletions
+25
-10
tripmap.vue
...omponents/newTravelmanager/TravelGroupControl/tripmap.vue
+25
-10
No files found.
src/components/newTravelmanager/TravelGroupControl/tripmap.vue
View file @
3f8dccdc
<
template
>
<div
class=
"tripmap-form marginT20"
v-if=
"dataAll"
>
<div
class=
"row"
>
<div
class=
"row"
v-loading=
"setLoading"
>
<div
v-for=
"(x, index) in TripMapList"
::key=
"x.Id"
...
...
@@ -87,6 +88,7 @@ export default {
props
:
[
"dataAll"
,
"ConfigId"
],
data
()
{
return
{
setLoading
:
false
,
imageUrl
:
""
,
deviceMarkers
:
[],
loadingCity
:
false
,
...
...
@@ -202,6 +204,7 @@ export default {
container
:
"trip_map"
,
style
:
"mapbox://styles/alex9012/clm92pvs1011j01qzexlh6g2b"
,
// 'mapbox://styles/mapbox/light-v9','mapbox://styles/alex9012/clm92pvs1011j01qzexlh6g2b'
center
:
[
2.177432
,
41.382894
],
zoom
:
6
,
preserveDrawingBuffer
:
true
});
this
.
map
.
on
(
"load"
,
async
()
=>
{
...
...
@@ -242,13 +245,29 @@ export default {
},
methods
:
{
getResultImg
()
{
this
.
setLoading
=
true
let
that
=
this
var
postJson
=
{
ConfigId
:
this
.
ConfigId
,
};
this
.
imageUrl
=
this
.
map
.
getCanvas
().
toDataURL
(
"image/png"
);
let
mapCanvas
=
document
.
querySelector
(
".mapboxgl-canvas"
);
// mapCanvas.style.display = "none";
html2Canvas
(
document
.
getElementById
(
'trip_map'
)).
then
(
function
(
canvas
)
{
var
image
=
document
.
createElement
(
"a"
);
//image.href = canvas.toDataURL("image/jpeg").replace("image/jpeg", "image/octet-stream");
image
.
href
=
canvas
.
toDataURL
(
"image/png"
);
console
.
log
(
image
.
href
,
'========='
)
let
blob
=
that
.
base64ToBlob
(
image
.
href
);
let
newArr
=
[];
newArr
.
push
(
blob
);
var
path
=
`/Upload/Temporary`
;
that
.
uploadSelfBlob
(
path
,
newArr
,
postJson
,
x
=>
{
if
(
x
.
data
.
StatusCode
==
1
){
let
allPath
=
that
.
domainManager
().
ViittoFileUrl
+
x
.
data
.
FilePath
;
// console.log(allPath,'------')
}
that
.
setLoading
=
false
})
return
image
.
download
=
"map.png"
;
image
.
click
();
});
...
...
@@ -308,16 +327,12 @@ export default {
// 获取坐标信息
await
this
.
calcCitiesGeoInfoHandler
();
//console.log(this.citiesData)
console
.
log
(
this
.
map
);
// 可见范围
const
bounds
=
new
mapboxgl
.
LngLatBounds
();
this
.
citiesData
.
forEach
(
city
=>
{
bounds
.
extend
([
city
.
longitude
,
city
.
latitude
]);
});
console
.
log
(
bounds
);
this
.
map
.
fitBounds
(
bounds
);
console
.
log
(
bounds
,
'========bounds'
)
this
.
map
.
setCenter
(
bounds
.
getCenter
());
this
.
addMarker
();
//标记
this
.
createLineHandler
();
//连线
...
...
@@ -691,13 +706,13 @@ export default {
}
#trip_map
{
width
:
100%
;
/* height: 500px; */
height
:
500px
;
position
:
absolute
;
/* position: fixed; */
top
:
0
;
bottom
:
0
;
left
:
0
;
right
:
0
;
position
:
fixed
;
background
:
#FFF
;
z-index
:
5000
;
}
...
...
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