For AI agents: a documentation index is available at /llms.txt. Markdown versions of all pages are available by appending .md to any URL.
Class ImageManager
Hierarchy (View Summary)
- Evented
- ImageManager
Constructors
constructor
-
Returns ImageManager
Properties
atlasImage
atlasTexture
callbackDispatchedThisFrame
dirty
images
loaded
patterns
requestors
This is used to track requests for images that are not yet available. When the image is loaded, the requestors will be notified.
updatedImages
Methods
addImage
-
Parameters
- id: string
- image: StyleImage
Returns void
beginFrame
-
Returns void
bind
-
Parameters
- context: Context
Returns void
cloneImages
-
Returns Record<string, StyleImage>
destroy
-
Returns void
dispatchRenderCallbacks
-
Parameters
- ids: string[]
Returns void
fire
-
Parameters
- event: string | Event
Optionalproperties: any
Returns this
getImage
-
Parameters
- id: string
Returns StyleImage
getImages
-
Parameters
- ids: string[]
Returns Promise<GetImagesResponse>
getPattern
-
Parameters
- id: string
Returns ImagePosition
getPixelSize
-
Returns { height: number; width: number }
isLoaded
-
Returns boolean
listens
-
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
trueif there is at least one registered listener for specified event type,falseotherwise - type: string
listImages
-
Returns string[]
off
-
Removes a previously registered event listener.
Parameters
- type: string
The event type to remove listeners for.
- listener: Listener
The listener function to remove.
Returns this
- type: string
on
-
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 withtargetandtypeproperties.
Returns Subscription
- type: string
once
-
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.
Optionallistener: ListenerThe function to be called when the event is fired the first time.
Returns ImageManager | Promise<any>
thisor a promise if a listener is not provided - type: string
removeImage
-
Parameters
- id: string
Returns void
setEventedParent
-
Bubble all events fired by this instance of Evented to this parent instance of Evented.
Parameters
Optionalparent: Evented | nullOptionaldata: any
Returns this
setLoaded
-
Parameters
- loaded: boolean
Returns void
updateImage
-
Parameters
- id: string
- image: StyleImage
Optionalvalidate: boolean
Returns void
Methods mixed in to other classes for event capabilities.