StoryMapJS API
    Preparing search index...

    Interface OlSourceAbstract

    Abstract base class; normally only used for creating subclasses and not instantiated in apps. Base class for :ol/layer/Layer~Layer sources.

    A generic change event is triggered when the state of the source changes.

    interface OlSource {
        disposed: boolean;
        loading: number | boolean;
        on: ObjectOnSignature<EventsKey>;
        once: ObjectOnSignature<EventsKey>;
        projection: OlProjection | null;
        un: ObjectOnSignature<void>;
        viewRejector: (arg0: Error) => void;
        viewResolver: (arg0: ViewOptions) => void;
        addChangeListener(key: string, listener: Listener): void;
        addEventListener(type: string, listener: Listener): void;
        applyProperties(source: BaseObject): void;
        changed(): void;
        dispatchEvent(event: string | BaseEvent): boolean | undefined;
        dispose(): void;
        disposeInternal(): void;
        get(key: string): any;
        getAttributions(): Attribution | null;
        getAttributionsCollapsible(): boolean;
        getInterpolate(): boolean;
        getKeys(): string[];
        getListeners(type: string): Listener[] | undefined;
        getProjection(): OlProjection | null;
        getProperties(): NoInfer<{ [x: string]: any }>;
        getPropertiesInternal(): Partial<NoInfer<{ [x: string]: any }>> | null;
        getResolutions(projection?: OlProjection): number[] | null;
        getRevision(): number;
        getState(): State;
        getView(): Promise<ViewOptions>;
        getWrapX(): boolean | undefined;
        hasListener(type?: string): boolean;
        hasProperties(): boolean;
        notify(key: string, oldValue: any): void;
        onceInternal(
            type: string | string[],
            listener: (arg0: Event | BaseEvent) => unknown,
        ): EventsKey | EventsKey[];
        onInternal(
            type: string | string[],
            listener: (arg0: Event | BaseEvent) => unknown,
        ): EventsKey | EventsKey[];
        ready(): Promise<void>;
        refresh(): void;
        removeChangeListener(key: string, listener: Listener): void;
        removeEventListener(type: string, listener: Listener): void;
        set(key: string, value: any, silent?: boolean): void;
        setAttributions(attributions: AttributionLike | undefined): void;
        setProperties(values: Partial<NoInfer<Properties>>, silent?: boolean): void;
        setState(state: State): void;
        unInternal(
            type: string | string[],
            listener: (arg0: Event | BaseEvent) => unknown,
        ): void;
        unset(key: string, silent?: boolean): void;
    }

    Hierarchy

    • BaseObject<{ [x: string]: any }>
      • OlSource
    Index
    disposed: boolean

    The object has already been disposed.

    loading: number | boolean

    This source is currently loading data. Sources that defer loading to the map's tile queue never set this to a truthy value.

    on: ObjectOnSignature<EventsKey>
    once: ObjectOnSignature<EventsKey>
    projection: OlProjection | null
    un: ObjectOnSignature<void>
    viewRejector: (arg0: Error) => void
    viewResolver: (arg0: ViewOptions) => void
    • Parameters

      • key: string

        Key name.

      • listener: Listener

        Listener.

      Returns void

    • Parameters

      • type: string

        Type.

      • listener: Listener

        Listener.

      Returns void

    • Protected

      Apply any properties from another object without triggering events.

      Parameters

      • source: BaseObject

        The source object.

      Returns void

    • Increases the revision counter and dispatches a 'change' event.

      Returns void

    • Dispatches an event and calls all listeners listening for events of this type. The event parameter can either be a string or an Object with a type property.

      Parameters

      • event: string | BaseEvent

        Event object.

      Returns boolean | undefined

      false if anyone called preventDefault on the event object or if any of the listeners returned false.

    • Clean up.

      Returns void

    • Protected

      Extension point for disposable objects.

      Returns void

    • Gets a value.

      Parameters

      • key: string

        Key name.

      Returns any

      Value.

    • Get the attribution function for the source.

      Returns Attribution | null

      Attribution function.

    • Returns boolean

      Attributions are collapsible.

    • Returns boolean

      Use linear interpolation when resampling.

    • Get a list of object property names.

      Returns string[]

      List of property names.

    • Get the listeners for a specified event type. Listeners are returned in the order that they will be called in.

      Parameters

      • type: string

        Type.

      Returns Listener[] | undefined

      Listeners.

    • Get the projection of the source.

      Returns OlProjection | null

      Projection.

    • Get an object of all property names and values.

      Returns NoInfer<{ [x: string]: any }>

      Object.

    • Get an object of all property names and values.

      Returns Partial<NoInfer<{ [x: string]: any }>> | null

      Object.

    • Parameters

      Returns number[] | null

      Resolutions.

    • Get the version number for this object. Each time the object is modified, its version number will be incremented.

      Returns number

      Revision.

    • Get the state of the source, see import("./Source.js").State for possible states.

      Returns State

      State.

    • Returns Promise<ViewOptions>

      A promise for view-related properties.

    • Returns boolean | undefined

      Wrap X.

    • Parameters

      • Optionaltype: string

        Type. If not provided, true will be returned if this event target has any listeners.

      Returns boolean

      Has listeners.

    • Returns boolean

      The object has properties.

    • Parameters

      • key: string

        Key name.

      • oldValue: any

        Old value.

      Returns void

    • Protected

      Parameters

      • type: string | string[]

        Type.

      • listener: (arg0: Event | BaseEvent) => unknown

        Listener.

      Returns EventsKey | EventsKey[]

      Event key.

    • Protected

      Parameters

      • type: string | string[]

        Type.

      • listener: (arg0: Event | BaseEvent) => unknown

        Listener.

      Returns EventsKey | EventsKey[]

      Event key.

    • Protected

      Resolve once the source is ready to be used (its state is ready), or reject if it fails to load (its state is error). Sources that configure asynchronously can use this to expose data (e.g. dimensions) through a promise instead of the change event.

      Returns Promise<void>

      Resolves when the source is ready.

    • Refreshes the source. The source will be cleared, and data from the server will be reloaded.

      Returns void

    • Parameters

      • key: string

        Key name.

      • listener: Listener

        Listener.

      Returns void

    • Parameters

      • type: string

        Type.

      • listener: Listener

        Listener.

      Returns void

    • Sets a value.

      Parameters

      • key: string

        Key name.

      • value: any

        Value.

      • Optionalsilent: boolean

        Update without triggering an event.

      Returns void

    • Set the attributions of the source.

      Parameters

      • attributions: AttributionLike | undefined

        Attributions. Can be passed as string, Array<string>, :ol/source/Source~Attribution, or undefined.

      Returns void

    • Sets a collection of key-value pairs. Note that this changes any existing properties and adds new ones (it does not remove any existing properties).

      Parameters

      • values: Partial<NoInfer<Properties>>

        Values.

      • Optionalsilent: boolean

        Update without triggering an event.

      Returns void

    • Set the state of the source.

      Parameters

      • state: State

        State.

      Returns void

    • Protected

      Unlisten for a certain type of event.

      Parameters

      • type: string | string[]

        Type.

      • listener: (arg0: Event | BaseEvent) => unknown

        Listener.

      Returns void

    • Unsets a property.

      Parameters

      • key: string

        Key name.

      • Optionalsilent: boolean

        Unset without triggering an event.

      Returns void