feat: 标记点功能新增label。

pull/5/head
cbwu 1 year ago
parent 09f3e998cb
commit 32d0bfb64c

@ -2,7 +2,7 @@
* @Author: cbwu 504-wuchengbo@htsdfp.com * @Author: cbwu 504-wuchengbo@htsdfp.com
* @Date: 2024-03-07 14:15:35 * @Date: 2024-03-07 14:15:35
* @LastEditors: cbwu * @LastEditors: cbwu
* @LastEditTime: 2024-04-10 16:30:23 * @LastEditTime: 2024-04-11 09:11:25
* @Description: * @Description:
--> -->
<template> <template>
@ -22,7 +22,7 @@ import {
import { initViewer, perfViewer, showNavigator } from '@/utils/map/sceneViewer' import { initViewer, perfViewer, showNavigator } from '@/utils/map/sceneViewer'
import { flyToChina } from '@/utils/map/camera' import { flyToChina } from '@/utils/map/camera'
import CreatePolyline from '@/utils/map/draw/drawPolyline' 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>() const viewerDivRef = ref<HTMLDivElement>()
let viewer: Viewer let viewer: Viewer
window.CESIUM_BASE_URL = 'node_modules/cesium/Build/Cesium/' window.CESIUM_BASE_URL = 'node_modules/cesium/Build/Cesium/'

@ -2,7 +2,7 @@
* @Author: cbwu 504-wuchengbo@htsdfp.com * @Author: cbwu 504-wuchengbo@htsdfp.com
* @Date: 2024-04-10 08:53:12 * @Date: 2024-04-10 08:53:12
* @LastEditors: cbwu * @LastEditors: cbwu
* @LastEditTime: 2024-04-10 16:29:56 * @LastEditTime: 2024-04-11 09:09:38
* @Description: 广 * @Description: 广
*/ */
import { Entity, Cartesian3, Cartesian2, Color, HeightReference } from 'cesium' import { Entity, Cartesian3, Cartesian2, Color, HeightReference } from 'cesium'
@ -21,14 +21,16 @@ export class BillBoard extends Entity {
scale: 1, scale: 1,
// 设置实体贴地 // 设置实体贴地
heightReference: HeightReference.CLAMP_TO_GROUND, 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),
// },
}) })
} }
} }

Loading…
Cancel
Save