Classdesc

Abstract base class; normally only used for creating subclasses and not instantiated in apps. Base class for sources providing images divided into a tile grid.

Abstract

Api

Hierarchy (view full)

Constructors

Properties

disposed: boolean

The object has already been disposed.

loading: boolean

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

on: TileSourceOnSignature<EventsKey>
once: TileSourceOnSignature<EventsKey>
projection: null | Projection
tileCache: TileCache
tileGrid: null | TileGrid
tileOptions: Options
tmpSize: Size
un: TileSourceOnSignature<void>
viewRejector: ((arg0) => void)

Type declaration

    • (arg0): void
    • Parameters

      • arg0: Error

      Returns void

viewResolver: ((arg0) => void)

Type declaration

    • (arg0): void
    • Parameters

      • arg0: ViewOptions

      Returns void

zDirection: number | NearestDirectionFunction

zDirection hint, read by the renderer. Indicates which resolution should be used by a renderer if the views resolution does not match any resolution of the tile source. If 0, the nearest resolution will be used. If 1, the nearest lower resolution will be used. If -1, the nearest higher resolution will be used.

Methods

  • 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: Object

      The source object.

    Returns void

  • Returns boolean

    Can expire cache.

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

    Returns void

    Api

  • Remove all cached tiles from the source. The next render cycle will fetch new tiles.

    Returns void

    Api

  • 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 undefined | boolean

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

    Api

  • Clean up.

    Returns void

  • Protected

    Extension point for disposable objects.

    Returns void

  • Parameters

    • projection: Projection

      Projection.

    • usedTiles: {
          [x: string]: boolean;
      }

      Used tiles.

      • [x: string]: boolean

    Returns void

  • Parameters

    • projection: Projection

      Projection.

    • z: number

      Zoom level.

    • tileRange: TileRange

      Tile range.

    • callback: ((arg0) => boolean | void)

      Called with each loaded tile. If the callback returns false, the tile will not be considered loaded.

        • (arg0): boolean | void
        • Parameters

          Returns boolean | void

    Returns boolean

    The tile range is fully covered with loaded tiles.

  • Gets a value.

    Parameters

    • key: string

      Key name.

    Returns any

    Value.

    Api

  • Get the attribution function for the source.

    Returns null | Attribution

    Attribution function.

    Api

  • Returns boolean

    Attributions are collapsible.

    Api

  • Parameters

    • projection: Projection

      Projection.

    Returns number

    Gutter.

  • Returns boolean

    Use linear interpolation when resampling.

  • Return the key to be used for all tiles in the source.

    Returns string

    The key for all tiles.

  • Get a list of object property names.

    Returns string[]

    List of property names.

    Api

  • 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 undefined | Listener[]

    Listeners.

  • Parameters

    • projection: Projection

      Projection.

    Returns boolean

    Opaque.

  • Get the projection of the source.

    Returns null | Projection

    Projection.

    Api

  • Get an object of all property names and values.

    Returns {
        [x: string]: any;
    }

    Object.

    • [x: string]: any

    Api

  • Get an object of all property names and values.

    Returns null | {
        [x: string]: any;
    }

    Object.

  • Parameters

    • Optional projection: Projection

      Projection.

    Returns null | number[]

    Resolutions.

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

    Returns number

    Revision.

    Api

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

    Returns State

    State.

    Api

  • Parameters

    • z: number

      Tile coordinate z.

    • x: number

      Tile coordinate x.

    • y: number

      Tile coordinate y.

    • pixelRatio: number

      Pixel ratio.

    • projection: Projection

      Projection.

    Returns external.ol.Tile

    Tile.

    Abstract

  • Protected

    Parameters

    • projection: Projection

      Projection.

    Returns TileCache

    Tile cache.

  • Returns a tile coordinate wrapped around the x-axis. When the tile coordinate is outside the resolution and extent range of the tile grid, null will be returned.

    Parameters

    • tileCoord: TileCoord

      Tile coordinate.

    • Optional projection: Projection

      Projection.

    Returns TileCoord

    Tile coordinate to be passed to the tileUrlFunction or null if no tile URL should be created for the passed tileCoord.

  • Return the tile grid of the tile source.

    Returns null | TileGrid

    Tile grid.

    Api

  • Parameters

    • projection: Projection

      Projection.

    Returns TileGrid

    Tile grid.

  • Get the tile pixel ratio for this source. Subclasses may override this method, which is meant to return a supported pixel ratio that matches the provided pixelRatio as close as possible.

    Parameters

    • pixelRatio: number

      Pixel ratio.

    Returns number

    Tile pixel ratio.

  • Parameters

    • z: number

      Z.

    • pixelRatio: number

      Pixel ratio.

    • projection: Projection

      Projection.

    Returns Size

    Tile size.

  • Returns Promise<ViewOptions>

    A promise for view-related properties.

  • Returns undefined | boolean

    Wrap X.

  • Parameters

    • Optional type: 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) => unknown)

      Listener.

        • (arg0): unknown
        • Parameters

          • arg0: Event | BaseEvent

          Returns unknown

    Returns EventsKey | EventsKey[]

    Event key.

  • Protected

    Parameters

    • type: string | string[]

      Type.

    • listener: ((arg0) => unknown)

      Listener.

        • (arg0): unknown
        • Parameters

          • arg0: Event | BaseEvent

          Returns unknown

    Returns EventsKey | EventsKey[]

    Event key.

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

    Returns void

    Api

  • 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.

    • Optional silent: boolean

      Update without triggering an event.

    Returns void

    Api

  • Set the attributions of the source.

    Parameters

    • attributions: undefined | AttributionLike

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

    Returns void

    Api

  • Protected

    Set the value to be used as the key for all tiles in the source.

    Parameters

    • key: string

      The key for tiles.

    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: {
          [x: string]: any;
      }

      Values.

      • [x: string]: any
    • Optional silent: boolean

      Update without triggering an event.

    Returns void

    Api

  • 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) => unknown)

      Listener.

        • (arg0): unknown
        • Parameters

          • arg0: Event | BaseEvent

          Returns unknown

    Returns void

  • Unsets a property.

    Parameters

    • key: string

      Key name.

    • Optional silent: boolean

      Unset without triggering an event.

    Returns void

    Api

  • Increases the cache size if needed

    Parameters

    • tileCount: number

      Minimum number of tiles needed.

    • projection: Projection

      Projection.

    Returns void

  • Marks a tile coord as being used, without triggering a load.

    Parameters

    • z: number

      Tile coordinate z.

    • x: number

      Tile coordinate x.

    • y: number

      Tile coordinate y.

    • projection: Projection

      Projection.

    Returns void

    Abstract