@yangyongtao/gaea 1.1.27 → 1.1.29
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.
- package/CHANGELOG.md +10 -0
- package/package.json +1 -1
- package/src/GaeaMethods.js +33 -17
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.1.29] - 2026-09-04
|
|
4
|
+
|
|
5
|
+
### Fixed
|
|
6
|
+
- 2D/3D 切换严格隐藏 3D 图标:新增 `_markersVisible` 全局状态,`showAllMarkers` / `hideAllMarkers` 同步更新;`addScreenIcon` 新增图标按当前状态显隐;`setCategoryVisible` 显示分类、复位按钮、`lockedModesSwitch` 解锁恢复图标时均叠加全局可见性判断,杜绝 2D 模式下图标残留
|
|
7
|
+
|
|
8
|
+
## [1.1.28] - 2026-09-01
|
|
9
|
+
|
|
10
|
+
### Changed
|
|
11
|
+
- 海塘图标按 `haitangyizhangtu` 规则改为等级图标:`_initScreenIcons` 优先使用每条海塘自身的 `imgUrl`(`child.imgUrl || cfg.img`),默认 10 条海塘分别配置 `海塘-{level}级.png`(沿浦/霞关/下在=3级、大渔=2级、三茆/信智/雾城/渔岙/流岐岙=4级、木林=5级)
|
|
12
|
+
|
|
3
13
|
## [1.1.27] - 2026-09-01
|
|
4
14
|
|
|
5
15
|
### Added
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yangyongtao/gaea",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.29",
|
|
4
4
|
"description": "Gaea 3D visualization component library - Vue 3 components based on Godot WASM engine. Includes WMTS layer loading, camera view control, Vite plugin auto-injection, etc.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.cjs",
|
package/src/GaeaMethods.js
CHANGED
|
@@ -171,16 +171,16 @@ const defaultConfig = {
|
|
|
171
171
|
/** 图层树分类数据(默认数据,接口数据会合并进来) */
|
|
172
172
|
layerCategories: [
|
|
173
173
|
{ key: 'seawall', text: '海塘', visible: true, children: [
|
|
174
|
-
{ text: '沿浦海塘', position: { x: 27.220705, y: 120.457998, z: 20 } },
|
|
175
|
-
{ text: '霞关海塘', position: { x: 27.171059, y: 120.467901, z: 20 } },
|
|
176
|
-
{ text: '三茆海塘', position: { x: 27.193284, y: 120.464411, z: 20 } },
|
|
177
|
-
{ text: '大渔海塘', position: { x: 27.39027, y: 120.599554, z: 20 } },
|
|
178
|
-
{ text: '信智海塘', position: { x: 27.300806, y: 120.544077, z: 20 } },
|
|
179
|
-
{ text: '下在海塘', position: { x: 27.215789, y: 120.445849, z: 10 } },
|
|
180
|
-
{ text: '木林海塘', position: { x: 27.193183, y: 120.424486, z: 20 } },
|
|
181
|
-
{ text: '雾城海塘', position: { x: 27.27682, y: 120.518917, z: 20 } },
|
|
182
|
-
{ text: '渔岙海塘', position: { x: 27.403744, y: 120.557879, z: 20 } },
|
|
183
|
-
{ text: '流岐岙海塘', position: { x: 27.318176, y: 120.542761, z: 20 } },
|
|
174
|
+
{ text: '沿浦海塘', level: '3', imgUrl: '/image/screenIcon/海塘-3级.png', position: { x: 27.220705, y: 120.457998, z: 20 } },
|
|
175
|
+
{ text: '霞关海塘', level: '3', imgUrl: '/image/screenIcon/海塘-3级.png', position: { x: 27.171059, y: 120.467901, z: 20 } },
|
|
176
|
+
{ text: '三茆海塘', level: '4', imgUrl: '/image/screenIcon/海塘-4级.png', position: { x: 27.193284, y: 120.464411, z: 20 } },
|
|
177
|
+
{ text: '大渔海塘', level: '2', imgUrl: '/image/screenIcon/海塘-2级.png', position: { x: 27.39027, y: 120.599554, z: 20 } },
|
|
178
|
+
{ text: '信智海塘', level: '4', imgUrl: '/image/screenIcon/海塘-4级.png', position: { x: 27.300806, y: 120.544077, z: 20 } },
|
|
179
|
+
{ text: '下在海塘', level: '3', imgUrl: '/image/screenIcon/海塘-3级.png', position: { x: 27.215789, y: 120.445849, z: 10 } },
|
|
180
|
+
{ text: '木林海塘', level: '5', imgUrl: '/image/screenIcon/海塘-5级.png', position: { x: 27.193183, y: 120.424486, z: 20 } },
|
|
181
|
+
{ text: '雾城海塘', level: '4', imgUrl: '/image/screenIcon/海塘-4级.png', position: { x: 27.27682, y: 120.518917, z: 20 } },
|
|
182
|
+
{ text: '渔岙海塘', level: '4', imgUrl: '/image/screenIcon/海塘-4级.png', position: { x: 27.403744, y: 120.557879, z: 20 } },
|
|
183
|
+
{ text: '流岐岙海塘', level: '4', imgUrl: '/image/screenIcon/海塘-4级.png', position: { x: 27.318176, y: 120.542761, z: 20 } },
|
|
184
184
|
]},
|
|
185
185
|
{ key: 'hydrometricStations', text: '水文站', visible: true, children: [
|
|
186
186
|
{ text: '灵溪', stcd: '7010CK01', sttp: 'ZQ', position: { x: 27.5014, y: 120.3847, z: 100 } },
|
|
@@ -290,6 +290,7 @@ export class GaeaApp {
|
|
|
290
290
|
this.tLayers = [];
|
|
291
291
|
this.layerCategories = this.config.layerCategories || [];
|
|
292
292
|
this._screenIconList = [];
|
|
293
|
+
this._markersVisible = true; // 全局图标可见性(2D 模式下强制隐藏,3D 下恢复)
|
|
293
294
|
this._hiddenCategories = new Set();
|
|
294
295
|
this._tilesetMap = {}; // 已加载的 3D Tiles 引用,key 为 tileset 名称
|
|
295
296
|
this._secIsClickArr = [];
|
|
@@ -560,9 +561,11 @@ export class GaeaApp {
|
|
|
560
561
|
// 解锁视角(内部会调 UseAutoVisible 恢复非断面图标)
|
|
561
562
|
this.lockedModesSwitch(false);
|
|
562
563
|
// 恢复被 hiddenScreenWithClass 隐藏的图标 DOM
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
564
|
+
if (this._markersVisible) {
|
|
565
|
+
document.querySelectorAll('.gaea-locationLineStyle, .gaea-iconscreen, .gaea-iconGif').forEach(el => {
|
|
566
|
+
el.style.display = '';
|
|
567
|
+
});
|
|
568
|
+
}
|
|
566
569
|
// 断面模型缩回
|
|
567
570
|
if (this._raisedSection) {
|
|
568
571
|
this._raisedSection.TranslateObjectLocal(new Gaea.Vector3(0, -44, 0));
|
|
@@ -870,7 +873,7 @@ export class GaeaApp {
|
|
|
870
873
|
this.addScreenIcon({
|
|
871
874
|
name: child.text,
|
|
872
875
|
text: child.text,
|
|
873
|
-
imgUrl: cfg.img,
|
|
876
|
+
imgUrl: child.imgUrl || cfg.img,
|
|
874
877
|
method: cfg.method,
|
|
875
878
|
position: child.position,
|
|
876
879
|
offset: cfg.offset,
|
|
@@ -912,11 +915,11 @@ export class GaeaApp {
|
|
|
912
915
|
}
|
|
913
916
|
const els = document.querySelectorAll('.gaea-cat-' + categoryKey);
|
|
914
917
|
console.log('[GaeaApp] setCategoryVisible:', categoryKey, visible, '元素数:', els.length);
|
|
915
|
-
els.forEach(el => { el.style.display = visible ? '' : 'none'; });
|
|
918
|
+
els.forEach(el => { el.style.display = visible && this._markersVisible ? '' : 'none'; });
|
|
916
919
|
// 同步引擎可见性
|
|
917
920
|
const items = this._screenIconList.filter(item => item.category === categoryKey);
|
|
918
921
|
items.forEach(item => {
|
|
919
|
-
if (visible) {
|
|
922
|
+
if (visible && this._markersVisible) {
|
|
920
923
|
item.element.UseAutoVisible();
|
|
921
924
|
item.element.EnablePick = true;
|
|
922
925
|
} else {
|
|
@@ -1799,6 +1802,7 @@ export class GaeaApp {
|
|
|
1799
1802
|
child.AddChild(screen, false);
|
|
1800
1803
|
const screenItem = { element: screen, type: type || null, category };
|
|
1801
1804
|
this._screenIconList.push(screenItem);
|
|
1805
|
+
this._applyMarkerVisibility(screenItem);
|
|
1802
1806
|
return screen;
|
|
1803
1807
|
}
|
|
1804
1808
|
}
|
|
@@ -1810,9 +1814,19 @@ export class GaeaApp {
|
|
|
1810
1814
|
Gaea.World.Instance.RenderableObjectList.AddLast(screen);
|
|
1811
1815
|
const screenItem = { element: screen, type: type || null, category };
|
|
1812
1816
|
this._screenIconList.push(screenItem);
|
|
1817
|
+
this._applyMarkerVisibility(screenItem);
|
|
1813
1818
|
return screen;
|
|
1814
1819
|
}
|
|
1815
1820
|
|
|
1821
|
+
/** 根据全局图标可见性状态(_markersVisible)应用单个图标显隐 */
|
|
1822
|
+
_applyMarkerVisibility(screenItem) {
|
|
1823
|
+
if (this._markersVisible) return;
|
|
1824
|
+
screenItem.element.ForceSetVisible(false);
|
|
1825
|
+
screenItem.element.EnablePick = false;
|
|
1826
|
+
const el = document.getElementById(screenItem.element.DivID);
|
|
1827
|
+
if (el) el.style.display = 'none';
|
|
1828
|
+
}
|
|
1829
|
+
|
|
1816
1830
|
/** 记录当前视角,返回 URI 字符串 */
|
|
1817
1831
|
favorite() {
|
|
1818
1832
|
return Gaea.GaeaCamera.ConvertBy(Gaea.World.Instance.DefaultCamera).Favorite();
|
|
@@ -2095,7 +2109,7 @@ export class GaeaApp {
|
|
|
2095
2109
|
Gaea.World.Instance.CameraController.LockedEntity = null;
|
|
2096
2110
|
// 解锁时恢复非断面图标的自动可见
|
|
2097
2111
|
this._screenIconList.forEach(item => {
|
|
2098
|
-
if (!item.type) {
|
|
2112
|
+
if (!item.type && this._markersVisible) {
|
|
2099
2113
|
item.element.UseAutoVisible();
|
|
2100
2114
|
item.element.EnablePick = true;
|
|
2101
2115
|
}
|
|
@@ -2377,6 +2391,7 @@ export class GaeaApp {
|
|
|
2377
2391
|
|
|
2378
2392
|
/** 显示所有屏幕标记 */
|
|
2379
2393
|
showAllMarkers = () => {
|
|
2394
|
+
this._markersVisible = true;
|
|
2380
2395
|
this._screenIconList.forEach(item => {
|
|
2381
2396
|
// 跳过被隐藏分类的标记
|
|
2382
2397
|
if (this._hiddenCategories.has(item.category)) return
|
|
@@ -2390,6 +2405,7 @@ export class GaeaApp {
|
|
|
2390
2405
|
|
|
2391
2406
|
/** 隐藏所有屏幕标记 */
|
|
2392
2407
|
hideAllMarkers = () => {
|
|
2408
|
+
this._markersVisible = false;
|
|
2393
2409
|
this._screenIconList.forEach(item => {
|
|
2394
2410
|
item.element.ForceSetVisible(false)
|
|
2395
2411
|
item.element.EnablePick = false
|