|
|
@@ -81,10 +81,23 @@
|
|
|
/>
|
|
|
</el-select>
|
|
|
</div>
|
|
|
- <div v-if="['lon', 'lat', 'filePath', 'EPSILON'].includes(item)">
|
|
|
+ <div
|
|
|
+ v-if="
|
|
|
+ [
|
|
|
+ 'lon',
|
|
|
+ 'lat',
|
|
|
+ 'lonKey',
|
|
|
+ 'latKey',
|
|
|
+ 'filePath',
|
|
|
+ 'EPSILON',
|
|
|
+ 'distance',
|
|
|
+ ].includes(item)
|
|
|
+ "
|
|
|
+ >
|
|
|
{{ item }}:
|
|
|
<el-input
|
|
|
v-model="params[item]"
|
|
|
+ @input="handleSelectChange(item, $event)"
|
|
|
style="width: 240px"
|
|
|
:placeholder="'请输入' + item"
|
|
|
/>
|
|
|
@@ -153,6 +166,7 @@
|
|
|
<vue-json-editor
|
|
|
v-model="backData.content"
|
|
|
:value="backData.content"
|
|
|
+ @json-change="handleJsonChange2"
|
|
|
:show-btns="false"
|
|
|
:mode="'code'"
|
|
|
:lang="'zh'"
|
|
|
@@ -412,10 +426,10 @@ export default {
|
|
|
value: "1.2.5.4",
|
|
|
label: "缓冲区计算",
|
|
|
},
|
|
|
- // {
|
|
|
- // value: "1.2.5.5",
|
|
|
- // label: "线面体分割",
|
|
|
- // },
|
|
|
+ {
|
|
|
+ value: "1.2.5.5",
|
|
|
+ label: "线面体分割",
|
|
|
+ },
|
|
|
// {
|
|
|
// value: "1.2.5.6",
|
|
|
// label: "时空差异分析",
|
|
|
@@ -538,6 +552,9 @@ export default {
|
|
|
handleJsonChange(jsonStr) {
|
|
|
this.jsonData = jsonStr;
|
|
|
},
|
|
|
+ handleJsonChange2(jsonStr) {
|
|
|
+ this.backData.content = jsonStr;
|
|
|
+ },
|
|
|
// 搜索微功能服务
|
|
|
searchServerList() {
|
|
|
let requestParams = {
|
|
|
@@ -606,6 +623,7 @@ export default {
|
|
|
this.addLine(coordinates);
|
|
|
break;
|
|
|
case "Polygon":
|
|
|
+ case "MultiPolygon":
|
|
|
// 面
|
|
|
this.addPolygon(coordinates);
|
|
|
break;
|
|
|
@@ -628,6 +646,7 @@ export default {
|
|
|
this.addLine(coordinates);
|
|
|
break;
|
|
|
case "Polygon":
|
|
|
+ case "MultiPolygon":
|
|
|
// 面
|
|
|
this.addPolygon(coordinates);
|
|
|
break;
|
|
|
@@ -639,7 +658,8 @@ export default {
|
|
|
setTimeout(() => {
|
|
|
viewer.scene.requestRender();
|
|
|
});
|
|
|
- }, // 添加点到地图中
|
|
|
+ },
|
|
|
+ // 添加点到地图中
|
|
|
addPoint(coordinates) {
|
|
|
// 1. 解析点的坐标
|
|
|
console.log("addPoint coordinates", coordinates);
|
|
|
@@ -664,7 +684,8 @@ export default {
|
|
|
});
|
|
|
// 3. 将点实体添加到drawnEntities中
|
|
|
this.drawnEntities.push(pointEntity);
|
|
|
- }, // 添加线到地图中
|
|
|
+ },
|
|
|
+ // 添加线到地图中
|
|
|
addLine(coordinates) {
|
|
|
// 1. 解析线的坐标
|
|
|
console.log("addLine coordinates", coordinates);
|
|
|
@@ -715,21 +736,39 @@ export default {
|
|
|
},
|
|
|
// 添加面到地图中
|
|
|
addPolygon(coordinates) {
|
|
|
- // 2. 处理坐标格式:确保获取外部环坐标
|
|
|
+ // 检测是否为MultiPolygon类型(MultiPolygon的坐标是三维数组)
|
|
|
+ if (
|
|
|
+ Array.isArray(coordinates[0]) &&
|
|
|
+ Array.isArray(coordinates[0][0]) &&
|
|
|
+ Array.isArray(coordinates[0][0][0])
|
|
|
+ ) {
|
|
|
+ console.log("MultiPolygon coordinates", coordinates);
|
|
|
+ // 是MultiPolygon类型,遍历每个Polygon
|
|
|
+ coordinates.forEach((polygonCoordinates) => {
|
|
|
+ this.renderSinglePolygon(polygonCoordinates);
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ // 是单个Polygon类型
|
|
|
+ this.renderSinglePolygon(coordinates);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 渲染单个Polygon
|
|
|
+ renderSinglePolygon(coordinates) {
|
|
|
+ // 1. 处理坐标格式:确保获取外部环坐标
|
|
|
const outerRingCoordinates =
|
|
|
Array.isArray(coordinates[0]) && Array.isArray(coordinates[0][0])
|
|
|
? coordinates[0]
|
|
|
: coordinates;
|
|
|
|
|
|
- // 3. 检测坐标是否包含Z值
|
|
|
+ // 2. 检测坐标是否包含Z值
|
|
|
const hasZValues = outerRingCoordinates.some(
|
|
|
(coord) => coord.length > 2 && typeof coord[2] === "number"
|
|
|
);
|
|
|
|
|
|
- // 4. 根据是否有Z值选择合适的坐标转换方法
|
|
|
+ // 3. 根据是否有Z值选择合适的坐标转换方法
|
|
|
let positions;
|
|
|
let baseHeight = 0;
|
|
|
- let extrudedHeight = 100; // 默认挤压高度
|
|
|
+ let extrudedHeight = 0; // 默认挤压高度
|
|
|
|
|
|
if (hasZValues) {
|
|
|
// 包含Z值,使用带高度的坐标转换方法
|
|
|
@@ -759,7 +798,7 @@ export default {
|
|
|
positions = SkyScenery.Cartesian3.fromDegreesArray(flatCoordinates);
|
|
|
}
|
|
|
|
|
|
- // 5. 创建面实体
|
|
|
+ // 4. 创建面实体
|
|
|
const polygonEntity = viewer.entities.add({
|
|
|
name: "polygon",
|
|
|
polygon: {
|
|
|
@@ -780,7 +819,7 @@ export default {
|
|
|
},
|
|
|
});
|
|
|
|
|
|
- // 6. 将面实体添加到drawnEntities中
|
|
|
+ // 5. 将面实体添加到drawnEntities中
|
|
|
this.drawnEntities.push(polygonEntity);
|
|
|
},
|
|
|
handleSelectChange(item, value) {
|
|
|
@@ -1454,12 +1493,22 @@ export default {
|
|
|
) {
|
|
|
requestData.outPrj = this.params.outPrj;
|
|
|
}
|
|
|
+ if (
|
|
|
+ this.SceneValue &&
|
|
|
+ this.dmsServerItem &&
|
|
|
+ this.dmsServerItem.elementTypes &&
|
|
|
+ this.ifHasType("distance") &&
|
|
|
+ this.params.distance
|
|
|
+ ) {
|
|
|
+ requestData.distance = this.params.distance;
|
|
|
+ }
|
|
|
this.jsonData = requestData;
|
|
|
},
|
|
|
// 发送几何数据到后台接口
|
|
|
sendGeometriesToBackend() {
|
|
|
// 这里使用axios发送请求,需要确保项目中已安装并导入axios
|
|
|
let requestData;
|
|
|
+ this.backData = {};
|
|
|
let requestUrl = this.dmsServerItem.apiUrl;
|
|
|
if (
|
|
|
this.ifHasType("point") ||
|