Files
planet/frontend/public/earth/js/constants.js
rayd1o bb6b18fe3b feat(earth): satellite dot rendering with hover/lock rings, dim cables when satellite locked
- Change satellite points from squares to circular dots
- Add hover ring (white) and lock ring (yellow) for satellites
- Fix satellite hover/lock ring state management
- Dim all cables when satellite is locked
- Increase MAX_SATELLITES to 2000
- Fix satIntersects scoping bug
2026-03-19 17:41:53 +08:00

61 lines
1.3 KiB
JavaScript

// constants.js - Global constants and configuration
// Scene configuration
export const CONFIG = {
defaultCameraZ: 300,
minZoom: 0.5,
maxZoom: 5.0,
earthRadius: 100,
rotationSpeed: 0.0005,
};
// Earth coordinate constants
export const EARTH_CONFIG = {
tilt: 23.5, // earth tilt angle (degrees)
tiltRad: 23.5 * Math.PI / 180, // earth tilt angle (radians)
// hangzhou coordinates
chinaLat: 30.2741,
chinaLon: 120.1552,
chinaRotLon: 120.1552 - 270, // for rotation calculation (chinaLon - 270)
// view reset coefficient
latCoefficient: 0.5
};
export const PATHS = {
cablesApi: '/api/v1/visualization/geo/cables',
landingPointsApi: '/api/v1/visualization/geo/landing-points',
geoJSON: './geo.json',
landingPointsStatic: './landing-point-geo.geojson',
};
// Cable colors mapping
export const CABLE_COLORS = {
'Americas II': 0xff4444,
'AU Aleutian A': 0x44ff44,
'AU Aleutian B': 0x4444ff,
'default': 0xffff44
};
export const CABLE_CONFIG = {
lockedOpacityMin: 0.6,
lockedOpacityMax: 1.0,
otherOpacity: 0.5,
otherBrightness: 0.6,
pulseSpeed: 0.003,
pulseCoefficient: 0.4
};
export const CABLE_STATE = {
NORMAL: 'normal',
HOVERED: 'hovered',
LOCKED: 'locked'
};
export const GRID_CONFIG = {
latitudeStep: 10,
longitudeStep: 30,
gridStep: 5
};