|
|
@@ -107,26 +107,25 @@ 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
|
|
|
- var nPositions = [];
|
|
|
- var nRegions = [];
|
|
|
- // that.regions = [];
|
|
|
- for (var pt of result.object.positions) {
|
|
|
- let cartographic = Cesium.Cartographic.fromCartesian(pt);
|
|
|
- var longitude = Cesium.Math.toDegrees(cartographic.longitude);
|
|
|
- var latitude = Cesium.Math.toDegrees(cartographic.latitude);
|
|
|
- var height = cartographic.height;
|
|
|
- // that.regions.push({ x: longitude, y: latitude });
|
|
|
- nPositions.push(longitude);
|
|
|
- nPositions.push(latitude);
|
|
|
- nRegions.push({ x: longitude, y: latitude });
|
|
|
- }
|
|
|
-
|
|
|
- // that.regions.push(that.regions[0]);
|
|
|
+ // var nPositions = [];
|
|
|
+ // var nRegions = [];
|
|
|
+ // // that.regions = [];
|
|
|
+ // for (var pt of result.object.positions) {
|
|
|
+ // let cartographic = Cesium.Cartographic.fromCartesian(pt);
|
|
|
+ // var longitude = Cesium.Math.toDegrees(cartographic.longitude);
|
|
|
+ // var latitude = Cesium.Math.toDegrees(cartographic.latitude);
|
|
|
+ // var height = cartographic.height;
|
|
|
+ // // that.regions.push({ x: longitude, y: latitude });
|
|
|
+ // nPositions.push(longitude);
|
|
|
+ // nPositions.push(latitude);
|
|
|
+ // nRegions.push({ x: longitude, y: latitude });
|
|
|
+ // }
|
|
|
+ // // that.regions.push(that.regions[0]);
|
|
|
|
|
|
- viewer.entities.removeAll();
|
|
|
+ // viewer.entities.removeAll();
|
|
|
// let polygonEntity = new Cesium.Entity({
|
|
|
// id: "polygon",
|
|
|
// // position: Cesium.Cartesian3.fromDegreesArray([
|
|
|
@@ -154,7 +153,7 @@ const handlerDrawing = function (PolyType, tooltipNum) { //(传入操作的Dra
|
|
|
positions: positions
|
|
|
});
|
|
|
//半透线
|
|
|
- window.polylineTransparent.show = PolyType !== "Polygon"
|
|
|
+ window.polylineTransparent.show = true //PolyType !== "Polygon"
|
|
|
let p2 = [...result.object.positions]
|
|
|
if (PolyType == "Polygon") { //画面时,需要首尾相连
|
|
|
p2.push(p2[0])
|