fix: polish earth toolbar controls and loading copy
This commit is contained in:
@@ -9,6 +9,7 @@ import {
|
||||
updateZoomDisplay,
|
||||
updateEarthStats,
|
||||
setLoading,
|
||||
setLoadingMessage,
|
||||
showTooltip,
|
||||
hideTooltip,
|
||||
showError,
|
||||
@@ -392,6 +393,12 @@ async function loadData(showWhiteSphere = false) {
|
||||
const loadToken = ++currentLoadToken;
|
||||
isDataLoading = true;
|
||||
hideError();
|
||||
setLoadingMessage(
|
||||
showWhiteSphere ? "正在刷新全球态势数据..." : "正在初始化全球态势数据...",
|
||||
showWhiteSphere
|
||||
? "重新同步卫星、海底光缆与登陆点数据"
|
||||
: "同步卫星、海底光缆与登陆点数据",
|
||||
);
|
||||
setLoading(true);
|
||||
clearLockedObject();
|
||||
hideInfoCard();
|
||||
@@ -761,11 +768,19 @@ function animate() {
|
||||
|
||||
const earth = getEarth();
|
||||
const deltaTime = clock.getDelta() * 1000;
|
||||
const hasInertia =
|
||||
Math.abs(inertialVelocity.x) > INERTIA_MIN_VELOCITY ||
|
||||
Math.abs(inertialVelocity.y) > INERTIA_MIN_VELOCITY;
|
||||
|
||||
if (getAutoRotate() && earth) {
|
||||
earth.rotation.y += CONFIG.rotationSpeed * (deltaTime / 16);
|
||||
targetRotation.y = earth.rotation.y;
|
||||
targetRotation.x = earth.rotation.x;
|
||||
|
||||
// Keep the drag target aligned with autorotation only when the user is not
|
||||
// actively dragging and there is no residual inertial motion to preserve.
|
||||
if (!isDragging && !hasInertia) {
|
||||
targetRotation.y = earth.rotation.y;
|
||||
targetRotation.x = earth.rotation.x;
|
||||
}
|
||||
}
|
||||
|
||||
if (earth) {
|
||||
|
||||
Reference in New Issue
Block a user