|
@@ -51,12 +51,35 @@ export default {
|
|
|
title: "",
|
|
|
active_dableData: null,
|
|
|
tableData: null,
|
|
|
+ layersData: {},
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
|
async draw_vector_server(jscType){
|
|
|
let res = await QueryOne({ jscType, id: "4602" });
|
|
|
- tdsy.addLayer({ ...res.data, title: this.title });
|
|
|
+ this.layersData = { ...res.data, title: this.title }
|
|
|
+ tdsy.addLayer(this.layersData);
|
|
|
+ this.Getlayers(res.data.url)
|
|
|
+ },
|
|
|
+ async Getlayers(mapurl) {
|
|
|
+ let url = `${mapurl}/layers.json`;
|
|
|
+ let res = await axios.get(url);
|
|
|
+ let layers = res.data[0].subLayers.layers;
|
|
|
+ if(layers.length > 0)
|
|
|
+ this.layersData.layerName = layers[0].name
|
|
|
+ },
|
|
|
+ async setLayerStatus(item) {
|
|
|
+ if(this.layersData.layerName){
|
|
|
+ var params_gh = {
|
|
|
+ layerName: this.layersData.layerName,
|
|
|
+ isVisible: true,
|
|
|
+ displayFilter: `xmmc = '${item['项目名称']}'`
|
|
|
+ }
|
|
|
+ console.log(params_gh,'params_gh')
|
|
|
+ tdsy.superProvider.setLayerStatusParameters([params_gh],150000,item.id)
|
|
|
+ }else{
|
|
|
+ Message.error('缺少图层名称,设置失败')
|
|
|
+ }
|
|
|
},
|
|
|
multiPolygonToPolygons(multiPolygon) {
|
|
|
const polygons = [];
|
|
@@ -198,10 +221,15 @@ export default {
|
|
|
go(item) {
|
|
|
if(!item.geom){
|
|
|
this.$message.warning( "缺少定位图斑" );
|
|
|
+ }else{
|
|
|
+ if(this.cockpit_vector.mapType) {
|
|
|
+ this.setLayerStatus(item)
|
|
|
+ }
|
|
|
+ else
|
|
|
+ this.addpolygon(item)
|
|
|
}
|
|
|
store.setVectordataid(item.dataid)
|
|
|
let arr = [];
|
|
|
- const that = this;
|
|
|
// BoxCommonVector_entity = new Cesium.CustomDataSource("BoxCommonVector_entity");
|
|
|
// viewer.dataSources.add(BoxCommonVector_entity);
|
|
|
|
|
@@ -212,11 +240,14 @@ export default {
|
|
|
"value": item[key],
|
|
|
});
|
|
|
|
|
|
- if (key == 'geom') {
|
|
|
- console.log();
|
|
|
-
|
|
|
+ });
|
|
|
+ store.state.vectorData = arr
|
|
|
+ store.setActiveToolBar(9);
|
|
|
|
|
|
- let geojson = item[key];
|
|
|
+ },
|
|
|
+ addpolygon(item){
|
|
|
+ const that = this;
|
|
|
+ let geojson = item.geom;
|
|
|
|
|
|
if (geojson.type == 'MultiPolygon') {
|
|
|
this.build_data(geojson);
|
|
@@ -293,16 +324,6 @@ export default {
|
|
|
|
|
|
|
|
|
}, 6000)
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
-
|
|
|
- store.state.vectorData = arr
|
|
|
- store.setActiveToolBar(9);
|
|
|
-
|
|
|
},
|
|
|
change_witch() {
|
|
|
this.get_search(this.state);
|