diff --git a/frontend/public/earth/js/controls.js b/frontend/public/earth/js/controls.js index 027a4f0e..1ca92aef 100644 --- a/frontend/public/earth/js/controls.js +++ b/frontend/public/earth/js/controls.js @@ -153,11 +153,17 @@ function animateValue(start, end, duration, onUpdate, onComplete) { export function resetView(camera) { if (!earthObj) return; + const chinaLat = 40; + const chinaLon = -154; + + const baseTilt = 23.5 * Math.PI / 180; + const latRot = chinaLat * Math.PI / 180; + const targetRotX = baseTilt + latRot * 0.5; + const targetRotY = -(chinaLon * Math.PI / 180); + const startRotX = earthObj.rotation.x; const startRotY = earthObj.rotation.y; const startZoom = zoomLevel; - const targetRotX = 23.5 * Math.PI / 180; - const targetRotY = 0; const targetZoom = 1.0; animateValue(0, 1, 800, (progress) => { @@ -170,7 +176,7 @@ export function resetView(camera) { updateZoomDisplay(zoomLevel, camera.position.z.toFixed(0)); }, () => { zoomLevel = 1.0; - showStatusMessage('视图已重置', 'info'); + showStatusMessage('视角已重置到中国', 'info'); }); if (typeof window.clearLockedCable === 'function') { diff --git a/frontend/public/earth/js/main.js b/frontend/public/earth/js/main.js index 1d56a858..06f49862 100644 --- a/frontend/public/earth/js/main.js +++ b/frontend/public/earth/js/main.js @@ -301,6 +301,8 @@ function onMouseMove(event, camera) { showTooltip(event.clientX + 10, event.clientY + 10, `纬度: ${coords.lat}°
经度: ${coords.lon}°
海拔: ${coords.alt.toFixed(1)} km`); } + } else { + hideTooltip(); } if (isDragging) {