Merge branch 'master' of http://xny.yj-3d.com:3000/zh/sdk4.0_new
This commit is contained in:
@ -172,7 +172,7 @@ const MouseCoordinate = (sdk, status) => {
|
||||
let degrees = tools.cartesian3Towgs84(cartesian, sdk.viewer)
|
||||
let coordinateSystem = getCoordinateSystem()
|
||||
let positionType = getDMS()
|
||||
if (coordinateSystem === 'EPSG:4326') {
|
||||
if (coordinateSystem === 'EPSG:4326' || coordinateSystem === 'EPSG:4490') {
|
||||
position = {
|
||||
x: degrees.lng,
|
||||
y: degrees.lat,
|
||||
@ -202,7 +202,7 @@ const MouseCoordinate = (sdk, status) => {
|
||||
}
|
||||
else {
|
||||
let coordinateSystem = getCoordinateSystem()
|
||||
if (coordinateSystem === 'EPSG:4326') {
|
||||
if (coordinateSystem === 'EPSG:4326' || coordinateSystem === 'EPSG:4490') {
|
||||
contentElm.innerHTML = `<div class='mousePosiWords' style='width: 150px;position: absolute; z-index: 777; color: #ffffff; font-size: 12px; left:${left + 20}px; top:${top + 10}px;'><p style='margin: 0;'>经度:-</p><p style='margin: 0;'>维度:-</p><p style='margin: 0;'>海拔:-</p></div>`
|
||||
}
|
||||
else {
|
||||
|
||||
@ -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>
|
||||
|
||||
Reference in New Issue
Block a user