Commit 07d9efe7 authored by youjie's avatar youjie

no message

parent 8d568a4f
......@@ -62,7 +62,7 @@
:preview-src-list="[PostConfig.MapUrl]">
</el-image>
</div>
<p v-else>地图暂未生成图</p>
<p v-else @click="ShowMap=!ShowMap">地图暂未生成图</p>
</div>
</div>
<Tripmap v-if="ShowMap" :dataAll="PostConfig" :ConfigId="ConfigId" @Cancel="ShowMap=false" @Success="getMapImgSuccess"></Tripmap>
......
......@@ -64,6 +64,13 @@
<div>
<span class="MapImgButtom CancelMapImg" @click="Cancel">取消</span>
</div>
<div style="margin-left: 20px;">
<span
class="MapImgButtom setMapImg"
@click="SavePositionStr"
>保存坐标</span
>
</div>
<div style="margin-left: 20px;">
<span
class="MapImgButtom setMapImg"
......@@ -298,31 +305,25 @@ export default {
await this.addCountriesMaker(); //标记国家
//this.addDocumentEventListener();
},
// 记录PositionStr
SavePositionStr(type) {
if (type) {
this.TripMapList.forEach(x => {
x.CityList.forEach(y => {
this.citiesData.forEach(z => {
if (y.MName == z.name) {
y.Lng = z.Lng;
y.Lat = z.Lat;
}
});
});
// 保存标记坐标
SavePositionStr() {
this.TripMapList.forEach(x => {
x.CityList.forEach(y => {
this.citiesData.forEach(z => {
if (y.MName == z.name) {
y.Lng = z.Lng;
y.Lat = z.Lat;
}
});
this.dataAll.TripMapList = JSON.parse(JSON.stringify(this.TripMapList));
} else {
this.TripMapList.forEach(x => {
this.countriesData.forEach(y => {
if (x.MName == y.name) {
x.Lng = y.Lng;
x.Lat = y.Lat;
}
});
});
this.countriesData.forEach(y => {
if (x.MName == y.name) {
x.Lng = y.Lng;
x.Lat = y.Lat;
}
});
// this.dataAll.TripMapList = JSON.parse(JSON.stringify(this.TripMapList))
}
});
this.dataAll.TripMapList = JSON.parse(JSON.stringify(this.TripMapList));
},
// 导出地图片
getResultImg() {
......@@ -636,44 +637,7 @@ export default {
source: source,
paint: paintBgObj
})
};
return
var layTextObj = {
id: "mapLayer-"+ x.MId,
type: "fill",
source: "word-source-japan", //创建的数据源id
filter: ["==", "NAME_ZH", x.MName],
paint: {},
layout: {
'text-field': "{name}"
}
};
this.map.addLayer(layTextObj);
var paintBgObj = {
//设置属性
"fill-color": {
'property': 'cartodb_id',
stops: [
[1, "#0080ff"],
[10, "#FFC0CB"],
[20, "#DB7093"],
[30, "#EE82EE"],
[30, "#BA55D3"],
[50, "#6A5ACD"]
]
},
"fill-outline-color": "#4f4f4f",
"fill-opacity": 0.5
};
var layBg = {
id: "mapLayerId-"+ x.MId,
type: "fill",
source: "word-source-japan", //创建的数据源id
paint: paintBgObj
};
this.map.addLayer(layBg);
}
});
},
......@@ -726,7 +690,6 @@ export default {
let currentMarkerLngLat = marker.getLngLat();
that.citiesData[i].Lng = currentMarkerLngLat.lng;
that.citiesData[i].Lat = currentMarkerLngLat.lat;
that.SavePositionStr(1);
});
this.deviceMarkers.push(marker);
......@@ -919,7 +882,6 @@ export default {
let currentMarkerLngLat = marker.getLngLat();
that.countriesData[i].Lng = currentMarkerLngLat.lng;
that.countriesData[i].Lat = currentMarkerLngLat.lat;
// that.SavePositionStr()
});
this.countriesMarkers.push(marker);
}
......
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