This commit is contained in:
2025-12-12 17:01:12 +08:00
parent 52f5c653da
commit 9de7ab532d
4 changed files with 17 additions and 14 deletions

View File

@ -158,7 +158,7 @@ function CesiumContainer(sdk, options) {
infoElm.style['border-radius'] = '18px';
infoElm.style.display = 'flex';
if (coordinateSystem === 'EPSG:4326') {
if (coordinateSystem === 'EPSG:4326' || coordinateSystem === 'EPSG:4490') {
infoElm.innerHTML = `
<div><span>经度:</span><span>-</span></div>
<div><span>纬度:</span><span>-</span></div>
@ -198,7 +198,7 @@ function CesiumContainer(sdk, options) {
// let pos = sdk.viewer.scene.clampToHeight(_cartesian)
let position = tools.cartesian3Towgs84(_cartesian, sdk.viewer)
// position.alt = height
if (coordinateSystem === 'EPSG:4326') {
if (coordinateSystem === 'EPSG:4326' || coordinateSystem === 'EPSG:4490') {
// infoElm.innerHTML = `
// <span>经度:</span><span>${Number(position.lng.toFixed(6))}° </span>
// <span>纬度:</span><span>${Number(position.lat.toFixed(6))}° </span>
@ -233,6 +233,7 @@ function CesiumContainer(sdk, options) {
else {
// let result = proj.convert([{ x: position.lng, y: position.lat, z: position.alt }], 'EPSG:4326', coordinateSystem)
let result = proj.convert([{ x: position.lng, y: position.lat, z: position.alt }], 'EPSG:4326', posiToCoordinate(coordinateSystem, position))
if (result.points.length) {
infoElm.innerHTML = `
<div><span>x</span><span>${Number(result.points[0].x.toFixed(2))}</span></div>
@ -773,7 +774,7 @@ function setCoordinateSystem(sdk, epsg) {
let tools = new Tools()
let proj = sdk.proj
let position = tools.cartesian3Towgs84(_cartesian, sdk.viewer)
if (coordinateSystem === 'EPSG:4326') {
if (coordinateSystem === 'EPSG:4326' || coordinateSystem === 'EPSG:4490') {
// infoElm.innerHTML = `
// <span>经度:</span><span>${Number(position.lng.toFixed(6))}° </span>
// <span>纬度:</span><span>${Number(position.lat.toFixed(6))}° </span>