Layer source for the CartoDB Maps API.

Hierarchy (view full)

Constructors

  • Parameters

    • options: Options

      CartoDB options.

    Returns CartoDB

Properties

crossOrigin: null | string
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
tileCacheForProjection: {
    [x: string]: TileCache;
}
tileClass: typeof ImageTile
tileGrid: null | TileGrid
tileGridForProjection: {
    [x: string]: default;
}
tileLoadFunction: LoadFunction
tileOptions: Options
tmpSize: Size
un: TileSourceOnSignature<void>
urls: null | string[]
viewRejector: ((arg0: Error) => void)
viewResolver: ((arg0: ViewOptions) => 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

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

    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.

  • 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: external.ol.Tile) => 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.

  • Get the attribution function for the source.

    Returns null | Attribution

    Attribution function.

  • Returns boolean

    Attributions are collapsible.

  • Returns the current config.

    Returns any

    The current configuration.

  • Returns number

    Gutter.

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

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

  • Get an object of all property names and values.

    Returns {
        [x: string]: any;
    }

    Object.

    • [x: string]: any
  • Get an object of all property names and values.

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

    Object.

  • Parameters

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

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

    Returns State

    State.

  • Parameters

    • z: number

      Tile coordinate z.

    • x: number

      Tile coordinate x.

    • y: number

      Tile coordinate y.

    • pixelRatio: number

      Pixel ratio.

    • projection: Projection

      Projection.

    Returns ImageTile | ReprojTile

    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.

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

  • Parameters

    • projection: Projection

      Projection.

    Returns TileGrid

    Tile grid.

  • Protected

    Parameters

    • z: number

      Tile coordinate z.

    • x: number

      Tile coordinate x.

    • y: number

      Tile coordinate y.

    • pixelRatio: number

      Pixel ratio.

    • projection: Projection

      Projection.

    Returns ImageTile

    Tile.

  • Return the tile load function of the source.

    Returns LoadFunction

    TileLoadFunction

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

  • Return the tile URL function of the source.

    Returns UrlFunction

    TileUrlFunction

  • Return the URLs used for this source. When a tileUrlFunction is used instead of url or urls, null will be returned.

    Returns null | string[]

    URLs.

  • Returns Promise<ViewOptions>

    A promise for view-related properties.

  • Returns undefined | boolean

    Wrap X.

  • Protected

    Handle tile change events.

    Parameters

    • event: BaseEvent

      Event.

    Returns void

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

        • (arg0): unknown
        • Parameters

          • arg0: Event | BaseEvent

          Returns unknown

    Returns EventsKey | EventsKey[]

    Event key.

  • Protected

    Parameters

    • type: string | string[]

      Type.

    • listener: ((arg0: Event | BaseEvent) => 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

  • 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: undefined | AttributionLike

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

    Returns void

  • Sets the CartoDB config

    Parameters

    • config: any

      In the case of anonymous maps, a CartoDB configuration object. If using named maps, a key-value lookup with the template parameters.

    Returns void

  • 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
    • Optionalsilent: boolean

      Update without triggering an event.

    Returns void

  • Sets whether to render reprojection edges or not (usually for debugging).

    Parameters

    • render: boolean

      Render the edges.

    Returns void

  • 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

  • Set the tile load function of the source.

    Parameters

    • tileLoadFunction: LoadFunction

      Tile load function.

    Returns void

  • Set the tile URL function of the source.

    Parameters

    • tileUrlFunction: UrlFunction

      Tile URL function.

    • Optionalkey: string

      Optional new tile key for the source.

    Returns void

  • Set the URL to use for requests.

    Parameters

    • url: string

      URL.

    Returns void

  • Set the URLs to use for requests.

    Parameters

    • urls: string[]

      URLs.

    Returns void

  • Parameters

    • tileCoord: TileCoord

      Tile coordinate.

    • pixelRatio: number

      Pixel ratio.

    • projection: Projection

      Projection.

    Returns undefined | string

    Tile URL.

  • Protected

    Unlisten for a certain type of event.

    Parameters

    • type: string | string[]

      Type.

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

      Listener.

        • (arg0): unknown
        • Parameters

          • arg0: Event | BaseEvent

          Returns unknown

    Returns void

  • Unsets a property.

    Parameters

    • key: string

      Key name.

    • Optionalsilent: boolean

      Unset without triggering an event.

    Returns void

  • Increases the cache size if needed

    Parameters

    • tileCount: number

      Minimum number of tiles needed.

    • projection: Projection

      Projection.

    Returns void

  • Updates the carto db config.

    Parameters

    • config: any

      a key-value lookup. Values will replace current values in the config.

    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.

    Returns void