Hierarchy

  • CanvasSource
    • CanvasSource

Properties

_listeners: Listeners
_oneTimeListeners: Listeners
_eventedParent: Evented
_eventedParentData: any
type: string
id: string
minzoom: number
maxzoom: number
tileSize: number
url: string
coordinates: Coordinates
tiles: {
    [_: string]: Tile;
}

Type declaration

  • [_: string]: Tile
dispatcher: Dispatcher
map: Map$1
texture: Texture
image: HTMLImageElement | ImageBitmap
tileID: CanonicalTileID
_boundsArray: RasterBoundsArray
boundsBuffer: VertexBuffer
boundsSegments: SegmentVector
_loaded: boolean
_request: AbortController
options: CanvasSourceSpecification
animate: boolean
canvas: HTMLCanvasElement
width: number
height: number
play: (() => void)

Type declaration

    • (): void
    • Enables animation. The image will be copied from the canvas to the map on each frame.

      Returns void

pause: (() => void)

Type declaration

    • (): void
    • Disables animation. The map will display a static copy of the canvas image.

      Returns void

_playing: boolean

Methods

  • Adds a listener to a specified event type.

    Parameters

    • type: string

      The event type to add a listen for.

    • listener: Listener

      The function to be called when the event is fired. The listener function is called with the data object passed to fire, extended with target and type properties.

    Returns CanvasSource

    this

  • Removes a previously registered event listener.

    Parameters

    • type: string

      The event type to remove listeners for.

    • listener: Listener

      The listener function to remove.

    Returns CanvasSource

    this

  • Adds a listener that will be called only once to a specified event type.

    The listener will be called first time the event fires after the listener is registered.

    Parameters

    • type: string

      The event type to listen for.

    • Optional listener: Listener

      The function to be called when the event is fired the first time.

    Returns Promise<any> | CanvasSource

    this or a promise if a listener is not provided

  • Parameters

    • event: string | Event$1
    • Optional properties: any

    Returns CanvasSource

  • Returns a true if this instance of Evented or any forwardeed instances of Evented have a listener for the specified type.

    Parameters

    • type: string

      The event type

    Returns boolean

    true if there is at least one registered listener for specified event type, false otherwise

  • Bubble all events fired by this instance of Evented to this parent instance of Evented.

    Parameters

    • Optional parent: Evented
    • Optional data: any

    Returns CanvasSource

    this

  • Returns boolean

  • Updates the image URL and, optionally, the coordinates. To avoid having the image flash after changing, set the raster-fade-duration paint property on the raster layer to 0.

    Parameters

    • options: UpdateImageOptions

      The options object.

    Returns CanvasSource

    this

  • Returns void

  • Sets the image's coordinates and re-renders the map.

    Parameters

    • coordinates: Coordinates

      Four geographical coordinates, represented as arrays of longitude and latitude numbers, which define the corners of the image. The coordinates start at the top left corner of the image and proceed in clockwise order. They do not have to represent a rectangle.

    Returns CanvasSource

    this

  • Parameters

    • tile: Tile

    Returns Promise<void>

  • Returns Promise<void>

  • Returns the HTML canvas element.

    Returns HTMLCanvasElement

    The HTML canvas element.

  • Parameters

    • map: Map$1

    Returns void

  • Returns void

  • Returns void

  • Returns CanvasSourceSpecification

  • Returns boolean

  • Returns boolean

Generated using TypeDoc