Classdesc

A source for working with GeoTIFF data. Note for users of the full build: The GeoTIFF source requires the geotiff.js library to be loaded as well.

Api

Hierarchy (view full)

Constructors

  • Parameters

    • options: Options

      Data tile options.

    Returns GeoTIFF

Properties

bandCount: number
convertToRGB_: boolean | "auto"
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

  • Determine the projection of the images in this GeoTIFF. The default implementation looks at the ProjectedCSTypeGeoKey and the GeographicTypeGeoKey of each image in turn. You can override this method in a subclass to support more projections.

    Parameters

    • sources: GeoTIFFImage[][]

      Each source is a list of images from a single GeoTIFF.

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

  • Returns Error

    A source loading error. When the source state is error, use this function to get more information about the error. To debug a faulty configuration, you may want to use a listener like

    geotiffSource.on('change', () => {
    if (geotiffSource.getState() === 'error') {
    console.error(geotiffSource.getError());
    }
    });
  • 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

    • z: number

      Tile coordinate z.

    • x: number

      Tile coordinate x.

    • y: number

      Tile coordinate y.

    • targetProj: Projection

      The output projection.

    • sourceProj: Projection

      The input projection.

    Returns DataTile

    Tile.

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

    Tile.

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

  • Protected

    Get the source tile size at the given zoom level. This may be different than the rendered tile size.

    Parameters

    • z: number

      Tile zoom level.

    Returns Size

    The source tile size.

  • Returns Promise<ViewOptions>

    A promise for view-related properties.

  • Returns undefined | boolean

    Wrap X.

  • Handle tile change events.

    Parameters

    • event: BaseEvent

      Event.

    Returns void

  • 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

  • Protected

    Parameters

    • loader: Loader

      The data loader.

    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

  • Sets the tile grid to use when reprojecting the tiles to the given projection instead of the default tile grid for the projection.

    This can be useful when the default tile grid cannot be created (e.g. projection has no extent defined) or for optimization reasons (custom tile size, resolutions, ...).

    Parameters

    • projection: ProjectionLike

      Projection.

    • tilegrid: TileGrid

      Tile grid to use for the projection.

    Returns void

    Api

  • Protected

    Set the source tile sizes. The length of the array is expected to match the number of levels in the tile grid.

    Parameters

    • tileSizes: Size[]

      An array of tile sizes.

    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