@yangyongtao/gaea 1.1.32 → 1.1.34

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,13 +1,10 @@
1
- /**
1
+ /**
2
2
  * gaea-3dview npm package
3
3
  *
4
- * 初始化在 new GaeaApp() 时自动完成,Vue 页面只需配置。
5
- *
6
- * 用法:
7
- * setConfig({ serveUrl: '...', serveLocal: '...' });
4
+ * 鍒濆鍖栧湪 new GaeaApp() 鏃惰嚜鍔ㄥ畬鎴愶紝Vue 椤甸潰鍙渶閰嶇疆銆? *
5
+ * 鐢ㄦ硶锛? * setConfig({ serveUrl: '...', serveLocal: '...' });
8
6
  * const app = new GaeaApp();
9
- * await app.ready; // 可选,等待初始化完成
10
- */
7
+ * await app.ready; // 鍙€夛紝绛夊緟鍒濆鍖栧畬鎴? */
11
8
 
12
9
  import { Group, Tween, Easing } from '@tweenjs/tween.js';
13
10
  window.TWEEN = { Group, Tween, Easing };
@@ -15,7 +12,7 @@ window.TWEEN = { Group, Tween, Easing };
15
12
  import Gaea from '../public/index.js';
16
13
 
17
14
 
18
- // ==================== Loading 动画 ====================
15
+ // ==================== Loading 鍔ㄧ敾 ====================
19
16
 
20
17
  (function injectLoadingStyle() {
21
18
  if (document.getElementById('gaea-loading-style')) return;
@@ -54,9 +51,9 @@ import Gaea from '../public/index.js';
54
51
  transition: background 0.2s; backdrop-filter: blur(4px);
55
52
  }
56
53
  #gaea-layertree-btn:hover { background: rgba(0,0,0,0.7); }
57
- /* 屏幕图标样式(对齐 ht_3dview) */
54
+ /* 灞忓箷鍥炬爣鏍峰紡锛堝榻?ht_3dview锛?*/
58
55
  .gaea-locationLineStyle {
59
- position: absolute; overflow: hidden; z-index: 11; pointer-events: auto;
56
+ position: absolute; overflow: hidden; z-index: 1; pointer-events: auto;
60
57
  user-select: none; -webkit-user-select: none;
61
58
  }
62
59
  .gaea-locationLineStyle .text-wrapper {
@@ -75,7 +72,7 @@ import Gaea from '../public/index.js';
75
72
  }
76
73
  .gaea-iconscreen {
77
74
  position: absolute; overflow: hidden; width: 169px; height: 55px;
78
- user-select: none; -webkit-user-select: none; z-index: 11; pointer-events: auto;
75
+ user-select: none; -webkit-user-select: none; z-index: 1; pointer-events: auto;
79
76
  }
80
77
  .gaea-iconscreen img {
81
78
  position: absolute; width: 100%; height: 100%;
@@ -92,7 +89,7 @@ import Gaea from '../public/index.js';
92
89
  }
93
90
  .gaea-iconGif {
94
91
  position: absolute; overflow: hidden; width: 48px; height: 48px;
95
- user-select: none; -webkit-user-select: none; z-index: 11; pointer-events: auto;
92
+ user-select: none; -webkit-user-select: none; z-index: 1; pointer-events: auto;
96
93
  }
97
94
  .gaea-iconGif img {
98
95
  width: 100%; height: 100%; object-fit: contain; display: block;
@@ -117,26 +114,28 @@ function hideLoading() {
117
114
  }
118
115
 
119
116
 
120
- // ==================== 配置 ====================
117
+ // ==================== 閰嶇疆 ====================
121
118
 
122
- /** 默认引擎资源服务器地址(Gaea.pck / Gaea.wasm 等大文件),可在运行时/环境变量覆盖 */
119
+ /** 榛樿寮曟搸璧勬簮鏈嶅姟鍣ㄥ湴鍧€锛圙aea.pck / Gaea.wasm 绛夊ぇ鏂囦欢锛夛紝鍙湪杩愯鏃?鐜鍙橀噺瑕嗙洊 */
123
120
  const DEFAULT_ENGINE_ASSETS_URL = 'http://172.20.176.100:7072/gaea/Gaea';
124
121
 
125
122
  /**
126
- * 解析默认 executable:
127
- * 优先级:运行时全局变量 window.__GAEA_ASSETS_URL__(宿主站点 config.js 可设置,
128
- * 换地址无需重新打包)> 构建环境变量 VITE_GAEA_EXECUTABLE > 内置默认地址。
129
- */
123
+ * 瑙f瀽榛樿 executable锛? * 浼樺厛绾э細杩愯鏃跺叏灞€鍙橀噺 window.__GAEA_ASSETS_URL__锛堝涓荤珯鐐?config.js 鍙缃紝
124
+ * 鎹㈠湴鍧€鏃犻渶閲嶆柊鎵撳寘锛? dev 鐜鏈湴 /Gaea锛堣蛋 vite dev server 涓棿浠讹紝涓嶄緷璧栫嚎涓婏級
125
+ * > 鏋勫缓鐜鍙橀噺 VITE_GAEA_EXECUTABLE > 鍐呯疆榛樿璧勬簮鏈嶅姟鍣ㄥ湴鍧€銆? */
130
126
  function resolveDefaultExecutable() {
131
127
  if (typeof window !== 'undefined' && window.__GAEA_ASSETS_URL__) {
132
128
  return window.__GAEA_ASSETS_URL__;
133
129
  }
134
130
  try {
135
- if (import.meta.env && import.meta.env.VITE_GAEA_EXECUTABLE) {
136
- return import.meta.env.VITE_GAEA_EXECUTABLE;
131
+ if (import.meta.env) {
132
+ // dev 寮€鍙戯細寮曟搸璧勬簮璧?vite dev server 涓棿浠讹紙鏈湴 gaea public锛夛紝鏃犻渶璁块棶绾夸笂
133
+ if (import.meta.env.DEV) return '/Gaea';
134
+ // 鏋勫缓鏃跺彲鐢ㄧ幆澧冨彉閲忚鐩栵紙濡傛湰鍦版祴璇?build 浜х墿鎸囧悜鏈湴璧勬簮鏈嶅姟鍣級
135
+ if (import.meta.env.VITE_GAEA_EXECUTABLE) return import.meta.env.VITE_GAEA_EXECUTABLE;
137
136
  }
138
137
  } catch (e) {
139
- /* 非 vite 环境忽略 */
138
+ /* 闈?vite 鐜蹇界暐 */
140
139
  }
141
140
  return DEFAULT_ENGINE_ASSETS_URL;
142
141
  }
@@ -144,153 +143,151 @@ function resolveDefaultExecutable() {
144
143
  const defaultConfig = {
145
144
  serveUrl: '',
146
145
  serveLocal: '',
147
- // Engine 配置
146
+ // Engine 閰嶇疆
148
147
  executable: resolveDefaultExecutable(),
149
148
  fileSizes: { 'Gaea.pck': 450751936, 'Gaea.wasm': 16580215 },
150
149
  canvasResizePolicy: 2,
151
150
  experimentalVK: false,
152
151
  focusCanvas: true,
153
152
  /**
154
- * 服务模式:
155
- * 'platform' - 服务平台:影像走 serveUrl 的 WMTS,并加载地形、贴地线
156
- * 'online' - 在线:仅加载天地图影像,不加载地形和贴地线
157
- */
153
+ * 鏈嶅姟妯″紡锛? * 'platform' - 鏈嶅姟骞冲彴锛氬奖鍍忚蛋 serveUrl 鐨?WMTS锛屽苟鍔犺浇鍦板舰銆佽创鍦扮嚎
154
+ * 'online' - 鍦ㄧ嚎锛氫粎鍔犺浇澶╁湴鍥惧奖鍍忥紝涓嶅姞杞藉湴褰㈠拰璐村湴绾? */
158
155
  serviceMode: 'platform',
159
- /** 天地图 token(在线模式使用) */
156
+ /** 澶╁湴鍥?token锛堝湪绾挎ā寮忎娇鐢級 */
160
157
  tiandituToken: '63201cfd7df1e1bff7d88bb8baa32151',
161
- /** 天地图最小/最大层级 */
158
+ /** 澶╁湴鍥炬渶灏?鏈€澶у眰绾?*/
162
159
  tiandituLevelRange: [0, 21],
163
- /** 默认加载的影像图层(服务平台模式生效) */
160
+ /** 榛樿鍔犺浇鐨勫奖鍍忓浘灞傦紙鏈嶅姟骞冲彴妯″紡鐢熸晥锛?*/
164
161
  defaultLayers: [
165
162
  { layerName: 'earthland', forMat: 'image/png', min: 0, max: 18, transparency: 0.3 },
166
- { layerName: '苍南L19', forMat: 'image/png', min: 5, max: 17 },
163
+ { layerName: '鑻嶅崡L19', forMat: 'image/png', min: 5, max: 17 },
167
164
  ],
168
- /** 默认加载的地形服务(走 serveUrl,url 为相对路径或完整地址;空数组则不加载) */
165
+ /** 榛樿鍔犺浇鐨勫湴褰㈡湇鍔★紙璧?serveUrl锛寀rl 涓虹浉瀵硅矾寰勬垨瀹屾暣鍦板潃锛涚┖鏁扮粍鍒欎笉鍔犺浇锛?*/
169
166
  defaultTerrains: [
170
- { name: '苍南县地形', url: 'htc/service/tms/1.0.0/苍南县地形@EPSG%3A4326@terrain/' },
167
+ { name: '鑻嶅崡鍘垮湴褰?, url: 'htc/service/tms/1.0.0/鑻嶅崡鍘垮湴褰EPSG%3A4326@terrain/' },
171
168
  ],
172
- /** 默认加载的贴地线(矢量线服务,依赖 WMTS 服务列表;空数组则不加载) */
169
+ /** 榛樿鍔犺浇鐨勮创鍦扮嚎锛堢煝閲忕嚎鏈嶅姟锛屼緷璧?WMTS 鏈嶅姟鍒楄〃锛涚┖鏁扮粍鍒欎笉鍔犺浇锛?*/
173
170
  defaultGroundLines: [
174
- { name: '苍南县边界', range: [0, 9], color: [255, 255, 0], index: 100 },
175
- { name: '苍南县镇边界', range: [9, 15], color: [0, 255, 0], index: 80 },
176
- { name: '苍南县村边界', range: [15, 19], color: [255, 255, 255], index: 60 },
177
- { name: '沿浦海塘工程范围线', range: [0, 21], color: [0, 255, 255], index: 120 },
171
+ { name: '鑻嶅崡鍘胯竟鐣?, range: [0, 9], color: [255, 255, 0], index: 100 },
172
+ { name: '鑻嶅崡鍘块晣杈圭晫', range: [9, 15], color: [0, 255, 0], index: 80 },
173
+ { name: '鑻嶅崡鍘挎潙杈圭晫', range: [15, 19], color: [255, 255, 255], index: 60 },
174
+ { name: '娌挎郸娴峰宸ョ▼鑼冨洿绾?, range: [0, 21], color: [0, 255, 255], index: 120 },
178
175
  ],
179
- /** 默认加载的倾斜摄影 3D Tiles(空数组则不加载) */
176
+ /** 榛樿鍔犺浇鐨勫€炬枩鎽勫奖 3D Tiles锛堢┖鏁扮粍鍒欎笉鍔犺浇锛?*/
180
177
  default3DTiles: [],
181
- /** 默认相机视角 */
178
+ /** 榛樿鐩告満瑙嗚 */
182
179
  defaultCameraPosition: '27.3680928977018,120.414139621887,0,109379.690132486,0,0',
183
- /** 引擎加载进度回调 */
180
+ /** 寮曟搸鍔犺浇杩涘害鍥炶皟 */
184
181
  onProgress: null,
185
- /** 引擎加载提示文字 */
186
- loadingText: 'GAEA 引擎加载中...',
187
- /** DataHub API 地址(图层树数据接口),为空则只用默认数据 */
182
+ /** 寮曟搸鍔犺浇鎻愮ず鏂囧瓧 */
183
+ loadingText: 'GAEA 寮曟搸鍔犺浇涓?..',
184
+ /** DataHub API 鍦板潃锛堝浘灞傛爲鏁版嵁鎺ュ彛锛夛紝涓虹┖鍒欏彧鐢ㄩ粯璁ゆ暟鎹?*/
188
185
  dataHubApiUrl: '',
189
- /** 是否显示图层树按钮(右上角重置按钮旁边) */
186
+ /** 鏄惁鏄剧ず鍥惧眰鏍戞寜閽紙鍙充笂瑙掗噸缃寜閽梺杈癸級 */
190
187
  showLayerTreeBtn: false,
191
- /** 默认隐藏的分类 key 列表,如 ['rainStations', 'rescue'] */
188
+ /** 榛樿闅愯棌鐨勫垎绫?key 鍒楄〃锛屽 ['rainStations', 'rescue'] */
192
189
  defaultHiddenCategories: [],
193
- /** 图层树分类数据(默认数据,接口数据会合并进来) */
190
+ /** 鍥惧眰鏍戝垎绫绘暟鎹紙榛樿鏁版嵁锛屾帴鍙f暟鎹細鍚堝苟杩涙潵锛?*/
194
191
  layerCategories: [
195
- { key: 'seawall', text: '海塘', visible: true, children: [
196
- { text: '沿浦海塘', level: '3', imgUrl: '/image/screenIcon/海塘-3级.png', position: { x: 27.220705, y: 120.457998, z: 20 } },
197
- { text: '霞关海塘', level: '3', imgUrl: '/image/screenIcon/海塘-3级.png', position: { x: 27.171059, y: 120.467901, z: 20 } },
198
- { text: '三茆海塘', level: '4', imgUrl: '/image/screenIcon/海塘-4级.png', position: { x: 27.193284, y: 120.464411, z: 20 } },
199
- { text: '大渔海塘', level: '2', imgUrl: '/image/screenIcon/海塘-2级.png', position: { x: 27.39027, y: 120.599554, z: 20 } },
200
- { text: '信智海塘', level: '4', imgUrl: '/image/screenIcon/海塘-4级.png', position: { x: 27.300806, y: 120.544077, z: 20 } },
201
- { text: '下在海塘', level: '3', imgUrl: '/image/screenIcon/海塘-3级.png', position: { x: 27.215789, y: 120.445849, z: 10 } },
202
- { text: '木林海塘', level: '5', imgUrl: '/image/screenIcon/海塘-5级.png', position: { x: 27.193183, y: 120.424486, z: 20 } },
203
- { text: '雾城海塘', level: '4', imgUrl: '/image/screenIcon/海塘-4级.png', position: { x: 27.27682, y: 120.518917, z: 20 } },
204
- { text: '渔岙海塘', level: '4', imgUrl: '/image/screenIcon/海塘-4级.png', position: { x: 27.403744, y: 120.557879, z: 20 } },
205
- { text: '流岐岙海塘', level: '4', imgUrl: '/image/screenIcon/海塘-4级.png', position: { x: 27.318176, y: 120.542761, z: 20 } },
192
+ { key: 'seawall', text: '娴峰', visible: true, children: [
193
+ { text: '娌挎郸娴峰', level: '3', imgUrl: '/image/screenIcon/娴峰-3绾?png', position: { x: 27.220705, y: 120.457998, z: 20 } },
194
+ { text: '闇炲叧娴峰', level: '3', imgUrl: '/image/screenIcon/娴峰-3绾?png', position: { x: 27.171059, y: 120.467901, z: 20 } },
195
+ { text: '涓夎寙娴峰', level: '4', imgUrl: '/image/screenIcon/娴峰-4绾?png', position: { x: 27.193284, y: 120.464411, z: 20 } },
196
+ { text: '澶ф笖娴峰', level: '2', imgUrl: '/image/screenIcon/娴峰-2绾?png', position: { x: 27.39027, y: 120.599554, z: 20 } },
197
+ { text: '淇℃櫤娴峰', level: '4', imgUrl: '/image/screenIcon/娴峰-4绾?png', position: { x: 27.300806, y: 120.544077, z: 20 } },
198
+ { text: '涓嬪湪娴峰', level: '3', imgUrl: '/image/screenIcon/娴峰-3绾?png', position: { x: 27.215789, y: 120.445849, z: 10 } },
199
+ { text: '鏈ㄦ灄娴峰', level: '5', imgUrl: '/image/screenIcon/娴峰-5绾?png', position: { x: 27.193183, y: 120.424486, z: 20 } },
200
+ { text: '闆惧煄娴峰', level: '4', imgUrl: '/image/screenIcon/娴峰-4绾?png', position: { x: 27.27682, y: 120.518917, z: 20 } },
201
+ { text: '娓斿矙娴峰', level: '4', imgUrl: '/image/screenIcon/娴峰-4绾?png', position: { x: 27.403744, y: 120.557879, z: 20 } },
202
+ { text: '娴佸矏宀欐捣濉?, level: '4', imgUrl: '/image/screenIcon/娴峰-4绾?png', position: { x: 27.318176, y: 120.542761, z: 20 } },
206
203
  ]},
207
- { key: 'hydrometricStations', text: '水文站', visible: true, children: [
208
- { text: '灵溪', stcd: '7010CK01', sttp: 'ZQ', position: { x: 27.5014, y: 120.3847, z: 100 } },
209
- { text: '流石', stcd: '7010CK02', sttp: 'ZQ', position: { x: 27.5029, y: 120.4615, z: 100 } },
210
- { text: '观美', stcd: '7050CK02', sttp: 'ZQ', position: { x: 27.4658, y: 120.364, z: 100 } },
211
- { text: '桂兰溪', stcd: '7061CK68', sttp: 'ZQ', position: { x: 27.4584, y: 120.3071, z: 100 } },
204
+ { key: 'hydrometricStations', text: '姘存枃绔?, visible: true, children: [
205
+ { text: '鐏垫邯', stcd: '7010CK01', sttp: 'ZQ', position: { x: 27.5014, y: 120.3847, z: 100 } },
206
+ { text: '娴佺煶', stcd: '7010CK02', sttp: 'ZQ', position: { x: 27.5029, y: 120.4615, z: 100 } },
207
+ { text: '瑙傜編', stcd: '7050CK02', sttp: 'ZQ', position: { x: 27.4658, y: 120.364, z: 100 } },
208
+ { text: '妗傚叞婧?, stcd: '7061CK68', sttp: 'ZQ', position: { x: 27.4584, y: 120.3071, z: 100 } },
212
209
  ]},
213
- { key: 'tideStations', text: '潮位站', visible: true, children: [] },
214
- { key: 'riverStations', text: '河道水位站', visible: true, children: [] },
215
- { key: 'rainStations', text: '雨量站', visible: true, children: [] },
216
- { key: 'reservoirs', text: '水库', visible: true, children: [] },
217
- { key: 'sluice', text: '水闸', visible: true, children: [
218
- { text: '联盟水闸', position: { x: 27.200462, y: 120.465635, z: 50 } },
219
- { text: '沿浦水闸', position: { x: 27.222987, y: 120.453175, z: 20 } },
220
- { text: '下在水闸', position: { x: 27.221816, y: 120.445182, z: 50 } },
221
- { text: '下在海塘纳排闸', position: { x: 27.219978, y: 120.445672, z: 50 } },
222
- { text: '岭尾水闸', position: { x: 27.215762, y: 120.462235, z: 40 } },
223
- { text: '岭尾新闸', position: { x: 27.210369, y: 120.458532, z: 10 } },
210
+ { key: 'tideStations', text: '娼綅绔?, visible: true, children: [] },
211
+ { key: 'riverStations', text: '娌抽亾姘翠綅绔?, visible: true, children: [] },
212
+ { key: 'rainStations', text: '闆ㄩ噺绔?, visible: true, children: [] },
213
+ { key: 'reservoirs', text: '姘村簱', visible: true, children: [] },
214
+ { key: 'sluice', text: '姘撮椄', visible: true, children: [
215
+ { text: '鑱旂洘姘撮椄', position: { x: 27.200462, y: 120.465635, z: 50 } },
216
+ { text: '娌挎郸姘撮椄', position: { x: 27.222987, y: 120.453175, z: 20 } },
217
+ { text: '涓嬪湪姘撮椄', position: { x: 27.221816, y: 120.445182, z: 50 } },
218
+ { text: '涓嬪湪娴峰绾虫帓闂?, position: { x: 27.219978, y: 120.445672, z: 50 } },
219
+ { text: '宀熬姘撮椄', position: { x: 27.215762, y: 120.462235, z: 40 } },
220
+ { text: '宀熬鏂伴椄', position: { x: 27.210369, y: 120.458532, z: 10 } },
224
221
  ]},
225
- { key: 'secData', text: '断面数据', visible: true, children: [
222
+ { key: 'secData', text: '鏂潰鏁版嵁', visible: true, children: [
226
223
  { text: 'YPDP0+600', position: { x: 27.217692, y: 120.461823, z: 30 },
227
224
  indexList: {
228
- 1: { label: '素填土', details: ['成分: 人工回填黏性土', '厚度: 约1.5m', '作用: 表层覆盖防护'] },
229
- 2: { label: '淤泥', details: ['类别: 海相淤泥', '颜色: 灰黑色', '状态: 流塑', '含水率: 约55%'] },
230
- 3: { label: '6.89', details: ['类型: 堤顶设计高程', '数值: 6.89m', '作用: 防洪堤坝顶部标高'] },
231
- 4: { label: '6.00', details: ['类型: 设计洪水位', '数值: 6.00m', '标准: 重现期P=5%'] },
232
- 5: { label: '植被护坡', details: ['类型: 草皮护坡', '坡度: 1:2', '作用: 防止坡面雨水冲刷'] },
233
- 6: { label: '3.00', details: ['类型: 常水位', '数值: 3.00m', '作用: 日常运行水位线'] },
234
- 7: { label: '砖石混合料填筑', details: ['成分: 砖石与黏土混合', '厚度: 约2.5m', '作用: 堤身填筑主体'] },
235
- 8: { label: '2.00', details: ['类型: 堤脚高程', '数值: 2.00m', '作用: 堤坝底部基础标高'] },
236
- 9: { label: '3.94设计洪水P=5%', details: ['类型: 设计洪水位', '频率: 5%(20年一遇)', '数值: 3.94m', '作用: 堤防设计标准水位'] },
237
- 10: { label: '4.5', details: ['类型: 设计高潮位', '标准: 50年一遇', '数值: 4.45m', '作用: 海堤防潮标准'] },
238
- 11: { label: '50年一遇设计高潮位4.45m', details: ['类型: 设计高潮位', '重现期: 50年', '数值: 4.45m', '作用: 校核堤顶高程'] },
225
+ 1: { label: '绱犲~鍦?, details: ['鎴愬垎: 浜哄伐鍥炲~榛忔€у湡', '鍘氬害: 绾?.5m', '浣滅敤: 琛ㄥ眰瑕嗙洊闃叉姢'] },
226
+ 2: { label: '娣ゆ偿', details: ['绫诲埆: 娴风浉娣ゆ偿', '棰滆壊: 鐏伴粦鑹?, '鐘舵€? 娴佸', '鍚按鐜? 绾?5%'] },
227
+ 3: { label: '6.89', details: ['绫诲瀷: 鍫ら《璁捐楂樼▼', '鏁板€? 6.89m', '浣滅敤: 闃叉椽鍫ゅ潩椤堕儴鏍囬珮'] },
228
+ 4: { label: '6.00', details: ['绫诲瀷: 璁捐娲按浣?, '鏁板€? 6.00m', '鏍囧噯: 閲嶇幇鏈烶=5%'] },
229
+ 5: { label: '妞嶈鎶ゅ潯', details: ['绫诲瀷: 鑽夌毊鎶ゅ潯', '鍧″害: 1:2', '浣滅敤: 闃叉鍧¢潰闆ㄦ按鍐插埛'] },
230
+ 6: { label: '3.00', details: ['绫诲瀷: 甯告按浣?, '鏁板€? 3.00m', '浣滅敤: 鏃ュ父杩愯姘翠綅绾?] },
231
+ 7: { label: '鐮栫煶娣峰悎鏂欏~绛?, details: ['鎴愬垎: 鐮栫煶涓庨粡鍦熸贩鍚?, '鍘氬害: 绾?.5m', '浣滅敤: 鍫よ韩濉瓚涓讳綋'] },
232
+ 8: { label: '2.00', details: ['绫诲瀷: 鍫よ剼楂樼▼', '鏁板€? 2.00m', '浣滅敤: 鍫ゅ潩搴曢儴鍩虹鏍囬珮'] },
233
+ 9: { label: '3.94璁捐娲按P=5%', details: ['绫诲瀷: 璁捐娲按浣?, '棰戠巼: 5%(20骞翠竴閬?', '鏁板€? 3.94m', '浣滅敤: 鍫ら槻璁捐鏍囧噯姘翠綅'] },
234
+ 10: { label: '4.5', details: ['绫诲瀷: 璁捐楂樻疆浣?, '鏍囧噯: 50骞翠竴閬?, '鏁板€? 4.45m', '浣滅敤: 娴峰牑闃叉疆鏍囧噯'] },
235
+ 11: { label: '50骞翠竴閬囪璁¢珮娼綅4.45m', details: ['绫诲瀷: 璁捐楂樻疆浣?, '閲嶇幇鏈? 50骞?, '鏁板€? 4.45m', '浣滅敤: 鏍℃牳鍫ら《楂樼▼'] },
239
236
  },
240
237
  favorite: '27.2201168867619,120.460489990829,152.923049719807,297.140390154652,50.2192727515776,0.00126576050689737',
241
238
  secAnimation: [{x:27.217703, y:120.46207, z:32}, {x:27.217626, y:120.461815, z:32}, {x:27.217433, y:120.461448, z:32}] },
242
239
  { text: 'YPDP0+100', position: { x: 27.223027, y: 120.454653, z: 30 },
243
240
  indexList: {
244
- 1: { label: '淤泥', details: ['类别: 海相淤泥', '颜色: 灰黑色', '状态: 流塑'] },
245
- 2: { label: '素土', details: ['类别: 天然沉积土', '颜色: 黄褐色', '状态: 可塑', '承载力: 一般'] },
246
- 3: { label: '砖石混合材料填筑', details: ['成分: 砖石与黏土混合', '厚度: 约2m', '作用: 堤身填筑主体'] },
247
- 4: { label: '6.98', details: ['类型: 堤顶设计高程', '数值: 6.98m'] },
248
- 5: { label: '6.00', details: ['类型: 设计洪水位', '数值: 6.00m', '标准: P=5%'] },
249
- 6: { label: '3.94', details: ['类型: 设计洪水位', '频率: 5%', '数值: 3.94m'] },
250
- 7: { label: '2.00', details: ['类型: 堤脚高程', '数值: 2.00m'] },
251
- 8: { label: '4.5', details: ['类型: 设计高潮位', '标准: 50年一遇', '数值: 4.45m'] },
241
+ 1: { label: '娣ゆ偿', details: ['绫诲埆: 娴风浉娣ゆ偿', '棰滆壊: 鐏伴粦鑹?, '鐘舵€? 娴佸'] },
242
+ 2: { label: '绱犲湡', details: ['绫诲埆: 澶╃劧娌夌Н鍦?, '棰滆壊: 榛勮鑹?, '鐘舵€? 鍙', '鎵胯浇鍔? 涓€鑸?] },
243
+ 3: { label: '鐮栫煶娣峰悎鏉愭枡濉瓚', details: ['鎴愬垎: 鐮栫煶涓庨粡鍦熸贩鍚?, '鍘氬害: 绾?m', '浣滅敤: 鍫よ韩濉瓚涓讳綋'] },
244
+ 4: { label: '6.98', details: ['绫诲瀷: 鍫ら《璁捐楂樼▼', '鏁板€? 6.98m'] },
245
+ 5: { label: '6.00', details: ['绫诲瀷: 璁捐娲按浣?, '鏁板€? 6.00m', '鏍囧噯: P=5%'] },
246
+ 6: { label: '3.94', details: ['绫诲瀷: 璁捐娲按浣?, '棰戠巼: 5%', '鏁板€? 3.94m'] },
247
+ 7: { label: '2.00', details: ['绫诲瀷: 鍫よ剼楂樼▼', '鏁板€? 2.00m'] },
248
+ 8: { label: '4.5', details: ['绫诲瀷: 璁捐楂樻疆浣?, '鏍囧噯: 50骞翠竴閬?, '鏁板€? 4.45m'] },
252
249
  },
253
250
  favorite: '27.2241401069656,120.45184648674,114.05854266096,366.355033916145,42.1285030727423,359.999914392757',
254
251
  secAnimation: [{x:27.223145, y:120.454946, z:30}, {x:27.223085, y:120.454756, z:30}, {x:27.222844, y:120.454466, z:30}] },
255
252
  { text: 'YPDP0+200', position: { x: 27.222541, y: 120.455453, z: 30 },
256
253
  indexList: {
257
- 0: { label: '淤泥', details: ['类别: 海相淤泥', '颜色: 灰黑色', '状态: 流塑'] },
258
- 1: { label: '素土', details: ['类别: 天然沉积土', '颜色: 黄褐色', '状态: 可塑'] },
259
- 2: { label: '砖石混合材料填筑', details: ['成分: 砖石与黏土混合', '作用: 堤身填筑主体'] },
260
- 3: { label: '6.98', details: ['类型: 堤顶设计高程', '数值: 6.98m'] },
261
- 4: { label: '6.00', details: ['类型: 设计洪水位', '数值: 6.00m', '标准: P=5%'] },
262
- 5: { label: '3.94', details: ['类型: 设计洪水位', '频率: 5%', '数值: 3.94m'] },
263
- 6: { label: '2.00', details: ['类型: 堤脚高程', '数值: 2.00m'] },
264
- 7: { label: '4.5', details: ['类型: 设计高潮位', '标准: 50年一遇', '数值: 4.45m'] },
254
+ 0: { label: '娣ゆ偿', details: ['绫诲埆: 娴风浉娣ゆ偿', '棰滆壊: 鐏伴粦鑹?, '鐘舵€? 娴佸'] },
255
+ 1: { label: '绱犲湡', details: ['绫诲埆: 澶╃劧娌夌Н鍦?, '棰滆壊: 榛勮鑹?, '鐘舵€? 鍙'] },
256
+ 2: { label: '鐮栫煶娣峰悎鏉愭枡濉瓚', details: ['鎴愬垎: 鐮栫煶涓庨粡鍦熸贩鍚?, '浣滅敤: 鍫よ韩濉瓚涓讳綋'] },
257
+ 3: { label: '6.98', details: ['绫诲瀷: 鍫ら《璁捐楂樼▼', '鏁板€? 6.98m'] },
258
+ 4: { label: '6.00', details: ['绫诲瀷: 璁捐娲按浣?, '鏁板€? 6.00m', '鏍囧噯: P=5%'] },
259
+ 5: { label: '3.94', details: ['绫诲瀷: 璁捐娲按浣?, '棰戠巼: 5%', '鏁板€? 3.94m'] },
260
+ 6: { label: '2.00', details: ['绫诲瀷: 鍫よ剼楂樼▼', '鏁板€? 2.00m'] },
261
+ 7: { label: '4.5', details: ['绫诲瀷: 璁捐楂樻疆浣?, '鏍囧噯: 50骞翠竴閬?, '鏁板€? 4.45m'] },
265
262
  },
266
263
  favorite: '27.2239199251089,120.452312356798,114.058543530715,366.288499980401,42.128503423954,359.999913220015',
267
264
  secAnimation: [{x:27.222801, y:120.455528, z:30}, {x:27.222681, y:120.455458, z:30}, {x:27.22226, y:120.455318, z:30}] },
268
265
  { text: 'YPDP0+750', position: { x: 27.220289, y: 120.459753, z: 30 },
269
266
  indexList: {
270
- 0: { label: '淤泥', details: ['类别: 海相淤泥', '颜色: 灰黑色', '状态: 流塑'] },
271
- 1: { label: '砖石混合料填筑', details: ['成分: 砖石与黏土混合', '厚度: 约2.5m', '作用: 堤身填筑主体'] },
272
- 2: { label: '7.00', details: ['类型: 堤顶设计高程', '数值: 7.00m'] },
273
- 3: { label: '6.00', details: ['类型: 设计洪水位', '数值: 6.00m', '标准: P=5%'] },
274
- 4: { label: '3.94', details: ['类型: 设计洪水位', '频率: 5%', '数值: 3.94m'] },
275
- 5: { label: '2.00', details: ['类型: 堤脚高程', '数值: 2.00m'] },
276
- 6: { label: '4.5', details: ['类型: 设计高潮位', '标准: 50年一遇', '数值: 4.45m'] },
277
- 7: { label: '植被护坡', details: ['类型: 草皮护坡', '坡度: 1:2', '作用: 防止坡面冲刷'] },
267
+ 0: { label: '娣ゆ偿', details: ['绫诲埆: 娴风浉娣ゆ偿', '棰滆壊: 鐏伴粦鑹?, '鐘舵€? 娴佸'] },
268
+ 1: { label: '鐮栫煶娣峰悎鏂欏~绛?, details: ['鎴愬垎: 鐮栫煶涓庨粡鍦熸贩鍚?, '鍘氬害: 绾?.5m', '浣滅敤: 鍫よ韩濉瓚涓讳綋'] },
269
+ 2: { label: '7.00', details: ['绫诲瀷: 鍫ら《璁捐楂樼▼', '鏁板€? 7.00m'] },
270
+ 3: { label: '6.00', details: ['绫诲瀷: 璁捐娲按浣?, '鏁板€? 6.00m', '鏍囧噯: P=5%'] },
271
+ 4: { label: '3.94', details: ['绫诲瀷: 璁捐娲按浣?, '棰戠巼: 5%', '鏁板€? 3.94m'] },
272
+ 5: { label: '2.00', details: ['绫诲瀷: 鍫よ剼楂樼▼', '鏁板€? 2.00m'] },
273
+ 6: { label: '4.5', details: ['绫诲瀷: 璁捐楂樻疆浣?, '鏍囧噯: 50骞翠竴閬?, '鏁板€? 4.45m'] },
274
+ 7: { label: '妞嶈鎶ゅ潯', details: ['绫诲瀷: 鑽夌毊鎶ゅ潯', '鍧″害: 1:2', '浣滅敤: 闃叉鍧¢潰鍐插埛'] },
278
275
  },
279
276
  favorite: '27.2220502555847,120.457317110875,125.021048589548,347.301009802588,44.1512225983844,0.0020422112185327',
280
277
  secAnimation: [{x:27.220482, y:120.459976, z:30}, {x:27.220375, y:120.459853, z:30}, {x:27.220072, y:120.459602, z:30}] },
281
278
  ]},
282
- { key: 'uavNests', text: '无人机巢站', visible: true, children: [] },
283
- { key: 'rescue', text: '隐患', visible: false, children: [
284
- { text: '隐患1', position: { x: 27.381728, y: 120.587895, z: 20 } },
285
- { text: '隐患2', position: { x: 27.183096, y: 120.48657, z: 20 } },
286
- { text: '隐患3', position: { x: 27.313019, y: 120.538779, z: 20 } },
287
- { text: '隐患4', position: { x: 27.219926, y: 120.455543, z: 20 } },
288
- { text: '隐患5', position: { x: 27.266007, y: 120.52789, z: 20 } },
279
+ { key: 'uavNests', text: '鏃犱汉鏈哄发绔?, visible: true, children: [] },
280
+ { key: 'rescue', text: '闅愭偅', visible: false, children: [
281
+ { text: '闅愭偅1', position: { x: 27.381728, y: 120.587895, z: 20 } },
282
+ { text: '闅愭偅2', position: { x: 27.183096, y: 120.48657, z: 20 } },
283
+ { text: '闅愭偅3', position: { x: 27.313019, y: 120.538779, z: 20 } },
284
+ { text: '闅愭偅4', position: { x: 27.219926, y: 120.455543, z: 20 } },
285
+ { text: '闅愭偅5', position: { x: 27.266007, y: 120.52789, z: 20 } },
289
286
  ]},
290
- { key: 'materials', text: '物资仓库', visible: false, children: [
291
- { text: '仓库1', position: { x: 27.220674, y: 120.460029, z: 1.179 } },
292
- { text: '仓库2', position: { x: 27.227569, y: 120.458844, z: 4.265 } },
293
- { text: '仓库3', position: { x: 27.23543, y: 120.452171, z: 3.29 } },
287
+ { key: 'materials', text: '鐗╄祫浠撳簱', visible: false, children: [
288
+ { text: '浠撳簱1', position: { x: 27.220674, y: 120.460029, z: 1.179 } },
289
+ { text: '浠撳簱2', position: { x: 27.227569, y: 120.458844, z: 4.265 } },
290
+ { text: '浠撳簱3', position: { x: 27.23543, y: 120.452171, z: 3.29 } },
294
291
  ]},
295
292
  ],
296
293
  };
@@ -303,7 +300,7 @@ export function getConfig() { return _config; }
303
300
 
304
301
  // ==================== GaeaApp ====================
305
302
 
306
- console.log('[GaeaMethods] 模块已加载 - setCategoryVisible 可用');
303
+ console.log('[GaeaMethods] 妯″潡宸插姞杞?- setCategoryVisible 鍙敤');
307
304
 
308
305
  export class GaeaApp {
309
306
  constructor(options = {}) {
@@ -312,134 +309,131 @@ export class GaeaApp {
312
309
  this.tLayers = [];
313
310
  this.layerCategories = this.config.layerCategories || [];
314
311
  this._screenIconList = [];
315
- this._markersVisible = true; // 全局图标可见性(2D 模式下强制隐藏,3D 下恢复)
312
+ this._markersVisible = true; // 鍏ㄥ眬鍥炬爣鍙鎬э紙2D 妯″紡涓嬪己鍒堕殣钘忥紝3D 涓嬫仮澶嶏級
316
313
  this._hiddenCategories = new Set();
317
- this._tilesetMap = {}; // 已加载的 3D Tiles 引用,key 为 tileset 名称
314
+ this._tilesetMap = {}; // 宸插姞杞界殑 3D Tiles 寮曠敤锛宬ey 涓?tileset 鍚嶇О
318
315
  this._secIsClickArr = [];
319
316
  this._secScreenIconKeyValue = {};
320
317
  this._groundPolygonElements = [];
321
318
  this.tweenGroup = new TWEEN.Group();
322
319
  this._tourConfig = {
323
- '沿浦水闸': { direction: [-0.5, 0.3, 0.3], positionList: [
324
- { name: '位置点0', pos: { x: 27.222747, y: 120.453035, z: 21.4 }, lockOut: [-0.5, 0.3, 0], lockOutAngle: 1.5 },
325
- { name: '位置点1', pos: { x: 27.222827, y: 120.453089, z: 21.4 }, lockIn: [-0.5, 0.3, 0], lockInAngle: -1.5, lockOut: [-0.5, 0.3, 0], lockOutAngle: 1.5 },
326
- { name: '位置点2', pos: { x: 27.222909, y: 120.453142, z: 21.4 }, lockIn: [-0.5, 0.3, 0], lockInAngle: -1.5, lockOut: [-0.5, 0.3, 0], lockOutAngle: 1.5 },
327
- { name: '位置点3', pos: { x: 27.222982, y: 120.453192, z: 21.4 }, lockIn: [-0.5, 0.3, 0], lockInAngle: -1.5 },
320
+ '娌挎郸姘撮椄': { direction: [-0.5, 0.3, 0.3], positionList: [
321
+ { name: '浣嶇疆鐐?', pos: { x: 27.222747, y: 120.453035, z: 21.4 }, lockOut: [-0.5, 0.3, 0], lockOutAngle: 1.5 },
322
+ { name: '浣嶇疆鐐?', pos: { x: 27.222827, y: 120.453089, z: 21.4 }, lockIn: [-0.5, 0.3, 0], lockInAngle: -1.5, lockOut: [-0.5, 0.3, 0], lockOutAngle: 1.5 },
323
+ { name: '浣嶇疆鐐?', pos: { x: 27.222909, y: 120.453142, z: 21.4 }, lockIn: [-0.5, 0.3, 0], lockInAngle: -1.5, lockOut: [-0.5, 0.3, 0], lockOutAngle: 1.5 },
324
+ { name: '浣嶇疆鐐?', pos: { x: 27.222982, y: 120.453192, z: 21.4 }, lockIn: [-0.5, 0.3, 0], lockInAngle: -1.5 },
328
325
  ]},
329
- '联盟水闸': { direction: [1.5, 0, 0], positionList: [
330
- { name: '位置点1', pos: { x: 27.200467, y: 120.465716, z: 26 }, lockIn: [0, -0.5, 0], lockInAngle: -1.5, lockOut: [0.5, 0, 0], lockOutAngle: -1.5 },
331
- { name: '位置点2', pos: { x: 27.200486, y: 120.465716, z: 26 }, lockIn: [0.5, 0, 0], lockInAngle: 1.5, lockOut: [0.5, 0, 0], lockOutAngle: -1.5 },
332
- { name: '位置点3', pos: { x: 27.200513, y: 120.465716, z: 26 }, lockIn: [0.5, 0, 0], lockInAngle: 1.5, lockOut: [0, 0.5, 0], lockOutAngle: -1.5 },
333
- { name: '位置点4', pos: { x: 27.200513, y: 120.46561, z: 26 }, lockIn: [0, 0.5, 0], lockInAngle: 1.5, lockOut: [0, 0.5, 0], lockOutAngle: -1.5 },
334
- { name: '位置点5', pos: { x: 27.200513, y: 120.465524, z: 26 }, lockIn: [0, 0.5, 0], lockInAngle: 1.5, lockOut: [-0.5, 0, 0], lockOutAngle: -1.5 },
335
- { name: '位置点6', pos: { x: 27.200463, y: 120.465521, z: 26 }, lockIn: [-0.5, 0, 0], lockInAngle: 1.5, lockOut: [0, -0.5, 0], lockOutAngle: -1.5 },
336
- { name: '位置点7', pos: { x: 27.200467, y: 120.465616, z: 26 }, lockIn: [0, -0.5, 0], lockInAngle: 1.5, lockOut: [0, -0.5, 0], lockOutAngle: -1.5 },
337
- { name: '位置点8', pos: { x: 27.200467, y: 120.465716, z: 26 }, lockIn: [0, -0.5, 0], lockInAngle: 1.5, lockOut: [0.5, 0, 0], lockOutAngle: -1.5 },
326
+ '鑱旂洘姘撮椄': { direction: [1.5, 0, 0], positionList: [
327
+ { name: '浣嶇疆鐐?', pos: { x: 27.200467, y: 120.465716, z: 26 }, lockIn: [0, -0.5, 0], lockInAngle: -1.5, lockOut: [0.5, 0, 0], lockOutAngle: -1.5 },
328
+ { name: '浣嶇疆鐐?', pos: { x: 27.200486, y: 120.465716, z: 26 }, lockIn: [0.5, 0, 0], lockInAngle: 1.5, lockOut: [0.5, 0, 0], lockOutAngle: -1.5 },
329
+ { name: '浣嶇疆鐐?', pos: { x: 27.200513, y: 120.465716, z: 26 }, lockIn: [0.5, 0, 0], lockInAngle: 1.5, lockOut: [0, 0.5, 0], lockOutAngle: -1.5 },
330
+ { name: '浣嶇疆鐐?', pos: { x: 27.200513, y: 120.46561, z: 26 }, lockIn: [0, 0.5, 0], lockInAngle: 1.5, lockOut: [0, 0.5, 0], lockOutAngle: -1.5 },
331
+ { name: '浣嶇疆鐐?', pos: { x: 27.200513, y: 120.465524, z: 26 }, lockIn: [0, 0.5, 0], lockInAngle: 1.5, lockOut: [-0.5, 0, 0], lockOutAngle: -1.5 },
332
+ { name: '浣嶇疆鐐?', pos: { x: 27.200463, y: 120.465521, z: 26 }, lockIn: [-0.5, 0, 0], lockInAngle: 1.5, lockOut: [0, -0.5, 0], lockOutAngle: -1.5 },
333
+ { name: '浣嶇疆鐐?', pos: { x: 27.200467, y: 120.465616, z: 26 }, lockIn: [0, -0.5, 0], lockInAngle: 1.5, lockOut: [0, -0.5, 0], lockOutAngle: -1.5 },
334
+ { name: '浣嶇疆鐐?', pos: { x: 27.200467, y: 120.465716, z: 26 }, lockIn: [0, -0.5, 0], lockInAngle: 1.5, lockOut: [0.5, 0, 0], lockOutAngle: -1.5 },
338
335
  ]},
339
- '下在水闸': { direction: [0.5, 0, 0], positionList: [
340
- { name: '位置点1', pos: { x: 27.221763, y: 120.4452, z: 27.6 }, lockOut: [0, -0.5, 0], lockOutAngle: 1.5 },
341
- { name: '位置点2', pos: { x: 27.221763, y: 120.445142, z: 27.6 }, lockIn: [0, -0.5, 0], lockInAngle: -1.5, lockOut: [0, -0.5, 0], lockOutAngle: 1.5 },
342
- { name: '位置点3', pos: { x: 27.221763, y: 120.445084, z: 27.6 }, lockIn: [0, -0.5, 0], lockInAngle: -1.5 },
336
+ '涓嬪湪姘撮椄': { direction: [0.5, 0, 0], positionList: [
337
+ { name: '浣嶇疆鐐?', pos: { x: 27.221763, y: 120.4452, z: 27.6 }, lockOut: [0, -0.5, 0], lockOutAngle: 1.5 },
338
+ { name: '浣嶇疆鐐?', pos: { x: 27.221763, y: 120.445142, z: 27.6 }, lockIn: [0, -0.5, 0], lockInAngle: -1.5, lockOut: [0, -0.5, 0], lockOutAngle: 1.5 },
339
+ { name: '浣嶇疆鐐?', pos: { x: 27.221763, y: 120.445084, z: 27.6 }, lockIn: [0, -0.5, 0], lockInAngle: -1.5 },
343
340
  ]},
344
- '岭尾新闸': { direction: [-0.5, 0.5, 0.5], positionList: [] },
345
- '岭尾水闸': { direction: [-0.4, 0.5, 0.3], positionList: [] },
341
+ '宀熬鏂伴椄': { direction: [-0.5, 0.5, 0.5], positionList: [] },
342
+ '宀熬姘撮椄': { direction: [-0.4, 0.5, 0.3], positionList: [] },
346
343
  };
347
344
  console.log('[GaeaApp] constructor layerCategories:', this.layerCategories.length);
348
345
  window.Gaea = Gaea;
349
346
 
350
- // 显示 loading
347
+ // 鏄剧ず loading
351
348
  showLoading();
352
349
 
353
- // 自动启动初始化,catch 防止未处理的 Promise rejection
350
+ // 鑷姩鍚姩鍒濆鍖栵紝catch 闃叉鏈鐞嗙殑 Promise rejection
354
351
  this.ready = this._autoInit().catch(err => {
355
- console.error('[GaeaApp] 初始化失败:', err);
352
+ console.error('[GaeaApp] 鍒濆鍖栧け璐?', err);
356
353
  });
357
354
  }
358
355
 
359
356
  get config() { return { ..._config, ...this._options }; }
360
357
 
361
- // ---- 内部初始化 ----
358
+ // ---- 鍐呴儴鍒濆鍖?----
362
359
 
363
360
  async _autoInit() {
364
- console.log('[GaeaApp] 开始初始化...');
361
+ console.log('[GaeaApp] 寮€濮嬪垵濮嬪寲...');
365
362
 
366
- // 1. 等 canvas 就绪
363
+ // 1. 绛?canvas 灏辩华
367
364
  await this._waitForCanvas();
368
- console.log('[GaeaApp] canvas 就绪');
365
+ console.log('[GaeaApp] canvas 灏辩华');
369
366
 
370
- // 2. 启动 Godot 引擎
367
+ // 2. 鍚姩 Godot 寮曟搸
371
368
  await this._startEngine();
372
- console.log('[GaeaApp] 引擎启动完成');
369
+ console.log('[GaeaApp] 寮曟搸鍚姩瀹屾垚');
373
370
 
374
- // 3. 初始化环境
375
- await this._initEnvironment();
376
- console.log('[GaeaApp] 环境初始化完成');
371
+ // 3. 鍒濆鍖栫幆澧? await this._initEnvironment();
372
+ console.log('[GaeaApp] 鐜鍒濆鍖栧畬鎴?);
377
373
 
378
- // 4. 加载默认图层
374
+ // 4. 鍔犺浇榛樿鍥惧眰
379
375
  await this._initLayers();
380
- console.log('[GaeaApp] 图层加载完成');
376
+ console.log('[GaeaApp] 鍥惧眰鍔犺浇瀹屾垚');
381
377
 
382
- // 影像/地形就绪即可显示地图,隐藏 loading,避免用户等待模型/接口
378
+ // 褰卞儚/鍦板舰灏辩华鍗冲彲鏄剧ず鍦板浘锛岄殣钘?loading锛岄伩鍏嶇敤鎴风瓑寰呮ā鍨?鎺ュ彛
383
379
  hideLoading();
384
380
  this._addResetButton();
385
381
  this._addLayerTreeButton();
386
- console.log('[GaeaApp] 地图已就绪,模型与图层树数据后台加载中...');
382
+ console.log('[GaeaApp] 鍦板浘宸插氨缁紝妯″瀷涓庡浘灞傛爲鏁版嵁鍚庡彴鍔犺浇涓?..');
387
383
 
388
- // 剩余重资源(模型位置、GLTF、图层树接口、屏幕图标)后台异步加载,不阻塞地图显示
384
+ // 鍓╀綑閲嶈祫婧愶紙妯″瀷浣嶇疆銆丟LTF銆佸浘灞傛爲鎺ュ彛銆佸睆骞曞浘鏍囷級鍚庡彴寮傛鍔犺浇锛屼笉闃诲鍦板浘鏄剧ず
389
385
  this._loadRestAsync();
390
386
  }
391
387
 
392
- /** 后台异步加载:模型位置调整 → GLTF → 图层树数据 → 屏幕图标 */
388
+ /** 鍚庡彴寮傛鍔犺浇锛氭ā鍨嬩綅缃皟鏁?鈫?GLTF 鈫?鍥惧眰鏍戞暟鎹?鈫?灞忓箷鍥炬爣 */
393
389
  async _loadRestAsync() {
394
390
  try {
395
- // 5. 调整模型位置
396
- console.log('[GaeaApp] 开始调整模型位置...');
391
+ // 5. 璋冩暣妯″瀷浣嶇疆
392
+ console.log('[GaeaApp] 寮€濮嬭皟鏁存ā鍨嬩綅缃?..');
397
393
  const models = [
398
- { nodeName: '沿浦水闸', position: '-2876603.788, 4892658.352, 2900208.622', rotation: '-37.24, 162.42, -17.17' },
399
- { nodeName: '下在水闸', position: '-2875959.024, 4893109.058, 2900101.919', rotation: '-23.42, -165.20, -34.52' },
400
- { nodeName: '联盟水闸', position: '-2878251.995, 4893011.199, 2897998.160', rotation: '-23.43, -165.98, -33.40' },
401
- { nodeName: '岭尾新闸', position: '-2877382.212, 4892920.226, 2898965.484', rotation: '7.79, 36.98, 40.83' },
402
- { nodeName: '岭尾水闸', position: '-2877582.576, 4892520.352, 2899499.184', rotation: '-41.04, 126.37, 6.29' },
394
+ { nodeName: '娌挎郸姘撮椄', position: '-2876603.788, 4892658.352, 2900208.622', rotation: '-37.24, 162.42, -17.17' },
395
+ { nodeName: '涓嬪湪姘撮椄', position: '-2875959.024, 4893109.058, 2900101.919', rotation: '-23.42, -165.20, -34.52' },
396
+ { nodeName: '鑱旂洘姘撮椄', position: '-2878251.995, 4893011.199, 2897998.160', rotation: '-23.43, -165.98, -33.40' },
397
+ { nodeName: '宀熬鏂伴椄', position: '-2877382.212, 4892920.226, 2898965.484', rotation: '7.79, 36.98, 40.83' },
398
+ { nodeName: '宀熬姘撮椄', position: '-2877582.576, 4892520.352, 2899499.184', rotation: '-41.04, 126.37, 6.29' },
403
399
  ];
404
400
  for (const model of models) {
405
401
  try {
406
402
  const node = Gaea.World.Instance.GetNode(model.nodeName);
407
- if (!node) { console.warn(`[GaeaApp] 未找到节点: ${model.nodeName}`); continue; }
403
+ if (!node) { console.warn(`[GaeaApp] 鏈壘鍒拌妭鐐? ${model.nodeName}`); continue; }
408
404
  const inst = Gaea.MeshInstance.ConvertBy(node);
409
405
  const pos = model.position.split(',').map(v => parseFloat(v.trim()));
410
406
  const rot = model.rotation.split(',').map(v => parseFloat(v.trim()));
411
407
  if (inst.Translation) inst.Translation = new Gaea.Vector3(pos[0], pos[1], pos[2]);
412
408
  if (inst.RotationDegrees) inst.RotationDegrees = new Gaea.Vector3(rot[0], rot[1], rot[2]);
413
409
  } catch (e) {
414
- console.warn(`[GaeaApp] 调整模型 ${model.nodeName} 失败:`, e.message);
410
+ console.warn(`[GaeaApp] 璋冩暣妯″瀷 ${model.nodeName} 澶辫触:`, e.message);
415
411
  }
416
412
  }
417
- console.log('[GaeaApp] 所有模型位置调整完成');
413
+ console.log('[GaeaApp] 鎵€鏈夋ā鍨嬩綅缃皟鏁村畬鎴?);
418
414
 
419
- // 6. 加载 GLTF 模型
415
+ // 6. 鍔犺浇 GLTF 妯″瀷
420
416
  await this._loadGltfModels();
421
417
 
422
- // 7. 获取图层树数据(有接口走接口,没接口用默认)
418
+ // 7. 鑾峰彇鍥惧眰鏍戞暟鎹紙鏈夋帴鍙h蛋鎺ュ彛锛屾病鎺ュ彛鐢ㄩ粯璁わ級
423
419
  await this._fetchLayerTreeData();
424
420
 
425
- // 同步 layerCategories(修复数据更新未同步的问题)
421
+ // 鍚屾 layerCategories锛堜慨澶嶆暟鎹洿鏂版湭鍚屾鐨勯棶棰橈級
426
422
  this.layerCategories = this.config.layerCategories || [];
427
- console.log('[GaeaApp] layerCategories 更新后:', this.layerCategories.length);
423
+ console.log('[GaeaApp] layerCategories 鏇存柊鍚?', this.layerCategories.length);
428
424
 
429
- // 8. 初始化屏幕图标
430
- this._initScreenIcons();
425
+ // 8. 鍒濆鍖栧睆骞曞浘鏍? this._initScreenIcons();
431
426
 
432
- // 应用默认隐藏的分类
433
- const hiddenCats = this.config.defaultHiddenCategories || []
427
+ // 搴旂敤榛樿闅愯棌鐨勫垎绫? const hiddenCats = this.config.defaultHiddenCategories || []
434
428
  hiddenCats.forEach(key => {
435
429
  const cat = this.layerCategories.find(c => c.key === key)
436
430
  if (cat) cat.visible = false
437
431
  this.setCategoryVisible(key, false)
438
432
  })
439
433
 
440
- console.log('[GaeaApp] 后台资源加载完成');
434
+ console.log('[GaeaApp] 鍚庡彴璧勬簮鍔犺浇瀹屾垚');
441
435
  } catch (e) {
442
- console.error('[GaeaApp] 后台资源加载出错:', e);
436
+ console.error('[GaeaApp] 鍚庡彴璧勬簮鍔犺浇鍑洪敊:', e);
443
437
  }
444
438
  }
445
439
 
@@ -451,7 +445,7 @@ export class GaeaApp {
451
445
  if (el && el.width > 0) {
452
446
  resolve();
453
447
  } else if (Date.now() - start > 10000) {
454
- reject(new Error('等待 canvas 超时'));
448
+ reject(new Error('绛夊緟 canvas 瓒呮椂'));
455
449
  } else {
456
450
  requestAnimationFrame(check);
457
451
  }
@@ -462,10 +456,10 @@ export class GaeaApp {
462
456
 
463
457
  async _startEngine() {
464
458
  if (!window.Engine) {
465
- throw new Error('window.Engine 不存在,请确保 <script src="/Gaea.js"> 已加载');
459
+ throw new Error('window.Engine 涓嶅瓨鍦紝璇风‘淇?<script src="/Gaea.js"> 宸插姞杞?);
466
460
  }
467
461
  if (!window.Engine.isWebGLAvailable()) {
468
- throw new Error('WebGL 不可用');
462
+ throw new Error('WebGL 涓嶅彲鐢?);
469
463
  }
470
464
 
471
465
  const cfg = this.config;
@@ -482,7 +476,7 @@ export class GaeaApp {
482
476
  });
483
477
 
484
478
  await engine.startGame({
485
- onProgress: cfg.onProgress || ((cur, total) => console.log(`引擎加载: ${cur}/${total}`)),
479
+ onProgress: cfg.onProgress || ((cur, total) => console.log(`寮曟搸鍔犺浇: ${cur}/${total}`)),
486
480
  });
487
481
  }
488
482
 
@@ -511,10 +505,10 @@ export class GaeaApp {
511
505
  const cfg = this.config;
512
506
 
513
507
  if (cfg.serviceMode === 'online') {
514
- // 在线模式:仅加载天地图影像,不加载地形/贴地线/3D Tiles
508
+ // 鍦ㄧ嚎妯″紡锛氫粎鍔犺浇澶╁湴鍥惧奖鍍忥紝涓嶅姞杞藉湴褰?璐村湴绾?3D Tiles
515
509
  this.addTianditu();
516
510
  } else {
517
- // 服务平台模式:WMTS 影像 + 贴地线 + 地形
511
+ // 鏈嶅姟骞冲彴妯″紡锛歐MTS 褰卞儚 + 璐村湴绾?+ 鍦板舰
518
512
  await this.getAllServe();
519
513
  const list = cfg.defaultLayers;
520
514
  if (list?.length) {
@@ -522,79 +516,74 @@ export class GaeaApp {
522
516
  this.addLayer(layer);
523
517
  }
524
518
  }
525
- // 贴地线(矢量线服务,依赖 this.layers)
526
- try { this.addGroundLines(); } catch (e) { console.error('加载贴地线失败:', e); }
527
- // 地形服务
528
- try { await this.addInitTerrainServer(); } catch (e) { console.error('加载地形失败:', e); }
529
- // 倾斜摄影 3D Tiles(isInitLoad 为 true 的自动加载,依赖地形服务)
530
- const tiles = cfg.default3DTiles || []
519
+ // 璐村湴绾匡紙鐭㈤噺绾挎湇鍔★紝渚濊禆 this.layers锛? try { this.addGroundLines(); } catch (e) { console.error('鍔犺浇璐村湴绾垮け璐?', e); }
520
+ // 鍦板舰鏈嶅姟
521
+ try { await this.addInitTerrainServer(); } catch (e) { console.error('鍔犺浇鍦板舰澶辫触:', e); }
522
+ // 鍊炬枩鎽勫奖 3D Tiles锛坕sInitLoad 涓?true 鐨勮嚜鍔ㄥ姞杞斤紝渚濊禆鍦板舰鏈嶅姟锛? const tiles = cfg.default3DTiles || []
531
523
  tiles.filter(item => item.isInitLoad).forEach(item => this.add3DTiles(item))
532
524
  }
533
525
 
534
526
  const pos = cfg.defaultCameraPosition;
535
527
  if (pos) {
536
- // 等一帧再设相机,确保引擎把图层处理完
528
+ // 绛変竴甯у啀璁剧浉鏈猴紝纭繚寮曟搸鎶婂浘灞傚鐞嗗畬
537
529
  await new Promise(r => requestAnimationFrame(r));
538
530
  this.SetPosition(pos);
539
531
  }
540
532
  }
541
533
 
542
- // ---- 天地图 ----
534
+ // ---- 澶╁湴鍥?----
543
535
 
544
- /** 加载天地图影像 + 注记 */
536
+ /** 鍔犺浇澶╁湴鍥惧奖鍍?+ 娉ㄨ */
545
537
  addTianditu() {
546
538
  const cfg = this.config;
547
539
 
548
- // 影像底图(卫星图)
549
- const imgStore = new Gaea.TDTWMTSImageStore();
540
+ // 褰卞儚搴曞浘锛堝崼鏄熷浘锛? const imgStore = new Gaea.TDTWMTSImageStore();
550
541
  imgStore.ServerUri = cfg.tiandituServerUri || 'https://t{0}.tianditu.gov.cn/img_c/wmts';
551
542
  imgStore.FormatString = cfg.tiandituFormatString || 'SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=img&STYLE=default&TILEMATRIXSET=c&FORMAT=tiles&TILECOL={0}&TILEROW={1}&TILEMATRIX={2}&tk={3}';
552
543
  imgStore.ImageExtension = cfg.tiandituImageExtension ?? Gaea.ImageExtensionEnum.JPEG;
553
544
  imgStore.TK = cfg.tiandituToken;
554
- imgStore.Name = '影像底图';
545
+ imgStore.Name = '褰卞儚搴曞浘';
555
546
  imgStore.LevelRange = new Gaea.Vector2(cfg.tiandituLevelRange[0], cfg.tiandituLevelRange[1]);
556
547
  Gaea.World.Instance.DefaultPyramidTileSet.AddImageStore(imgStore);
557
- console.log('天地图影像加载成功');
548
+ console.log('澶╁湴鍥惧奖鍍忓姞杞芥垚鍔?);
558
549
 
559
- // 注记图层(道路/地名标注)
560
- const labelStore = new Gaea.TDTWMTSImageStore();
550
+ // 娉ㄨ鍥惧眰锛堥亾璺?鍦板悕鏍囨敞锛? const labelStore = new Gaea.TDTWMTSImageStore();
561
551
  labelStore.ServerUri = 'https://t{0}.tianditu.gov.cn/cia_c/wmts';
562
552
  labelStore.FormatString = 'SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=cia&STYLE=default&TILEMATRIXSET=c&FORMAT=image/png&TILECOL={0}&TILEROW={1}&TILEMATRIX={2}&tk={3}';
563
553
  labelStore.ImageExtension = Gaea.ImageExtensionEnum.PNG;
564
554
  labelStore.TK = cfg.tiandituToken;
565
- labelStore.Name = '天地图注记';
555
+ labelStore.Name = '澶╁湴鍥炬敞璁?;
566
556
  labelStore.LevelRange = new Gaea.Vector2(cfg.tiandituLevelRange[0], cfg.tiandituLevelRange[1]);
567
557
  Gaea.World.Instance.DefaultPyramidTileSet.AddImageStore(labelStore);
568
- console.log('天地图注记加载成功');
558
+ console.log('澶╁湴鍥炬敞璁板姞杞芥垚鍔?);
569
559
 
570
560
  return { imgStore, labelStore };
571
561
  }
572
562
 
573
- /** 添加右上角重置按钮 */
563
+ /** 娣诲姞鍙充笂瑙掗噸缃寜閽?*/
574
564
  _addResetButton() {
575
565
  if (document.getElementById('gaea-reset-btn')) return;
576
566
  const btn = document.createElement('button');
577
567
  btn.id = 'gaea-reset-btn';
578
- btn.title = '重置视角';
579
- btn.innerHTML = '⟳';
568
+ btn.title = '閲嶇疆瑙嗚';
569
+ btn.innerHTML = '鉄?;
580
570
  btn.onclick = () => {
581
571
  const pos = this.config.defaultCameraPosition;
582
572
  if (pos) this.SetPosition(pos);
583
- // 解锁视角(内部会调 UseAutoVisible 恢复非断面图标)
573
+ // 瑙i攣瑙嗚锛堝唴閮ㄤ細璋?UseAutoVisible 鎭㈠闈炴柇闈㈠浘鏍囷級
584
574
  this.lockedModesSwitch(false);
585
- // 恢复被 hiddenScreenWithClass 隐藏的图标 DOM
575
+ // 鎭㈠琚?hiddenScreenWithClass 闅愯棌鐨勫浘鏍?DOM
586
576
  if (this._markersVisible) {
587
577
  document.querySelectorAll('.gaea-locationLineStyle, .gaea-iconscreen, .gaea-iconGif').forEach(el => {
588
578
  el.style.display = '';
589
579
  });
590
580
  }
591
- // 断面模型缩回
581
+ // 鏂潰妯″瀷缂╁洖
592
582
  if (this._raisedSection) {
593
583
  this._raisedSection.TranslateObjectLocal(new Gaea.Vector3(0, -44, 0));
594
584
  this._raisedSection = null;
595
585
  }
596
- // 重置游览模型位置到初始位置
597
- if (this._currentTourModel) {
586
+ // 閲嶇疆娓歌妯″瀷浣嶇疆鍒板垵濮嬩綅缃? if (this._currentTourModel) {
598
587
  const name = this._currentTourModel?.Root?.Name;
599
588
  const cfg = this._gltfCfgMap?.[name];
600
589
  if (cfg) {
@@ -603,10 +592,9 @@ export class GaeaApp {
603
592
  this._currentTourModel = null;
604
593
  this._currentTourIndexPos = 0;
605
594
  }
606
- // 重置断面状态
607
- this._secIsClickArr = [];
595
+ // 閲嶇疆鏂潰鐘舵€? this._secIsClickArr = [];
608
596
  this._secScreenIconKeyValue = {};
609
- // 隐藏断面标签
597
+ // 闅愯棌鏂潰鏍囩
610
598
  this._screenIconList.forEach(item => {
611
599
  if (item.type === 'dabaSec') {
612
600
  item.element.ForceSetVisible(false);
@@ -614,48 +602,48 @@ export class GaeaApp {
614
602
  }
615
603
  });
616
604
  document.querySelectorAll('.waterLevel, .damScreen').forEach(el => el.style.display = 'none');
617
- // 通知 SecTourView 隐藏
605
+ // 閫氱煡 SecTourView 闅愯棌
618
606
  document.dispatchEvent(new CustomEvent('gaea-reset-view', { bubbles: true }));
619
607
  };
620
608
  document.body.appendChild(btn);
621
609
  }
622
610
 
623
- /** 添加图层树按钮 */
611
+ /** 娣诲姞鍥惧眰鏍戞寜閽?*/
624
612
  _addLayerTreeButton() {
625
613
  if (document.getElementById('gaea-layertree-btn')) return
626
614
  const btn = document.createElement('button')
627
615
  btn.id = 'gaea-layertree-btn'
628
- btn.title = '图层控制'
629
- btn.innerHTML = '☰'
616
+ btn.title = '鍥惧眰鎺у埗'
617
+ btn.innerHTML = '鈽?
630
618
  btn.onclick = () => {
631
619
  document.dispatchEvent(new CustomEvent('gaea-toggle-layertree'))
632
620
  }
633
621
  document.body.appendChild(btn)
634
622
  }
635
623
 
636
- // ---- GLTF 模型 ----
624
+ // ---- GLTF 妯″瀷 ----
637
625
 
638
626
  async _loadGltfModels() {
639
627
  const gltfList = [
640
- { name: 'YPDP0+600', position: { x: 27.217692, y: 120.461823, z: -44 }, rotate: [0, 198, 0], size: [1, 1, 1], show: true, url: 'gltf/大坝断面600.gltf' },
641
- { name: 'YPDP0+750', position: { x: 27.220289, y: 120.459753, z: -44 }, rotate: [0, 226, 0], size: [1, 1, 1], show: true, url: 'gltf/大坝断面750.gltf' },
642
- { name: 'YPDP0+100', position: { x: 27.223027, y: 120.454653, z: -44 }, rotate: [0, 222, 0], size: [1, 1, 1], show: true, url: 'gltf/大坝断面100.gltf' },
643
- { name: 'YPDP0+200', position: { x: 27.222541, y: 120.455453, z: -44 }, rotate: [0, 246, 0], size: [1, 1, 1], show: true, url: 'gltf/大坝断面200.gltf' },
644
- { name: '沿浦泵站', position: { x: 27.222001, y: 120.452509, z: 17 }, rotate: [0, -38, 0], size: [1, 1, 1], show: true, url: 'gltf/沿浦泵站.gltf', enablePick: true },
645
- { name: '下在海塘纳排闸', position: { x: 27.219978, y: 120.445672, z: 15 }, rotate: [0, 0, 0], size: [1, 1, 1], show: true, url: 'gltf/下在海塘纳排闸.gltf', enablePick: true },
646
- { name: '盒子模型', position: { x: 27.241836, y: 120.462750, z: 50 }, rotate: [0, 90, 0], size: [10, 10, 10], show: true, url: 'gltf/box.gltf' },
647
- { name: 'YPDP0+600游览模型', position: { x: 27.217433, y: 120.461448, z: 32 }, rotate: [0, 90, 0], size: [1, 1, 1], show: true, url: 'gltf/box.gltf' },
648
- { name: 'YPDP0+750游览模型', position: { x: 27.220072, y: 120.459602, z: 30 }, rotate: [0, 90, 0], size: [1, 1, 1], show: true, url: 'gltf/box.gltf' },
649
- { name: 'YPDP0+100游览模型', position: { x: 27.222844, y: 120.454466, z: 30 }, rotate: [0, 90, 0], size: [1, 1, 1], show: true, url: 'gltf/box.gltf' },
650
- { name: 'YPDP0+200游览模型', position: { x: 27.22226, y: 120.455318, z: 30 }, rotate: [0, 90, 0], size: [1, 1, 1], show: true, url: 'gltf/box.gltf' },
651
- { name: '沿浦水闸游览模型', position: { x: 27.222747, y: 120.453035, z: 21.8 }, rotate: [0, -30, 0], size: [1, 1, 1], show: false, url: 'gltf/box.gltf' },
652
- { name: '沿浦水闸定位模型', position: { x: 27.230788, y: 120.453009, z: 487.5 }, rotate: [0, 0, 0], size: [1, 1, 1], show: false, url: 'gltf/box.gltf' },
653
- { name: '下在水闸游览模型', position: { x: 27.221763, y: 120.4452, z: 27.6 }, rotate: [0, 0, 0], size: [1, 1, 1], show: false, url: 'gltf/box.gltf' },
654
- { name: '联盟水闸游览模型', position: { x: 27.200467, y: 120.465716, z: 26 }, rotate: [0, 180, 0], size: [0.1, 0.1, 0.1], show: false, url: 'gltf/box.gltf' },
655
- { name: '岭尾水闸游览模型', position: { x: 27.215661, y: 120.462325, z: 34 }, rotate: [0, -66, 0], size: [1, 1, 1], show: false, url: 'gltf/box.gltf' },
656
- { name: '岭尾新闸游览模型', position: { x: 27.21038, y: 120.458513, z: 4 }, rotate: [0, 30, 0], size: [1, 1, 1], show: false, url: 'gltf/box.gltf' },
657
- { name: '盒子模型-yanpu', position: { x: 27.231665, y: 120.456095, z: 48.608 }, rotate: [0, 90, 0], size: [10, 10, 10], show: true, url: 'gltf/box.gltf' },
658
- { name: '防汛沙袋', position: { x: 27.218723, y: 120.460473, z: 18 }, rotate: [0, 0, 0], size: [1, 1, 1], show: false, url: 'gltf/sanddai.glb' },
628
+ { name: 'YPDP0+600', position: { x: 27.217692, y: 120.461823, z: -44 }, rotate: [0, 198, 0], size: [1, 1, 1], show: true, url: 'gltf/澶у潩鏂潰600.gltf' },
629
+ { name: 'YPDP0+750', position: { x: 27.220289, y: 120.459753, z: -44 }, rotate: [0, 226, 0], size: [1, 1, 1], show: true, url: 'gltf/澶у潩鏂潰750.gltf' },
630
+ { name: 'YPDP0+100', position: { x: 27.223027, y: 120.454653, z: -44 }, rotate: [0, 222, 0], size: [1, 1, 1], show: true, url: 'gltf/澶у潩鏂潰100.gltf' },
631
+ { name: 'YPDP0+200', position: { x: 27.222541, y: 120.455453, z: -44 }, rotate: [0, 246, 0], size: [1, 1, 1], show: true, url: 'gltf/澶у潩鏂潰200.gltf' },
632
+ { name: '娌挎郸娉电珯', position: { x: 27.222001, y: 120.452509, z: 17 }, rotate: [0, -38, 0], size: [1, 1, 1], show: true, url: 'gltf/娌挎郸娉电珯.gltf', enablePick: true },
633
+ { name: '涓嬪湪娴峰绾虫帓闂?, position: { x: 27.219978, y: 120.445672, z: 15 }, rotate: [0, 0, 0], size: [1, 1, 1], show: true, url: 'gltf/涓嬪湪娴峰绾虫帓闂?gltf', enablePick: true },
634
+ { name: '鐩掑瓙妯″瀷', position: { x: 27.241836, y: 120.462750, z: 50 }, rotate: [0, 90, 0], size: [10, 10, 10], show: true, url: 'gltf/box.gltf' },
635
+ { name: 'YPDP0+600娓歌妯″瀷', position: { x: 27.217433, y: 120.461448, z: 32 }, rotate: [0, 90, 0], size: [1, 1, 1], show: true, url: 'gltf/box.gltf' },
636
+ { name: 'YPDP0+750娓歌妯″瀷', position: { x: 27.220072, y: 120.459602, z: 30 }, rotate: [0, 90, 0], size: [1, 1, 1], show: true, url: 'gltf/box.gltf' },
637
+ { name: 'YPDP0+100娓歌妯″瀷', position: { x: 27.222844, y: 120.454466, z: 30 }, rotate: [0, 90, 0], size: [1, 1, 1], show: true, url: 'gltf/box.gltf' },
638
+ { name: 'YPDP0+200娓歌妯″瀷', position: { x: 27.22226, y: 120.455318, z: 30 }, rotate: [0, 90, 0], size: [1, 1, 1], show: true, url: 'gltf/box.gltf' },
639
+ { name: '娌挎郸姘撮椄娓歌妯″瀷', position: { x: 27.222747, y: 120.453035, z: 21.8 }, rotate: [0, -30, 0], size: [1, 1, 1], show: false, url: 'gltf/box.gltf' },
640
+ { name: '娌挎郸姘撮椄瀹氫綅妯″瀷', position: { x: 27.230788, y: 120.453009, z: 487.5 }, rotate: [0, 0, 0], size: [1, 1, 1], show: false, url: 'gltf/box.gltf' },
641
+ { name: '涓嬪湪姘撮椄娓歌妯″瀷', position: { x: 27.221763, y: 120.4452, z: 27.6 }, rotate: [0, 0, 0], size: [1, 1, 1], show: false, url: 'gltf/box.gltf' },
642
+ { name: '鑱旂洘姘撮椄娓歌妯″瀷', position: { x: 27.200467, y: 120.465716, z: 26 }, rotate: [0, 180, 0], size: [0.1, 0.1, 0.1], show: false, url: 'gltf/box.gltf' },
643
+ { name: '宀熬姘撮椄娓歌妯″瀷', position: { x: 27.215661, y: 120.462325, z: 34 }, rotate: [0, -66, 0], size: [1, 1, 1], show: false, url: 'gltf/box.gltf' },
644
+ { name: '宀熬鏂伴椄娓歌妯″瀷', position: { x: 27.21038, y: 120.458513, z: 4 }, rotate: [0, 30, 0], size: [1, 1, 1], show: false, url: 'gltf/box.gltf' },
645
+ { name: '鐩掑瓙妯″瀷-yanpu', position: { x: 27.231665, y: 120.456095, z: 48.608 }, rotate: [0, 90, 0], size: [10, 10, 10], show: true, url: 'gltf/box.gltf' },
646
+ { name: '闃叉睕娌欒', position: { x: 27.218723, y: 120.460473, z: 18 }, rotate: [0, 0, 0], size: [1, 1, 1], show: false, url: 'gltf/sanddai.glb' },
659
647
  ];
660
648
 
661
649
  this._gltfCfgMap = {};
@@ -664,16 +652,15 @@ export class GaeaApp {
664
652
  this._gltfCfgMap[item.name] = item;
665
653
  }
666
654
 
667
- console.log('[GaeaApp] 开始加载 GLTF 模型...');
668
- // 并行加载所有模型(原串行逐个 await 会累加耗时)
669
- await Promise.all(gltfList.map(async (item) => {
655
+ console.log('[GaeaApp] 寮€濮嬪姞杞?GLTF 妯″瀷...');
656
+ // 骞惰鍔犺浇鎵€鏈夋ā鍨嬶紙鍘熶覆琛岄€愪釜 await 浼氱疮鍔犺€楁椂锛? await Promise.all(gltfList.map(async (item) => {
670
657
  item.url = encodeURI(item.url);
671
658
  try {
672
659
  const el = await this.AddGltf(item);
673
660
  if (el) this._gltfElements[item.name] = el;
674
- } catch (e) { console.warn(`[GaeaApp] 模型 ${item.name} 加载失败:`, e.message); }
661
+ } catch (e) { console.warn(`[GaeaApp] 妯″瀷 ${item.name} 鍔犺浇澶辫触:`, e.message); }
675
662
  }));
676
- console.log('[GaeaApp] GLTF 模型加载完成');
663
+ console.log('[GaeaApp] GLTF 妯″瀷鍔犺浇瀹屾垚');
677
664
  }
678
665
 
679
666
  AddGltf = ({
@@ -685,10 +672,10 @@ export class GaeaApp {
685
672
  const element = new Gaea.GLTFElement();
686
673
  element.UseAbsoluteHeight = useAbsoluteHeight;
687
674
  element.ResourceName = url;
688
- console.log(`模型开始加载: ${name}`);
675
+ console.log(`妯″瀷寮€濮嬪姞杞? ${name}`);
689
676
 
690
677
  element.OnModelInit(async () => {
691
- // 大坝断面模型设置 Unshaded
678
+ // 澶у潩鏂潰妯″瀷璁剧疆 Unshaded
692
679
  if (name.includes('YPDP0')) {
693
680
  const n = element.Root.GetChildCount();
694
681
  for (let i = 0; i < n; i++) {
@@ -700,7 +687,7 @@ export class GaeaApp {
700
687
  }
701
688
  }
702
689
  }
703
- console.log(`模型加载完毕: ${name}`);
690
+ console.log(`妯″瀷鍔犺浇瀹屾瘯: ${name}`);
704
691
  initFun();
705
692
  element.EnablePick = enablePick;
706
693
  Gaea.QueryServer.Instance.Enable = enablePick;
@@ -719,36 +706,35 @@ export class GaeaApp {
719
706
  });
720
707
  };
721
708
 
722
- // ---- 图层树数据 ----
709
+ // ---- 鍥惧眰鏍戞暟鎹?----
723
710
 
724
711
  async _fetchLayerTreeData() {
725
712
  const cfg = this.config;
726
713
  const apiUrl = cfg.dataHubApiUrl;
727
714
  if (!apiUrl) {
728
- console.log('[GaeaApp] 未配置 dataHubApiUrl,使用默认图层树数据');
715
+ console.log('[GaeaApp] 鏈厤缃?dataHubApiUrl锛屼娇鐢ㄩ粯璁ゅ浘灞傛爲鏁版嵁');
729
716
  return;
730
717
  }
731
- console.log('[GaeaApp] 从 DataHub 获取图层树数据...');
718
+ console.log('[GaeaApp] 浠?DataHub 鑾峰彇鍥惧眰鏍戞暟鎹?..');
732
719
  try {
733
720
  const res = await fetch(`${apiUrl}/open/api/5rLGPS6E8Zvr`, { headers: this._dataHubHeaders(cfg) });
734
721
  if (!res.ok) throw new Error(`HTTP ${res.status}`);
735
722
  const json = await res.json();
736
723
  if (json.data) this._mergeStationData(json.data);
737
- console.log('[GaeaApp] 图层树数据更新完成');
724
+ console.log('[GaeaApp] 鍥惧眰鏍戞暟鎹洿鏂板畬鎴?);
738
725
  } catch (e) {
739
- console.warn('[GaeaApp] 接口获取失败,使用默认数据:', e.message);
726
+ console.warn('[GaeaApp] 鎺ュ彛鑾峰彇澶辫触锛屼娇鐢ㄩ粯璁ゆ暟鎹?', e.message);
740
727
  }
741
728
  }
742
729
 
743
- /** DataHub API 签名头(HmacSHA256) */
730
+ /** DataHub API 绛惧悕澶达紙HmacSHA256锛?*/
744
731
  _dataHubHeaders(cfg) {
745
732
  const appKey = cfg.dataHubAppKey || 'testAppKey';
746
733
  const appSecret = cfg.dataHubAppSecret || 'testAppSecret';
747
734
  const nonce = Math.random().toString(36).substring(2, 10);
748
735
  const timestamp = Date.now();
749
736
  const signStr = `${appKey}${timestamp}${nonce}`;
750
- // 简化版:用 btoa 替代 HmacSHA256(生产环境需用 Web Crypto API)
751
- const signature = btoa(signStr + appSecret);
737
+ // 绠€鍖栫増锛氱敤 btoa 鏇夸唬 HmacSHA256锛堢敓浜х幆澧冮渶鐢?Web Crypto API锛? const signature = btoa(signStr + appSecret);
752
738
  return {
753
739
  'Content-Type': 'application/json',
754
740
  'X-App-Key': appKey,
@@ -758,7 +744,7 @@ export class GaeaApp {
758
744
  };
759
745
  }
760
746
 
761
- /** 将API测站数据合并到默认分类中 */
747
+ /** 灏咥PI娴嬬珯鏁版嵁鍚堝苟鍒伴粯璁ゅ垎绫讳腑 */
762
748
  _mergeStationData(apiData) {
763
749
  const cfg = this.config;
764
750
  const sttpMap = {
@@ -784,12 +770,12 @@ export class GaeaApp {
784
770
  }
785
771
  }
786
772
 
787
- /** 从图层树数据创建屏幕图标 */
773
+ /** 浠庡浘灞傛爲鏁版嵁鍒涘缓灞忓箷鍥炬爣 */
788
774
  _initScreenIcons() {
789
775
  const cats = this.layerCategories || [];
790
776
  const catConfig = {
791
777
  seawall: {
792
- img: '/image/screenIcon/海塘-红.png', method: 'textImage',
778
+ img: '/image/screenIcon/娴峰-绾?png', method: 'textImage',
793
779
  visibleRange: [5000, 150000], offset: [-40, -35], anchorType: 6,
794
780
  onClick: (name, data) => {
795
781
  this.flyToNode(data);
@@ -797,7 +783,7 @@ export class GaeaApp {
797
783
  },
798
784
  },
799
785
  hydrometricStations: {
800
- img: '/image/screenIcon/潮位站-正常.png', method: 'textImage',
786
+ img: '/image/screenIcon/娼綅绔?姝e父.png', method: 'textImage',
801
787
  visibleRange: [10, 5000], offset: [-40, -35],
802
788
  onClick: (name, data) => {
803
789
  console.log('[GaeaApp] hydrometricStations onClick:', name, data);
@@ -810,18 +796,18 @@ export class GaeaApp {
810
796
  if (window.__gaeaIconClickHandler) {
811
797
  window.__gaeaIconClickHandler({ detail: eventData });
812
798
  }
813
- console.log('[GaeaApp] hydrometricStations 事件已派发');
799
+ console.log('[GaeaApp] hydrometricStations 浜嬩欢宸叉淳鍙?);
814
800
  },
815
801
  },
816
802
  tideStations: {
817
- img: '/image/screenIcon/潮位站-正常.png', method: 'textImage',
803
+ img: '/image/screenIcon/娼綅绔?姝e父.png', method: 'textImage',
818
804
  visibleRange: [10, 5000], offset: [-40, -35],
819
805
  onClick: (name, data) => {
820
806
  document.dispatchEvent(new CustomEvent('gaea-icon-click', { detail: { category: 'tideStations', name, data } }));
821
807
  },
822
808
  },
823
809
  riverStations: {
824
- img: '/image/screenIcon/河道站-正常.png', method: 'textImage',
810
+ img: '/image/screenIcon/娌抽亾绔?姝e父.png', method: 'textImage',
825
811
  visibleRange: [10, 5000], offset: [-40, -35],
826
812
  onClick: (name, data) => {
827
813
  this.flyToNode(data);
@@ -829,7 +815,7 @@ export class GaeaApp {
829
815
  },
830
816
  },
831
817
  rainStations: {
832
- img: '/image/screenIcon/雨量站-绿.png', method: 'textImage',
818
+ img: '/image/screenIcon/闆ㄩ噺绔?缁?png', method: 'textImage',
833
819
  visibleRange: [10, 5000], offset: [-40, -35],
834
820
  onClick: (name, data) => {
835
821
  this.flyToNode(data);
@@ -837,7 +823,7 @@ export class GaeaApp {
837
823
  },
838
824
  },
839
825
  reservoirs: {
840
- img: '/image/screenIcon/水库站.png', method: 'styled',
826
+ img: '/image/screenIcon/姘村簱绔?png', method: 'styled',
841
827
  visibleRange: [10, 5000], offset: [-40, -35],
842
828
  onClick: (name, data) => {
843
829
  this.flyToNode(data);
@@ -845,7 +831,7 @@ export class GaeaApp {
845
831
  },
846
832
  },
847
833
  sluice: {
848
- img: '/image/screenIcon/闸门-绿.png', method: 'textImage',
834
+ img: '/image/screenIcon/闂搁棬-缁?png', method: 'textImage',
849
835
  visibleRange: [10, 3000], offset: [-40, -35],
850
836
  onClick: (name, data) => {
851
837
  this.flyToNode(data);
@@ -853,21 +839,21 @@ export class GaeaApp {
853
839
  },
854
840
  },
855
841
  secData: {
856
- img: '/image/screenIcon/断面.png', method: 'styled',
842
+ img: '/image/screenIcon/鏂潰.png', method: 'styled',
857
843
  visibleRange: [10, 3000], offset: [-40, -35],
858
844
  onClick: (name, data) => {
859
845
  this._onSecDataClick(name, data);
860
846
  },
861
847
  },
862
848
  uavNests: {
863
- img: '/image/screenIcon/无人机.png', method: 'imageOnly',
849
+ img: '/image/screenIcon/鏃犱汉鏈?png', method: 'imageOnly',
864
850
  visibleRange: [10, 5000], offset: [-25, -80],
865
851
  onClick: (name, data) => {
866
852
  document.dispatchEvent(new CustomEvent('gaea-icon-click', { detail: { category: 'uavNests', name, data } }));
867
853
  },
868
854
  },
869
855
  rescue: {
870
- img: '/image/screenIcon/隐患.png', method: 'imageOnly',
856
+ img: '/image/screenIcon/闅愭偅.png', method: 'imageOnly',
871
857
  visibleRange: [10, 5000], offset: [-25, -80],
872
858
  onClick: (name, data) => {
873
859
  this.flyToNode(data);
@@ -875,7 +861,7 @@ export class GaeaApp {
875
861
  },
876
862
  },
877
863
  materials: {
878
- img: '/image/screenIcon/物资仓库.png', method: 'imageOnly',
864
+ img: '/image/screenIcon/鐗╄祫浠撳簱.png', method: 'imageOnly',
879
865
  visibleRange: [10, 5000], offset: [-25, -80],
880
866
  onClick: (name, data) => {
881
867
  this.flyToNode(data);
@@ -883,7 +869,7 @@ export class GaeaApp {
883
869
  },
884
870
  },
885
871
  };
886
- console.log('[GaeaApp] 开始创建屏幕图标... categories:', cats.length);
872
+ console.log('[GaeaApp] 寮€濮嬪垱寤哄睆骞曞浘鏍?.. categories:', cats.length);
887
873
  let count = 0;
888
874
  for (const cat of cats) {
889
875
  if (!cat.children?.length) continue;
@@ -908,38 +894,34 @@ export class GaeaApp {
908
894
  },
909
895
  });
910
896
  } catch (e) {
911
- console.warn(`[GaeaApp] 图标 ${child.text} 创建失败:`, e.message);
897
+ console.warn(`[GaeaApp] 鍥炬爣 ${child.text} 鍒涘缓澶辫触:`, e.message);
912
898
  }
913
899
  }
914
- // 根据配置的 visible 决定初始显隐(不影响创建,只控制初始状态)
900
+ // 鏍规嵁閰嶇疆鐨?visible 鍐冲畾鍒濆鏄鹃殣锛堜笉褰卞搷鍒涘缓锛屽彧鎺у埗鍒濆鐘舵€侊級
915
901
  if (cat.visible === false) {
916
902
  this.setCategoryVisible(cat.key, false);
917
903
  }
918
904
  }
919
- console.log('[GaeaApp] 屏幕图标创建完成, 共:', count);
920
- // 通知外部图标已就绪
921
- document.dispatchEvent(new CustomEvent('gaea-icons-ready'));
905
+ console.log('[GaeaApp] 灞忓箷鍥炬爣鍒涘缓瀹屾垚, 鍏?', count);
906
+ // 閫氱煡澶栭儴鍥炬爣宸插氨缁? document.dispatchEvent(new CustomEvent('gaea-icons-ready'));
922
907
  }
923
908
 
924
- // ---- 图层分类显隐控制 ----
909
+ // ---- 鍥惧眰鍒嗙被鏄鹃殣鎺у埗 ----
925
910
 
926
911
  /**
927
- * 设置某个分类图标的可见性
928
- * @param {string} categoryKey 分类 key(如 'seawall', 'hydrometricStations' 等)
929
- * @param {boolean} visible 是否可见
912
+ * 璁剧疆鏌愪釜鍒嗙被鍥炬爣鐨勫彲瑙佹€? * @param {string} categoryKey 鍒嗙被 key锛堝 'seawall', 'hydrometricStations' 绛夛級
913
+ * @param {boolean} visible 鏄惁鍙
930
914
  */
931
915
  setCategoryVisible(categoryKey, visible) {
932
- // 记录分类显隐状态
933
- if (visible) {
916
+ // 璁板綍鍒嗙被鏄鹃殣鐘舵€? if (visible) {
934
917
  this._hiddenCategories.delete(categoryKey)
935
918
  } else {
936
919
  this._hiddenCategories.add(categoryKey)
937
920
  }
938
921
  const els = document.querySelectorAll('.gaea-cat-' + categoryKey);
939
- console.log('[GaeaApp] setCategoryVisible:', categoryKey, visible, '元素数:', els.length);
922
+ console.log('[GaeaApp] setCategoryVisible:', categoryKey, visible, '鍏冪礌鏁?', els.length);
940
923
  els.forEach(el => { el.style.display = visible && this._markersVisible ? '' : 'none'; });
941
- // 同步引擎可见性
942
- const items = this._screenIconList.filter(item => item.category === categoryKey);
924
+ // 鍚屾寮曟搸鍙鎬? const items = this._screenIconList.filter(item => item.category === categoryKey);
943
925
  items.forEach(item => {
944
926
  if (visible && this._markersVisible) {
945
927
  item.element.UseAutoVisible();
@@ -952,8 +934,7 @@ export class GaeaApp {
952
934
  }
953
935
 
954
936
  /**
955
- * 获取某个分类的当前可见性(根据 DOM 元素判断)
956
- * @param {string} categoryKey
937
+ * 鑾峰彇鏌愪釜鍒嗙被鐨勫綋鍓嶅彲瑙佹€э紙鏍规嵁 DOM 鍏冪礌鍒ゆ柇锛? * @param {string} categoryKey
957
938
  * @returns {boolean}
958
939
  */
959
940
  getCategoryVisible(categoryKey) {
@@ -961,13 +942,13 @@ export class GaeaApp {
961
942
  return el ? el.style.display !== 'none' : true;
962
943
  }
963
944
 
964
- // ---- 公开方法 ----
945
+ // ---- 鍏紑鏂规硶 ----
965
946
 
966
- /** 初始化默认图层和相机视角(手动调用,可传参覆盖配置) */
947
+ /** 鍒濆鍖栭粯璁ゅ浘灞傚拰鐩告満瑙嗚锛堟墜鍔ㄨ皟鐢紝鍙紶鍙傝鐩栭厤缃級 */
967
948
  async initDefaultLayers({ layers, cameraPosition } = {}) {
968
949
  const cfg = this.config;
969
950
  await this.getAllServe();
970
- console.log('WMTS 图层数量:', this.layers.length);
951
+ console.log('WMTS 鍥惧眰鏁伴噺:', this.layers.length);
971
952
  this.layers.slice(0, 10).forEach(l => console.log(' -', l.Title));
972
953
 
973
954
  const pos = cameraPosition ?? cfg.defaultCameraPosition;
@@ -990,7 +971,7 @@ export class GaeaApp {
990
971
  const layers = Gaea.WMTSImageStore.ParserXml2Capabilities(hostUrl, xml);
991
972
  this.layers = [...this.layers, ...(layers || [])];
992
973
  } catch (e) {
993
- console.warn('getAllServe 失败:', e.message);
974
+ console.warn('getAllServe 澶辫触:', e.message);
994
975
  }
995
976
  return this.layers;
996
977
  }
@@ -998,12 +979,12 @@ export class GaeaApp {
998
979
  addLayer({ layerName, max, min, transparency, forMat = 'image/vnd.jpeg-png', inserIndex = null } = {}) {
999
980
  const mime = ['image/jpeg','image/png','image/tga','image/webp','image/bmp','application/json;type=geojson','image/vnd.jpeg-png'];
1000
981
  const mimeIdx = mime.indexOf(forMat);
1001
- if (mimeIdx === -1) return console.warn('未知图层类型:', forMat);
982
+ if (mimeIdx === -1) return console.warn('鏈煡鍥惧眰绫诲瀷:', forMat);
1002
983
 
1003
- if (!this.layers?.length) return console.warn('图层列表为空,请先调用 getAllServe()');
984
+ if (!this.layers?.length) return console.warn('鍥惧眰鍒楄〃涓虹┖锛岃鍏堣皟鐢?getAllServe()');
1004
985
 
1005
986
  const capability = this.layers.find(i => i.Title === layerName);
1006
- if (!capability) return console.warn(`图层 "${layerName}" 未找到`);
987
+ if (!capability) return console.warn(`鍥惧眰 "${layerName}" 鏈壘鍒癭);
1007
988
 
1008
989
  const store = new Gaea.WMTSImageStore();
1009
990
  store.ImageExtension = mimeIdx;
@@ -1012,24 +993,24 @@ export class GaeaApp {
1012
993
  if (max !== undefined) store.LevelRange = new Gaea.Vector2(min, max);
1013
994
  if (transparency !== undefined) store.ImageTransparency = transparency;
1014
995
 
1015
- if (!store.CurrentCapabilitie.InstanceID) return console.error(`${layerName} 加载异常`);
996
+ if (!store.CurrentCapabilitie.InstanceID) return console.error(`${layerName} 鍔犺浇寮傚父`);
1016
997
 
1017
998
  const tileset = Gaea.World.Instance.DefaultPyramidTileSet;
1018
999
  inserIndex !== null ? tileset.InsertImageStore(store, inserIndex) : tileset.AddImageStore(store);
1019
- console.log(`影像 "${layerName}" 添加成功`);
1000
+ console.log(`褰卞儚 "${layerName}" 娣诲姞鎴愬姛`);
1020
1001
  return store;
1021
1002
  }
1022
1003
 
1023
- // ---- 地形服务 ----
1004
+ // ---- 鍦板舰鏈嶅姟 ----
1024
1005
 
1025
- /** 加载单个地形服务 */
1006
+ /** 鍔犺浇鍗曚釜鍦板舰鏈嶅姟 */
1026
1007
  _initTerrainServer(url) {
1027
1008
  return new Promise((resolve) => {
1028
1009
  Gaea.World.Instance.InitTerrainServer2(url, () => resolve());
1029
1010
  });
1030
1011
  }
1031
1012
 
1032
- /** 加载配置中的地形服务(cfg.defaultTerrains,url 为相对 serveUrl 的路径或完整地址) */
1013
+ /** 鍔犺浇閰嶇疆涓殑鍦板舰鏈嶅姟锛坈fg.defaultTerrains锛寀rl 涓虹浉瀵?serveUrl 鐨勮矾寰勬垨瀹屾暣鍦板潃锛?*/
1033
1014
  async addInitTerrainServer(terrains) {
1034
1015
  const cfg = this.config;
1035
1016
  const list = terrains ?? cfg.defaultTerrains;
@@ -1038,20 +1019,20 @@ export class GaeaApp {
1038
1019
  const url = /^https?:\/\//.test(t.url) ? t.url : `${cfg.serveUrl}${t.url}`;
1039
1020
  try {
1040
1021
  await this._initTerrainServer(url);
1041
- console.log(`地形 "${t.name}" 加载成功`);
1022
+ console.log(`鍦板舰 "${t.name}" 鍔犺浇鎴愬姛`);
1042
1023
  } catch (e) {
1043
- console.warn(`地形 "${t.name}" 加载失败:`, e?.message);
1024
+ console.warn(`鍦板舰 "${t.name}" 鍔犺浇澶辫触:`, e?.message);
1044
1025
  }
1045
1026
  }
1046
1027
  }
1047
1028
 
1048
- // ---- 贴地线(矢量线服务) ----
1029
+ // ---- 璐村湴绾匡紙鐭㈤噺绾挎湇鍔★級 ----
1049
1030
 
1050
- /** 从 WMTS 服务列表创建矢量要素服务 */
1031
+ /** 浠?WMTS 鏈嶅姟鍒楄〃鍒涘缓鐭㈤噺瑕佺礌鏈嶅姟 */
1051
1032
  CreateFeature(serviceName, levelRange, render, alias) {
1052
- if (!this.layers?.length) return console.warn('矢量服务列表为空,请先调用 getAllServe()');
1033
+ if (!this.layers?.length) return console.warn('鐭㈤噺鏈嶅姟鍒楄〃涓虹┖锛岃鍏堣皟鐢?getAllServe()');
1053
1034
  const cap = this.layers.find(i => i.Title === serviceName);
1054
- if (!cap) return console.warn(`矢量服务 "${serviceName}" 未找到`);
1035
+ if (!cap) return console.warn(`鐭㈤噺鏈嶅姟 "${serviceName}" 鏈壘鍒癭);
1055
1036
  const store = new Gaea.WMTSVectorStore();
1056
1037
  store.Name = alias == null ? serviceName : alias;
1057
1038
  store.Init(cap);
@@ -1062,7 +1043,7 @@ export class GaeaApp {
1062
1043
  return store;
1063
1044
  }
1064
1045
 
1065
- /** 添加单条贴地线 */
1046
+ /** 娣诲姞鍗曟潯璐村湴绾?*/
1066
1047
  AddVTSLine({ name, range, color, index }) {
1067
1048
  const symbol = new Gaea.GroundPolylineSymbol();
1068
1049
  symbol.Width = 2;
@@ -1074,40 +1055,37 @@ export class GaeaApp {
1074
1055
  return render;
1075
1056
  }
1076
1057
 
1077
- /** 加载配置中的贴地线(cfg.defaultGroundLines,依赖 getAllServe 的服务列表) */
1058
+ /** 鍔犺浇閰嶇疆涓殑璐村湴绾匡紙cfg.defaultGroundLines锛屼緷璧?getAllServe 鐨勬湇鍔″垪琛級 */
1078
1059
  addGroundLines(groundLines) {
1079
1060
  const cfg = this.config;
1080
1061
  const list = groundLines ?? cfg.defaultGroundLines;
1081
1062
  if (!list?.length) return;
1082
- if (!this.layers?.length) return console.warn('贴地线需要先加载 WMTS 服务列表(getAllServe)');
1063
+ if (!this.layers?.length) return console.warn('璐村湴绾块渶瑕佸厛鍔犺浇 WMTS 鏈嶅姟鍒楄〃(getAllServe)');
1083
1064
  for (const item of list) {
1084
1065
  if (item.isInitLoad === false) continue;
1085
1066
  try {
1086
1067
  this.AddVTSLine(item);
1087
- console.log(`贴地线 "${item.name}" 加载成功`);
1068
+ console.log(`璐村湴绾?"${item.name}" 鍔犺浇鎴愬姛`);
1088
1069
  } catch (e) {
1089
- console.warn(`贴地线 "${item.name}" 加载失败:`, e?.message);
1070
+ console.warn(`璐村湴绾?"${item.name}" 鍔犺浇澶辫触:`, e?.message);
1090
1071
  }
1091
1072
  }
1092
1073
  }
1093
1074
 
1094
- // ---- 贴地面(矢量面绘制) ----
1075
+ // ---- 璐村湴闈紙鐭㈤噺闈㈢粯鍒讹級 ----
1095
1076
 
1096
1077
  /**
1097
- * 根据坐标数组添加贴地面
1098
- * @param {Array} coords - 坐标数组,格式 [[lng, lat], [lng, lat], ...]
1099
- * @param {string} name - 面名称
1100
- * @param {string} colorHex - 颜色 hex 值,如 '#3498db'
1101
- * @returns {object|null} 创建的 PolygonGeometryElement,失败返回 null
1078
+ * 鏍规嵁鍧愭爣鏁扮粍娣诲姞璐村湴闈? * @param {Array} coords - 鍧愭爣鏁扮粍锛屾牸寮?[[lng, lat], [lng, lat], ...]
1079
+ * @param {string} name - 闈㈠悕绉? * @param {string} colorHex - 棰滆壊 hex 鍊硷紝濡?'#3498db'
1080
+ * @returns {object|null} 鍒涘缓鐨?PolygonGeometryElement锛屽け璐ヨ繑鍥?null
1102
1081
  */
1103
1082
  addGroundPolygonByCoords(coords, name, colorHex) {
1104
1083
  if (!coords || coords.length < 3) {
1105
- console.warn(`坐标点不足,跳过: ${name}`);
1084
+ console.warn(`鍧愭爣鐐逛笉瓒筹紝璺宠繃: ${name}`);
1106
1085
  return null;
1107
1086
  }
1108
- // 检查是否已存在同名面
1109
- if (this._groundPolygonElements.find(p => p.name === name)) {
1110
- console.warn(`贴地面 "${name}" 已存在,跳过`);
1087
+ // 妫€鏌ユ槸鍚﹀凡瀛樺湪鍚屽悕闈? if (this._groundPolygonElements.find(p => p.name === name)) {
1088
+ console.warn(`璐村湴闈?"${name}" 宸插瓨鍦紝璺宠繃`);
1111
1089
  return null;
1112
1090
  }
1113
1091
 
@@ -1143,36 +1121,36 @@ export class GaeaApp {
1143
1121
  return polygonElement;
1144
1122
  }
1145
1123
 
1146
- /** 移除指定贴地面 */
1124
+ /** 绉婚櫎鎸囧畾璐村湴闈?*/
1147
1125
  removeGroundPolygon(element) {
1148
1126
  try {
1149
1127
  Gaea.World.Instance.RenderableObjectList.Remove(element);
1150
1128
  } catch (err) {
1151
- console.error('移除贴地面失败:', err);
1129
+ console.error('绉婚櫎璐村湴闈㈠け璐?', err);
1152
1130
  }
1153
1131
  const idx = this._groundPolygonElements.findIndex(p => p.element === element);
1154
1132
  if (idx >= 0) this._groundPolygonElements.splice(idx, 1);
1155
1133
  }
1156
1134
 
1157
- /** 清除所有贴地面 */
1135
+ /** 娓呴櫎鎵€鏈夎创鍦伴潰 */
1158
1136
  clearAllGroundPolygons() {
1159
1137
  this._groundPolygonElements.forEach(item => {
1160
1138
  try {
1161
1139
  Gaea.World.Instance.RenderableObjectList.Remove(item.element);
1162
1140
  } catch (err) {
1163
- console.error('移除贴地面失败:', err);
1141
+ console.error('绉婚櫎璐村湴闈㈠け璐?', err);
1164
1142
  }
1165
1143
  });
1166
1144
  this._groundPolygonElements = [];
1167
1145
  }
1168
1146
 
1169
- /** 定位到指定视角(经纬度高程 + 相机参数) */
1147
+ /** 瀹氫綅鍒版寚瀹氳瑙掞紙缁忕含搴﹂珮绋?+ 鐩告満鍙傛暟锛?*/
1170
1148
  SetPosition(numStr) {
1171
1149
  const arr = numStr.split(',').map(s => Number(s.trim()));
1172
1150
  Gaea.World.Instance.DefaultCamera.SetPosition2(arr[0], arr[1], arr[2], arr[3], arr[4], arr[5]);
1173
1151
  }
1174
1152
 
1175
- /** 飞到图层树节点位置 */
1153
+ /** 椋炲埌鍥惧眰鏍戣妭鐐逛綅缃?*/
1176
1154
  flyToNode(node) {
1177
1155
  if (!node?.position) return;
1178
1156
  const { x, y, z } = node.position;
@@ -1181,9 +1159,8 @@ export class GaeaApp {
1181
1159
  }
1182
1160
 
1183
1161
  /**
1184
- * 根据名称或 id 定位到海塘
1185
- * @param {string} name - 海塘名称或 id
1186
- * @param {string} [tilesetUrl] - 可选,倾斜摄影 3D Tiles 的 tileset.json 地址
1162
+ * 鏍规嵁鍚嶇О鎴?id 瀹氫綅鍒版捣濉? * @param {string} name - 娴峰鍚嶇О鎴?id
1163
+ * @param {string} [tilesetUrl] - 鍙€夛紝鍊炬枩鎽勫奖 3D Tiles 鐨?tileset.json 鍦板潃
1187
1164
  */
1188
1165
  flyToSeawall = (name, tilesetUrl) => {
1189
1166
  const cats = this.layerCategories || []
@@ -1198,12 +1175,12 @@ export class GaeaApp {
1198
1175
  return
1199
1176
  }
1200
1177
  }
1201
- console.warn(`[GaeaApp] 未找到海塘: ${name}`)
1178
+ console.warn(`[GaeaApp] 鏈壘鍒版捣濉? ${name}`)
1202
1179
  };
1203
1180
 
1204
1181
  /**
1205
- * 加载倾斜摄影 3D Tiles
1206
- * @param {Object} item - { jsonUrl: tileset.json地址, tilName?: 名称, height?: 高度偏移, isInitLoad?: 是否初始化加载 }
1182
+ * 鍔犺浇鍊炬枩鎽勫奖 3D Tiles
1183
+ * @param {Object} item - { jsonUrl: tileset.json鍦板潃, tilName?: 鍚嶇О, height?: 楂樺害鍋忕Щ, isInitLoad?: 鏄惁鍒濆鍖栧姞杞?}
1207
1184
  */
1208
1185
  add3DTiles = (item) => {
1209
1186
  const tilesetUrl = typeof item === 'string' ? item : item.jsonUrl
@@ -1230,45 +1207,43 @@ export class GaeaApp {
1230
1207
  if (name) {
1231
1208
  this._tilesetMap[name] = tileset
1232
1209
  }
1233
- console.log('[GaeaApp] 3D Tiles 已加载:', name || tilesetUrl, height ? `高度: ${height}` : '', enabledClip ? '(裁剪已启用)' : '')
1210
+ console.log('[GaeaApp] 3D Tiles 宸插姞杞?', name || tilesetUrl, height ? `楂樺害: ${height}` : '', enabledClip ? '(瑁佸壀宸插惎鐢?' : '')
1234
1211
  return tileset
1235
1212
  };
1236
1213
 
1237
- // ---- 倾斜挖方 ----
1214
+ // ---- 鍊炬枩鎸栨柟 ----
1238
1215
 
1239
1216
  /**
1240
- * 根据多边形坐标裁剪地形(倾斜挖方)
1241
- * @param {Array<{x: number, y: number, z: number}>} pointList - 多边形顶点坐标数组 [{x: 纬度, y: 经度, z: 高程}, ...]
1242
- * @param {number} height - 裁剪深度/高度
1243
- * @param {Function} [callback] - 完成后的回调函数,接收 _Holeitem
1244
- * @returns {boolean} 是否成功
1217
+ * 鏍规嵁澶氳竟褰㈠潗鏍囪鍓湴褰紙鍊炬枩鎸栨柟锛? * @param {Array<{x: number, y: number, z: number}>} pointList - 澶氳竟褰㈤《鐐瑰潗鏍囨暟缁?[{x: 绾害, y: 缁忓害, z: 楂樼▼}, ...]
1218
+ * @param {number} height - 瑁佸壀娣卞害/楂樺害
1219
+ * @param {Function} [callback] - 瀹屾垚鍚庣殑鍥炶皟鍑芥暟锛屾帴鏀?_Holeitem
1220
+ * @returns {boolean} 鏄惁鎴愬姛
1245
1221
  * @example
1246
1222
  * app.editTerrainTool([
1247
1223
  * { x: 27.2205, y: 120.456, z: 10 },
1248
1224
  * { x: 27.2210, y: 120.458, z: 10 },
1249
1225
  * { x: 27.2195, y: 120.458, z: 10 }
1250
- * ], 50, (item) => { console.log('挖方完成', item) })
1226
+ * ], 50, (item) => { console.log('鎸栨柟瀹屾垚', item) })
1251
1227
  */
1252
1228
  editTerrainTool = (pointList, height, callback) => {
1253
1229
  if (!pointList || pointList.length === 0) {
1254
- console.warn('[GaeaApp] editTerrainTool: pointList 不能为空')
1230
+ console.warn('[GaeaApp] editTerrainTool: pointList 涓嶈兘涓虹┖')
1255
1231
  return false
1256
1232
  }
1257
1233
 
1258
1234
  const Position = pointList.map(point => new Gaea.Vector3(point.x, point.y, point.z))
1259
1235
 
1260
- // 经纬度 → 笛卡尔坐标
1261
- const originPoint = pointList.map(p => Gaea.GaeaMath.SphericalToCartesianDeg(new Gaea.Vector3(p.x, p.y, p.z)))
1236
+ // 缁忕含搴?鈫?绗涘崱灏斿潗鏍? const originPoint = pointList.map(p => Gaea.GaeaMath.SphericalToCartesianDeg(new Gaea.Vector3(p.x, p.y, p.z)))
1262
1237
 
1263
- // 启用 QueryServer
1238
+ // 鍚敤 QueryServer
1264
1239
  Gaea.QueryServer.Instance.Enable = true
1265
1240
 
1266
- // 清旧挖方
1241
+ // 娓呮棫鎸栨柟
1267
1242
  if (this._holeItem) {
1268
1243
  Gaea.ExcavationManager.Instance.RemoveItem(this._holeItem)
1269
1244
  }
1270
1245
 
1271
- // 创建挖方对象 (坐标点, 插值距离, 深度, UV缩放, 是否法线材质, 是否需要edge)
1246
+ // 鍒涘缓鎸栨柟瀵硅薄 (鍧愭爣鐐? 鎻掑€艰窛绂? 娣卞害, UV缂╂斁, 鏄惁娉曠嚎鏉愯川, 鏄惁闇€瑕乪dge)
1272
1247
  this._holeItem = Gaea.ExcavationManager.Instance.CreateItem(originPoint, 100, height, 100, true, true)
1273
1248
  Gaea.ExcavationManager.Instance.ExposureLength = 0
1274
1249
  Gaea.ExcavationManager.Instance.AddItem(this._holeItem)
@@ -1281,7 +1256,7 @@ export class GaeaApp {
1281
1256
  Gaea.QueryServer.Instance.ClipBox = box
1282
1257
  }
1283
1258
 
1284
- console.log('[GaeaApp] 挖方已执行:', `深度: ${height}`, `顶点数: ${pointList.length}`)
1259
+ console.log('[GaeaApp] 鎸栨柟宸叉墽琛?', `娣卞害: ${height}`, `椤剁偣鏁? ${pointList.length}`)
1285
1260
 
1286
1261
  setTimeout(() => {
1287
1262
  if (typeof callback === 'function') {
@@ -1291,7 +1266,7 @@ export class GaeaApp {
1291
1266
  };
1292
1267
 
1293
1268
  /**
1294
- * 还原地形(清除所有挖方效果)
1269
+ * 杩樺師鍦板舰锛堟竻闄ゆ墍鏈夋寲鏂规晥鏋滐級
1295
1270
  */
1296
1271
  restoreTerrain = () => {
1297
1272
  if (this._holeItem) {
@@ -1304,27 +1279,26 @@ export class GaeaApp {
1304
1279
  Gaea.QueryServer.Instance.ClipBox.QueueFree()
1305
1280
  Gaea.QueryServer.Instance.ClipBox = null
1306
1281
  }
1307
- console.log('[GaeaApp] 地形已还原')
1282
+ console.log('[GaeaApp] 鍦板舰宸茶繕鍘?)
1308
1283
  };
1309
1284
 
1310
1285
  /**
1311
- * 监听画布鼠标点击,获取点击位置的经纬度坐标
1312
- * @example
1286
+ * 鐩戝惉鐢诲竷榧犳爣鐐瑰嚮锛岃幏鍙栫偣鍑讳綅缃殑缁忕含搴﹀潗鏍? * @example
1313
1287
  * app.addMouseClick((pos) => {
1314
- * console.log('点击位置:', pos) // { x: 纬度, y: 经度, z: 高程 }
1288
+ * console.log('鐐瑰嚮浣嶇疆:', pos) // { x: 绾害, y: 缁忓害, z: 楂樼▼ }
1315
1289
  * })
1316
1290
  */
1317
1291
  addMouseClick = (callback) => {
1318
1292
  const canvas = document.getElementById('canvas')
1319
1293
  if (!canvas) {
1320
- console.warn('[GaeaApp] addMouseClick: canvas 元素未找到')
1294
+ console.warn('[GaeaApp] addMouseClick: canvas 鍏冪礌鏈壘鍒?)
1321
1295
  return
1322
1296
  }
1323
1297
  canvas.addEventListener('mousedown', (event) => {
1324
1298
  const result = Gaea.GaeaMath.ProjectPosition(new Gaea.Vector2(event.offsetX, event.offsetY))
1325
1299
  const lonlat = Gaea.GaeaMath.CartesianToSphericalDeg(result)
1326
1300
  const pos = { x: lonlat.x, y: lonlat.y, z: lonlat.z }
1327
- console.log('[GaeaApp] 点击位置:', pos)
1301
+ console.log('[GaeaApp] 鐐瑰嚮浣嶇疆:', pos)
1328
1302
  if (typeof callback === 'function') {
1329
1303
  callback(pos)
1330
1304
  }
@@ -1332,17 +1306,17 @@ export class GaeaApp {
1332
1306
  };
1333
1307
 
1334
1308
  /**
1335
- * 获取已加载的模型元素
1336
- * @param {string} name - 模型名称
1337
- * @returns {object} GLTFElement 或 null
1309
+ * 鑾峰彇宸插姞杞界殑妯″瀷鍏冪礌
1310
+ * @param {string} name - 妯″瀷鍚嶇О
1311
+ * @returns {object} GLTFElement 鎴?null
1338
1312
  */
1339
1313
  getModel = (name) => {
1340
1314
  return this._gltfElements[name] || null
1341
1315
  };
1342
1316
 
1343
1317
  /**
1344
- * 获取模型当前状态(位置、旋转、缩放)
1345
- * @param {string} name - 模型名称
1318
+ * 鑾峰彇妯″瀷褰撳墠鐘舵€侊紙浣嶇疆銆佹棆杞€佺缉鏀撅級
1319
+ * @param {string} name - 妯″瀷鍚嶇О
1346
1320
  * @returns {object|null} { position, rotate, scale, visible }
1347
1321
  */
1348
1322
  getModelInfo = (name) => {
@@ -1357,72 +1331,68 @@ export class GaeaApp {
1357
1331
  };
1358
1332
 
1359
1333
  /**
1360
- * 设置模型位置(经纬度 + 高程)
1361
- * @param {string} name - 模型名称
1362
- * @param {object} position - { x: 纬度, y: 经度, z: 高程 }
1334
+ * 璁剧疆妯″瀷浣嶇疆锛堢粡绾害 + 楂樼▼锛? * @param {string} name - 妯″瀷鍚嶇О
1335
+ * @param {object} position - { x: 绾害, y: 缁忓害, z: 楂樼▼ }
1363
1336
  */
1364
1337
  setModelPosition = (name, position) => {
1365
1338
  const el = this._gltfElements[name]
1366
- if (!el) { console.warn(`[GaeaApp] 模型 "${name}" 未找到`); return }
1339
+ if (!el) { console.warn(`[GaeaApp] 妯″瀷 "${name}" 鏈壘鍒癭); return }
1367
1340
  el.GeographyPosition = new Gaea.Vector3(position.x, position.y, position.z)
1368
1341
  };
1369
1342
 
1370
1343
  /**
1371
- * 设置模型旋转
1372
- * @param {string} name - 模型名称
1344
+ * 璁剧疆妯″瀷鏃嬭浆
1345
+ * @param {string} name - 妯″瀷鍚嶇О
1373
1346
  * @param {number[]} rotate - [pitch, yaw, roll]
1374
1347
  */
1375
1348
  setModelRotation = (name, rotate) => {
1376
1349
  const el = this._gltfElements[name]
1377
- if (!el) { console.warn(`[GaeaApp] 模型 "${name}" 未找到`); return }
1350
+ if (!el) { console.warn(`[GaeaApp] 妯″瀷 "${name}" 鏈壘鍒癭); return }
1378
1351
  el.TiltHeadingBank = new Gaea.Vector3(rotate[0], rotate[1], rotate[2])
1379
1352
  };
1380
1353
 
1381
1354
  /**
1382
- * 设置模型缩放
1383
- * @param {string} name - 模型名称
1355
+ * 璁剧疆妯″瀷缂╂斁
1356
+ * @param {string} name - 妯″瀷鍚嶇О
1384
1357
  * @param {number[]} size - [sx, sy, sz]
1385
1358
  */
1386
1359
  setModelScale = (name, size) => {
1387
1360
  const el = this._gltfElements[name]
1388
- if (!el) { console.warn(`[GaeaApp] 模型 "${name}" 未找到`); return }
1361
+ if (!el) { console.warn(`[GaeaApp] 妯″瀷 "${name}" 鏈壘鍒癭); return }
1389
1362
  el.Root.Scale = new Gaea.Vector3(size[0], size[1], size[2])
1390
1363
  };
1391
1364
 
1392
1365
  /**
1393
- * 设置模型可见性
1394
- * @param {string} name - 模型名称
1366
+ * 璁剧疆妯″瀷鍙鎬? * @param {string} name - 妯″瀷鍚嶇О
1395
1367
  * @param {boolean} visible
1396
1368
  */
1397
1369
  setModelVisible = (name, visible) => {
1398
1370
  const el = this._gltfElements[name]
1399
- if (!el) { console.warn(`[GaeaApp] 模型 "${name}" 未找到`); return }
1371
+ if (!el) { console.warn(`[GaeaApp] 妯″瀷 "${name}" 鏈壘鍒癭); return }
1400
1372
  el.Root.Visible = visible
1401
1373
  };
1402
1374
 
1403
1375
  /**
1404
- * 移除模型(参考 ht_3dview removeGltf)
1405
- * @param {string} name - 模型名称
1376
+ * 绉婚櫎妯″瀷锛堝弬鑰?ht_3dview removeGltf锛? * @param {string} name - 妯″瀷鍚嶇О
1406
1377
  */
1407
1378
  removeGltf = (name) => {
1408
1379
  const el = this._gltfElements[name]
1409
- if (!el) { console.warn(`[GaeaApp] 模型 "${name}" 未找到`); return }
1380
+ if (!el) { console.warn(`[GaeaApp] 妯″瀷 "${name}" 鏈壘鍒癭); return }
1410
1381
  Gaea.World.Instance.RenderableObjectList.Remove(el)
1411
1382
  delete this._gltfElements[name]
1412
1383
  delete this._gltfCfgMap[name]
1413
1384
  };
1414
1385
 
1415
1386
  /**
1416
- * 修改模型配置(位置/旋转/缩放一起设置,参考 ht_3dview updateElementPosition)
1417
- * @param {object} options
1418
- * @param {string} options.name - 模型名称
1419
- * @param {object} options.position - { x: 纬度, y: 经度, z: 高程 }
1387
+ * 淇敼妯″瀷閰嶇疆锛堜綅缃?鏃嬭浆/缂╂斁涓€璧疯缃紝鍙傝€?ht_3dview updateElementPosition锛? * @param {object} options
1388
+ * @param {string} options.name - 妯″瀷鍚嶇О
1389
+ * @param {object} options.position - { x: 绾害, y: 缁忓害, z: 楂樼▼ }
1420
1390
  * @param {number[]} [options.rotate] - [pitch, yaw, roll]
1421
1391
  * @param {number[]} [options.size] - [sx, sy, sz]
1422
1392
  */
1423
1393
  updateElementPosition = ({ name, position, rotate, size }) => {
1424
1394
  const el = this._gltfElements[name]
1425
- if (!el) { console.warn(`[GaeaApp] 模型 "${name}" 未找到`); return }
1395
+ if (!el) { console.warn(`[GaeaApp] 妯″瀷 "${name}" 鏈壘鍒癭); return }
1426
1396
  if (position) {
1427
1397
  el.GeographyPosition = new Gaea.Vector3(position.x, position.y, position.z)
1428
1398
  }
@@ -1435,11 +1405,8 @@ export class GaeaApp {
1435
1405
  };
1436
1406
 
1437
1407
  /**
1438
- * 添加鼠标移动监听(参考 ht_3dview addMouseMove,使用 Gaea 引擎事件)
1439
- * 回调返回当前鼠标所在位置的经纬度坐标
1440
- * @param {function} cb - (pos: {x,y,z}) => void
1441
- * @returns {function} 调用可取消监听
1442
- */
1408
+ * 娣诲姞榧犳爣绉诲姩鐩戝惉锛堝弬鑰?ht_3dview addMouseMove锛屼娇鐢?Gaea 寮曟搸浜嬩欢锛? * 鍥炶皟杩斿洖褰撳墠榧犳爣鎵€鍦ㄤ綅缃殑缁忕含搴﹀潗鏍? * @param {function} cb - (pos: {x,y,z}) => void
1409
+ * @returns {function} 璋冪敤鍙彇娑堢洃鍚? */
1443
1410
  addMouseMove = (cb = null) => {
1444
1411
  const handle = Gaea.World.Instance.OnMouseMove((p, b) => {
1445
1412
  const screenpos = new Gaea.Vector2(p.x, p.y)
@@ -1456,7 +1423,7 @@ export class GaeaApp {
1456
1423
  };
1457
1424
 
1458
1425
  /**
1459
- * 移除鼠标移动监听
1426
+ * 绉婚櫎榧犳爣绉诲姩鐩戝惉
1460
1427
  */
1461
1428
  removeMouseMove = () => {
1462
1429
  if (this._mouseMoveHandle) {
@@ -1466,15 +1433,12 @@ export class GaeaApp {
1466
1433
  };
1467
1434
 
1468
1435
  /**
1469
- * 添加鼠标抬起监听(参考 ht_3dview,使用 Gaea 引擎 OnMouseUp 事件)
1470
- * 回调返回点击位置的经纬度坐标
1436
+ * 娣诲姞榧犳爣鎶捣鐩戝惉锛堝弬鑰?ht_3dview锛屼娇鐢?Gaea 寮曟搸 OnMouseUp 浜嬩欢锛? * 鍥炶皟杩斿洖鐐瑰嚮浣嶇疆鐨勭粡绾害鍧愭爣
1471
1437
  * @param {function} cb - (pos: {x,y,z}) => void
1472
- * @returns {function} 调用可取消监听
1473
- */
1438
+ * @returns {function} 璋冪敤鍙彇娑堢洃鍚? */
1474
1439
  addMouseUp = (cb = null) => {
1475
1440
  const handle = Gaea.World.Instance.OnMouseUp((p, b) => {
1476
- if (b !== 1) return // 仅左键
1477
- const screenpos = new Gaea.Vector2(p.x, p.y)
1441
+ if (b !== 1) return // 浠呭乏閿? const screenpos = new Gaea.Vector2(p.x, p.y)
1478
1442
  const spacepos = Gaea.GaeaMath.ProjectPosition(screenpos)
1479
1443
  const latlonalt = Gaea.GaeaMath.CartesianToSphericalDeg(spacepos)
1480
1444
  const pos = { x: latlonalt.x, y: latlonalt.y, z: latlonalt.z }
@@ -1488,7 +1452,7 @@ export class GaeaApp {
1488
1452
  };
1489
1453
 
1490
1454
  /**
1491
- * 移除鼠标抬起监听
1455
+ * 绉婚櫎榧犳爣鎶捣鐩戝惉
1492
1456
  */
1493
1457
  removeMouseUp = () => {
1494
1458
  if (this._mouseUpHandle) {
@@ -1498,11 +1462,9 @@ export class GaeaApp {
1498
1462
  };
1499
1463
 
1500
1464
  /**
1501
- * 交互式拾取坐标(点击地图获取经纬度,参考 ht_3dview 选择坐标流程)
1502
- * 点击地图后回调返回坐标,自动取消监听
1465
+ * 浜や簰寮忔嬀鍙栧潗鏍囷紙鐐瑰嚮鍦板浘鑾峰彇缁忕含搴︼紝鍙傝€?ht_3dview 閫夋嫨鍧愭爣娴佺▼锛? * 鐐瑰嚮鍦板浘鍚庡洖璋冭繑鍥炲潗鏍囷紝鑷姩鍙栨秷鐩戝惉
1503
1466
  * @param {function} cb - (pos: {x,y,z}) => void
1504
- * @returns {function} 调用可取消拾取
1505
- */
1467
+ * @returns {function} 璋冪敤鍙彇娑堟嬀鍙? */
1506
1468
  pickPosition = (cb) => {
1507
1469
  const cancel = this.addMouseUp((pos) => {
1508
1470
  cancel()
@@ -1512,10 +1474,9 @@ export class GaeaApp {
1512
1474
  };
1513
1475
 
1514
1476
  /**
1515
- * 交互式拾取模型,返回模型信息
1477
+ * 浜や簰寮忔嬀鍙栨ā鍨嬶紝杩斿洖妯″瀷淇℃伅
1516
1478
  * @param {function} callback - (modelInfo) => void
1517
- * @returns {function} 调用可取消拾取
1518
- */
1479
+ * @returns {function} 璋冪敤鍙彇娑堟嬀鍙? */
1519
1480
  pickModel = (callback) => {
1520
1481
  const canvas = document.getElementById('canvas')
1521
1482
  if (!canvas) return () => {}
@@ -1537,8 +1498,7 @@ export class GaeaApp {
1537
1498
  };
1538
1499
 
1539
1500
  /**
1540
- * 获取所有可选模型列表(用于面板下拉选择,参考 ht_3dview gaeaData.gltfList)
1541
- * @returns {Array<{name: string, url: string, position?: object}>}
1501
+ * 鑾峰彇鎵€鏈夊彲閫夋ā鍨嬪垪琛紙鐢ㄤ簬闈㈡澘涓嬫媺閫夋嫨锛屽弬鑰?ht_3dview gaeaData.gltfList锛? * @returns {Array<{name: string, url: string, position?: object}>}
1542
1502
  */
1543
1503
  getGltfList = () => {
1544
1504
  return Object.values(this._gltfCfgMap).map(cfg => ({
@@ -1548,12 +1508,10 @@ export class GaeaApp {
1548
1508
  };
1549
1509
 
1550
1510
  /**
1551
- * 加载用户自定义模型(参考 ht_3dview addGltf)
1552
- * 新增模型到场景并记录到配置表
1511
+ * 鍔犺浇鐢ㄦ埛鑷畾涔夋ā鍨嬶紙鍙傝€?ht_3dview addGltf锛? * 鏂板妯″瀷鍒板満鏅苟璁板綍鍒伴厤缃〃
1553
1512
  * @param {object} cfg
1554
- * @param {string} cfg.name - 模型实例名(不能重复)
1555
- * @param {string} cfg.url - 模型 URL
1556
- * @param {object} cfg.position - { x: 纬度, y: 经度, z: 高程 }
1513
+ * @param {string} cfg.name - 妯″瀷瀹炰緥鍚嶏紙涓嶈兘閲嶅锛? * @param {string} cfg.url - 妯″瀷 URL
1514
+ * @param {object} cfg.position - { x: 绾害, y: 缁忓害, z: 楂樼▼ }
1557
1515
  * @param {number[]} cfg.rotate - [pitch, yaw, roll]
1558
1516
  * @param {number[]} cfg.size - [sx, sy, sz]
1559
1517
  * @param {boolean} [cfg.show=true]
@@ -1563,10 +1521,10 @@ export class GaeaApp {
1563
1521
  addGltf = async (cfg) => {
1564
1522
  const { name, url, position, rotate, size, show = true, enablePick = true } = cfg;
1565
1523
  if (!name || !url || !position || !rotate || !size) {
1566
- console.warn('[GaeaApp] addGltf: 缺少必要参数', cfg);
1524
+ console.warn('[GaeaApp] addGltf: 缂哄皯蹇呰鍙傛暟', cfg);
1567
1525
  return null;
1568
1526
  }
1569
- // 记录到配置表,供后续面板编辑
1527
+ // 璁板綍鍒伴厤缃〃锛屼緵鍚庣画闈㈡澘缂栬緫
1570
1528
  this._gltfCfgMap[name] = {
1571
1529
  name, url, position: { ...position }, rotate: [...rotate], size: [...size],
1572
1530
  show, enablePick, isUserAdd: true
@@ -1579,25 +1537,21 @@ export class GaeaApp {
1579
1537
  };
1580
1538
 
1581
1539
  /**
1582
- * 根据经纬度飞到指定位置
1583
- * @param {number} lat - 纬度
1584
- * @param {number} lng - 经度
1585
- * @param {number} [z=0] - 地面高程
1586
- * @param {number} [alt=500] - 相机高度
1587
- * @param {number} [pitch=0] - 俯仰角,默认 0(垂直俯视),负值向前倾斜
1588
- * @param {number} [yaw=0] - 偏航角
1589
- */
1540
+ * 鏍规嵁缁忕含搴﹂鍒版寚瀹氫綅缃? * @param {number} lat - 绾害
1541
+ * @param {number} lng - 缁忓害
1542
+ * @param {number} [z=0] - 鍦伴潰楂樼▼
1543
+ * @param {number} [alt=500] - 鐩告満楂樺害
1544
+ * @param {number} [pitch=0] - 淇话瑙掞紝榛樿 0锛堝瀭鐩翠刊瑙嗭級锛岃礋鍊煎悜鍓嶅€炬枩
1545
+ * @param {number} [yaw=0] - 鍋忚埅瑙? */
1590
1546
  flyToPosition = (lat, lng, z = 0, alt = 500, pitch = 0, yaw = 0) => {
1591
1547
  this.SetPosition(`${lat},${lng},${z},${alt},${pitch},${yaw}`)
1592
1548
  };
1593
1549
 
1594
- // ---- 沿线飞行 ----
1550
+ // ---- 娌跨嚎椋炶 ----
1595
1551
 
1596
1552
  /**
1597
- * 沿线飞行 - 相机沿路径自动飞行
1598
- * @param {Array} lineData - 路径点数组,每个点 {x: 纬度, y: 经度, z?: 高度}
1599
- * @param {Object} options - 飞行配置(height/step/duration/xrotation/lockEye/minZoom/maxZoom)
1600
- * @returns {Promise} 飞行完成后 resolve
1553
+ * 娌跨嚎椋炶 - 鐩告満娌胯矾寰勮嚜鍔ㄩ琛? * @param {Array} lineData - 璺緞鐐规暟缁勶紝姣忎釜鐐?{x: 绾害, y: 缁忓害, z?: 楂樺害}
1554
+ * @param {Object} options - 椋炶閰嶇疆锛坔eight/step/duration/xrotation/lockEye/minZoom/maxZoom锛? * @returns {Promise} 椋炶瀹屾垚鍚?resolve
1601
1555
  */
1602
1556
  flyAlongPath = async (lineData, options = {}) => {
1603
1557
  const opts = {
@@ -1612,8 +1566,8 @@ export class GaeaApp {
1612
1566
  };
1613
1567
 
1614
1568
  if (!lineData || lineData.length < 2) {
1615
- console.error('flyAlongPath: 至少需要2个路径点');
1616
- return Promise.reject(new Error('至少需要2个路径点'));
1569
+ console.error('flyAlongPath: 鑷冲皯闇€瑕?涓矾寰勭偣');
1570
+ return Promise.reject(new Error('鑷冲皯闇€瑕?涓矾寰勭偣'));
1617
1571
  }
1618
1572
 
1619
1573
  try {
@@ -1662,29 +1616,28 @@ export class GaeaApp {
1662
1616
 
1663
1617
  return new Promise((resolve) => {
1664
1618
  this._flyAnimationPlayer.PlayWithCallback('flyPathAnimation', Gaea.CallbackType.AnimatioFinished, () => {
1665
- console.log('沿线飞行动画播放完成');
1619
+ console.log('娌跨嚎椋炶鍔ㄧ敾鎾斁瀹屾垚');
1666
1620
  resolve();
1667
1621
  });
1668
1622
  });
1669
1623
  } catch (error) {
1670
- console.error('flyAlongPath 启动失败:', error);
1624
+ console.error('flyAlongPath 鍚姩澶辫触:', error);
1671
1625
  this._cleanupFlyResources();
1672
1626
  return Promise.reject(error);
1673
1627
  }
1674
1628
  };
1675
1629
 
1676
- /** 停止沿线飞行 */
1630
+ /** 鍋滄娌跨嚎椋炶 */
1677
1631
  stopFlyAlongPath = () => {
1678
1632
  try {
1679
- // Godot AnimationPlayer.Stop(reset:bool),参数是布尔而非动画名
1680
- if (this._flyAnimationPlayer) this._flyAnimationPlayer.Stop(false);
1633
+ // Godot AnimationPlayer.Stop(reset:bool)锛屽弬鏁版槸甯冨皵鑰岄潪鍔ㄧ敾鍚? if (this._flyAnimationPlayer) this._flyAnimationPlayer.Stop(false);
1681
1634
  } catch (error) {
1682
- console.error('停止飞行失败:', error);
1635
+ console.error('鍋滄椋炶澶辫触:', error);
1683
1636
  }
1684
1637
  this._cleanupFlyResources();
1685
1638
  };
1686
1639
 
1687
- /** 清理飞行相关资源 */
1640
+ /** 娓呯悊椋炶鐩稿叧璧勬簮 */
1688
1641
  _cleanupFlyResources = () => {
1689
1642
  try {
1690
1643
  if (this._flyAnimationPlayer) {
@@ -1699,11 +1652,11 @@ export class GaeaApp {
1699
1652
  Gaea.World.Instance.CameraController.LockedEntity = null;
1700
1653
  this._flyAnimation = null;
1701
1654
  } catch (error) {
1702
- console.error('清理飞行资源失败:', error);
1655
+ console.error('娓呯悊椋炶璧勬簮澶辫触:', error);
1703
1656
  }
1704
1657
  };
1705
1658
 
1706
- /** 相机复位到默认视角 */
1659
+ /** 鐩告満澶嶄綅鍒伴粯璁よ瑙?*/
1707
1660
  cameraReset = () => {
1708
1661
  this._cleanupFlyResources();
1709
1662
  const pos = this.config.defaultCameraPosition;
@@ -1711,14 +1664,13 @@ export class GaeaApp {
1711
1664
  };
1712
1665
 
1713
1666
  /**
1714
- * 添加屏幕图标(参考 ht_3dview 三种创建方式)
1715
- * @param {string} opts.method - 'textImage' | 'styled' | 'imageOnly'
1667
+ * 娣诲姞灞忓箷鍥炬爣锛堝弬鑰?ht_3dview 涓夌鍒涘缓鏂瑰紡锛? * @param {string} opts.method - 'textImage' | 'styled' | 'imageOnly'
1716
1668
  */
1717
1669
  addScreenIcon({ name, text, imgUrl, position, method = 'textImage', offset = [0, 0], visibleRange = [10, 50000], anchorType = 6, drawLine = false, onClick, type = null, category = null, divId: externalDivId, elementName, elementChildrenIndex } = {}) {
1718
1670
  const safeId = name.replace(/[^a-zA-Z0-9\u4e00-\u9fa5]/g, '_');
1719
1671
  const divId = externalDivId || 'gaea-icon-' + safeId;
1720
1672
 
1721
- // 如果是外部传入的 divId,直接使用已有的 DOM 元素
1673
+ // 濡傛灉鏄閮ㄤ紶鍏ョ殑 divId锛岀洿鎺ヤ娇鐢ㄥ凡鏈夌殑 DOM 鍏冪礌
1722
1674
  let container;
1723
1675
  if (externalDivId) {
1724
1676
  container = document.getElementById(externalDivId);
@@ -1768,8 +1720,7 @@ export class GaeaApp {
1768
1720
 
1769
1721
  } // end else (externalDivId)
1770
1722
 
1771
- // 打分类标记,用于按类别显隐
1772
- if (category) {
1723
+ // 鎵撳垎绫绘爣璁帮紝鐢ㄤ簬鎸夌被鍒樉闅? if (category) {
1773
1724
  container.classList.add('gaea-cat-' + category);
1774
1725
  }
1775
1726
 
@@ -1778,15 +1729,14 @@ export class GaeaApp {
1778
1729
  }
1779
1730
 
1780
1731
  container.style.position = 'absolute';
1781
- container.style.zIndex = '99';
1732
+ container.style.zIndex = '1';
1782
1733
  container.style.pointerEvents = 'auto';
1783
1734
  container.style.cursor = 'pointer';
1784
1735
 
1785
- // 在 DOM 上绑点击事件(Gaea ScreenGUIElement 的 OnHitElement 对 DOM 型图标不生效)
1786
- container.addEventListener('click', (e) => {
1736
+ // 鍦?DOM 涓婄粦鐐瑰嚮浜嬩欢锛圙aea ScreenGUIElement 鐨?OnHitElement 瀵?DOM 鍨嬪浘鏍囦笉鐢熸晥锛? container.addEventListener('click', (e) => {
1787
1737
  e.stopPropagation();
1788
1738
  e.preventDefault();
1789
- console.log('[GaeaApp] 图标点击:', name);
1739
+ console.log('[GaeaApp] 鍥炬爣鐐瑰嚮:', name);
1790
1740
  if (onClick) { onClick(name, { text, position }); }
1791
1741
  else if (position) { this.flyToNode({ position }); }
1792
1742
  });
@@ -1811,7 +1761,7 @@ export class GaeaApp {
1811
1761
  screen.EnablePick = true;
1812
1762
  if (visibleRange.length) screen.VisibleRange = new Gaea.Vector2(visibleRange[0], visibleRange[1]);
1813
1763
 
1814
- // 如果有 elementName,将图标挂到 GLTF 模型子节点上(位置由父节点决定)
1764
+ // 濡傛灉鏈?elementName锛屽皢鍥炬爣鎸傚埌 GLTF 妯″瀷瀛愯妭鐐逛笂锛堜綅缃敱鐖惰妭鐐瑰喅瀹氾級
1815
1765
  if (elementName && elementChildrenIndex !== undefined) {
1816
1766
  const el = this._gltfElements?.[elementName];
1817
1767
  console.log('[GaeaApp] addScreenIcon element:', elementName, 'el:', !!el, 'childrenIndex:', elementChildrenIndex);
@@ -1828,8 +1778,7 @@ export class GaeaApp {
1828
1778
  return screen;
1829
1779
  }
1830
1780
  }
1831
- // 子节点未找到,回退到绝对位置
1832
- console.warn('[GaeaApp] elementName/childIndex 未找到,使用 position 回退:', elementName, elementChildrenIndex);
1781
+ // 瀛愯妭鐐规湭鎵惧埌锛屽洖閫€鍒扮粷瀵逛綅缃? console.warn('[GaeaApp] elementName/childIndex 鏈壘鍒帮紝浣跨敤 position 鍥為€€:', elementName, elementChildrenIndex);
1833
1782
  }
1834
1783
 
1835
1784
  screen.GeographyPosition = new Gaea.Vector3(position.x, position.y, position.z || 0);
@@ -1840,7 +1789,7 @@ export class GaeaApp {
1840
1789
  return screen;
1841
1790
  }
1842
1791
 
1843
- /** 根据全局图标可见性状态(_markersVisible)应用单个图标显隐 */
1792
+ /** 鏍规嵁鍏ㄥ眬鍥炬爣鍙鎬х姸鎬侊紙_markersVisible锛夊簲鐢ㄥ崟涓浘鏍囨樉闅?*/
1844
1793
  _applyMarkerVisibility(screenItem) {
1845
1794
  if (this._markersVisible) return;
1846
1795
  screenItem.element.ForceSetVisible(false);
@@ -1849,30 +1798,28 @@ export class GaeaApp {
1849
1798
  if (el) el.style.display = 'none';
1850
1799
  }
1851
1800
 
1852
- /** 记录当前视角,返回 URI 字符串 */
1801
+ /** 璁板綍褰撳墠瑙嗚锛岃繑鍥?URI 瀛楃涓?*/
1853
1802
  favorite() {
1854
1803
  return Gaea.GaeaCamera.ConvertBy(Gaea.World.Instance.DefaultCamera).Favorite();
1855
1804
  }
1856
1805
 
1857
- /** 定位到已记录的视角 URI */
1806
+ /** 瀹氫綅鍒板凡璁板綍鐨勮瑙?URI */
1858
1807
  favoritePosition(uri) {
1859
1808
  Gaea.World.Instance.DefaultCamera.GotoFavorite(uri);
1860
1809
  }
1861
1810
 
1862
1811
  /**
1863
- * 添加点位标记到 3D 地图
1812
+ * 娣诲姞鐐逛綅鏍囪鍒?3D 鍦板浘
1864
1813
  * @param {Object} opts
1865
- * @param {string} opts.name - 唯一标识名
1866
- * @param {string} [opts.text] - 显示文本
1867
- * @param {number} opts.lat - 纬度
1868
- * @param {number} opts.lng - 经度
1869
- * @param {number} [opts.z=0] - 高度
1870
- * @param {string} [opts.imgUrl] - 图标地址
1871
- * @param {'textImage'|'styled'|'imageOnly'} [opts.method='textImage'] - 显示样式
1872
- * @param {Array<number>} [opts.offset=[0,0]] - 屏幕偏移
1873
- * @param {Function} [opts.onClick] - 点击回调
1874
- * @param {string} [opts.category] - 分类标识(用于图层树显隐控制)
1875
- * @returns {Gaea.ScreenGUIElement} screen 元素
1814
+ * @param {string} opts.name - 鍞竴鏍囪瘑鍚? * @param {string} [opts.text] - 鏄剧ず鏂囨湰
1815
+ * @param {number} opts.lat - 绾害
1816
+ * @param {number} opts.lng - 缁忓害
1817
+ * @param {number} [opts.z=0] - 楂樺害
1818
+ * @param {string} [opts.imgUrl] - 鍥炬爣鍦板潃
1819
+ * @param {'textImage'|'styled'|'imageOnly'} [opts.method='textImage'] - 鏄剧ず鏍峰紡
1820
+ * @param {Array<number>} [opts.offset=[0,0]] - 灞忓箷鍋忕Щ
1821
+ * @param {Function} [opts.onClick] - 鐐瑰嚮鍥炶皟
1822
+ * @param {string} [opts.category] - 鍒嗙被鏍囪瘑锛堢敤浜庡浘灞傛爲鏄鹃殣鎺у埗锛? * @returns {Gaea.ScreenGUIElement} screen 鍏冪礌
1876
1823
  */
1877
1824
  addMarker({ name, text, lat, lng, z = 0, imgUrl, method = 'textImage', offset = [0, 0], onClick, category } = {}) {
1878
1825
  return this.addScreenIcon({
@@ -1883,7 +1830,7 @@ export class GaeaApp {
1883
1830
  method,
1884
1831
  offset,
1885
1832
  onClick: (clickedName, data) => {
1886
- // 派发全局自定义事件,父组件可通过 document.addEventListener 监听
1833
+ // 娲惧彂鍏ㄥ眬鑷畾涔変簨浠讹紝鐖剁粍浠跺彲閫氳繃 document.addEventListener 鐩戝惉
1887
1834
  document.dispatchEvent(new CustomEvent('gaea-marker-click', {
1888
1835
  detail: { name: clickedName, text: data.text, position: data.position, category },
1889
1836
  bubbles: true
@@ -1895,7 +1842,7 @@ export class GaeaApp {
1895
1842
  })
1896
1843
  }
1897
1844
 
1898
- // ---- 引擎动画方法 ----
1845
+ // ---- 寮曟搸鍔ㄧ敾鏂规硶 ----
1899
1846
 
1900
1847
  hiddenScreenWithClass(className) {
1901
1848
  const els = document.querySelectorAll(className);
@@ -1936,15 +1883,15 @@ export class GaeaApp {
1936
1883
  if (details.length) {
1937
1884
  details.forEach(item => { html += `<div class="daba-tooltip-item">${item}</div>`; });
1938
1885
  } else {
1939
- html = '<div class="daba-tooltip-item">暂无详情</div>';
1886
+ html = '<div class="daba-tooltip-item">鏆傛棤璇︽儏</div>';
1940
1887
  }
1941
1888
  return `<div class="daba-tooltip-title">${name} - ${label}</div>${html}`;
1942
1889
  }
1943
1890
 
1944
- /** 断面数据点击处理 */
1891
+ /** 鏂潰鏁版嵁鐐瑰嚮澶勭悊 */
1945
1892
  _onSecDataClick(name, data) {
1946
1893
  const sectionModel = this._gltfElements?.[name];
1947
- const tourModelName = name + '游览模型';
1894
+ const tourModelName = name + '娓歌妯″瀷';
1948
1895
  const tourModel = this._gltfElements?.[tourModelName];
1949
1896
 
1950
1897
  document.dispatchEvent(new CustomEvent('gaea-icon-click', {
@@ -1957,8 +1904,7 @@ export class GaeaApp {
1957
1904
  return;
1958
1905
  }
1959
1906
 
1960
- // 首次点击断面时注入标签样式
1961
- if (!document.getElementById('gaea-sec-styles')) {
1907
+ // 棣栨鐐瑰嚮鏂潰鏃舵敞鍏ユ爣绛炬牱寮? if (!document.getElementById('gaea-sec-styles')) {
1962
1908
  const style = document.createElement('style');
1963
1909
  style.id = 'gaea-sec-styles';
1964
1910
  style.textContent = `
@@ -1986,20 +1932,17 @@ export class GaeaApp {
1986
1932
  this.updateElementPosition({ element: tourModel, position: gltfCfg.position, rotate: gltfCfg.rotate, size: gltfCfg.size });
1987
1933
  }
1988
1934
 
1989
- // this.RemoveVts({ vtsName: '沿浦海塘工程范围线' });
1990
- // 通知隐藏图层树
1991
- document.dispatchEvent(new CustomEvent('gaea-hide-layertree', { bubbles: true }));
1935
+ // this.RemoveVts({ vtsName: '娌挎郸娴峰宸ョ▼鑼冨洿绾? });
1936
+ // 閫氱煡闅愯棌鍥惧眰鏍? document.dispatchEvent(new CustomEvent('gaea-hide-layertree', { bubbles: true }));
1992
1937
  this.FlyOver(() => {
1993
1938
  this.hiddenScreenWithClass('.waterLevel');
1994
1939
  this.hiddenScreenWithClass('.damScreen');
1995
1940
 
1996
1941
  this.gltfPlayer(sectionModel, { x: 0, y: 44, z: 0 }, 1).then(() => {
1997
- // 记录已升起的断面模型,供重置时缩回
1998
- this._raisedSection = sectionModel;
1942
+ // 璁板綍宸插崌璧风殑鏂潰妯″瀷锛屼緵閲嶇疆鏃剁缉鍥? this._raisedSection = sectionModel;
1999
1943
  if (tourModel) {
2000
1944
  this.lockedModesSwitch(true, tourModel, [-10, 50, 0], [50, 50]);
2001
- // 锁定模型后再通知显示断面滚动条
2002
- document.dispatchEvent(new CustomEvent('gaea-sec-locked', { detail: { name }, bubbles: true }));
1945
+ // 閿佸畾妯″瀷鍚庡啀閫氱煡鏄剧ず鏂潰婊氬姩鏉? document.dispatchEvent(new CustomEvent('gaea-sec-locked', { detail: { name }, bubbles: true }));
2003
1946
  }
2004
1947
 
2005
1948
  if (!this._secIsClickArr.includes(name)) {
@@ -2017,9 +1960,9 @@ export class GaeaApp {
2017
1960
  const entryLabel = typeof value === 'object' && value.label ? value.label : String(value);
2018
1961
  let cls, imgUrl, offset;
2019
1962
  if (hasNumber(entryLabel)) {
2020
- cls = 'waterLevel'; offset = [0, -54]; imgUrl = '/image/labelImg/水位.png';
1963
+ cls = 'waterLevel'; offset = [0, -54]; imgUrl = '/image/labelImg/姘翠綅.png';
2021
1964
  } else {
2022
- cls = 'damScreen'; offset = [0, -19]; imgUrl = '/image/labelImg/左边.png';
1965
+ cls = 'damScreen'; offset = [0, -19]; imgUrl = '/image/labelImg/宸﹁竟.png';
2023
1966
  }
2024
1967
  const divid = this._createSecLabel(entryLabel, cls, imgUrl, {
2025
1968
  onMouseEnter: (e) => {
@@ -2052,12 +1995,12 @@ export class GaeaApp {
2052
1995
  this.hiddenScreenWithClass('.gaea-iconscreen');
2053
1996
  this.hiddenScreenWithClass('.gaea-locationLineStyle');
2054
1997
  this.hiddenScreenWithClass('.gaea-iconGif');
2055
- }).catch(err => console.warn('[GaeaApp] 断面动画失败:', err.message));
1998
+ }).catch(err => console.warn('[GaeaApp] 鏂潰鍔ㄧ敾澶辫触:', err.message));
2056
1999
  });
2057
2000
  this.SetPosition(data.favorite || `${data.position.x},${data.position.y},${data.position.z},${data.position.z + 500},0,0`);
2058
2001
  }
2059
2002
 
2060
- /** 飞行结束回调 */
2003
+ /** 椋炶缁撴潫鍥炶皟 */
2061
2004
  FlyOver(callback) {
2062
2005
  const camera = Gaea.World.Instance.DefaultCamera;
2063
2006
  camera.OnFlyOverCallBack(() => {
@@ -2065,15 +2008,15 @@ export class GaeaApp {
2065
2008
  });
2066
2009
  }
2067
2010
 
2068
- /** GLTF 模型平移动画 */
2011
+ /** GLTF 妯″瀷骞崇Щ鍔ㄧ敾 */
2069
2012
  gltfPlayer = (element, targetPos, time = 5) => {
2070
2013
  return new Promise((resolve, reject) => {
2071
2014
  if (!element || !element.TranslateObjectLocal) {
2072
- reject(new Error('无效的元素对象:缺少 TranslateObjectLocal 方法'));
2015
+ reject(new Error('鏃犳晥鐨勫厓绱犲璞★細缂哄皯 TranslateObjectLocal 鏂规硶'));
2073
2016
  return;
2074
2017
  }
2075
2018
  if (!targetPos || typeof targetPos.x !== 'number' || typeof targetPos.y !== 'number' || typeof targetPos.z !== 'number') {
2076
- reject(new Error('无效的目标位置:必须包含数字类型的 x/y/z 属性'));
2019
+ reject(new Error('鏃犳晥鐨勭洰鏍囦綅缃細蹇呴』鍖呭惈鏁板瓧绫诲瀷鐨?x/y/z 灞炴€?));
2077
2020
  return;
2078
2021
  }
2079
2022
  const frameRate = 60;
@@ -2110,12 +2053,12 @@ export class GaeaApp {
2110
2053
  };
2111
2054
  moveStep();
2112
2055
  } catch (error) {
2113
- reject(new Error(`动画执行出错:${error.message}`));
2056
+ reject(new Error(`鍔ㄧ敾鎵ц鍑洪敊锛?{error.message}`));
2114
2057
  }
2115
2058
  });
2116
2059
  };
2117
2060
 
2118
- /** 锁定/解锁相机视角到模型 */
2061
+ /** 閿佸畾/瑙i攣鐩告満瑙嗚鍒版ā鍨?*/
2119
2062
  lockedModesSwitch = (mode, element, Offset3D = [0, 1.1, 0], MinMaxZoom3D = [1.1, 1.1], LockEye = false) => {
2120
2063
  if (mode) {
2121
2064
  const ev = new Gaea.EntityView();
@@ -2129,8 +2072,7 @@ export class GaeaApp {
2129
2072
  return ev;
2130
2073
  } else {
2131
2074
  Gaea.World.Instance.CameraController.LockedEntity = null;
2132
- // 解锁时恢复非断面图标的自动可见
2133
- this._screenIconList.forEach(item => {
2075
+ // 瑙i攣鏃舵仮澶嶉潪鏂潰鍥炬爣鐨勮嚜鍔ㄥ彲瑙? this._screenIconList.forEach(item => {
2134
2076
  if (!item.type && this._markersVisible) {
2135
2077
  item.element.UseAutoVisible();
2136
2078
  item.element.EnablePick = true;
@@ -2139,7 +2081,7 @@ export class GaeaApp {
2139
2081
  }
2140
2082
  };
2141
2083
 
2142
- /** 修改模型位置/旋转 */
2084
+ /** 淇敼妯″瀷浣嶇疆/鏃嬭浆 */
2143
2085
  updateElementPosition = ({ element, position, rotate, size }) => {
2144
2086
  element.GeographyPosition = new Gaea.Vector3(position.x, position.y, position.z);
2145
2087
  if (rotate?.length > 0) {
@@ -2147,14 +2089,14 @@ export class GaeaApp {
2147
2089
  }
2148
2090
  };
2149
2091
 
2150
- /** 移除 VTS 矢量图层 */
2092
+ /** 绉婚櫎 VTS 鐭㈤噺鍥惧眰 */
2151
2093
  RemoveVts = ({ vtsName }) => {
2152
2094
  Gaea.World.Instance.DefaultVectorPyramidTileSet.RemoveImageStore(
2153
2095
  Gaea.WMTSVectorStore.ConvertBy(Gaea.World.Instance.DefaultVectorPyramidTileSet.GetImageStore(vtsName))
2154
2096
  );
2155
2097
  };
2156
2098
 
2157
- /** GLTF 轨迹动画播放(用于断面游览) */
2099
+ /** GLTF 杞ㄨ抗鍔ㄧ敾鎾斁锛堢敤浜庢柇闈㈡父瑙堬級 */
2158
2100
  gtlfAnimationPlayer = (trackList, animationConfig, element) => {
2159
2101
  element.GeographyPosition = new Gaea.Vector3(trackList[0].x, trackList[0].y, trackList[0].z);
2160
2102
  const { animationName, animationType, animationPlaySpeed } = animationConfig;
@@ -2181,7 +2123,7 @@ export class GaeaApp {
2181
2123
  return animationPlayer;
2182
2124
  };
2183
2125
 
2184
- /** 环绕飞行 */
2126
+ /** 鐜粫椋炶 */
2185
2127
  FlyAroundPoint = (element, targetAngle, time, callbacks = {}) => {
2186
2128
  const { onStart = () => {}, onUpdate = () => {}, onComplete = () => {} } = callbacks;
2187
2129
  if (!targetAngle || !element) { onComplete(null); return; }
@@ -2203,7 +2145,7 @@ export class GaeaApp {
2203
2145
  tween.start();
2204
2146
  };
2205
2147
 
2206
- /** 启动 TWEEN 更新循环(首次调用时启动) */
2148
+ /** 鍚姩 TWEEN 鏇存柊寰幆锛堥娆¤皟鐢ㄦ椂鍚姩锛?*/
2207
2149
  _startTweenLoop() {
2208
2150
  if (this._tweenLoopStarted) return;
2209
2151
  this._tweenLoopStarted = true;
@@ -2214,7 +2156,7 @@ export class GaeaApp {
2214
2156
  requestAnimationFrame(animate);
2215
2157
  }
2216
2158
 
2217
- /** 提取索引区间的 pos 数组,起始>目标时反序 */
2159
+ /** 鎻愬彇绱㈠紩鍖洪棿鐨?pos 鏁扮粍锛岃捣濮?鐩爣鏃跺弽搴?*/
2218
2160
  getPosArrayBetweenIndexes(list, currentIdx, targetIdx) {
2219
2161
  if (!Array.isArray(list) || currentIdx < 0 || targetIdx < 0 ||
2220
2162
  currentIdx >= list.length || targetIdx >= list.length) {
@@ -2228,22 +2170,20 @@ export class GaeaApp {
2228
2170
  return result;
2229
2171
  }
2230
2172
 
2231
- /** 室内游览初始化:隐藏图标 + 锁定游览模型 */
2173
+ /** 瀹ゅ唴娓歌鍒濆鍖栵細闅愯棌鍥炬爣 + 閿佸畾娓歌妯″瀷 */
2232
2174
  initModelTour(modelName, direction = [-0.5, 0, 0]) {
2233
- // 隐藏所有屏幕图标
2234
- this._screenIconList.forEach(item => {
2175
+ // 闅愯棌鎵€鏈夊睆骞曞浘鏍? this._screenIconList.forEach(item => {
2235
2176
  item.element.ForceSetVisible(false);
2236
2177
  item.element.EnablePick = false;
2237
2178
  });
2238
2179
  this.hiddenScreenWithClass('.gaea-locationLineStyle');
2239
2180
  this.hiddenScreenWithClass('.gaea-iconscreen');
2240
2181
  this.hiddenScreenWithClass('.gaea-iconGif');
2241
- // 隐藏图层树
2242
- document.dispatchEvent(new CustomEvent('gaea-hide-layertree', { bubbles: true }));
2182
+ // 闅愯棌鍥惧眰鏍? document.dispatchEvent(new CustomEvent('gaea-hide-layertree', { bubbles: true }));
2243
2183
 
2244
- const tourModel = this._gltfElements?.[`${modelName}游览模型`];
2184
+ const tourModel = this._gltfElements?.[`${modelName}娓歌妯″瀷`];
2245
2185
  if (!tourModel) {
2246
- console.warn('[GaeaApp] 游览模型未找到:', modelName);
2186
+ console.warn('[GaeaApp] 娓歌妯″瀷鏈壘鍒?', modelName);
2247
2187
  return null;
2248
2188
  }
2249
2189
  this._currentTourModel = tourModel;
@@ -2252,7 +2192,7 @@ export class GaeaApp {
2252
2192
  return tourModel;
2253
2193
  }
2254
2194
 
2255
- /** 室内游览路径节点点击:沿路径移动 + 转头 */
2195
+ /** 瀹ゅ唴娓歌璺緞鑺傜偣鐐瑰嚮锛氭部璺緞绉诲姩 + 杞ご */
2256
2196
  tourNodeClick(positionList, index) {
2257
2197
  const tourModel = this._currentTourModel;
2258
2198
  if (!tourModel) return;
@@ -2261,7 +2201,7 @@ export class GaeaApp {
2261
2201
  const currentPosList = this.getPosArrayBetweenIndexes(positionList, currentIdx, index);
2262
2202
  const time = 2 * (currentPosList.length - 1);
2263
2203
  this.gtlfAnimationPlayer(currentPosList, {
2264
- animationName: `动画${index}`, animationType: 'time', animationPlaySpeed: time, animationLoop: false,
2204
+ animationName: `鍔ㄧ敾${index}`, animationType: 'time', animationPlaySpeed: time, animationLoop: false,
2265
2205
  }, tourModel);
2266
2206
  const status = currentIdx > index ? 'out' : 'in';
2267
2207
  this._currentTourIndexPos = index;
@@ -2282,7 +2222,7 @@ export class GaeaApp {
2282
2222
  }, time * 1000);
2283
2223
  }
2284
2224
 
2285
- /** 通过 URL 加载资源 */
2225
+ /** 閫氳繃 URL 鍔犺浇璧勬簮 */
2286
2226
  LoadResourceFromUrl = (url, name) => {
2287
2227
  return new Promise((resolve, reject) => {
2288
2228
  Gaea.GaeaResourceLoader.Instance.LoadResourceFromUrl1(url, name, (code, msg) => {
@@ -2292,22 +2232,20 @@ export class GaeaApp {
2292
2232
  });
2293
2233
  };
2294
2234
 
2295
- /** 添加单个点图标 */
2235
+ /** 娣诲姞鍗曚釜鐐瑰浘鏍?*/
2296
2236
  addPointIcon = async (options = {}) => {
2297
2237
  const { lat, lng, alt = 0, iconSize = 500, enablePick = true } = options;
2298
2238
  if (lat == null || lng == null) {
2299
- console.error('addPointIcon: lat 和 lng 不能为空');
2239
+ console.error('addPointIcon: lat 鍜?lng 涓嶈兘涓虹┖');
2300
2240
  return null;
2301
2241
  }
2302
- // 资源名带版本号:npm 包早期附带的 1111.res 不完整,会被引擎按名缓存进持久化文件系统,
2303
- // 换新名可强制重新下载注册,避免命中旧的无效缓存
2304
- const resName = 'pointIconV3.res';
2242
+ // 璧勬簮鍚嶅甫鐗堟湰鍙凤細npm 鍖呮棭鏈熼檮甯︾殑 1111.res 涓嶅畬鏁达紝浼氳寮曟搸鎸夊悕缂撳瓨杩涙寔涔呭寲鏂囦欢绯荤粺锛? // 鎹㈡柊鍚嶅彲寮哄埗閲嶆柊涓嬭浇娉ㄥ唽锛岄伩鍏嶅懡涓棫鐨勬棤鏁堢紦瀛? const resName = 'pointIconV3.res';
2305
2243
  if (!this._pointIconLoaded) {
2306
2244
  const resUrl = `${this.config.serveLocal}/1111.res?v=3`;
2307
2245
  try {
2308
2246
  await this.LoadResourceFromUrl(resUrl, resName);
2309
2247
  } catch (e) {
2310
- console.error('addPointIcon: 加载 .res 图标文件失败');
2248
+ console.error('addPointIcon: 鍔犺浇 .res 鍥炬爣鏂囦欢澶辫触');
2311
2249
  return null;
2312
2250
  }
2313
2251
  this._pointIconLoaded = true;
@@ -2331,7 +2269,7 @@ export class GaeaApp {
2331
2269
  return element;
2332
2270
  };
2333
2271
 
2334
- /** 清除所有点图标 */
2272
+ /** 娓呴櫎鎵€鏈夌偣鍥炬爣 */
2335
2273
  clearPointIcons = () => {
2336
2274
  if (this._pointIconElements && this._pointIconElements.length > 0) {
2337
2275
  this._pointIconElements.forEach
@@ -2341,17 +2279,17 @@ export class GaeaApp {
2341
2279
  this.clearTyphoonRoute();
2342
2280
  };
2343
2281
 
2344
- /** 加载台风路线:创建图标并沿路径运动(点位数组 [{lat,lng,alt}]) */
2282
+ /** 鍔犺浇鍙伴璺嚎锛氬垱寤哄浘鏍囧苟娌胯矾寰勮繍鍔紙鐐逛綅鏁扮粍 [{lat,lng,alt}]锛?*/
2345
2283
  addTyphoonRoute = async (pointList = [], options = {}) => {
2346
2284
  const { animationPlaySpeed = 20, animationLoop = true } = options;
2347
2285
  this.clearTyphoonRoute();
2348
2286
  if (!pointList || pointList.length < 2) {
2349
- console.warn('addTyphoonRoute: 至少需要2个点位');
2287
+ console.warn('addTyphoonRoute: 鑷冲皯闇€瑕?涓偣浣?);
2350
2288
  return;
2351
2289
  }
2352
2290
  const element = await this.addPointIcon({ lat: pointList[0].lat, lng: pointList[0].lng, alt: pointList[0].alt || 0 });
2353
2291
  if (!element) {
2354
- console.error('addTyphoonRoute: 创建图标失败');
2292
+ console.error('addTyphoonRoute: 鍒涘缓鍥炬爣澶辫触');
2355
2293
  return;
2356
2294
  }
2357
2295
  if (this._pointIconElements) {
@@ -2401,7 +2339,7 @@ export class GaeaApp {
2401
2339
  return { element };
2402
2340
  };
2403
2341
 
2404
- /** 清除台风路线 */
2342
+ /** 娓呴櫎鍙伴璺嚎 */
2405
2343
  clearTyphoonRoute = () => {
2406
2344
  this._typhoonCancelled = true;
2407
2345
  if (this._typhoonTimer) { clearTimeout(this._typhoonTimer); this._typhoonTimer = null; }
@@ -2411,44 +2349,42 @@ export class GaeaApp {
2411
2349
  }
2412
2350
  };
2413
2351
 
2414
- /** 显示所有屏幕标记 */
2352
+ /** 鏄剧ず鎵€鏈夊睆骞曟爣璁?*/
2415
2353
  showAllMarkers = () => {
2416
2354
  this._markersVisible = true;
2417
2355
  this._screenIconList.forEach(item => {
2418
- // 跳过被隐藏分类的标记
2356
+ // 璺宠繃琚殣钘忓垎绫荤殑鏍囪
2419
2357
  if (this._hiddenCategories.has(item.category)) return
2420
2358
  item.element.UseAutoVisible()
2421
2359
  item.element.EnablePick = true
2422
- // 同步显示 DOM 元素
2360
+ // 鍚屾鏄剧ず DOM 鍏冪礌
2423
2361
  const el = document.getElementById(item.element.DivID)
2424
2362
  if (el) el.style.display = ''
2425
2363
  })
2426
2364
  };
2427
2365
 
2428
- /** 隐藏所有屏幕标记 */
2366
+ /** 闅愯棌鎵€鏈夊睆骞曟爣璁?*/
2429
2367
  hideAllMarkers = () => {
2430
2368
  this._markersVisible = false;
2431
2369
  this._screenIconList.forEach(item => {
2432
2370
  item.element.ForceSetVisible(false)
2433
2371
  item.element.EnablePick = false
2434
- // 同步隐藏 DOM 元素
2372
+ // 鍚屾闅愯棌 DOM 鍏冪礌
2435
2373
  const el = document.getElementById(item.element.DivID)
2436
2374
  if (el) el.style.display = 'none'
2437
2375
  })
2438
2376
  };
2439
2377
 
2440
- // ---- 水面加载 ----
2378
+ // ---- 姘撮潰鍔犺浇 ----
2441
2379
 
2442
2380
  /**
2443
- * 加载水面
2381
+ * 鍔犺浇姘撮潰
2444
2382
  * @param {Object} opts
2445
- * @param {string} opts.gltfUrl - GLTF 模型路径
2446
- * @param {Object} opts.Position - { x: 纬度, y: 经度, z: 高程 }
2447
- * @param {Array<number>} opts.rotate - [tilt, heading, bank] 旋转角度
2448
- * @param {Array<number>} opts.scale - [sx, sy, sz] 缩放
2449
- * @param {Array<number>} [opts.colorDeep=[0,157,187]] - 深水区颜色 [r, g, b](0-255)
2450
- * @param {number} [opts.flowSpeed=0.1] - 流速
2451
- */
2383
+ * @param {string} opts.gltfUrl - GLTF 妯″瀷璺緞
2384
+ * @param {Object} opts.Position - { x: 绾害, y: 缁忓害, z: 楂樼▼ }
2385
+ * @param {Array<number>} opts.rotate - [tilt, heading, bank] 鏃嬭浆瑙掑害
2386
+ * @param {Array<number>} opts.scale - [sx, sy, sz] 缂╂斁
2387
+ * @param {Array<number>} [opts.colorDeep=[0,157,187]] - 娣辨按鍖洪鑹?[r, g, b]锛?-255锛? * @param {number} [opts.flowSpeed=0.1] - 娴侀€? */
2452
2388
  addWaterHandle = async ({
2453
2389
  gltfUrl, Position, rotate, scale,
2454
2390
  colorDeep = [0, 157, 187],
@@ -2478,26 +2414,22 @@ export class GaeaApp {
2478
2414
  Gaea.World.Instance.SetMtlColor(material, 'color_shallow', new Gaea.Color(0 / 255, 157 / 255, 187 / 255, 1))
2479
2415
  Gaea.World.Instance.SetMtlColor(material, 'color_deep', new Gaea.Color(colorDeep[0] / 255, colorDeep[1] / 255, colorDeep[2] / 255, 1))
2480
2416
  Gaea.World.Instance.SetMtlFloat(material, 'transparency_clarity', 0)
2481
- Gaea.World.Instance.SetMtlFloat(material, "transparency_refraction", 0); // 折射度
2482
- Gaea.World.Instance.SetMtlFloat(material, "foam_amount", 0.8); // 气泡大小
2417
+ Gaea.World.Instance.SetMtlFloat(material, "transparency_refraction", 0); // 鎶樺皠搴? Gaea.World.Instance.SetMtlFloat(material, "foam_amount", 0.8); // 姘旀场澶у皬
2483
2418
  })
2484
2419
 
2485
2420
  Gaea.World.Instance.RenderableObjectList.AddLast(element)
2486
2421
  return element
2487
2422
  };
2488
2423
 
2489
- // ---- 开门动画 ----
2424
+ // ---- 寮€闂ㄥ姩鐢?----
2490
2425
 
2491
2426
  /**
2492
- * 模型缓动动画(缩放/位移/旋转)
2493
- * @param {Object} element - GLTF 元素
2494
- * @param {Object} Scale - 目标缩放 { x, y, z }
2495
- * @param {Object} Position - 目标位置 { x, y, z }
2496
- * @param {Object} translation - 模型相对位移 { x, y, z }
2497
- * @param {number} time - 动画时间(ms)
2498
- * @param {Object} Door - 门旋转角度 { x, y, z }
2499
- * @param {number} floor - 门在模型树中的层级索引
2500
- */
2427
+ * 妯″瀷缂撳姩鍔ㄧ敾锛堢缉鏀?浣嶇Щ/鏃嬭浆锛? * @param {Object} element - GLTF 鍏冪礌
2428
+ * @param {Object} Scale - 鐩爣缂╂斁 { x, y, z }
2429
+ * @param {Object} Position - 鐩爣浣嶇疆 { x, y, z }
2430
+ * @param {Object} translation - 妯″瀷鐩稿浣嶇Щ { x, y, z }
2431
+ * @param {number} time - 鍔ㄧ敾鏃堕棿锛坢s锛? * @param {Object} Door - 闂ㄦ棆杞搴?{ x, y, z }
2432
+ * @param {number} floor - 闂ㄥ湪妯″瀷鏍戜腑鐨勫眰绾х储寮? */
2501
2433
  tweentest = (element, Scale = {}, Position = {}, translation = {}, time, Door = {}, floor = 0) => {
2502
2434
  const { Tween, Easing } = window.TWEEN
2503
2435
 
@@ -2557,15 +2489,14 @@ export class GaeaApp {
2557
2489
  }
2558
2490
  };
2559
2491
 
2560
- // ---- 模型内置动画 ----
2492
+ // ---- 妯″瀷鍐呯疆鍔ㄧ敾 ----
2561
2493
 
2562
2494
  /**
2563
- * 执行模型内置动画(如开闸/关闸动画)
2564
- * @param {Object} opts
2565
- * @param {string} opts.animationPath - 动画路径,如 '沿浦水闸/AnimationPlayer'
2566
- * @param {string} opts.animationName - 动画名称,如 '开闸'
2567
- * @param {number} [opts.speed=1.0] - 动画速度
2568
- * @param {boolean} [opts.isReversePlay=false] - 是否反向播放
2495
+ * 鎵ц妯″瀷鍐呯疆鍔ㄧ敾锛堝寮€闂?鍏抽椄鍔ㄧ敾锛? * @param {Object} opts
2496
+ * @param {string} opts.animationPath - 鍔ㄧ敾璺緞锛屽 '娌挎郸姘撮椄/AnimationPlayer'
2497
+ * @param {string} opts.animationName - 鍔ㄧ敾鍚嶇О锛屽 '寮€闂?
2498
+ * @param {number} [opts.speed=1.0] - 鍔ㄧ敾閫熷害
2499
+ * @param {boolean} [opts.isReversePlay=false] - 鏄惁鍙嶅悜鎾斁
2569
2500
  */
2570
2501
  executeModelAnimation = ({ animationPath, animationName, speed = 1.0, isReversePlay = false }) => {
2571
2502
  const node = Gaea.World.Instance.GetNode(animationPath)