3D-City Model
    Preparing search index...

    SettingsManager – Singleton manager for global 3D scene, rendering, and resource/performance settings.

    Stores, applies, and exposes all tunable performance and visual parameters for Cesium (or similar) applications: tile cache, screen-space error, post-processing, level of detail, and more. Provides high-level "profiles" for batch configuration and ensures only one instance exists at a time.

    // Get or create singleton instance:
    const sm = new SettingsManager(viewer, layers, { profile: 'medium' });
    sm.fxaa = false;
    sm.msaa = 4;

    // Use a profile:
    SettingsManager.Profiles.high; // -> { ...high settings... }
    Index

    Constructors

    • Construct and/or get the singleton instance. If already created, returns the existing instance instead of creating a new one.

      Parameters

      • viewer: any

        Main viewer object.

      • layers: any

        Layer collections/registry.

      • Optionaloptions: object = {}

        Settings to override or set, aligned to the full parameter/property list.

      Returns SettingsManager

    Properties

    layers: any

    Layer collections for applying/tuning global settings.

    listeners: undefined | Set<any>

    Registered listeners for profile/setting changes.

    viewer: any

    Main application viewer (Cesium or similar).

    Profiles: object = ...

    Named profile presets for low, medium, high, ultra quality/performance. Each profile is an object with the above settings, e.g., tileCacheSize, maximumScreenSpaceError, etc.

    Accessors

    Methods

    • Applies key level-of-detail and error parameters from SettingsManager to a layer (except for POINTS). Propagates adaptive detail, error factor, and density configs to the Layer instance.

      Parameters

      • layer: Layer

        The target Layer to update.

      Returns void

      settingsManager.apply(tileLayer); // Applies all relevant settings for rendering/LOD.
      
    • Returns terrain and primitive depth bias values based on input (e.g., shadow map size). Used to tune Cesium rendering and shadow quality, depending on texture or shadow map resolution.

      Parameters

      • value: number

        Usually shadow map size or resolution (e.g., 1024, 2048, or 4096).

      Returns object

      An object with terrain and primitive bias values.

      const bias = settingsManager.getDepthBias(2048); // { terrain: 0.00065, primitive: 0.00002 }
      
    • Updates all settings from a configuration object. Each entry in the config object is copied to the SettingsManager instance by property name. After update, dispatches a global 'settings-update' CustomEvent to notify listeners of changes.

      Parameters

      • config: object

        A flat object with keys matching SettingsManager properties.

      Returns void

      window#settings-update - CustomEvent with no detail; signals settings were updated.

      settingsManager.update(SettingsManager.Profiles.high);
      
    • Updates all settings and options from a named profile string (e.g., 'low', 'high', 'ultra'). Loads the matching settings object from SettingsManager.Profiles, applies them via .update, and dispatches a global profile-changed CustomEvent on the window to inform other components.

      Parameters

      • profileString: string

        The profile name (key) to load, such as "low", "medium", "high", "ultra".

      Returns void

      window#profile-changed - Fired as a bubbling CustomEvent, with detail containing the chosen profile name.

      settingsManager.updateFromString("ultra");
      // settings and rendering quality are switched, and event listeners can react to 'profile-changed'.