Ver código fonte

增加粮食审计目录、修改点位加载逻辑、接口服务增加proxyToken参数

wdq 1 mês atrás
pai
commit
7c15835a1f

+ 1 - 0
config/config.js

@@ -55,6 +55,7 @@ var onemapUrlConfig = {
         { columnId: 2373, type: 1, label: "朱家角镇资环疑点", layerType: "vector" },
         { columnId: 2120, type: 0, label: "青浦区审计土地专题", layerType: "vector" },
         { columnId: 2290, type: 1, label: "土地矢量数据", layerType: "raster" },
+        { columnId: 2577, type: 1, label: "青浦区审计粮食专题", layerType: "vector" }
         // { columnId: 2021, type: 1, label: "青浦规资地图服务", layerType: "raster" }
     ],
     // {

+ 54 - 13
scripts/mod/layerVue/vector.js

@@ -209,8 +209,10 @@ define([
 
         // canvas.width = parseFloat(svgDom.getAttribute('width')); //  * pixelRatio
         // canvas.height = parseFloat(svgDom.getAttribute('height')); //  * pixelRatio 
-        canvas.width = 500;
-        canvas.height = 500;
+        // canvas.width = 500
+        // canvas.height = 500
+        canvas.width = option.width
+        canvas.height = option.height
         img.src = path;
         img.onload = function () {
             // 增加底色
@@ -273,13 +275,27 @@ define([
         var guid = "VECTOR--" + options.layerInfo.id
         let img = null;
         if (style.point) {
-            // 获取svg
-            let svg = getAndSetSVGElement(style.point.photo, style.point.color)
-            // console.log(svg)
-            img = await svgToImg(svg);
-            // img = await export2Base64Img(img, "", {
-            //     background: "#ffffff00"
-            // });
+            if (style.point.photo.indexOf(".svg") > -1) {
+                // 获取svg
+                let svg = getAndSetSVGElement(style.point.photo, style.point.color)
+                // console.log(svg)
+                img = await svgToImg(svg);
+                if (style.point.photo.indexOf("coordinate") == -1) {
+                    img = await export2Base64Img(img, "", {
+                        background: "#ffffff00",
+                        width: 200,
+                        height: 200
+                    });
+                } else {
+                    img = await export2Base64Img(img, "", {
+                        background: "#ffffff00",
+                        width: 500,
+                        height: 500
+                    });
+                }
+            } else {
+                img = style.point.photo;
+            }
         }
 
         Cesium.GeoJsonDataSource.load(options.geo).then(
@@ -305,8 +321,8 @@ define([
                         // })
                         entity.billboard = new Cesium.BillboardGraphics({
                             image: img,
-                            width: 50,
-                            height: 50,
+                            width: 28,
+                            height: 28,
                             pixelOffset: new Cesium.Cartesian2(0, -25),
                             heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
                             // scaleByDistance: new Cesium.NearFarScalar(10000, 1, 20000, 0.75),
@@ -317,11 +333,28 @@ define([
                         entity.polyline.material = Cesium.Color.fromCssColorString(style.polyline.color).withAlpha(style.polyline.alpha); // 颜色
                     }
                     if (entity.polygon) {
-                        entity.polygon.height = 0.2;
+                        entity.polygon.height = 0;
                         entity.polygon.outline = true; // 边框是否显示
                         entity.polygon.outlineColor = Cesium.Color.fromCssColorString(style.polygon.outerColor); // 边框颜色
                         entity.polygon.outlineWidth = style.polygon.outerWidth; // 边框宽度
                         entity.polygon.material = Cesium.Color.fromCssColorString(style.polygon.innerColor).withAlpha(style.polygon.alpha);// 填充色
+
+                        // entity.polyline = new Cesium.PolylineGraphics({
+                        //     position: entity.polygon.hierarchy.getValue().positions.concat([]),
+                        //     width: style.polygon.outerWidth,
+                        //     material: Cesium.Color.fromCssColorString(style.polygon.outerColor), // 颜色
+                        // });
+
+                        let outline = map3DViewer.map.entities.add({
+                            name: "线",
+                            polyline: {
+                                //经纬度数组转世界坐标,带高度的话是fromDegreesArrayHeights
+                                positions: entity.polygon.hierarchy.getValue().positions.concat([]),
+                                width: style.polygon.outerWidth,
+                                material: Cesium.Color.fromCssColorString(style.polygon.outerColor),
+                            }
+                        });
+                        entity.outline = outline;
                     }
                     entity.layerId = guid
                     entity.mod = "vectorMod"
@@ -338,7 +371,15 @@ define([
     };
 
     function removeVECTOR(options) {
-        map3DViewer.map.dataSources.remove(map3DViewer.map.dataSources.getByName(options.guid)[0]);
+        let dataSource = map3DViewer.map.dataSources.getByName(options.guid)[0]
+        var entities = dataSource.entities.values;
+        for (var i = 0; i < entities.length; i++) {
+            var entity = entities[i];
+            if (entity.polygon) {
+                map3DViewer.map.entities.remove(entity.outline);
+            }
+        }
+        map3DViewer.map.dataSources.remove(dataSource);
         delete modValue.VECTOR[options.guid];
         delete modValue.VECTOR[options.guid + "_extent"];
         if (Object.getOwnPropertyNames(modValue.VECTOR).length == 0) {

+ 1 - 0
scripts/mod/menu/baseCalc/addressSearch.js

@@ -120,6 +120,7 @@ define(['html!templates/menu/baseCalc/addressSearch',
 				url: onemapUrlConfig.PROXY_URL + "/searchByName",
 				data: {
 					address: text,
+					proxyToken: localStorage.getItem("systemToken"),
 				},
 				success: function (data) {
 					if (data.code == 200) {

+ 2 - 1
scripts/mod/menu/baseCalc/pathPlanning.js

@@ -245,7 +245,8 @@ define(['html!templates/menu/baseCalc/pathPlanning',
 					destination: stopPointLon + "," + stopPointLat,
 					// origin: Math.floor(startArr[0] * 1000000) / 1000000 + "," + Math.floor(startArr[1] * 1000000) / 1000000,
 					// destination: Math.floor(stopArr[0] * 1000000) / 1000000 + "," + Math.floor(stopArr[1] * 1000000) / 1000000,
-					type: 0
+					type: 0,
+					proxyToken: localStorage.getItem("systemToken"),
 				},
 				success: function (data) {
 					if (data.status == 1) {

+ 10 - 6
scripts/vendor/CGCS2000ArcGisMapServerImageryProvider-nohx.js

@@ -6,12 +6,12 @@
     ee: 0.00669342162296594323,
     a: 6378245.0,
     projs: {
-      '01': 'wgs84', //84坐标
-      '02': 'gcj02', //火星坐标
-      '03': 'bd09', //百度坐标
-      '04': 'utm4', //utm坐标
-      '05': 'shcj', //城建坐标
-      '06': 'meter', //米制单位
+      '01': 'wgs84', // 84坐标
+      '02': 'gcj02', // 火星坐标
+      '03': 'bd09', // 百度坐标
+      '04': 'utm4', // utm坐标
+      '05': 'shcj', // 城建坐标
+      '06': 'meter', // 米制单位
       '07': 'degree' // 度制单位
     },
     epsg: {
@@ -1780,4 +1780,8 @@
   };
 
   Cesium.CGCS2000ArcGisMapServerImageryProvider = CGCS2000ArcGisMapServerImageryProvider;
+  Cesium.changeCoor = function (name, lon, lat) {
+    if (name == "wgs84_to_shcj")
+      return coordinate.wgs84_to_shcj(lon, lat);
+  }
 }(Cesium));