This is the documentation of version 1.0.0-rc.2. Go to the latest version, 1.0.0-rc.5.

Bloom

Bloom is the map effects plugin's emphasis for dark and driving styles. Lit roads, traffic tubes and route lines glow. The playground below has every bloom knob on one panel, including the colour scope:

Turning it on

Bloom is off until bloom.intensity is above 0. bloom.threshold sets how bright a pixel must be to glow, and bloom.radius sets how far the glow spreads:

import { MapEffects } from '@tomtom-org/maps-sdk-plugin-map-effects';

const effects = new MapEffects(map);
effects.updateConfig({ bloom: { intensity: 0.5, threshold: 0.6 } });

Bloom reads back the map canvas, so the map needs preserveDrawingBuffer: true.

Knob Range Default
bloom.intensity, bloom.threshold 0–1 0 (off), 0.55
bloom.radius (CSS px) 2–40 12
bloom.only list of style colour knobs, groups and CSS colours [] (the whole frame)
bloom.onlyTolerance 0–1 0.15

Scoping bloom by colour

bloom.only lists the colours bloom may light. Entries mix freely, and the default [] lights the whole frame.

import { setKnob } from '@tomtom-org/maps-sdk/map';
import { effectKnobCatalogue } from '@tomtom-org/maps-sdk-plugin-map-effects';

effects.updateConfig({ bloom: { intensity: 0.9, only: ['traffic'] } }); // a group of style colours
setKnob(effects, effectKnobCatalogue, 'bloom.only', ['traffic.incidents.colors.major', 'traffic.incidents.colors.closed']); // single knobs

const routeColor = '#1a73e8';                                                 // the color your RoutingModule draws routes in
setKnob(effects, effectKnobCatalogue, 'bloom.only', ['traffic', routeColor]); // plus a CSS colour of your own
Entry Resolves to
A style colour knob by its map-wide id, e.g. colors.roadMajor, traffic.flow.colors.slow, pois.label.color the colour the loaded style paints it in
A group of them (StyleColorKnobGroup), e.g. traffic, traffic.incidents, colors every colour knob whose id starts with it
A CSS colour, e.g. '#1a73e8' itself — for what no style knob paints, such as a route in the color you gave RoutingModule

How it renders

Bloom is neither a GPU pass nor a CSS overlay. It is a canvas at a quarter of the pixels, which the plugin redraws every frame and blends in screen mode. A glow needs the original and its blur, which a backdrop-filter can't give. Bloom draws from the GPU chain's output, so it glows over the depth of field's defocus. If a pass of your own shifts hues, a scope may need a wider bloom.onlyTolerance to find its colours. Keep bloom.radius moderate on large canvases.

Related guides and examples

Related guides

Related examples