修改添加gsojson的isdefault,方便重置场景
This commit is contained in:
@@ -197,7 +197,7 @@ export class CesiumUtils {
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量添加 Primitive(优化版本)
|
||||
* 批量添加 Primitive
|
||||
* - 按类型分组后批量创建,减少 scene.primitives.add 调用次数
|
||||
* - 同类型的多个实例合并到一个 Primitive 或 BillboardCollection 中
|
||||
* @param primitives - Primitive 配置选项数组
|
||||
@@ -384,13 +384,12 @@ export class CesiumUtils {
|
||||
|
||||
/**
|
||||
* 批量添加GeoJSON图层
|
||||
* @param layerConfigs - 图层配置数组,每个元素包含 layerId、geojsonData、isDefault 和 options
|
||||
* @param layerConfigs - 图层配置数组,每个元素包含 layerId、geojsonData 和 options
|
||||
*/
|
||||
async batchAddGeoJsonLayers(
|
||||
layerConfigs: Array<{
|
||||
layerId: string;
|
||||
geojsonData: CustomizeGeoJsonDataSource;
|
||||
isDefault?: boolean;
|
||||
options?: GeoJsonOptions;
|
||||
}>
|
||||
): Promise<void> {
|
||||
|
||||
@@ -136,7 +136,6 @@ export class EntityManager {
|
||||
*/
|
||||
clearAllEntities(clearType: 'default' | 'custom' | 'all' = 'custom'): void {
|
||||
const targetIds = this.#getTargetIdsByType(clearType);
|
||||
|
||||
targetIds.forEach((id) => {
|
||||
const entity = this.#viewer.entities.getById(id);
|
||||
if (entity) this.#viewer.entities.remove(entity);
|
||||
|
||||
@@ -103,7 +103,6 @@ export class PrimitiveManager {
|
||||
*/
|
||||
clearAllPrimitives(clearType: 'default' | 'custom' | 'all' = 'custom'): void {
|
||||
const targetMap = this.#getTargetMapByType(clearType);
|
||||
|
||||
targetMap.forEach((primitive) => {
|
||||
this.#viewer.scene.primitives.remove(primitive);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user