|
@@ -100,7 +100,11 @@ import { keys } from "lodash";
|
|
|
import { handModel, handnew, clearTranslate, keyName } from "./modelLayering";
|
|
|
import CockpitVector from "./CockpitVector.vue";
|
|
|
import MultiLevelQuery from "./MultiLevelQuery.vue";
|
|
|
-import { loadGeoJSON, str2Unicode } from "@/utils/MapHelper/help.js";
|
|
|
+import {
|
|
|
+ loadGeoJSON,
|
|
|
+ removeGeoJSON,
|
|
|
+ str2Unicode,
|
|
|
+} from "@/utils/MapHelper/help.js";
|
|
|
import * as pick_cockpit_vector from "./pick_cockpit_vector.js";
|
|
|
import * as tdsy from "@/views/cockpit/js/tdsy";
|
|
|
import * as turf from "@turf/turf";
|
|
@@ -198,7 +202,7 @@ export default {
|
|
|
let obj = store.state.vectorlayerlist[i];
|
|
|
if (obj.id == val) {
|
|
|
if (obj.serverType == "geoserver") {
|
|
|
- this.removeGeoJSON();
|
|
|
+ removeGeoJSON("geoserver");
|
|
|
this.addGeoJson("#0000ff");
|
|
|
} else {
|
|
|
this.addGeometrys(obj.type == "S3M");
|
|
@@ -248,7 +252,7 @@ export default {
|
|
|
toggleVisibility() {
|
|
|
this.removeMapLayerQuery();
|
|
|
this.remove_query_click();
|
|
|
- this.removeGeoJSON();
|
|
|
+ removeGeoJSON("geoserver");
|
|
|
store.setToolBarAction(9);
|
|
|
tdsy.remove(false);
|
|
|
},
|
|
@@ -313,7 +317,7 @@ export default {
|
|
|
let cur = geoms[index];
|
|
|
if (cur) {
|
|
|
if (cur.type) {
|
|
|
- this.removeGeoJSON();
|
|
|
+ removeGeoJSON("geoserver");
|
|
|
loadGeoJSON(
|
|
|
cur,
|
|
|
"#ff0000",
|
|
@@ -342,10 +346,10 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
removeGeoJSON() {
|
|
|
- viewer.entities.removeAll();
|
|
|
- viewer.dataSources._dataSources.forEach((das) => {
|
|
|
- if (das.name == "geoserver") viewer.dataSources.remove(das);
|
|
|
- });
|
|
|
+ // viewer.entities.removeAll();
|
|
|
+ // viewer.dataSources._dataSources.forEach((das) => {
|
|
|
+ // if (das.name == "geoserver") viewer.dataSources.remove(das);
|
|
|
+ // });
|
|
|
},
|
|
|
flyToSuperMap(cur) {
|
|
|
dataSourceLayer.entities.removeAll();
|
|
@@ -401,7 +405,7 @@ export default {
|
|
|
let scene = viewer.scene;
|
|
|
viewer.entities.removeAll();
|
|
|
dataSourceLayer.entities.removeAll();
|
|
|
- this.removeGeoJSON();
|
|
|
+ removeGeoJSON("geoserver");
|
|
|
//拾取模型
|
|
|
let pickedFeature = scene.pick(movement.position);
|
|
|
if (
|
|
@@ -415,8 +419,8 @@ export default {
|
|
|
this.pickPosition(movement);
|
|
|
}
|
|
|
},
|
|
|
- async mapSelect(pos, movement) {
|
|
|
- let obj = window.tempSelect;
|
|
|
+ async mapSelect(pos, obj) {
|
|
|
+ // let obj = window.tempSelect;
|
|
|
let queryByIDParameters = {
|
|
|
// getFeatureMode: "BUFFER",
|
|
|
getFeatureMode: "SPATIAL",
|
|
@@ -750,14 +754,13 @@ export default {
|
|
|
? obj.url.indexOf("geoserver")
|
|
|
: obj.url.indexOf("siweiserver");
|
|
|
let url = obj.url.substring(0, ind + 9) + "/ows";
|
|
|
- let point =
|
|
|
- "109.63004004171668,18.23499241311749 109.63028021461876,18.23213821035424 109.63097884008462,18.234344782708543 109.63004004171668,18.23499241311749";
|
|
|
+
|
|
|
let pointml = `<gml:Point srsName='EPSG:4326'><gml:coordinates>
|
|
|
${xy.lng},${xy.lat}</gml:coordinates></gml:Point>`;
|
|
|
let polygonml = `<gml:Polygon srsName="EPSG:4326">
|
|
|
<gml:outerBoundaryIs>
|
|
|
<gml:LinearRing>
|
|
|
- <gml:coordinates> ${point} </gml:coordinates>
|
|
|
+ <gml:coordinates> ${xy.points} </gml:coordinates>
|
|
|
</gml:LinearRing>
|
|
|
</gml:outerBoundaryIs>
|
|
|
</gml:Polygon>`;
|
|
@@ -768,7 +771,9 @@ export default {
|
|
|
typeName: `${obj.fwgzkj}:${obj.fwmc}`,
|
|
|
outputFormat: "application/json",
|
|
|
srsName: "EPSG:4326",
|
|
|
- filter: `<Filter xmlns='http://www.opengis.net/ogc' xmlns:gml='http://www.opengis.net/gml'><Intersects><PropertyName>geom</PropertyName> ${polygonml}</Intersects></Filter>`,
|
|
|
+ filter: `<Filter xmlns='http://www.opengis.net/ogc' xmlns:gml='http://www.opengis.net/gml'><Intersects><PropertyName>geom</PropertyName> ${
|
|
|
+ xy.lng ? pointml : polygonml
|
|
|
+ }</Intersects></Filter>`,
|
|
|
};
|
|
|
console.log("----", params);
|
|
|
let res = await axios.get(url, { params });
|
|
@@ -831,7 +836,7 @@ export default {
|
|
|
this.layersData = [];
|
|
|
viewer.entities.removeAll();
|
|
|
dataSourceLayer.entities.removeAll();
|
|
|
- this.removeGeoJSON();
|
|
|
+ removeGeoJSON("geoserver");
|
|
|
let title;
|
|
|
if (store.state.checkedData) title = store.state.checkedData.title;
|
|
|
// 超图分层分户
|
|
@@ -918,13 +923,13 @@ export default {
|
|
|
this.queryResultsGeom = {};
|
|
|
this.queryResultsGeomPart = {};
|
|
|
this.layerList = [];
|
|
|
- viewer.entities.removeAll();
|
|
|
+ // viewer.entities.removeAll();
|
|
|
if (this.handler.removeInputAction) {
|
|
|
this.handler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_CLICK);
|
|
|
this.handler.removeInputAction(Cesium.ScreenSpaceEventType.RIGHT_CLICK);
|
|
|
}
|
|
|
dataSourceLayer.entities.removeAll();
|
|
|
- this.removeGeoJSON();
|
|
|
+ removeGeoJSON("geoserver");
|
|
|
viewer.dataSources.remove(dataSourceLayer);
|
|
|
},
|
|
|
/**
|
|
@@ -991,8 +996,7 @@ export default {
|
|
|
case 1: {
|
|
|
this.mapQuerys("mapLayerQuery"); //图层点击事件
|
|
|
this.remove_query_click();
|
|
|
- viewer.entities.removeAll();
|
|
|
- common.clearHandlerDrawing("Polygon");
|
|
|
+ // viewer.entities.removeAll();
|
|
|
break;
|
|
|
}
|
|
|
case 2: {
|
|
@@ -1006,7 +1010,7 @@ export default {
|
|
|
this.$refs.MultiLevelQuery.clear_data(); //多级查询
|
|
|
|
|
|
this.remove_query_click();
|
|
|
-
|
|
|
+ common.clearHandlerDrawing("Polygon");
|
|
|
break;
|
|
|
}
|
|
|
case 4: {
|
|
@@ -1033,6 +1037,15 @@ export default {
|
|
|
//绘制
|
|
|
drawMap() {
|
|
|
let nReaions = [];
|
|
|
+ let that = this;
|
|
|
+ this.activeLayerId = "0";
|
|
|
+ this.layerList = [];
|
|
|
+ this.layersData = [];
|
|
|
+ // this.remove_query_click();
|
|
|
+ // let scene = viewer.scene;
|
|
|
+ // viewer.entities.removeAll();
|
|
|
+ // dataSourceLayer.entities.removeAll();
|
|
|
+ removeGeoJSON("geoserver");
|
|
|
if (!window.handlerPolygon) {
|
|
|
common.initHandler("Polygon");
|
|
|
}
|
|
@@ -1046,19 +1059,26 @@ export default {
|
|
|
filteredArr.push(res.positions[1]);
|
|
|
console.log(filteredArr, "max-----");
|
|
|
for (let i = 0; i < filteredArr.length; i += 2) {
|
|
|
- // result.push(arr.slice(i, i + 2));
|
|
|
nReaions.push({
|
|
|
x: filteredArr.slice(i, i + 2)[0],
|
|
|
y: filteredArr.slice(i, i + 2)[1],
|
|
|
});
|
|
|
}
|
|
|
- console.log(nReaions, "nReaions");
|
|
|
-
|
|
|
+ // console.log(nReaions, "nReaions");
|
|
|
+ removeGeoJSON("geoserver");
|
|
|
store.state.vectorlayerlist.forEach((obj) => {
|
|
|
if (obj.serverType == "geoserver") {
|
|
|
- // this.getGeoserver(xy, obj);
|
|
|
+ let points = "";
|
|
|
+ res.positions.forEach((item, index) => {
|
|
|
+ if ((index + 1) % 3 == 1) points += item + ",";
|
|
|
+ if ((index + 1) % 3 == 2) points += item + " ";
|
|
|
+ });
|
|
|
+ points += res.positions[0] + ",";
|
|
|
+ points += res.positions[1] + " ";
|
|
|
+ console.log(res.positions, points);
|
|
|
+ this.getGeoserver({ points }, obj);
|
|
|
} else {
|
|
|
- this.mapSelect(nReaions);
|
|
|
+ this.mapSelect(nReaions,obj);
|
|
|
}
|
|
|
});
|
|
|
},
|