GeoLeaf Core API - v3.0.0
    Preparing search index...

    The cached-layers store of the offline database — layer payloads kept for offline reads.

    One of the IndexedDB sub-modules, wired by init() with the shared database handle. It is the only store that compresses: the _maybeCompress* members are deliberately maybe, as compression is skipped when the runtime lacks support (_supportsCompression) or when the payload would not benefit (_isCompressibleResource — already-compressed binaries, small records). Reads go back through _maybeDecompressRecord, so a caller never has to know whether a given record was stored compressed.

    interface LayersDBInstance {
        _db: IDBDatabase | null;
        init(db: IDBDatabase): LayersDBInstance;
        _supportsCompression(): boolean;
        _estimateDataSize(
            data:
                | string
                | object
                | ArrayBuffer
                | Blob
                | ArrayBufferView<ArrayBufferLike>,
        ): number;
        _isCompressibleResource(
            data: string | object,
            metadata?: LayerMetadata,
        ): boolean;
        _maybeCompressData(
            data: string | object | ArrayBuffer,
            metadata?: LayerMetadata,
        ): Promise<CompressionResult>;
        _maybeCompressBinary(
            wrapper: BinaryWrapper,
            metadata?: LayerMetadata,
        ): Promise<CompressionResult>;
        _maybeDecompressRecord(
            record: LayerRecord | null,
        ): Promise<LayerRecord | null>;
        cacheLayer(
            id: string,
            data: string | object | ArrayBuffer,
            profileId: string,
            metadata?: LayerMetadata,
        ): Promise<void>;
        getLayer(id: string): Promise<LayerRecord | null>;
        removeLayer(id: string): Promise<void>;
        getLayersByProfile(profileId: string): Promise<LayerRecord[]>;
        clearProfile(profileId: string): Promise<number>;
    }
    Index

    Properties

    _db: IDBDatabase | null

    Methods

    • Parameters

      • data: string | object | ArrayBuffer | Blob | ArrayBufferView<ArrayBufferLike>

      Returns number

    • Parameters

      • data: string | object
      • Optionalmetadata: LayerMetadata

      Returns boolean

    • Parameters

      • data: string | object | ArrayBuffer
      • Optionalmetadata: LayerMetadata

      Returns Promise<CompressionResult>

    • Parameters

      • wrapper: BinaryWrapper
      • Optionalmetadata: LayerMetadata

      Returns Promise<CompressionResult>

    • Parameters

      • id: string
      • data: string | object | ArrayBuffer
      • profileId: string
      • Optionalmetadata: LayerMetadata

      Returns Promise<void>