Kaynağa Gözat

绘制、导入图形,在地图上显示的样式保持一致

maxiaoxiao 10 ay önce
ebeveyn
işleme
8f4534e445
1 değiştirilmiş dosya ile 4 ekleme ve 2 silme
  1. 4 2
      src/common/js/common.js

+ 4 - 2
src/common/js/common.js

@@ -103,7 +103,9 @@ const handlerDrawing = function (PolyType, tooltipNum) { //(传入操作的Dra
                 return;
             }
             if (PolyType == "Polygon") {
-                DrawHandler.polygon._polygon._material._color._value.alpha = 0.5 //绘制面透明度
+                // DrawHandler.polygon._polygon._material._color._value.alpha = 0.5 //绘制面透明度
+                DrawHandler.polygon._polygon._material._color._value = Cesium.Color.WHITE.withAlpha(0.3)
+                DrawHandler.polyline._polyline._material._color._value = Cesium.Color.RED
             }
             let positions = cartographic(result.object.positions)
             tooltip.setVisible(false);
@@ -112,7 +114,7 @@ const handlerDrawing = function (PolyType, tooltipNum) { //(传入操作的Dra
                 positions: positions
             });
             //半透线
-            window.polylineTransparent.show = true
+            window.polylineTransparent.show = PolyType !== "Polygon"
             let p2 = [...result.object.positions]
             if (PolyType == "Polygon") { //画面时,需要首尾相连
                 p2.push(p2[0])