Borrowed looks
A few parts the data-owned modules draw are made to look like part of the style, so they read their look off it. They follow the knobs that restyle what they borrow — the Styling Foundations module's sizes, and the look knobs of the POIs and traffic incidents modules — live, whether the knob was set before the module was created or after, and across a setStyle:
What each module borrows
| Module | What it borrows | The knobs it follows | Your own look instead |
|---|---|---|---|
PlacesModule, base-map marker type |
the POI labels and icons | POIsModule label.color, label.haloColor, sizeFactor; Styling labels.sizeFactor, symbols.sizeFactor |
label, or a layers override |
PlacesModule, circle-icon marker type |
the icon size | POIsModule sizeFactor; Styling symbols.sizeFactor |
a layers override |
PlacesModule, pin-clustered marker type |
the micro markers | POIsModule sizeFactor; Styling symbols.sizeFactor |
a layers override |
RoutingModule |
the delay colour of a traffic section |
TrafficIncidentsModule colors.minor, colors.moderate, colors.major |
a line-color under layers.sections.traffic.routeIncidentBackgroundLine |
TrafficIncidentDetailsModule |
the line colour of each incident magnitude | TrafficIncidentsModule colors.minor, colors.moderate, colors.major, colors.closed |
none: the module always draws the style's incident colours |
import { PlacesModule, POIsModule, poisKnobCatalogue, setKnob } from '@tomtom-org/maps-sdk/map';
const places = await PlacesModule.create(map, { markerType: 'base-map' });
const pois = await POIsModule.get(map);
setKnob(pois, poisKnobCatalogue, 'label.color', '#be185d'); // the places' labels turn with the map's POIs
Who wins
- A look of your own wins over the knob.
- With none of its knobs set, a route keeps the SDK's own delay colours, which match the incidents of the light styles.
- The
pinmarker type borrows nothing, and no knob reaches it. - The knob still writes only the style's layers: the module reads the new look and redraws its own (Who owns what).
Related guides and examples
Related guides
- Map styling — the size knobs these parts follow
- POIs and Traffic incidents — the look knobs these parts follow
- Map colours and the accent — the colour the modules' own parts default to
- Place styling — the marker types and what each draws
- Route sections — the
trafficsection and its delay colours
Related examples
- Borrowed looks — places, a route and fetched traffic incidents following the knobs that restyle the style's POIs and incidents