From ed837798421340859efca21e46adc17575bdfef8 Mon Sep 17 00:00:00 2001 From: yxl <584911253@qq.com> Date: 星期五, 10 一月 2025 16:23:17 +0800 Subject: [PATCH] 最新修改 --- src/assets/js/map/mapView.js | 49 ++++++++++++++++++++++++++++--------------------- 1 files changed, 28 insertions(+), 21 deletions(-) diff --git a/src/assets/js/map/mapView.js b/src/assets/js/map/mapView.js index 4bdab51..5c6cb30 100644 --- a/src/assets/js/map/mapView.js +++ b/src/assets/js/map/mapView.js @@ -36,10 +36,8 @@ console.log("鐐瑰嚮鐨勫璞�:", pickedObject); } }, Cesium.ScreenSpaceEventType.LEFT_CLICK); - // earthCtrl.factory.createTerrainLayer({ - // sourceType: "ctb", - // url: "https://tiles1.geovisearth.com/base/v1/terrain?token=486dac3bec56d7d7c2a581c150be2bd937462f1e8f3bc9c78b5658b396122405" - // }); + //鍔犺浇鍏ㄧ悆鍦板舰 + this.addTerrain(); this.addImageLayer(); // this.addqqmap(); let now2 = new Date(); @@ -116,6 +114,9 @@ // lat: 23.990136825668284, // alt: 150 // }) + earthCtrl.measure.pickPosition({}, function (e) { + console.info(e); + }); }, addTetrahedron(res) { earthCtrl.factory.addTetrahedron({ @@ -250,14 +251,14 @@ width: 1.5, color: '#87CEFA', }) - earthCtrl.factory.createWfsLayer('polyline', { + const layer1 = earthCtrl.factory.createWfsLayer('polyline', { urls: 'https://cim.smartearth.cn/geoserver/JiaShanBase/ows', layer: 'JiaShanBase:RadarM', width: 1.5, color: '#de3', }) - earthCtrl.factory.createWfsLayer('polyline', { + const layer2 = earthCtrl.factory.createWfsLayer('polyline', { urls: 'https://cim.smartearth.cn/geoserver/JiaShanBase/ows', layer: 'JiaShanBase:RadarS', width: 1.5, @@ -286,30 +287,36 @@ }, addModel() { const entity = earthCtrl.viewer.entities.add({ - position: SmartEarth.Cesium.Cartesian3.fromDegrees( - 121.614202387521061, - 23.990136825668284, - 0 + position: Cesium.Cartesian3.fromDegrees( + 121.576830, + 24.006230, ), model: { - uri: '/gltf/tank.glb', - scale: 15, - heightReference: SmartEarth.Cesium.HeightReference.CLAMP_TO_GROUND, - disableDepthTestDistance: Number.POSITIVE_INFINITY // 绂佺敤娣卞害娴嬭瘯 + uri: '/gltf/ddc.glb', + scale: 20, + heightReference: Cesium.HeightReference.CLAMP_TO_GROUND, + // disableDepthTestDistance: Number.POSITIVE_INFINITY // 绂佺敤娣卞害娴嬭瘯 }, label: { show: true, - text: '缁忓害锛�121.6142023,绾害锛�23.9901368', - color: SmartEarth.Cesium.Color.fromCssColorString("#fff"), + text: '缁忓害锛�121.576830,绾害锛�24.006230', + color: Cesium.Color.fromCssColorString("#fff"), font: "normal 14px MicroSoft YaHei", showBackground: true, - outlineColor: SmartEarth.Cesium.Color.WHITE, - pixelOffset: new SmartEarth.Cesium.Cartesian2(10, -30), - horizontalOrigin: SmartEarth.Cesium.HorizontalOrigin.CENTER, - verticalOrigin: SmartEarth.Cesium.VerticalOrigin.BOTTOM, - heightReference: SmartEarth.Cesium.HeightReference.CLAMP_TO_GROUND, + outlineColor: Cesium.Color.WHITE, + pixelOffset: new Cesium.Cartesian2(10, -30), + horizontalOrigin: Cesium.HorizontalOrigin.CENTER, + verticalOrigin: Cesium.VerticalOrigin.BOTTOM, + heightReference: Cesium.HeightReference.CLAMP_TO_GROUND, }, }); + }, + //鍔犺浇鍏ㄧ悆鍦板舰 + addTerrain() { + window.terrain = earthCtrl.factory.createTerrainLayer({ + sourceType: "ctb", + url:config.terrainUrl + }); } }; export default mapViewer; -- Gitblit v1.9.3