|
@@ -739,6 +739,9 @@ export default {
|
|
|
case "AreaJson3DRankShow":
|
|
|
this.AreaJson3DRankShow(params);
|
|
|
break;
|
|
|
+ case "PointJson3DShow":
|
|
|
+ this.pointJson3DShow(params);
|
|
|
+ break;
|
|
|
case "ClusterLayer":
|
|
|
this.clusterLayer(params);
|
|
|
break;
|
|
@@ -859,6 +862,9 @@ export default {
|
|
|
case "PrismEffect":
|
|
|
this.prismEffect(params);
|
|
|
break;
|
|
|
+ case "PrismDifferentHeightSideEffect":
|
|
|
+ this.prismDifferentHeightSideEffect(params);
|
|
|
+ break;
|
|
|
case "PrismDifferentHeightEffect":
|
|
|
this.prismDifferentHeightEffect(params);
|
|
|
break;
|
|
@@ -1876,8 +1882,6 @@ export default {
|
|
|
let html =
|
|
|
"<table style='width: 100%;padding-left: 10px;padding-right: 10px;table-layout:fixed;word-wrap:break-word;word-break:break-all;'><tbody>" +
|
|
|
"<tr><th style='width: 35%;text-align: left;'>属性</th><th style='width: 55%;text-align: left;'>数值</th></tr>";
|
|
|
-
|
|
|
- debugger
|
|
|
if(hanhua[title]){
|
|
|
for (let k in result.attributes) {
|
|
|
if( k !="extent" && k !="OBJECTID"){
|
|
@@ -1886,14 +1890,14 @@ export default {
|
|
|
hanhuaK.forEach(item=>{
|
|
|
if(item.name == k){
|
|
|
k= item.alias;
|
|
|
+ html = html +
|
|
|
+ "<tr><td style='width: 30%;'>" +
|
|
|
+ k +
|
|
|
+ ":</td><td style='width: 60%;'>" +
|
|
|
+ ((v == null) ? "" : v.toString()) +
|
|
|
+ "</td></tr>";
|
|
|
}
|
|
|
})
|
|
|
- html = html +
|
|
|
- "<tr><td style='width: 30%;'>" +
|
|
|
- k +
|
|
|
- ":</td><td style='width: 60%;'>" +
|
|
|
- ((v == null) ? "" : v.toString()) +
|
|
|
- "</td></tr>";
|
|
|
}
|
|
|
}
|
|
|
}else{
|
|
@@ -4794,6 +4798,106 @@ export default {
|
|
|
|
|
|
})
|
|
|
},
|
|
|
+
|
|
|
+ pointJson3DShow(params){
|
|
|
+ loadModules([ "esri/Graphic",
|
|
|
+ "esri/geometry/geometryEngine",
|
|
|
+ "esri/layers/GraphicsLayer", "esri/layers/FeatureLayer",
|
|
|
+ "esri/rest/support/Query",
|
|
|
+ "esri/rest/query",
|
|
|
+ "esri/geometry/Point"]).then(async ([Graphic, geometryEngine, GraphicsLayer,FeatureLayer,Query,query, Point]) => {
|
|
|
+ let that = this;
|
|
|
+ let status = params.status;
|
|
|
+ let where = "1=1";
|
|
|
+ let layer = this.m_map.layers.find(item => item.id === "pointFeaturelayer");
|
|
|
+ if(layer){
|
|
|
+ this.m_map.remove(layer);
|
|
|
+ }
|
|
|
+ if(status == "hide"){
|
|
|
+ return
|
|
|
+ }
|
|
|
+ let resultPointGraphics = []; //点graphic
|
|
|
+ let pointRenderer = {
|
|
|
+ type: "simple", // autocasts as new ClassBreaksRenderer()
|
|
|
+ symbol: {
|
|
|
+ type: "point-3d",
|
|
|
+ symbolLayers: [
|
|
|
+ {
|
|
|
+ type: "icon",
|
|
|
+ resource: {
|
|
|
+ href: levelfrIcon
|
|
|
+ },
|
|
|
+ size: 100,
|
|
|
+ outline: {
|
|
|
+ color: "white",
|
|
|
+ size: 2
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ };
|
|
|
+ let data = params.data;
|
|
|
+ data.forEach(item => {
|
|
|
+ let point = new Point({
|
|
|
+ x: item.x,
|
|
|
+ y: item.y,
|
|
|
+ spatialReference: this.m_view.spatialReference
|
|
|
+ });
|
|
|
+ let pointGraphics = new Graphic({
|
|
|
+ geometry: point,
|
|
|
+ attributes: item.attributes
|
|
|
+ });
|
|
|
+ resultPointGraphics.push(pointGraphics);
|
|
|
+ })
|
|
|
+
|
|
|
+ //绘制渲染点
|
|
|
+ const pointFeaturelayer = new FeatureLayer({
|
|
|
+ id:"pointFeaturelayer",
|
|
|
+ title:params.title,
|
|
|
+ source: resultPointGraphics,
|
|
|
+ geometryType: "point",
|
|
|
+ objectIdField: "OBJECTID",
|
|
|
+ popupEnabled: false,
|
|
|
+ //spatialReference: m_spatialReference,
|
|
|
+ elevationInfo: {
|
|
|
+ // mode: "relative-to-ground",
|
|
|
+ mode: "relative-to-scene"
|
|
|
+ },
|
|
|
+ outFields: ['*'],
|
|
|
+ popupTemplate: {
|
|
|
+ outFields: ['*'],
|
|
|
+ },
|
|
|
+ fields: params.fields,
|
|
|
+ renderer: pointRenderer,
|
|
|
+ labelingInfo: [{
|
|
|
+ labelExpressionInfo: {
|
|
|
+ value: params.showLableInfo
|
|
|
+ //value: "{111111}"
|
|
|
+ },
|
|
|
+ labelPlacement: "always-horizontal", //"always-horizontal"center-center
|
|
|
+ symbol: {
|
|
|
+ type: "label-3d", // autocasts as new LabelSymbol3D()
|
|
|
+ symbolLayers: [
|
|
|
+ {
|
|
|
+ type: "text", // autocasts as new TextSymbol3DLayer()
|
|
|
+ material: {
|
|
|
+ color: "#ff6a00" //[0, 240, 255,1]
|
|
|
+ },
|
|
|
+ font: { // autocasts as new Font()
|
|
|
+ size: 10,
|
|
|
+ //family: "Josefin Slab",
|
|
|
+ weight: "bold"
|
|
|
+ },
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ }]
|
|
|
+ });
|
|
|
+ that.m_map.add(pointFeaturelayer);
|
|
|
+
|
|
|
+
|
|
|
+ })
|
|
|
+ },
|
|
|
getTargetValueSymbol(index,length,X1,Y1,Z1,X2,Y2,Z2){
|
|
|
let x= X1 - ((X1-X2)/(length)) *(index-1);
|
|
|
let y = Y1 - ((Y1-Y2)/(length)) *(index-1);
|
|
@@ -9756,6 +9860,179 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
|
|
|
+
|
|
|
+ prismDifferentHeightSideEffect(params){
|
|
|
+ loadModules([
|
|
|
+ "esri/Graphic",
|
|
|
+ "esri/geometry/Mesh",
|
|
|
+ "esri/geometry/Point",
|
|
|
+ "esri/geometry/Polyline",
|
|
|
+ "esri/geometry/support/MeshComponent",
|
|
|
+ "esri/layers/GraphicsLayer",
|
|
|
+ "esri/symbols/TextSymbol",
|
|
|
+ "esri/symbols/SimpleLineSymbol",
|
|
|
+ "esri/geometry/Polygon",
|
|
|
+ ]).then(([Graphic, Mesh, Point,Polyline, MeshComponent, GraphicsLayer,TextSymbol,SimpleLineSymbol,Polygon]) =>{
|
|
|
+ debugger
|
|
|
+ if(params.status == "show"){
|
|
|
+ let f_layer = this.m_map.layers.find(item => item.id === "cylinderEffect");
|
|
|
+ if (f_layer) {
|
|
|
+ this.m_map.remove(f_layer);
|
|
|
+ }
|
|
|
+ let graphicsLayer = new GraphicsLayer({
|
|
|
+ id: "cylinderEffect",
|
|
|
+ title: "钻孔图层"
|
|
|
+ })
|
|
|
+ //let items = dizhi.zdycbpq
|
|
|
+ let items = params.items
|
|
|
+ items.forEach((item, index) => {
|
|
|
+ item.graphic = item.graphic.concat([item.graphic[0]]);
|
|
|
+ let polygon = new Polygon({
|
|
|
+ rings: [item.graphic],
|
|
|
+ spatialReference: this.m_view.spatialReference
|
|
|
+ })
|
|
|
+ let originGeometry = new Polygon({
|
|
|
+ rings: params.extent.rings,
|
|
|
+ spatialReference: this.m_view.spatialReference
|
|
|
+ })
|
|
|
+ let origin = [originGeometry.centroid.x,originGeometry.centroid.y];
|
|
|
+ let pointGeometry = polygon.centroid; //侧面中心
|
|
|
+ let point = [pointGeometry.x,pointGeometry.y,pointGeometry.z];
|
|
|
+ origin.push(pointGeometry.z)
|
|
|
+
|
|
|
+ if(JSON.stringify(item.data) != "{}"){
|
|
|
+ // 计算从当前顶点到几何中心的方向向量
|
|
|
+ let dx = point[0] - origin[0];
|
|
|
+ let dy = point[1] - origin[1];
|
|
|
+ let dz = point[2] - origin[2];
|
|
|
+ // 计算向量长度
|
|
|
+ let length = Math.sqrt(dx * dx + dy * dy + dz * dz);
|
|
|
+
|
|
|
+ // 单位化向量(方向保持不变,长度为1)
|
|
|
+ let unitVector = [dx / length, dy / length, dz / length];
|
|
|
+ // 沿单位向量方向延申20米(或其他需要的距离)
|
|
|
+ let offsetDistance = 20; // 偏移距离为20米
|
|
|
+ let offsetPoint = [
|
|
|
+ point[0] + unitVector[0] * offsetDistance,
|
|
|
+ point[1] + unitVector[1] * offsetDistance,
|
|
|
+ point[2] + unitVector[2] * offsetDistance
|
|
|
+ ];
|
|
|
+ // 创建新的 TextGraphic 点
|
|
|
+ let textPoint = new Point({
|
|
|
+ x: offsetPoint[0],
|
|
|
+ y: offsetPoint[1],
|
|
|
+ z: offsetPoint[2],
|
|
|
+ spatialReference: this.m_spatialReference
|
|
|
+ });
|
|
|
+ // // 添加三维注释
|
|
|
+ let textSymbol = new TextSymbol({
|
|
|
+ text: item.data.name +"---"+ item.data["01.土层名称"],
|
|
|
+ font: {
|
|
|
+ size: 14,
|
|
|
+ family: "Arial",
|
|
|
+ weight: "bold"
|
|
|
+ },
|
|
|
+ haloColor: "black",
|
|
|
+ haloSize: "2px",
|
|
|
+ color: "#FFD700", // 金色字体
|
|
|
+ backgroundColor: "rgba(0, 0, 0, 0.7)", // 添加半透明黑色背景
|
|
|
+ verticalAlignment: "middle",
|
|
|
+ horizontalAlignment: "left",
|
|
|
+ callout: {
|
|
|
+ type: "line", // 使用线条作为标注
|
|
|
+ color: "#FFD700", // 金色线条
|
|
|
+ border: { color: "black", width: 1 }, // 边框
|
|
|
+ size: 1.5
|
|
|
+ },
|
|
|
+ screenOffset: {
|
|
|
+ x: 10, // 偏移到右边
|
|
|
+ y: 0
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ let textGraphic = new Graphic({
|
|
|
+ geometry: textPoint,
|
|
|
+ symbol: textSymbol
|
|
|
+ });
|
|
|
+ graphicsLayer.add(textGraphic);
|
|
|
+
|
|
|
+ // 添加对应的线
|
|
|
+ let polyline = new Polyline({
|
|
|
+ paths: [
|
|
|
+ [point[0], point[1], point[2]],
|
|
|
+ [offsetPoint[0], offsetPoint[1], offsetPoint[2]]
|
|
|
+ ],
|
|
|
+ spatialReference: this.m_spatialReference
|
|
|
+ });
|
|
|
+ let lineSymbol = new SimpleLineSymbol({
|
|
|
+ color: "#FFD700", // 与文字匹配的金色
|
|
|
+ width: 2, // 线条宽度
|
|
|
+ style: "short-dot" // 虚线样式
|
|
|
+ });
|
|
|
+ let lineGraphic = new Graphic({
|
|
|
+ geometry: polyline,
|
|
|
+ symbol: lineSymbol
|
|
|
+ });
|
|
|
+ graphicsLayer.add(lineGraphic);
|
|
|
+ }
|
|
|
+
|
|
|
+ debugger
|
|
|
+ // 从Polygon获取顶点
|
|
|
+ let vertices = [];
|
|
|
+ polygon.rings[0].forEach(point => {
|
|
|
+ vertices.push(point[0], point[1], point[2]); // 将x, y, z添加到顶点数组
|
|
|
+ });
|
|
|
+ // 构建面的索引,确保每个面的三角形能被Mesh正确渲染
|
|
|
+ let faces = [];
|
|
|
+ let numVertices = polygon.rings[0].length;
|
|
|
+ for (let i = 1; i < numVertices - 1; i++) {
|
|
|
+ faces.push(0, i, i + 1); // 构建三角形
|
|
|
+ }
|
|
|
+ // 创建 Mesh
|
|
|
+ let prismMesh = new Mesh({
|
|
|
+ vertexAttributes: {
|
|
|
+ position: vertices
|
|
|
+ },
|
|
|
+ components: [
|
|
|
+ {
|
|
|
+ faces: faces
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ spatialReference: {
|
|
|
+ wkid: 102100 // 空间参考系
|
|
|
+ }
|
|
|
+ });
|
|
|
+ // 设置材质
|
|
|
+ let symbol = {
|
|
|
+ type: "mesh-3d",
|
|
|
+ symbolLayers: [{
|
|
|
+ type: "fill",
|
|
|
+ material: {
|
|
|
+ color: item.material.map((value, i) => i < 3 ? value * 255 : value).slice(0,3) // 转换颜色值
|
|
|
+ //color: "red" // 转换颜色值
|
|
|
+ }
|
|
|
+ }]
|
|
|
+ };
|
|
|
+
|
|
|
+ // 创建 Graphic 并添加到图层
|
|
|
+ let cylinderGraphic = new Graphic({
|
|
|
+ geometry: prismMesh,
|
|
|
+ symbol: symbol
|
|
|
+ });
|
|
|
+ graphicsLayer.add(cylinderGraphic);
|
|
|
+ });
|
|
|
+ this.m_map.add(graphicsLayer);
|
|
|
+ }else{
|
|
|
+ let f_layer = this.m_map.layers.find(item => item.id === "cylinderEffect");
|
|
|
+ if (f_layer) {
|
|
|
+ this.m_map.remove(f_layer);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
createFlyLine(params){
|
|
|
loadModules([
|
|
|
"esri/views/3d/externalRenderers",
|