TomTom Maps for JavaScript
    Preparing search index...

    Type Alias StyleChangeContext

    What a StyleChangeHandler is told about the style switch it is reacting to.

    The SDK's own modules read resetState to decide between restoring themselves (data, config, filters) onto the new style, or re-binding to it with defaults and nothing shown. Your handlers get the same information, so a custom overlay can make the same choice.

    map.addStyleChangeHandler({
    onStyleChanged: ({ resetState }) => {
    if (resetState) dropCustomLayers();
    else reattachCustomLayers();
    },
    });
    type StyleChangeContext = {
        resetState: boolean;
    }
    Index
    resetState: boolean

    true for a clean switch (setStyle(style, { resetState: true })), false when the switch carries SDK state over (setStyle(style) or setStyle(style, { resetState: false })).