From ef260dff5d38c36272a2ac97d40db70ab3f8c2cc Mon Sep 17 00:00:00 2001
From: BaoXs <bao_dida@163.com>
Date: 星期六, 14 五月 2022 16:48:16 +0800
Subject: [PATCH] 添加项目点,点击调整。 整理项目超链接
---
assets/service/drawService.js | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 59 insertions(+), 0 deletions(-)
diff --git a/assets/service/drawService.js b/assets/service/drawService.js
index 7b8be03..7378e00 100644
--- a/assets/service/drawService.js
+++ b/assets/service/drawService.js
@@ -49,4 +49,63 @@
'viewer': viewer, //鍏ㄥ眬Cesium瀵硅薄
};
CesiumDraw.clearDraw(options);
+}
+
+function saveDrawEntity(type,drawEntity,id){//zzf:淇濆瓨缁樺埗鐨勫浘褰�
+ let saveData;
+ if(type=='point'){
+ saveData= {
+ "id":id,
+ "type": type,
+ "longitude": drawEntity._position._value.x,
+ "latitude": drawEntity._position._value.y,
+ "height": drawEntity._position._value.z,
+ }
+ }
+ else if(type=='polyline'||type=='polygon'){
+ let longitudeList=[],latitudeList=[],heightList=[]
+ for(let i=0;i<drawEntity.length;i++){
+ longitudeList.push(drawEntity[i]._position._value.x)
+ latitudeList.push(drawEntity[i]._position._value.y)
+ heightList.push(drawEntity[i]._position._value.z)
+ }
+ saveData= {
+ "id":id,
+ "type": type,
+ "longitude": longitudeList.toString(),
+ "latitude":latitudeList.toString(),
+ "height": heightList.toString(),
+ }
+ }
+ else if(type=='label'){
+ saveData= {
+ "id":id,
+ "type": type,
+ "longitude": drawEntity._position._value.x,
+ "latitude": drawEntity._position._value.y,
+ "height": drawEntity._position._value.z,
+ "content":drawEntity.title,
+ "color":drawEntity._label._fillColor._value.toCssColorString(),
+ "fontsize":30,
+ "fontstyle":'SimSun',
+ }
+ }
+
+ let token = window.localStorage.getItem("token");
+ $.ajax({
+ type: "get",
+ async: false,
+ url: parent.httpConfig.webApiUrl + "landstamp/front/addDrawEntity",
+ data: saveData,
+ contentType: "application/json;charset=utf-8",
+ beforeSend:function(request){
+ request.setRequestHeader("token",token);
+ },
+ success: function (data) {
+ console.log(data)
+ },
+ error: function (XMLHttpRequest, textStatus, errorThrown) {
+ console.log("ajax璇锋眰澶辫触锛�");
+ }
+ });
}
\ No newline at end of file
--
Gitblit v1.9.1