On this page
Constructors
Properties
Methods

Class Evented<E>Abstract

Abstract class that provides event handling capabilities.

Type Parameters

Hierarchy (View Summary)

Index

Constructors

Properties

Methods

Constructors

Properties

loaded: boolean = false

Methods

  • Removes a listener for a specific event type.

    Type Parameters

    • EventType extends string

    Parameters

    • eventType: EventType

      The type of event to remove the listener from.

    • handler: (event: Extract<E, { type: EventType }>) => void

      The listener function to remove.

    Returns void

  • Adds a listener for a specific event type.

    Type Parameters

    • EventType extends string

    Parameters

    • eventType: EventType

      The type of event to listen for.

    • handler: (event: Extract<E, { type: EventType }>) => void

      The function to call when the event is fired.

    Returns void

    map.on('load', () => {
      console.log('Map loaded!');
    });
    
  • Adds a listener for a specific event type that will be called only once.

    Type Parameters

    • EventType extends string

    Parameters

    • eventType: EventType

      The type of event to listen for.

    • handler: (event: Extract<E, { type: EventType }>) => void

      The function to call when the event is fired.

    Returns void

    map.once('splatmodel:load', () => {
      console.log('First SplatModel loaded!');
    });
    

Was this helpful?

GeoSplats SDK
Reference
Evented