Commit 16a30f72 authored by 吴春's avatar 吴春
parents 1d89c046 b5fc4bf0
......@@ -518,6 +518,7 @@ var tripUtils = {
Title: "",
Description: "",
Rank: 0,
KMNumber:"",
};
},
......
<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,15 +706,15 @@ 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;
background: #FFF;
z-index: 5000;
}
body {
......
......@@ -136,8 +136,13 @@
<el-input type="textarea" :autosize="{minRows: 1, maxRows: 8 }" resize="none" class="w700"
placeholder="请输入行程大点信息" v-model="dayObj.TitleObj.Title"></el-input>
</el-form-item>
<el-form-item style="display:none;">
<el-input placeholder="请输入公里数" class="w120" v-model="dayObj.TitleObj.KMNumber">
<template slot="append">KM</template>
</el-input>
</el-form-item>
</span>
<span class="TC-spanTitle" v-if="dayObj.isRead">{{dayObj.TitleObj.Title}}</span>
<span class="TC-spanTitle" v-if="dayObj.isRead">{{dayObj.TitleObj.Title}} </span>
</div>
</div>
<div class="TC-Comtitlediv">
......@@ -626,7 +631,7 @@
scenicDescribeObj.Describe = s.About;
//this.WarmTripDescribe.ScenicDescribeArr.push(scenicDescribeObj);
if (scenicDescribeObj.Describe != null && scenicDescribeObj.Describe != "") {
// this.dayObj.WarmTipObj.Description += "<p>" + scenicDescribeObj.Describe + "</p>";
// this.dayObj.WarmTipObj.Description += "<p>" + scenicDescribeObj.Describe + "</p>";
}
}
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment