Browse Source

低空修改250322-01

zhiyuan-007 3 days ago
parent
commit
0bad6a2e26
3 changed files with 9 additions and 7 deletions
  1. 2 2
      src/components/mapTest.vue
  2. 1 1
      src/config/basicTool.json
  3. 6 4
      src/units/map/addDrawEvent.js

+ 2 - 2
src/components/mapTest.vue

@@ -75,8 +75,8 @@ export default {
       bridge = new CityGIS.Bridge({
         id:"i_map",
         //url:'https://cimweb.zjw.sh.cegn.cn:2007/map-tool-widget/#/jk_map',
-        //url:'http://localhost:5173/map-tool-widget/#/jk_map',
-        url: 'http://172.16.8.44:9250/map-tool-widget/#/jk_map',
+        url:'http://localhost:5173/map-tool-widget/#/jk_map',
+        //url: 'http://172.16.8.44:9250/map-tool-widget/#/jk_map',
         onReady:function (){
           // console.log("地图创建完成");
         }

+ 1 - 1
src/config/basicTool.json

@@ -42,7 +42,7 @@
             "title":"BaseMap",
             "visible": true,
             "opacity": 1,
-            "url": "https://cimweb.zjw.sh.cegn.cn:2008/MapServiceProxy/eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3NDI1MjcwNzgsImtleSI6IjkzNDkzMzIxIiwic2VydmljZU5vIjoiRDkwMDEwMDcxMjAyMzA4MDEiLCJ1c2VybmFtZSI6InB0Z2wifQ.NVVZlHG_VB4wb7OApW3CTHrkdbMgyqc_sTGz3TpUrZw",
+            "url": "https://cimweb.zjw.sh.cegn.cn:2008/MapServiceProxy/eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3NDI3MDcyMTIsImtleSI6IjkzNDkzMzIxIiwic2VydmljZU5vIjoiRDkwMDEwMDcxMjAyMzA4MDEiLCJ1c2VybmFtZSI6InB0Z2wifQ.Cb3SIeyf4xYD_Hb8yc-__2YDosWQ4Lj-CprBGet2aZw",
             "token": ""
           }
         }

+ 6 - 4
src/units/map/addDrawEvent.js

@@ -276,6 +276,7 @@ class AddDrawEvent {
         this.clearCreateListenerEvent()
         this.createListenerEventHander = this.sketchViewModel.on("create", (event) => {
             if (event.state === "complete") {
+                debugger
                 if(event?.graphic?.geometry?.type == "mesh"){
                     callback(this.getBaseCenter(event.graphic.geometry,this.type));
                 }else{
@@ -288,10 +289,11 @@ class AddDrawEvent {
         this.clearUpdateListenerEvent()
         this.updateListenerEventHander = this.sketchViewModel.on("update", (event) => {
             if (event.state === "complete") {
-                if(event?.graphic?.geometry?.type == "mesh"){
-                    callback(this.getBaseCenter(event.graphic.geometry,this.type));
-                }else{
-                    callback(event?.graphic?.geometry);
+                debugger
+                if(event?.graphics[0]?.geometry?.type == "mesh"){
+                    callback(this.getBaseCenter(event.graphics[0].geometry,this.type));
+                }else if(event?.graphics[0]?.geometry){
+                    callback(event?.graphics[0]?.geometry);
                 }
             }
         });