DESKTOP-CRQ4N2U\jintian 1 год назад
Родитель
Сommit
048eab33bd
1 измененных файлов с 43 добавлено и 5 удалено
  1. 43 5
      src/views/Map3d/components/coordsTool.vue

+ 43 - 5
src/views/Map3d/components/coordsTool.vue

@@ -36,7 +36,7 @@
 					<el-input v-model="position.locationCoords" type="textarea" :autosize="{ minRows: 6, maxRows: 6 }" />
 					<div class="jt-btn" style="margin-top: 10rem;">
 						<el-button color="rgb(20 136 255)" @click="Position">坐标定位</el-button>
-						<el-button color="rgb(255 100 100)" @click="empty"><span style="color: #fff;">清除定位</span></el-button>
+						<el-button color="rgb(255 100 100)" @click="emptyLoc"><span style="color: #fff;">清除定位</span></el-button>
 					</div>
 				</div>
 			</el-collapse-item>
@@ -52,7 +52,7 @@
 					<div class="jt-btn" style="margin-top: 10rem;">
 						<el-button color="rgb(20 136 255)" @click="pickUp">坐标拾取</el-button>
 						<el-button color="rgb(20 136 255)" @click="undo">撤销</el-button>
-						<el-button color="rgb(255 100 100)" @click="empty"><span style="color: #fff;">清空</span></el-button>
+						<el-button color="rgb(255 100 100)" @click="emptyPic"><span style="color: #fff;">清空</span></el-button>
 					</div>
 				</div>
 			</el-collapse-item>
@@ -160,6 +160,44 @@
 				}
 				this.pointEntities = []; //脏数据,存储entities
 			},
+			
+			/**
+			 * 坐标拾取 - 清空
+			 */
+			emptyPic() {
+				this.pickCoords = "";
+				this.pickCoordsArray = [];
+				this.pickCoordsLable = 1;
+				jt3d.CommonTools._sketchViewModel.sketchClear();
+				jt3d.CommonTools._sketchViewModel._clearEvent();
+				jt3d.CommonTools._sketchViewModel._clearEvent(jt3d.CommonTools._sketchViewModel._sketchEventHandler);
+			
+				jt3d._viewer.entities.remove(jt3d.LocateUtil._locationEntity);
+			
+				for (let i = 0; i < this.pointEntities.length; i++) {
+					jt3d._viewer.entities.remove(this.pointEntities[i]);
+				}
+				this.pointEntities = []; //脏数据,存储entities
+			},
+			
+			/**
+			 * 坐标定位 - 清空
+			 */
+			emptyLoc() {
+				this.pickCoordsArray = [];
+				this.pickCoordsLable = 1;
+				jt3d.CommonTools._sketchViewModel.sketchClear();
+				jt3d.CommonTools._sketchViewModel._clearEvent();
+				jt3d.CommonTools._sketchViewModel._clearEvent(jt3d.CommonTools._sketchViewModel._sketchEventHandler);
+			
+				this.position.locationCoords = "";
+				jt3d._viewer.entities.remove(jt3d.LocateUtil._locationEntity);
+			
+				for (let i = 0; i < this.pointEntities.length; i++) {
+					jt3d._viewer.entities.remove(this.pointEntities[i]);
+				}
+				this.pointEntities = []; //脏数据,存储entities
+			},
 
 			/**
 			 * 坐标定位
@@ -263,9 +301,9 @@
 			flyToEntity(entity) {
 				let flyToEntity = jt3d.LocateUtil.flyToEntity(entity, {
 					duration: 3,
-					heading: 200,
-					pitch: -80,
-					range: 1000
+					heading: -45,
+					pitch: -20,
+					range: 6000
 				});
 				flyToEntity.then(function(entity) {
 					if (entity.point) {