@@ -82,7 +80,7 @@ onMounted(() => {
cadData.getCadList()
})
const {cadList} = storeToRefs(cadData)
-
+
const delCadItem=(row)=>{
console.log(row.id)
cadData.delectCard(row.id)
@@ -93,7 +91,7 @@ const getTableHeight = computed(() => {
});
const tabList = reactive([
- {
+ {
label: "CAD导图",
id: "1",
}
diff --git a/src/ldmap/utils/map/init.js b/src/ldmap/utils/map/init.js
index 9606d0e..f66d733 100644
--- a/src/ldmap/utils/map/init.js
+++ b/src/ldmap/utils/map/init.js
@@ -77,10 +77,10 @@ const ldMap = {
self = this;
return new Promise((resolve, reject) => {
- if(wkid==self.wkid){
+ if (wkid == self.wkid) {
resolve()
- }else{
+ } else {
let tileInfo = new TileInfo(TianData.infoData(wkid));
self.wkid = wkid
let defaultInfo = {
@@ -506,6 +506,7 @@ const ldMap = {
return sketchVM;
}
function selectData(e) {
+
if (e.graphics[0].attributes.data?.pointType == 'Station' || e.graphics[0].attributes.data?.type == 'Station') {
return
}
@@ -554,10 +555,13 @@ const ldMap = {
if (e.state == 'complete') {
self.sketchLayer.selectGraphic = null
if (self.ldMapActionType != 'lineAction') {
+ try {
+ const areas = geodesicUtils.geodesicAreas([graphic.geometry], "square-meters");
+ const area = Math.abs(areas[0]).toFixed(2)
+ graphic.attributes.data.area = area
+ } catch {
- const areas = geodesicUtils.geodesicAreas([graphic.geometry], "square-meters");
- const area = Math.abs(areas[0]).toFixed(2)
- graphic.attributes.data.area = area
+ }
}
@@ -954,8 +958,8 @@ const ldMap = {
self.sketchLayer.pointLayer.removeAll();
self.lineLayer && self.lineLayer.removeAll()
self.loadelevationLayer.removeAll()
- self.hightlayer &&self.hightlayer.removeAll()
- self.textLayer&&self.textLayer.removeAll()
+ self.hightlayer && self.hightlayer.removeAll()
+ self.textLayer && self.textLayer.removeAll()
},
//清除点位
removePoint() {
@@ -1050,26 +1054,50 @@ const ldMap = {
return returnObj
},
+// 开始 结束
+// 线 31 118355 53
+// 点 118355 53 531
+// 线 53 118350 46
+// 线 53 531 180
+
+
+
+
+
+
//根据起点找终点返回数据
getMapByPoint(item, data) {
let linelayer = self.lineLayer.graphics.items
let point = self.getSketchDataByType("point");
let nowPointId = item.id
- let lineId = item.attributes.endIndex
+ let lineId
+ lineId = item.attributes.endIndex
+ let lineIdMore=linelayer.filter(item => item.attributes.leftId == nowPointId)
+
+ if(lineIdMore.length>1){
+ console.log(lineIdMore)
+ }
+
//当前的元素数据
let geometry = item.geometry
let attributes = item.attributes
if (lineId && lineId != nowPointId) {
- let linedata = linelayer.filter(item => item.id == lineId)[0]
+ let linedata = linelayer.filter(item => item.id == lineId)
+ console.log(linedata.length)
+ if(linedata.length >1){debugger}
+ linedata = linedata[0]
if (!linedata) { return data }
let val = [geometry.x, geometry.y, attributes.data.pointType, parseInt(linedata.attributes.data.styleId), nowPointId]
data.push(val)
let nextPointId = linedata.attributes.nextId
- let nextItem = point.filter(item => item.id == nextPointId)[0]
+ let nextItem = point.filter(item => item.id == nextPointId)
+
+ nextItem=nextItem[0]
+ if(nextItem.length >1){debugger}
if (!nextItem) { debugger }
return this.getMapByPoint(nextItem, data)
} else {
@@ -1280,6 +1308,7 @@ const ldMap = {
exitLineByVal(data) {
let polylineLayer = self.lineLayer
+
let p6 = this.lineLayer.graphics.items.filter(item => {
return item.id == data.id || item.id == data.lineId
@@ -1402,26 +1431,26 @@ const ldMap = {
},
//道路高程数据展示
- elevationData(flag,data) {
+ elevationData(flag, data) {
if (flag) {
data.forEach((item, index) => {
- let point = new Point({ x: item[0], y: item[1] })
- let text = item[2].toFixed(2)
- const graphic = new Graphic({
- geometry: point,
- visible: !(index % ((22 - self.view.zoom) * 2)),
- symbol: {
- type: "text", // autocasts as new TextSymbol()
- text: text,
- color: [255, 255, 255, 255],
- font: {
- weight: "bold"
- }
+ let point = new Point({ x: item[0], y: item[1] })
+ let text = item[2].toFixed(2)
+ const graphic = new Graphic({
+ geometry: point,
+ visible: !(index % ((22 - self.view.zoom) * 2)),
+ symbol: {
+ type: "text", // autocasts as new TextSymbol()
+ text: text,
+ color: [255, 255, 255, 255],
+ font: {
+ weight: "bold"
}
- });
+ }
+ });
- self.loadelevationLayer.add(graphic)
+ self.loadelevationLayer.add(graphic)
})
} else {
@@ -1567,11 +1596,11 @@ const ldMap = {
}
if (res.type == "House") {
- try{
+ try {
const areas = geodesicUtils.geodesicAreas([polygon], "square-meters");
const area = Math.abs(areas[0]).toFixed(2)
res.area = res.area || area
- }catch{
+ } catch {
}
diff --git a/src/ldmap/utils/map/load.json b/src/ldmap/utils/map/load.json
index 352089c..60264e8 100644
--- a/src/ldmap/utils/map/load.json
+++ b/src/ldmap/utils/map/load.json
@@ -12995,7 +12995,7 @@
31.70704632404608,
9.948623657226562
],
- [
+ [
119.48767501690634,
31.707041157844813,
9.917205810546875
diff --git a/stats.html b/stats.html
index b823d83..277aad5 100644
--- a/stats.html
+++ b/stats.html
@@ -4822,7 +4822,7 @@ var drawChart = (function (exports) {