OptionalonCallback invoked immediately before a style change begins.
What kind of switch is happening; see StyleChangeContext.
void or a Promise that resolves when preparation is complete
OptionalonCallback invoked after a new style has been fully loaded.
What kind of switch is happening; see StyleChangeContext.
void or a Promise that resolves when reinitialization is complete
Use this to restore state, reinitialize layers, or perform other setup that depends on the new style being ready. This method can be synchronous or asynchronous: handlers run one after the other, in registration order, and the promise returned by TomTomMap.setStyle resolves only once the last one has finished.
OptionalpriorityWhere this handler runs relative to the others: lower values run first, equal values run in
registration order. Defaults to 0, which is also what the SDK's data and visibility modules
use; the SDK's StylingModule runs at 100 so semantic styling always lands on top of
whatever the modules restored.
Handler interface for responding to map style changes.
Remarks
This interface defines callbacks that are invoked when the map style changes via TomTomMap.setStyle. Use this to perform cleanup or reinitialization of custom map features when styles are switched.
Lifecycle:
onStyleAboutToChange- Called before the new style is appliedonStyleChanged- Called after the new style has been fully loadedCommon Use Cases:
Example
See