This is the documentation of version 0.63.0. Go to the latest version, 1.0.0-rc.5.
TomTom Maps for JavaScript
    Preparing search index...

    Type Alias RoutingModuleSerializableConfig

    RoutingModuleSerializableConfig: Omit<
        RoutingModuleConfig,
        "chargingStops"
        | "waypoints",
    > & {
        chargingStops?: Omit<ChargingStopsConfig, "icon"> & {
            icon?: Omit<ChargingStopIconConfig, "customIcons" | "mapping"> & {
                customIcons?: SerializableCustomImage[];
                mapping?: Extract<ChargingStopIconMapping, { basedOn: "chargingSpeed" }>;
            };
        };
        waypoints?: Omit<WaypointsConfig, "icon" | "label"> & {
            icon?: Omit<
                WaypointIconConfig,
                WaypointIndexType
                | "customIcons"
                | "mapping",
            > & { [R in WaypointIndexType]?: SerializablePinIconConfig } & {
                customIcons?: SerializableCustomImage[];
            };
            label?: SerializableFeatureLabelConfig<WaypointLabelConfig>;
        };
    }

    The part of a RoutingModuleConfig that survives JSON, for saving getConfig() and replaying it with applyConfig().

    It leaves out what JSON cannot carry, which a replay adds back in code:

    • chargingStops.icon.mapping with basedOn: 'custom', whose fn is a function.
    • waypoints.icon.mapping and waypoints.label.title as a function — a MapLibre expression title serializes.
    • Any image given as an HTMLImageElement: chargingStops.icon.customIcons, waypoints.icon.customIcons and each waypoint role's image — see SerializableCustomImage.