Borrowed looks

Some parts that the data-owned modules and plugins draw should look like part of the style, so they take their look from it. They follow the knobs that restyle what they borrow. Those are the Styling Foundations module’s sizes and colours, and the look knobs of the POIs and traffic incidents modules. They update live, whether you set the knob before or after creating the module, and across a setStyle.

What each module borrows

ModuleWhat it borrowsThe knobs it followsYour own look instead
PlacesModule, base-map marker typethe POI labels and iconsPOIsModule label.color, label.haloColor, sizeFactor; Styling labels.sizeFactor, symbols.sizeFactorlabel, or a layers override
PlacesModule, circle-icon marker typethe icon sizePOIsModule sizeFactor; Styling symbols.sizeFactora layers override
PlacesModule, pin-clustered marker typethe micro markersPOIsModule sizeFactor; Styling symbols.sizeFactora layers override
RoutingModulethe delay colour of a traffic sectionTrafficIncidentsModule colors.minor, colors.moderate, colors.majora line-color under layers.sections.traffic.routeIncidentBackgroundLine
RoutingModule, summary bubblesthe label halo and label colours, for the bubble and its textStyling colors.labelHalo, colors.label, which a theme setssummaryBubbles.color, summaryBubbles.label.color
RoutingModule, border crossingsthe same, as the selected summary bubble takes themStyling colors.labelHalo, colors.labelcountryCrossings.color, countryCrossings.label.color
TrafficIncidentDetailsModulethe line colour of each incident magnitudeTrafficIncidentsModule colors.minor, colors.moderate, colors.major, colors.closedNone. The module always draws the style’s incident colours.
Landmarks3D pluginthe colour, opacity, wall gradient and zoom range of the 3D buildingsStyling colors.artificial, and colors.land it derives fromits color, opacity, verticalGradient, minZoom and maxZoom knobs
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

  • Your own look wins over the knob.
  • If you set none of its knobs, a route keeps the SDK’s own delay colours, which match the incidents of the light styles, and its summary bubbles and border crossings the SDK’s light or dark default.
  • The pin marker 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).
  • Borrowed looks — places, a route and fetched traffic incidents following the knobs that restyle the style’s POIs and incidents