From 37a4a03e1ddef4f66904dccee54b684e73e9a3b2 Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Fri, 18 Nov 2022 17:32:27 +0800
Subject: [PATCH] 1

---
 src/components/mobilemap/index.vue |   90 +++++++++++++++++++++++++++++++-------------
 1 files changed, 63 insertions(+), 27 deletions(-)

diff --git a/src/components/mobilemap/index.vue b/src/components/mobilemap/index.vue
index 0521447..6f70a3c 100644
--- a/src/components/mobilemap/index.vue
+++ b/src/components/mobilemap/index.vue
@@ -10,11 +10,8 @@
         <!-- 控制↓ -->
         <mobileLeftNav ref="mobileLeftNav"></mobileLeftNav>
         <mobileCortrol ref="mobileCortrol"></mobileCortrol>
-        <mobileCortrolButtom
-            ref="mobileCortrolButtom"
-            :mapCenter="mapCenter"
-            :frislayertHeight="frislayertHeight"
-        ></mobileCortrolButtom>
+        <mobileCortrolButtom ref="mobileCortrolButtom" :mapCenter="mapCenter" :frislayertHeight="frislayertHeight">
+        </mobileCortrolButtom>
         <mobileCortrolSearch ref="mobileCortrolSearch"></mobileCortrolSearch>
         <!-- 控制↑ -->
         <!-- 控制大弹窗的弹窗 -->
@@ -119,8 +116,8 @@
             ],
             // areaLayer: null,
             // mapCenter: [115.871863, 28.743861, 160.0],
-            mapCenter: [116.02680670, 28.68340803, 800.0], // 师大
-            // mapCenter: [115.79647126999, 28.6421878133715, 800.0], // 经管
+            // mapCenter: [116.02680670, 28.68340803, 800.0], // 师大
+            mapCenter: [115.79647126999, 28.6421878133715, 800.0], // 经管
             //   mapCenter: [116.35381525 - 0.00035, 27.95839468 + 0.0025, 160.0],
             // 控制4层缩放
             // onelayerNum: 80,
@@ -178,7 +175,7 @@
                 const that = this
                 if (that.titlesetLayerFlag == false && newCode == true) {
                     global.viewer.imageryLayers.addImageryProvider(new global.DC.Namespace.Cesium.SingleTileImageryProvider({
-                        url: '/zhxy/img/bg/bg.png'
+                        url: '/zhjg/img/bg/bg.png'
                     }))
 
                     silhouetteBlue =
@@ -238,15 +235,15 @@
                             //     })
                             // )
 
-                            // global.viewer.imageryLayers.addImageryProvider(
-                            //     new global.DC.Namespace.Cesium.UrlTemplateImageryProvider({
-                            //         url: 'https://t{s}.tianditu.gov.cn/DataServer?T=cva_w&x={x}&y={y}&l={z}&tk=789e558be762ff832392a0393fd8a4f1',
-                            //         subdomains: ['0', '1', '2', '3', '4', '5', '6', '7'],
-                            //         format: 'image/jpeg',
-                            //         show: true,
-                            //         maximumLevel: 18
-                            //     })
-                            // )
+                            // global.viewer.imageryLayers.addImageryProvider(new global.DC.Namespace.Cesium.UrlTemplateImageryProvider({
+                            //     url: 'https://t{s}.tianditu.gov.cn/DataServer?T=cva_w&x={x}&y={y}&l={z}&tk=789e558be762ff832392a0393fd8a4f1',
+                            //     subdomains: ['0', '1', '2', '3', '4', '5', '6', '7'],
+                            //     format: 'image/jpeg',
+                            //     show: true,
+                            //     maximumLevel: 18
+                            // }
+
+                            // ))
 
                             that.addBaseLayer()
 
@@ -297,7 +294,7 @@
                     window.layerGroup.addLayer(window.areaLayer)
                     axios
                         .get(
-                            'https://dev.jxpskj.com:8023/arcgis/rest/services/shidalk/MapServer/0/query?where=1%3D1&text=&objectIds=&time=&geometry=&geometryType=esriGeometryEnvelope&inSR=&spatialRel=esriSpatialRelIntersects&relationParam=&outFields=*&returnGeometry=true&maxAllowableOffset=&geometryPrecision=&outSR=&returnIdsOnly=false&returnCountOnly=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&returnZ=false&returnM=false&gdbVersion=&returnDistinctValues=false&returnTrueCurves=false&resultOffset=&resultRecordCount=&f=pjson'
+                            'https://dev.jxpskj.com:8023/arcgis/rest/services/jglk/MapServer/0/query?where=1%3D1&text=&objectIds=&time=&geometry=&geometryType=esriGeometryEnvelope&inSR=&spatialRel=esriSpatialRelIntersects&relationParam=&outFields=*&returnGeometry=true&maxAllowableOffset=&geometryPrecision=&outSR=&returnIdsOnly=false&returnCountOnly=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&returnZ=false&returnM=false&gdbVersion=&returnDistinctValues=false&returnTrueCurves=false&resultOffset=&resultRecordCount=&f=pjson'
                         )
                         .then((resultData) => {
                             resultData.data.features.forEach((item) => {
@@ -325,11 +322,12 @@
                             window.areaLayer.show = true
                         })
                     that.$store.commit('MSET_areaLayer', window.areaLayer)
-
                     // 判断是否有url参数
                     // console.log(that.urlParameterData);
-                    if (typeof that.urlParameterData != 'string') {
+                    if (JSON.stringify(that.urlParameterData) != '{}') {
                         // console.log(that.urlParameterData);
+
+                        var positionArr = that.urlParameterData.x.split(',')
                         that.$store.commit('initurlParameterLayer') // 初始化自定义标签图层
                         if (that.urlParameterData.methods == 'goto') {
                             // url有定位的参数
@@ -340,8 +338,8 @@
                                 list: [
                                     {
                                         name: that.urlParameterData.name || '无标题',
-                                        jd: that.urlParameterData.jd,
-                                        wd: that.urlParameterData.wd
+                                        jd: positionArr[0],
+                                        wd: positionArr[1]
                                     }
                                 ],
                                 clear: true
@@ -355,12 +353,12 @@
 
                             const d = {
                                 position: {},
-                                lntLat: [+that.urlParameterData.jd, +that.urlParameterData.wd],
+                                lntLat: [+positionArr[0], +positionArr[1]],
                                 query: {
                                     introduce: '暂无内容',
                                     address: '',
                                     ...(that.urlParameterData || {}),
-                                    lntLat: [+that.urlParameterData.jd, +that.urlParameterData.wd]
+                                    lntLat: [+positionArr[0], +positionArr[1]]
                                 },
                                 useJWD: true // 仅使用经纬度
                             }
@@ -368,7 +366,7 @@
                         } else if (that.urlParameterData.methods == 'arc') {
                             const objInit = {
                                 name: that.urlParameterData.mechanismname,
-                                lntLat: [that.urlParameterData.jd, that.urlParameterData.wd],
+                                lntLat: [positionArr[0], positionArr[1]],
                                 alt: that.urlParameterData.gd,
                                 heading: that.urlParameterData.heading,
                                 pitch: that.urlParameterData.pitch,
@@ -656,6 +654,25 @@
                 }
             })
 
+            global.DC.Namespace.Cesium.Camera.DEFAULT_VIEW_RECTANGLE = global.DC.Namespace.Cesium.Rectangle.fromDegrees(115.788116, 28.638531, 151.805469, 28.646045)
+
+            global.viewer.camera.setView({
+                // Cesium的坐标是以地心为原点,一向指向南美洲,一向指向亚洲,一向指向北极州
+                // fromDegrees()方法,将经纬度和高程转换为世界坐标
+                destination: global.DC.Namespace.Cesium.Cartesian3.fromDegrees(
+                    that.mapCenter[0],
+                    that.mapCenter[1],
+                    that.mapCenter[2]
+                ),
+                orientation: {
+                    // 指向
+                    heading: global.DC.Namespace.Cesium.Math.toRadians(0, 0),
+                    // 视角
+                    pitch: global.DC.Namespace.Cesium.Math.toRadians(-90),
+                    roll: 0
+                }
+            })
+
             const primitiveArr = global.viewer.scene.primitives._primitives
 
             global.viewer.scene.primitives.remove(primitiveArr[0])
@@ -674,6 +691,24 @@
             global.viewer.distanceLegend.enable = false
 
             that.viewerExist = true
+
+            const seeNewLayer = new global.DC.VectorLayer('seeNewLayer')
+            global.viewer.addLayer(seeNewLayer)
+
+            const billboard = new global.DC.Billboard(
+                new global.DC.Position(
+                    115.79624983,
+                    28.64160990,
+                    0
+                ), '/zhjg/img/icon/yx.png')
+
+            billboard.size = [67, 266]
+
+            billboard.setStyle({
+                pixelOffset: { x: 0, y: -133 }
+            })
+
+            seeNewLayer.addOverlay(billboard)
         }
         global.DC.ready(window.initViewer)
 
@@ -937,8 +972,8 @@
             const that = this
             tilesetLayer = new global.DC.TilesetLayer('tilesetLayer')
             global.viewer.addLayer(tilesetLayer)
-            tileset = new global.DC.Tileset('/zhxy/mx/tileset.json', {
-                luminanceAtZenith: 0.4,
+            tileset = new global.DC.Tileset('/zhjg/mx/tileset.json', {
+                luminanceAtZenith: 0.2,
                 // cullWithChildrenBounds: false,
                 // cullRequestsWhileMoving: false,
                 // skipLevelOfDetail: false,
@@ -1015,6 +1050,7 @@
     height: 100%;
     position: relative;
 }
+
 .heights {
     background-color: #fff;
     font-size: 24px;

--
Gitblit v1.9.3