From 32d0bfb64cca4393c77e31a9a5621d65586a1a2a Mon Sep 17 00:00:00 2001 From: cbwu <504-wuchengbo@htsdfp.com> Date: Thu, 11 Apr 2024 09:12:20 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=A0=87=E8=AE=B0=E7=82=B9=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E6=96=B0=E5=A2=9Elabel=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/map/SceneViewer.vue | 4 ++-- src/utils/map/geometry/billboard.ts | 18 ++++++++++-------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/components/map/SceneViewer.vue b/src/components/map/SceneViewer.vue index 31d3364..ff931e6 100644 --- a/src/components/map/SceneViewer.vue +++ b/src/components/map/SceneViewer.vue @@ -2,7 +2,7 @@ * @Author: cbwu 504-wuchengbo@htsdfp.com * @Date: 2024-03-07 14:15:35 * @LastEditors: cbwu - * @LastEditTime: 2024-04-10 16:30:23 + * @LastEditTime: 2024-04-11 09:11:25 * @Description: --> <template> @@ -22,7 +22,7 @@ import { import { initViewer, perfViewer, showNavigator } from '@/utils/map/sceneViewer' import { flyToChina } from '@/utils/map/camera' import CreatePolyline from '@/utils/map/draw/drawPolyline' -import DrawPoint from '@/utils/map/draw/drawPoint' +// import DrawPoint from '@/utils/map/draw/drawPoint' const viewerDivRef = ref<HTMLDivElement>() let viewer: Viewer window.CESIUM_BASE_URL = 'node_modules/cesium/Build/Cesium/' diff --git a/src/utils/map/geometry/billboard.ts b/src/utils/map/geometry/billboard.ts index 4e16f69..aa36efc 100644 --- a/src/utils/map/geometry/billboard.ts +++ b/src/utils/map/geometry/billboard.ts @@ -2,7 +2,7 @@ * @Author: cbwu 504-wuchengbo@htsdfp.com * @Date: 2024-04-10 08:53:12 * @LastEditors: cbwu - * @LastEditTime: 2024-04-10 16:29:56 + * @LastEditTime: 2024-04-11 09:09:38 * @Description: 广告牌对象 */ import { Entity, Cartesian3, Cartesian2, Color, HeightReference } from 'cesium' @@ -21,14 +21,16 @@ export class BillBoard extends Entity { scale: 1, // 设置实体贴地 heightReference: HeightReference.CLAMP_TO_GROUND, - // disableDepthTestDistance: Number.POSITIVE_INFINITY, // 可能会提高在不同角度下的清晰度 + disableDepthTestDistance: Number.POSITIVE_INFINITY, // 可能会提高在不同角度下的清晰度 + }, + label: { + text: 'Maker1', + font: '32px sans-serif', + scale: 0.5, + pixelOffset: new Cartesian2(45, -5), + heightReference: HeightReference.CLAMP_TO_GROUND, + disableDepthTestDistance: Number.POSITIVE_INFINITY, // 可能会提高在不同角度下的清晰度 }, - // label: { - // text: 'Maker1', - // font: '16px sans-serif', - // scale: 1, - // pixelOffset: new Cartesian2(5, 0), - // }, }) } }