Commit 07d9efe7 authored by youjie's avatar youjie

no message

parent 8d568a4f
...@@ -62,7 +62,7 @@ ...@@ -62,7 +62,7 @@
:preview-src-list="[PostConfig.MapUrl]"> :preview-src-list="[PostConfig.MapUrl]">
</el-image> </el-image>
</div> </div>
<p v-else>地图暂未生成图</p> <p v-else @click="ShowMap=!ShowMap">地图暂未生成图</p>
</div> </div>
</div> </div>
<Tripmap v-if="ShowMap" :dataAll="PostConfig" :ConfigId="ConfigId" @Cancel="ShowMap=false" @Success="getMapImgSuccess"></Tripmap> <Tripmap v-if="ShowMap" :dataAll="PostConfig" :ConfigId="ConfigId" @Cancel="ShowMap=false" @Success="getMapImgSuccess"></Tripmap>
......
...@@ -64,6 +64,13 @@ ...@@ -64,6 +64,13 @@
<div> <div>
<span class="MapImgButtom CancelMapImg" @click="Cancel">取消</span> <span class="MapImgButtom CancelMapImg" @click="Cancel">取消</span>
</div> </div>
<div style="margin-left: 20px;">
<span
class="MapImgButtom setMapImg"
@click="SavePositionStr"
>保存坐标</span
>
</div>
<div style="margin-left: 20px;"> <div style="margin-left: 20px;">
<span <span
class="MapImgButtom setMapImg" class="MapImgButtom setMapImg"
...@@ -298,31 +305,25 @@ export default { ...@@ -298,31 +305,25 @@ export default {
await this.addCountriesMaker(); //标记国家 await this.addCountriesMaker(); //标记国家
//this.addDocumentEventListener(); //this.addDocumentEventListener();
}, },
// 记录PositionStr // 保存标记坐标
SavePositionStr(type) { SavePositionStr() {
if (type) { this.TripMapList.forEach(x => {
this.TripMapList.forEach(x => { x.CityList.forEach(y => {
x.CityList.forEach(y => { this.citiesData.forEach(z => {
this.citiesData.forEach(z => { if (y.MName == z.name) {
if (y.MName == z.name) { y.Lng = z.Lng;
y.Lng = z.Lng; y.Lat = z.Lat;
y.Lat = z.Lat; }
}
});
});
}); });
this.dataAll.TripMapList = JSON.parse(JSON.stringify(this.TripMapList)); });
} else { this.countriesData.forEach(y => {
this.TripMapList.forEach(x => { if (x.MName == y.name) {
this.countriesData.forEach(y => { x.Lng = y.Lng;
if (x.MName == y.name) { x.Lat = y.Lat;
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() { getResultImg() {
...@@ -636,44 +637,7 @@ export default { ...@@ -636,44 +637,7 @@ export default {
source: source, source: source,
paint: paintBgObj 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 { ...@@ -726,7 +690,6 @@ export default {
let currentMarkerLngLat = marker.getLngLat(); let currentMarkerLngLat = marker.getLngLat();
that.citiesData[i].Lng = currentMarkerLngLat.lng; that.citiesData[i].Lng = currentMarkerLngLat.lng;
that.citiesData[i].Lat = currentMarkerLngLat.lat; that.citiesData[i].Lat = currentMarkerLngLat.lat;
that.SavePositionStr(1);
}); });
this.deviceMarkers.push(marker); this.deviceMarkers.push(marker);
...@@ -919,7 +882,6 @@ export default { ...@@ -919,7 +882,6 @@ export default {
let currentMarkerLngLat = marker.getLngLat(); let currentMarkerLngLat = marker.getLngLat();
that.countriesData[i].Lng = currentMarkerLngLat.lng; that.countriesData[i].Lng = currentMarkerLngLat.lng;
that.countriesData[i].Lat = currentMarkerLngLat.lat; that.countriesData[i].Lat = currentMarkerLngLat.lat;
// that.SavePositionStr()
}); });
this.countriesMarkers.push(marker); 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