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