修改文本框位置问题
This commit is contained in:
@ -54,7 +54,6 @@ class TextBox extends Base {
|
||||
// 配置CSS样式和内容结构
|
||||
viewer.cesiumWidget.container.appendChild(dom);
|
||||
let posi = Cesium.Cartesian3.fromDegrees(that.options.position.lng.toFixed(4), that.options.position.lat.toFixed(4), that.options.position.alt.toFixed(4))
|
||||
|
||||
that.handler = function () {
|
||||
const position = Cesium.SceneTransforms.wgs84ToWindowCoordinates(
|
||||
viewer.scene, posi
|
||||
@ -80,12 +79,15 @@ class TextBox extends Base {
|
||||
var cartographic = Cesium.Cartographic.fromCartesian(cartesian);
|
||||
var longitude = Cesium.Math.toDegrees(cartographic.longitude);
|
||||
var latitude = Cesium.Math.toDegrees(cartographic.latitude);
|
||||
|
||||
let height = await that.getClampToHeight({ lng: longitude, lat: latitude })
|
||||
that.position = {
|
||||
lng: longitude,
|
||||
lat: latitude,
|
||||
alt: cartographic.height
|
||||
// alt: cartographic.height
|
||||
alt: height
|
||||
}
|
||||
let posi = Cesium.Cartesian3.fromDegrees(longitude.toFixed(4), latitude.toFixed(4), cartographic.height.toFixed(4))
|
||||
let posi = Cesium.Cartesian3.fromDegrees(longitude.toFixed(4), latitude.toFixed(4), height.toFixed(4))
|
||||
|
||||
that.handler = function () {
|
||||
const position = Cesium.SceneTransforms.wgs84ToWindowCoordinates(
|
||||
|
Reference in New Issue
Block a user