@jorgmoritz/gis-manager 0.1.49 → 0.1.50
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/dist/index.cjs +1236 -90
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +559 -2
- package/dist/index.d.ts +559 -2
- package/dist/index.js +1234 -91
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -698,6 +698,506 @@ declare class CameraManager {
|
|
|
698
698
|
private waitForAnimationFrame;
|
|
699
699
|
}
|
|
700
700
|
|
|
701
|
+
/**
|
|
702
|
+
* 地形管理器类型定义
|
|
703
|
+
*/
|
|
704
|
+
/** 地形源类型 */
|
|
705
|
+
type TerrainSourceType = 'global' | 'local';
|
|
706
|
+
/** 地形提供者类型 */
|
|
707
|
+
type TerrainProviderType = 'cesium-ion' | 'url' | 'ellipsoid';
|
|
708
|
+
/** 地形源配置 */
|
|
709
|
+
interface TerrainSourceConfig {
|
|
710
|
+
/** 唯一标识 */
|
|
711
|
+
id: string;
|
|
712
|
+
/** 地形源类型:global=全局地形, local=局部地形 */
|
|
713
|
+
type: TerrainSourceType;
|
|
714
|
+
/** 地形提供者类型 */
|
|
715
|
+
providerType: TerrainProviderType;
|
|
716
|
+
/** 地形数据 URL(providerType 为 'url' 时必填) */
|
|
717
|
+
url?: string;
|
|
718
|
+
/** Cesium Ion Asset ID(providerType 为 'cesium-ion' 时使用) */
|
|
719
|
+
ionAssetId?: number;
|
|
720
|
+
/** 局部地形的覆盖范围 [west, south, east, north],单位:度 */
|
|
721
|
+
bounds?: [number, number, number, number];
|
|
722
|
+
/** 优先级,数值越大优先级越高,默认 0 */
|
|
723
|
+
priority?: number;
|
|
724
|
+
/** 缩放级别范围 */
|
|
725
|
+
zoomRange?: {
|
|
726
|
+
min?: number;
|
|
727
|
+
max?: number;
|
|
728
|
+
};
|
|
729
|
+
/** 是否请求顶点法线 */
|
|
730
|
+
requestVertexNormals?: boolean;
|
|
731
|
+
/** 是否请求水面遮罩 */
|
|
732
|
+
requestWaterMask?: boolean;
|
|
733
|
+
}
|
|
734
|
+
/** 地形切换选项 */
|
|
735
|
+
interface TerrainSwitchOptions {
|
|
736
|
+
/** 切换后是否飞行到目标区域(仅对局部地形有效) */
|
|
737
|
+
flyTo?: boolean;
|
|
738
|
+
/** 飞行时长(秒),默认 2 */
|
|
739
|
+
flyDuration?: number;
|
|
740
|
+
}
|
|
741
|
+
/** 地形切换结果 */
|
|
742
|
+
interface TerrainSwitchResult {
|
|
743
|
+
/** 是否成功 */
|
|
744
|
+
success: boolean;
|
|
745
|
+
/** 当前激活的地形源 ID */
|
|
746
|
+
activeId: string | null;
|
|
747
|
+
/** 错误信息 */
|
|
748
|
+
error?: string;
|
|
749
|
+
}
|
|
750
|
+
/** 地形管理器事件 */
|
|
751
|
+
interface TerrainManagerEvents {
|
|
752
|
+
/** 地形源已注册 */
|
|
753
|
+
registered: {
|
|
754
|
+
config: TerrainSourceConfig;
|
|
755
|
+
};
|
|
756
|
+
/** 地形源已移除 */
|
|
757
|
+
removed: {
|
|
758
|
+
id: string;
|
|
759
|
+
};
|
|
760
|
+
/** 地形已切换 */
|
|
761
|
+
switched: {
|
|
762
|
+
fromId: string | null;
|
|
763
|
+
toId: string | null;
|
|
764
|
+
};
|
|
765
|
+
/** 发生错误 */
|
|
766
|
+
error: {
|
|
767
|
+
id?: string;
|
|
768
|
+
error: unknown;
|
|
769
|
+
};
|
|
770
|
+
}
|
|
771
|
+
|
|
772
|
+
/**
|
|
773
|
+
* 地形管理器
|
|
774
|
+
* 统一管理地形源的注册、切换和生命周期
|
|
775
|
+
*/
|
|
776
|
+
|
|
777
|
+
declare class TerrainManager {
|
|
778
|
+
private CesiumNS;
|
|
779
|
+
private viewer;
|
|
780
|
+
/** 已注册的地形源 */
|
|
781
|
+
private sources;
|
|
782
|
+
/** 当前激活的地形源 ID */
|
|
783
|
+
private activeSourceId;
|
|
784
|
+
/** 事件发射器 */
|
|
785
|
+
events: Emitter<TerrainManagerEvents>;
|
|
786
|
+
constructor(CesiumNS: typeof Cesium, viewer: Cesium.Viewer);
|
|
787
|
+
/**
|
|
788
|
+
* 注册地形源
|
|
789
|
+
* @param config 地形源配置
|
|
790
|
+
*/
|
|
791
|
+
register(config: TerrainSourceConfig): void;
|
|
792
|
+
/**
|
|
793
|
+
* 批量注册地形源
|
|
794
|
+
* @param configs 地形源配置数组
|
|
795
|
+
*/
|
|
796
|
+
registerBatch(configs: TerrainSourceConfig[]): void;
|
|
797
|
+
/**
|
|
798
|
+
* 切换到指定地形源
|
|
799
|
+
* @param sourceId 地形源 ID
|
|
800
|
+
* @param options 切换选项
|
|
801
|
+
*/
|
|
802
|
+
switchTo(sourceId: string, options?: TerrainSwitchOptions): Promise<TerrainSwitchResult>;
|
|
803
|
+
/**
|
|
804
|
+
* 获取当前激活的地形源配置
|
|
805
|
+
*/
|
|
806
|
+
getActive(): TerrainSourceConfig | null;
|
|
807
|
+
/**
|
|
808
|
+
* 获取当前激活的地形源 ID
|
|
809
|
+
*/
|
|
810
|
+
getActiveId(): string | null;
|
|
811
|
+
/**
|
|
812
|
+
* 获取指定地形源配置
|
|
813
|
+
* @param sourceId 地形源 ID
|
|
814
|
+
*/
|
|
815
|
+
get(sourceId: string): TerrainSourceConfig | undefined;
|
|
816
|
+
/**
|
|
817
|
+
* 获取所有已注册的地形源
|
|
818
|
+
*/
|
|
819
|
+
list(): TerrainSourceConfig[];
|
|
820
|
+
/**
|
|
821
|
+
* 检查地形源是否已注册
|
|
822
|
+
* @param sourceId 地形源 ID
|
|
823
|
+
*/
|
|
824
|
+
has(sourceId: string): boolean;
|
|
825
|
+
/**
|
|
826
|
+
* 移除地形源
|
|
827
|
+
* @param sourceId 地形源 ID
|
|
828
|
+
*/
|
|
829
|
+
remove(sourceId: string): boolean;
|
|
830
|
+
/**
|
|
831
|
+
* 重置为椭球体(无地形)
|
|
832
|
+
*/
|
|
833
|
+
reset(): void;
|
|
834
|
+
/**
|
|
835
|
+
* 清除所有已注册的地形源
|
|
836
|
+
*/
|
|
837
|
+
clear(): void;
|
|
838
|
+
/**
|
|
839
|
+
* 销毁管理器
|
|
840
|
+
*/
|
|
841
|
+
destroy(): void;
|
|
842
|
+
/**
|
|
843
|
+
* 创建地形提供者
|
|
844
|
+
*/
|
|
845
|
+
private createTerrainProvider;
|
|
846
|
+
/**
|
|
847
|
+
* 飞行到指定范围
|
|
848
|
+
*/
|
|
849
|
+
private flyToBounds;
|
|
850
|
+
}
|
|
851
|
+
|
|
852
|
+
/**
|
|
853
|
+
* 影像管理器类型定义
|
|
854
|
+
*/
|
|
855
|
+
/** 影像提供者类型 */
|
|
856
|
+
type ImageryProviderType = 'urlTemplate' | 'wmts' | 'wms' | 'arcgis' | 'tms';
|
|
857
|
+
/** 影像图层类型 */
|
|
858
|
+
type ImageryLayerType = 'base' | 'overlay';
|
|
859
|
+
/** 影像图层配置 */
|
|
860
|
+
interface ImageryLayerConfig {
|
|
861
|
+
/** 唯一标识 */
|
|
862
|
+
id: string;
|
|
863
|
+
/** 影像数据 URL */
|
|
864
|
+
url: string;
|
|
865
|
+
/** 影像提供者类型 */
|
|
866
|
+
provider: ImageryProviderType;
|
|
867
|
+
/** 图层类型:base=底图, overlay=叠加层 */
|
|
868
|
+
layerType: ImageryLayerType;
|
|
869
|
+
/** 覆盖范围 [west, south, east, north],单位:度 */
|
|
870
|
+
bounds?: [number, number, number, number];
|
|
871
|
+
/** 透明度 0-1,默认 1 */
|
|
872
|
+
opacity?: number;
|
|
873
|
+
/** 层级顺序,数值越大越靠上,默认 0 */
|
|
874
|
+
zIndex?: number;
|
|
875
|
+
/** 缩放级别范围 */
|
|
876
|
+
zoomRange?: {
|
|
877
|
+
min?: number;
|
|
878
|
+
max?: number;
|
|
879
|
+
};
|
|
880
|
+
/** 是否默认显示,默认 true */
|
|
881
|
+
show?: boolean;
|
|
882
|
+
/** WMTS 特定配置 */
|
|
883
|
+
wmts?: {
|
|
884
|
+
layer: string;
|
|
885
|
+
style?: string;
|
|
886
|
+
tileMatrixSetID: string;
|
|
887
|
+
format?: string;
|
|
888
|
+
};
|
|
889
|
+
/** WMS 特定配置 */
|
|
890
|
+
wms?: {
|
|
891
|
+
layers: string;
|
|
892
|
+
parameters?: Record<string, string>;
|
|
893
|
+
};
|
|
894
|
+
/** 子域名列表(用于负载均衡) */
|
|
895
|
+
subdomains?: string[];
|
|
896
|
+
/** 自定义元数据 */
|
|
897
|
+
metadata?: Record<string, unknown>;
|
|
898
|
+
}
|
|
899
|
+
/** 影像加载选项 */
|
|
900
|
+
interface ImageryLoadOptions {
|
|
901
|
+
/** 加载后是否飞行到目标区域 */
|
|
902
|
+
flyTo?: boolean;
|
|
903
|
+
/** 飞行时长(秒),默认 2 */
|
|
904
|
+
flyDuration?: number;
|
|
905
|
+
}
|
|
906
|
+
/** 影像加载结果 */
|
|
907
|
+
interface ImageryLoadResult {
|
|
908
|
+
/** 图层 ID */
|
|
909
|
+
id: string;
|
|
910
|
+
/** 是否成功 */
|
|
911
|
+
success: boolean;
|
|
912
|
+
/** 错误信息 */
|
|
913
|
+
error?: string;
|
|
914
|
+
}
|
|
915
|
+
/** 影像管理器事件 */
|
|
916
|
+
interface ImageryManagerEvents {
|
|
917
|
+
/** 图层已添加 */
|
|
918
|
+
added: {
|
|
919
|
+
config: ImageryLayerConfig;
|
|
920
|
+
};
|
|
921
|
+
/** 图层已移除 */
|
|
922
|
+
removed: {
|
|
923
|
+
id: string;
|
|
924
|
+
};
|
|
925
|
+
/** 图层可见性变更 */
|
|
926
|
+
visibilityChanged: {
|
|
927
|
+
id: string;
|
|
928
|
+
visible: boolean;
|
|
929
|
+
};
|
|
930
|
+
/** 图层透明度变更 */
|
|
931
|
+
opacityChanged: {
|
|
932
|
+
id: string;
|
|
933
|
+
opacity: number;
|
|
934
|
+
};
|
|
935
|
+
/** 图层顺序变更 */
|
|
936
|
+
orderChanged: {
|
|
937
|
+
id: string;
|
|
938
|
+
zIndex: number;
|
|
939
|
+
};
|
|
940
|
+
/** 发生错误 */
|
|
941
|
+
error: {
|
|
942
|
+
id?: string;
|
|
943
|
+
error: unknown;
|
|
944
|
+
};
|
|
945
|
+
}
|
|
946
|
+
|
|
947
|
+
/**
|
|
948
|
+
* 影像管理器
|
|
949
|
+
* 统一管理影像图层的加载、叠加和生命周期
|
|
950
|
+
*/
|
|
951
|
+
|
|
952
|
+
declare class ImageryManager {
|
|
953
|
+
private CesiumNS;
|
|
954
|
+
private viewer;
|
|
955
|
+
/** 已加载的图层 */
|
|
956
|
+
private layers;
|
|
957
|
+
/** 事件发射器 */
|
|
958
|
+
events: Emitter<ImageryManagerEvents>;
|
|
959
|
+
constructor(CesiumNS: typeof Cesium, viewer: Cesium.Viewer);
|
|
960
|
+
/**
|
|
961
|
+
* 添加影像图层
|
|
962
|
+
* @param config 图层配置
|
|
963
|
+
* @param options 加载选项
|
|
964
|
+
*/
|
|
965
|
+
add(config: ImageryLayerConfig, options?: ImageryLoadOptions): Promise<ImageryLoadResult>;
|
|
966
|
+
/**
|
|
967
|
+
* 批量添加影像图层
|
|
968
|
+
* @param configs 图层配置数组
|
|
969
|
+
* @param options 加载选项
|
|
970
|
+
*/
|
|
971
|
+
addBatch(configs: ImageryLayerConfig[], options?: ImageryLoadOptions): Promise<ImageryLoadResult[]>;
|
|
972
|
+
/**
|
|
973
|
+
* 移除影像图层
|
|
974
|
+
* @param layerId 图层 ID
|
|
975
|
+
*/
|
|
976
|
+
remove(layerId: string): boolean;
|
|
977
|
+
/**
|
|
978
|
+
* 设置图层可见性
|
|
979
|
+
* @param layerId 图层 ID
|
|
980
|
+
* @param visible 是否可见
|
|
981
|
+
*/
|
|
982
|
+
setVisible(layerId: string, visible: boolean): boolean;
|
|
983
|
+
/**
|
|
984
|
+
* 设置图层透明度
|
|
985
|
+
* @param layerId 图层 ID
|
|
986
|
+
* @param opacity 透明度 0-1
|
|
987
|
+
*/
|
|
988
|
+
setOpacity(layerId: string, opacity: number): boolean;
|
|
989
|
+
/**
|
|
990
|
+
* 调整图层顺序
|
|
991
|
+
* @param layerId 图层 ID
|
|
992
|
+
* @param zIndex 新的层级
|
|
993
|
+
*/
|
|
994
|
+
reorder(layerId: string, zIndex: number): boolean;
|
|
995
|
+
/**
|
|
996
|
+
* 将图层移到最上层
|
|
997
|
+
* @param layerId 图层 ID
|
|
998
|
+
*/
|
|
999
|
+
bringToTop(layerId: string): boolean;
|
|
1000
|
+
/**
|
|
1001
|
+
* 将图层移到最下层
|
|
1002
|
+
* @param layerId 图层 ID
|
|
1003
|
+
*/
|
|
1004
|
+
sendToBottom(layerId: string): boolean;
|
|
1005
|
+
/**
|
|
1006
|
+
* 获取图层配置
|
|
1007
|
+
* @param layerId 图层 ID
|
|
1008
|
+
*/
|
|
1009
|
+
get(layerId: string): ImageryLayerConfig | undefined;
|
|
1010
|
+
/**
|
|
1011
|
+
* 获取底层 Cesium ImageryLayer
|
|
1012
|
+
* @param layerId 图层 ID
|
|
1013
|
+
*/
|
|
1014
|
+
getLayer(layerId: string): Cesium.ImageryLayer | undefined;
|
|
1015
|
+
/**
|
|
1016
|
+
* 获取所有图层配置
|
|
1017
|
+
*/
|
|
1018
|
+
list(): ImageryLayerConfig[];
|
|
1019
|
+
/**
|
|
1020
|
+
* 获取所有底图图层
|
|
1021
|
+
*/
|
|
1022
|
+
listBaseLayers(): ImageryLayerConfig[];
|
|
1023
|
+
/**
|
|
1024
|
+
* 获取所有叠加图层
|
|
1025
|
+
*/
|
|
1026
|
+
listOverlays(): ImageryLayerConfig[];
|
|
1027
|
+
/**
|
|
1028
|
+
* 检查图层是否存在
|
|
1029
|
+
* @param layerId 图层 ID
|
|
1030
|
+
*/
|
|
1031
|
+
has(layerId: string): boolean;
|
|
1032
|
+
/**
|
|
1033
|
+
* 清除所有叠加层(保留底图)
|
|
1034
|
+
*/
|
|
1035
|
+
clearOverlays(): void;
|
|
1036
|
+
/**
|
|
1037
|
+
* 清除所有图层
|
|
1038
|
+
*/
|
|
1039
|
+
clear(): void;
|
|
1040
|
+
/**
|
|
1041
|
+
* 销毁管理器
|
|
1042
|
+
*/
|
|
1043
|
+
destroy(): void;
|
|
1044
|
+
/**
|
|
1045
|
+
* 创建影像提供者
|
|
1046
|
+
*/
|
|
1047
|
+
private createImageryProvider;
|
|
1048
|
+
/**
|
|
1049
|
+
* 自动检测天地图 WMTS 服务并补充配置
|
|
1050
|
+
*/
|
|
1051
|
+
private autoDetectTiandituWmts;
|
|
1052
|
+
/**
|
|
1053
|
+
* 应用图层顺序
|
|
1054
|
+
*/
|
|
1055
|
+
private applyZIndex;
|
|
1056
|
+
/**
|
|
1057
|
+
* 飞行到指定范围
|
|
1058
|
+
*/
|
|
1059
|
+
private flyToBounds;
|
|
1060
|
+
}
|
|
1061
|
+
|
|
1062
|
+
/**
|
|
1063
|
+
* 3D Tiles 管理器类型定义
|
|
1064
|
+
*/
|
|
1065
|
+
/** 3D Tiles 类型 */
|
|
1066
|
+
type TilesetType = '3dtiles' | 'pointcloud' | 'model';
|
|
1067
|
+
/** 3D Tiles 配置 */
|
|
1068
|
+
interface TilesetConfig {
|
|
1069
|
+
/** 唯一标识 */
|
|
1070
|
+
id: string;
|
|
1071
|
+
/** tileset.json URL */
|
|
1072
|
+
url: string;
|
|
1073
|
+
/** 类型,默认 '3dtiles' */
|
|
1074
|
+
type?: TilesetType;
|
|
1075
|
+
/** 是否显示,默认 true */
|
|
1076
|
+
show?: boolean;
|
|
1077
|
+
/** 最大屏幕空间误差,默认 16 */
|
|
1078
|
+
maximumScreenSpaceError?: number;
|
|
1079
|
+
/** 点云着色配置 */
|
|
1080
|
+
pointCloudShading?: {
|
|
1081
|
+
attenuation?: boolean;
|
|
1082
|
+
geometricErrorScale?: number;
|
|
1083
|
+
eyeDomeLighting?: boolean;
|
|
1084
|
+
eyeDomeLightingStrength?: number;
|
|
1085
|
+
eyeDomeLightingRadius?: number;
|
|
1086
|
+
};
|
|
1087
|
+
/** 自定义元数据 */
|
|
1088
|
+
metadata?: Record<string, unknown>;
|
|
1089
|
+
}
|
|
1090
|
+
/** 3D Tiles 加载选项 */
|
|
1091
|
+
interface TilesetLoadOptions {
|
|
1092
|
+
/** 加载后是否飞行到目标 */
|
|
1093
|
+
flyTo?: boolean;
|
|
1094
|
+
/** 飞行时长(秒) */
|
|
1095
|
+
flyDuration?: number;
|
|
1096
|
+
}
|
|
1097
|
+
/** 3D Tiles 加载结果 */
|
|
1098
|
+
interface TilesetLoadResult {
|
|
1099
|
+
/** Tileset ID */
|
|
1100
|
+
id: string;
|
|
1101
|
+
/** 是否成功 */
|
|
1102
|
+
success: boolean;
|
|
1103
|
+
/** 错误信息 */
|
|
1104
|
+
error?: string;
|
|
1105
|
+
}
|
|
1106
|
+
/** 3D Tiles 管理器事件 */
|
|
1107
|
+
interface TilesetManagerEvents {
|
|
1108
|
+
/** Tileset 已添加 */
|
|
1109
|
+
added: {
|
|
1110
|
+
config: TilesetConfig;
|
|
1111
|
+
};
|
|
1112
|
+
/** Tileset 已移除 */
|
|
1113
|
+
removed: {
|
|
1114
|
+
id: string;
|
|
1115
|
+
};
|
|
1116
|
+
/** 可见性变更 */
|
|
1117
|
+
visibilityChanged: {
|
|
1118
|
+
id: string;
|
|
1119
|
+
visible: boolean;
|
|
1120
|
+
};
|
|
1121
|
+
/** 发生错误 */
|
|
1122
|
+
error: {
|
|
1123
|
+
id?: string;
|
|
1124
|
+
error: unknown;
|
|
1125
|
+
};
|
|
1126
|
+
}
|
|
1127
|
+
|
|
1128
|
+
/**
|
|
1129
|
+
* 3D Tiles 管理器
|
|
1130
|
+
* 统一管理 3D Tiles、点云等数据的加载和生命周期
|
|
1131
|
+
*/
|
|
1132
|
+
|
|
1133
|
+
declare class TilesetManager {
|
|
1134
|
+
private CesiumNS;
|
|
1135
|
+
private viewer;
|
|
1136
|
+
/** 已加载的 Tileset */
|
|
1137
|
+
private tilesets;
|
|
1138
|
+
/** 事件发射器 */
|
|
1139
|
+
events: Emitter<TilesetManagerEvents>;
|
|
1140
|
+
constructor(CesiumNS: typeof Cesium, viewer: Cesium.Viewer);
|
|
1141
|
+
/**
|
|
1142
|
+
* 添加 3D Tiles
|
|
1143
|
+
* @param config Tileset 配置
|
|
1144
|
+
* @param options 加载选项
|
|
1145
|
+
*/
|
|
1146
|
+
add(config: TilesetConfig, options?: TilesetLoadOptions): Promise<TilesetLoadResult>;
|
|
1147
|
+
/**
|
|
1148
|
+
* 移除 Tileset
|
|
1149
|
+
* @param tilesetId Tileset ID
|
|
1150
|
+
*/
|
|
1151
|
+
remove(tilesetId: string): boolean;
|
|
1152
|
+
/**
|
|
1153
|
+
* 设置 Tileset 可见性
|
|
1154
|
+
* @param tilesetId Tileset ID
|
|
1155
|
+
* @param visible 是否可见
|
|
1156
|
+
*/
|
|
1157
|
+
setVisible(tilesetId: string, visible: boolean): boolean;
|
|
1158
|
+
/**
|
|
1159
|
+
* 获取 Tileset 配置
|
|
1160
|
+
* @param tilesetId Tileset ID
|
|
1161
|
+
*/
|
|
1162
|
+
get(tilesetId: string): TilesetConfig | undefined;
|
|
1163
|
+
/**
|
|
1164
|
+
* 获取底层 Cesium Tileset
|
|
1165
|
+
* @param tilesetId Tileset ID
|
|
1166
|
+
*/
|
|
1167
|
+
getTileset(tilesetId: string): Cesium.Cesium3DTileset | undefined;
|
|
1168
|
+
/**
|
|
1169
|
+
* 获取所有 Tileset 配置
|
|
1170
|
+
*/
|
|
1171
|
+
list(): TilesetConfig[];
|
|
1172
|
+
/**
|
|
1173
|
+
* 检查 Tileset 是否存在
|
|
1174
|
+
* @param tilesetId Tileset ID
|
|
1175
|
+
*/
|
|
1176
|
+
has(tilesetId: string): boolean;
|
|
1177
|
+
/**
|
|
1178
|
+
* 飞行到指定 Tileset
|
|
1179
|
+
* @param tilesetId Tileset ID
|
|
1180
|
+
* @param duration 飞行时长
|
|
1181
|
+
*/
|
|
1182
|
+
flyTo(tilesetId: string, duration?: number): Promise<boolean>;
|
|
1183
|
+
/**
|
|
1184
|
+
* 清除所有 Tileset
|
|
1185
|
+
*/
|
|
1186
|
+
clear(): void;
|
|
1187
|
+
/**
|
|
1188
|
+
* 销毁管理器
|
|
1189
|
+
*/
|
|
1190
|
+
destroy(): void;
|
|
1191
|
+
/**
|
|
1192
|
+
* 创建 Tileset
|
|
1193
|
+
*/
|
|
1194
|
+
private createTileset;
|
|
1195
|
+
/**
|
|
1196
|
+
* 飞行到 Tileset
|
|
1197
|
+
*/
|
|
1198
|
+
private flyToTileset;
|
|
1199
|
+
}
|
|
1200
|
+
|
|
701
1201
|
interface SceneOptions {
|
|
702
1202
|
container: string | HTMLElement;
|
|
703
1203
|
imagery?: ImageryOptions;
|
|
@@ -715,10 +1215,13 @@ declare class SceneManager {
|
|
|
715
1215
|
private viewer;
|
|
716
1216
|
private layerManager;
|
|
717
1217
|
private cameraManager;
|
|
1218
|
+
private terrainManager;
|
|
1219
|
+
private imageryManager;
|
|
1220
|
+
private tilesetManager;
|
|
718
1221
|
constructor(CesiumNS: typeof Cesium, options: SceneOptions);
|
|
719
1222
|
getViewer(): Cesium.Viewer;
|
|
720
1223
|
/**
|
|
721
|
-
* Set a black background for areas without imagery.
|
|
1224
|
+
* Set a black background for areas without imagery.
|
|
722
1225
|
*/
|
|
723
1226
|
useBlackBackground(removeAllImagery?: boolean): void;
|
|
724
1227
|
destroy(): void;
|
|
@@ -727,8 +1230,20 @@ declare class SceneManager {
|
|
|
727
1230
|
setInitialCamera(view: CameraView | CameraInitOptions): void;
|
|
728
1231
|
getCameraManager(): CameraManager;
|
|
729
1232
|
getLayerManager(): LayerManager;
|
|
1233
|
+
getTerrainManager(): TerrainManager;
|
|
1234
|
+
getImageryManager(): ImageryManager;
|
|
1235
|
+
getTilesetManager(): TilesetManager;
|
|
1236
|
+
/**
|
|
1237
|
+
* @deprecated 请使用 getImageryManager().add() 代替
|
|
1238
|
+
*/
|
|
730
1239
|
setBaseImagery(url: string, layer_id: string, opts?: Omit<ImageryOptions, 'url'>): Cesium.ImageryLayer | undefined;
|
|
1240
|
+
/**
|
|
1241
|
+
* @deprecated 请使用 getTilesetManager().add() 代替
|
|
1242
|
+
*/
|
|
731
1243
|
set3DTiles(url: string, layer_id: string): Promise<any | undefined>;
|
|
1244
|
+
/**
|
|
1245
|
+
* @deprecated 请使用 getTerrainManager().switchTo() 代替
|
|
1246
|
+
*/
|
|
732
1247
|
setTerrain(options: TerrainOptions): Promise<Cesium.TerrainProvider | undefined>;
|
|
733
1248
|
addDSM(options: {
|
|
734
1249
|
url: string;
|
|
@@ -3398,6 +3913,8 @@ interface MassPolygonInteractionOptions {
|
|
|
3398
3913
|
enableHover?: boolean;
|
|
3399
3914
|
/** 是否启用点击选择(默认 false) */
|
|
3400
3915
|
enableClick?: boolean;
|
|
3916
|
+
/** 是否启用右键菜单(默认 false) */
|
|
3917
|
+
enableRightClick?: boolean;
|
|
3401
3918
|
/** 悬停高亮样式 */
|
|
3402
3919
|
highlightStyle?: HighlightStyleOptions;
|
|
3403
3920
|
/** 选中样式(点击后) */
|
|
@@ -3410,6 +3927,11 @@ interface MassPolygonInteractionOptions {
|
|
|
3410
3927
|
onHover?: (id: string | null, data: PolygonData | null) => void;
|
|
3411
3928
|
/** 点击回调 */
|
|
3412
3929
|
onClick?: (id: string | null, data: PolygonData | null) => void;
|
|
3930
|
+
/** 右键回调 */
|
|
3931
|
+
onRightClick?: (id: string, data: PolygonData, screenPosition: {
|
|
3932
|
+
x: number;
|
|
3933
|
+
y: number;
|
|
3934
|
+
}) => void;
|
|
3413
3935
|
}
|
|
3414
3936
|
/**
|
|
3415
3937
|
* 批量创建选项
|
|
@@ -3466,15 +3988,20 @@ declare class MassPolygonManager {
|
|
|
3466
3988
|
private interactionOptions;
|
|
3467
3989
|
private hoverHandler?;
|
|
3468
3990
|
private clickHandler?;
|
|
3991
|
+
private rightClickHandler?;
|
|
3469
3992
|
private highlightedId?;
|
|
3470
3993
|
private originalHighlightFillColor?;
|
|
3471
3994
|
private originalHighlightOutlineColor?;
|
|
3472
3995
|
private selectedId?;
|
|
3473
3996
|
private originalSelectFillColor?;
|
|
3474
3997
|
private originalSelectOutlineColor?;
|
|
3998
|
+
private highlightPrimitive?;
|
|
3999
|
+
private selectPrimitive?;
|
|
4000
|
+
private groundOutlinePrimitive?;
|
|
3475
4001
|
private lastPickTime;
|
|
3476
4002
|
private readonly pickThrottleMs;
|
|
3477
4003
|
private hoverLabel?;
|
|
4004
|
+
private isDestroyed;
|
|
3478
4005
|
constructor(CesiumNS: typeof Cesium, viewer: Cesium.Viewer);
|
|
3479
4006
|
/**
|
|
3480
4007
|
* 获取图层名称
|
|
@@ -3497,6 +4024,19 @@ declare class MassPolygonManager {
|
|
|
3497
4024
|
* 设置点击事件处理器
|
|
3498
4025
|
*/
|
|
3499
4026
|
private setupClickHandler;
|
|
4027
|
+
/**
|
|
4028
|
+
* 设置右键事件处理器
|
|
4029
|
+
*/
|
|
4030
|
+
private setupRightClickHandler;
|
|
4031
|
+
/**
|
|
4032
|
+
* 通过屏幕坐标获取地理位置,然后判断在哪个多边形内
|
|
4033
|
+
* 用于贴地模式下的精确拾取
|
|
4034
|
+
*/
|
|
4035
|
+
private pickPolygonByPosition;
|
|
4036
|
+
/**
|
|
4037
|
+
* 判断点是否在多边形内(射线法)
|
|
4038
|
+
*/
|
|
4039
|
+
private isPointInPolygon;
|
|
3500
4040
|
/**
|
|
3501
4041
|
* 处理鼠标离开
|
|
3502
4042
|
*/
|
|
@@ -3505,6 +4045,10 @@ declare class MassPolygonManager {
|
|
|
3505
4045
|
* 高亮指定多边形(悬停)
|
|
3506
4046
|
*/
|
|
3507
4047
|
private highlightPolygon;
|
|
4048
|
+
/**
|
|
4049
|
+
* 贴地模式下使用独立 Primitive 高亮/选中多边形
|
|
4050
|
+
*/
|
|
4051
|
+
private highlightPolygonWithSeparatePrimitive;
|
|
3508
4052
|
/**
|
|
3509
4053
|
* 清除悬停高亮
|
|
3510
4054
|
*/
|
|
@@ -3557,13 +4101,26 @@ declare class MassPolygonManager {
|
|
|
3557
4101
|
getBounds(): GeoBounds | null;
|
|
3558
4102
|
/**
|
|
3559
4103
|
* 飞行到所有多边形的范围
|
|
4104
|
+
*
|
|
4105
|
+
* 优化说明:
|
|
4106
|
+
* 1. 多点采样地形高度(四角 + 中心),取最大值确保相机不会陷入地下
|
|
4107
|
+
* 2. 修正 pitch 角度对视角高度的影响计算
|
|
4108
|
+
* 3. 添加最小/最大高度限制,防止极端情况
|
|
4109
|
+
* 4. 使用异步地形查询获取更精确的高度
|
|
4110
|
+
* 5. 添加销毁检查,防止异步回调在实例销毁后执行
|
|
3560
4111
|
*/
|
|
3561
4112
|
flyToBounds(options?: {
|
|
3562
4113
|
duration?: number;
|
|
3563
4114
|
padding?: number;
|
|
3564
4115
|
pitch?: number;
|
|
3565
4116
|
heading?: number;
|
|
4117
|
+
minHeight?: number;
|
|
4118
|
+
maxHeight?: number;
|
|
3566
4119
|
}): void;
|
|
4120
|
+
/**
|
|
4121
|
+
* 同步版本的飞行方法(降级方案)
|
|
4122
|
+
*/
|
|
4123
|
+
private flyToBoundsSync;
|
|
3567
4124
|
/**
|
|
3568
4125
|
* 设置可见性
|
|
3569
4126
|
*/
|
|
@@ -3749,4 +4306,4 @@ declare const placeholder: {
|
|
|
3749
4306
|
};
|
|
3750
4307
|
declare const droneModelUrl: string;
|
|
3751
4308
|
|
|
3752
|
-
export { AirplaneCursor, type AirplaneCursorOptions, type AltitudeMode, CZMLManager, type CameraDestinationInput, CameraEventBus, type CameraFOVChangeEvent, CameraFOVController, type CameraFlyOptions, type CameraInitOptions, CameraManager, type CameraOrientation, type CameraPoseChangeEvent, type CameraSetViewOptions, type CameraView, type CaptureWithViewOptions, type CesiumAssetsOptions, type ConvertedWaylineData, type ConvertedWaypointData, type CursorPoseChangeEvent, type CursorType, type CzmlExportOptions, type CzmlImportOptions, type EditingChange, Emitter, type FOVChangeEvent, type FOVControllerOptions, type FlightPathPreviewController, FlightSimulator, type FlightSimulatorController, type FlightSimulatorOptions, type FlightSimulatorState, type FlightSimulatorStateChangeEvent, type FlyToBoundsOptions, type FlyToOptions, FrustumPyramid, type FrustumPyramidOptions, type FrustumShapeChangeEvent, type GeoBounds, type GeoPoint, type HighlightStyleOptions, type HoverLabelStyleOptions, type ImageryOptions, type ImageryProviderKind, type InitOptions, type LODConfig, LODManager, type LODTarget, type LayerEvents, type LayerHandle, LayerManager, type LayerType, type Listener, type LoadMapLayersResult, type LoadSliceJsonOptions, type LoadSliceJsonResult, type LonLatHeight, type MapLayerConfig, type MassPolygonInteractionOptions, MassPolygonManager, type MassPolygonOptions, type MassPolygonResult, type Orientation, type PathEditingSaveResult, type PathOptions, type PathSafetyCheckOptions, type PathSafetyCheckResult, PathSafetyChecker, type PathToSinoflyOptions, type PhotoBillboardItem, type PhotoBillboardLayerOptions, type PhotoBillboardResult, type PointCloudPickResult, type PointCloudPickSession, PointCloudPicker, type PointCloudPickerOptions, type PolygonData, type PolygonDrawingOptions, type PolygonEditingSession, PolygonEditor, type PolygonPoint, type PolygonStyleOptions, type PreviousViewChange, type QuickEditOptions, RealtimeFlightTracker, type RealtimeFlightTrackerOptions, type RealtimeWaypoint, type RenderFlightPathOptions, type RenderFlightPathPreviewOptions, SceneManager, type SceneOptions, type ScreenshotOptions, type ScreenshotResult, type SegmentSafetyResult, type SelectionChange, type SelectionResult, type SelectionSession, Selector, type ShapeLineProps, type ShapePointProps, type ShapePolygonProps, type SinoflyAdapterOptions, type SinoflyWaylineData, type SinoflyWaypointInfo, type SliceJsonData, StateManager, type TerrainKind, type TerrainOptions, type Toggle2D3DContext, type Toggle2D3DOptions, type TrackStyleOptions, type VersionInfo, type VertexDetailInfo, type VertexDragMoveInfo, type VertexOperationInfo, type WaypointBatchUpdate, type WaypointUpdateData, assertCesiumAssetsConfigured, bringDataSourceToTop, bringPrimitiveCollectionToTop, calculateAbsoluteHeight, calculateBoundsDiagonal, calculateDistance, calculateDistanceAndMidpoint, calculateGeoBounds, calculateHeadingBetweenPoints, calculateMidpoint, calculateRelativeHeight, configureCesiumAssets, configureCesiumIonToken, convertPathToSinofly, convertSinoflyWayline, convertSinoflyWaylines, droneModelUrl, ensureCesiumIonToken, ensureLayerAbove, expandBounds, getCesiumBaseUrl, getCesiumIonToken, getDataSourceIndex, getDataSourceOrder, globalCameraEventBus, globalState, isPointInBounds, mergeBounds, placeholder, queryTerrainHeightAsync, queryTerrainHeightByLonLat, queryTerrainHeightByLonLatSync, queryTerrainHeightSync, queryTerrainHeights, queryTerrainHeightsByLonLat, renderFlightPath, renderFlightPathPreview, toggle2D3D, version, versionInfo };
|
|
4309
|
+
export { AirplaneCursor, type AirplaneCursorOptions, type AltitudeMode, CZMLManager, type CameraDestinationInput, CameraEventBus, type CameraFOVChangeEvent, CameraFOVController, type CameraFlyOptions, type CameraInitOptions, CameraManager, type CameraOrientation, type CameraPoseChangeEvent, type CameraSetViewOptions, type CameraView, type CaptureWithViewOptions, type CesiumAssetsOptions, type ConvertedWaylineData, type ConvertedWaypointData, type CursorPoseChangeEvent, type CursorType, type CzmlExportOptions, type CzmlImportOptions, type EditingChange, Emitter, type FOVChangeEvent, type FOVControllerOptions, type FlightPathPreviewController, FlightSimulator, type FlightSimulatorController, type FlightSimulatorOptions, type FlightSimulatorState, type FlightSimulatorStateChangeEvent, type FlyToBoundsOptions, type FlyToOptions, FrustumPyramid, type FrustumPyramidOptions, type FrustumShapeChangeEvent, type GeoBounds, type GeoPoint, type HighlightStyleOptions, type HoverLabelStyleOptions, type ImageryLayerConfig, type ImageryLayerType, type ImageryLoadOptions, type ImageryLoadResult, ImageryManager, type ImageryManagerEvents, type ImageryOptions, type ImageryProviderKind, type ImageryProviderType, type InitOptions, type LODConfig, LODManager, type LODTarget, type LayerEvents, type LayerHandle, LayerManager, type LayerType, type Listener, type LoadMapLayersResult, type LoadSliceJsonOptions, type LoadSliceJsonResult, type LonLatHeight, type MapLayerConfig, type MassPolygonInteractionOptions, MassPolygonManager, type MassPolygonOptions, type MassPolygonResult, type Orientation, type PathEditingSaveResult, type PathOptions, type PathSafetyCheckOptions, type PathSafetyCheckResult, PathSafetyChecker, type PathToSinoflyOptions, type PhotoBillboardItem, type PhotoBillboardLayerOptions, type PhotoBillboardResult, type PointCloudPickResult, type PointCloudPickSession, PointCloudPicker, type PointCloudPickerOptions, type PolygonData, type PolygonDrawingOptions, type PolygonEditingSession, PolygonEditor, type PolygonPoint, type PolygonStyleOptions, type PreviousViewChange, type QuickEditOptions, RealtimeFlightTracker, type RealtimeFlightTrackerOptions, type RealtimeWaypoint, type RenderFlightPathOptions, type RenderFlightPathPreviewOptions, SceneManager, type SceneOptions, type ScreenshotOptions, type ScreenshotResult, type SegmentSafetyResult, type SelectionChange, type SelectionResult, type SelectionSession, Selector, type ShapeLineProps, type ShapePointProps, type ShapePolygonProps, type SinoflyAdapterOptions, type SinoflyWaylineData, type SinoflyWaypointInfo, type SliceJsonData, StateManager, type TerrainKind, TerrainManager, type TerrainManagerEvents, type TerrainOptions, type TerrainProviderType, type TerrainSourceConfig, type TerrainSourceType, type TerrainSwitchOptions, type TerrainSwitchResult, type TilesetConfig, type TilesetLoadOptions, type TilesetLoadResult, TilesetManager, type TilesetManagerEvents, type TilesetType, type Toggle2D3DContext, type Toggle2D3DOptions, type TrackStyleOptions, type VersionInfo, type VertexDetailInfo, type VertexDragMoveInfo, type VertexOperationInfo, type WaypointBatchUpdate, type WaypointUpdateData, assertCesiumAssetsConfigured, bringDataSourceToTop, bringPrimitiveCollectionToTop, calculateAbsoluteHeight, calculateBoundsDiagonal, calculateDistance, calculateDistanceAndMidpoint, calculateGeoBounds, calculateHeadingBetweenPoints, calculateMidpoint, calculateRelativeHeight, configureCesiumAssets, configureCesiumIonToken, convertPathToSinofly, convertSinoflyWayline, convertSinoflyWaylines, droneModelUrl, ensureCesiumIonToken, ensureLayerAbove, expandBounds, getCesiumBaseUrl, getCesiumIonToken, getDataSourceIndex, getDataSourceOrder, globalCameraEventBus, globalState, isPointInBounds, mergeBounds, placeholder, queryTerrainHeightAsync, queryTerrainHeightByLonLat, queryTerrainHeightByLonLatSync, queryTerrainHeightSync, queryTerrainHeights, queryTerrainHeightsByLonLat, renderFlightPath, renderFlightPathPreview, toggle2D3D, version, versionInfo };
|