The icon's unique id in the map sprite.
Map feature styling references the icon by this id. Its values depend on the context:
icon.mapping picks by id (route waypoints), any unique string the mapping
returns.OptionalimageThe URL or data URI of the icon image.
To add a new icon to the sprite, set it. To reference an existing sprite icon, leave it out
or set it to undefined. The icon with the same id must then already exist in the sprite.
// Adding a new icon to the sprite
image: 'https://example.com/marker.png'
// Using a data URI
image: 'data:image/png;base64,iVBORw0KG...'
// Using a relative path
image: '/assets/icons/marker.png'
// Referencing an existing sprite icon (no URL needed)
// image is omitted when the icon already exists in the sprite
OptionaloffsetHorizontal offset of the icon from its anchor point, in pixels.
Positive values shift the icon right and negative values shift it left. The offset applies
before icon-size scaling, following the MapLibre icon-offset convention.
It takes effect only when you also provide image. An icon that references an existing
sprite icon by id alone ignores offsetX/offsetY.
OptionaloffsetVertical offset of the icon from its anchor point, in pixels.
Positive values shift the icon down and negative values shift it up. The offset applies
before icon-size scaling, following the MapLibre icon-offset convention.
It takes effect only when you also provide image. An icon that references an existing
sprite icon by id alone ignores offsetX/offsetY.
OptionalpixelThe pixel ratio of the icon image.
A custom map icon, added to the map sprite.
Use it to replace any default TomTom map icon, such as POIs, route waypoints or charging stations, with your own branding or design.
Remarks
An icon image can be a URL, raw SVG text, a data URI or a loaded img element. The SDK loads or transforms it if needed and adds it to the map style sprite for rendering.
Example
See
https://maplibre.org/maplibre-style-spec/sprite/