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

    Type Alias IconMapping<F>

    IconMapping:
        | { fn: (feature: F) => string | undefined; to: "imageID" }
        | {
            fn: (feature: F) => MapStylePOICategory | undefined;
            to: "poiCategory";
        }

    Picks the icon of each feature a module draws, from the feature itself.

    Type Parameters

    • F

      The feature fn receives.

    • imageID - fn returns the id of an image in the style's sprite, or of one the module adds.
    • poiCategory - fn returns a POI category, drawn with the SDK's icon for it, so data that is not a search result can still look like one.

    If fn returns undefined, that feature keeps the icon it has without a mapping.