智慧农业大数据平台
xiebin
2022-11-16 3dc278f10a4c3e3db7ce3a445bed710bdc88916e
src/components/map/index.vue
@@ -108,6 +108,8 @@
                    maximumLevel: 18
                })
            )
            //获取默认展示影像
            getSensings("SHOW").then(res=>{
                res.data.data.forEach(e=>{
@@ -130,7 +132,7 @@
            //         maximumLevel: 18
            //     })
            // )
            //
            // global.viewer.imageryLayers.addImageryProvider(
            //     new global.DC.Namespace.Cesium.UrlTemplateImageryProvider({
            //         url: 'http://t{s}.tianditu.gov.cn/DataServer?T=cva_w&x={x}&y={y}&l={z}&tk=e9533f5acb2ac470b07f406a4d24b4f0',
@@ -199,10 +201,10 @@
            const that = this
            // const center = this.getCenter(positions)
            const center = [item.longitude, item.latitude]
            const divIcon = new global.DC.DivIcon(
                new global.DC.Position(center[0], center[1], 0),
            const center = global.DC.CoordTransform.GCJ02ToWGS84(item.longitude, item.latitude)
            const divIcon = new global.DC.DivIcon(new global.DC.Position(center[0], center[1]),
                `
                        <div class="farm-map-icon">
                            <img src="../../../zhny-dp/img/icon/3858.png" alt="">
@@ -406,12 +408,13 @@
            //     })
            //     return
            // }
            const center = global.DC.CoordTransform.GCJ02ToWGS84(farmObj.longitude, farmObj.latitude)
            global.viewer.camera.flyTo({
                // Cesium的坐标是以地心为原点,一向指向南美洲,一向指向亚洲,一向指向北极州
                // fromDegrees()方法,将经纬度和高程转换为世界坐标
                destination: global.DC.Namespace.Cesium.Cartesian3.fromDegrees(
                    farmObj.longitude, farmObj.latitude, 3000.0
                        center[0], center[1], 3000.0
                ),
                orientation: {
                    // 指向