Global

Members

# constant ARROW_GLYPHS

The five built-in direction-arrow glyphs for the route stamp, authored pointing RIGHT (+x = travel). Mapbox draws them to canvas via Path2D; Google rotates them a quarter-turn (toUpwardPath) since its line symbols face -y. filled glyphs use fill; the rest stroke at ARROW_STROKE_UNITS.

# constant ARROW_STROKE_UNITS

Stroke width for stroked glyphs, in the glyph's own local units.

# constant ARROW_SYMBOL_SCALE

Google Symbol.scale at stamp scale 1. Set to 1.2 so Google matches Mapbox and the CMS preview, which both render the glyph at 1.2 px/unit. Calibration knob — nudge if Google reads too large/small.

# constant COMET_FRACTION

Length of the comet streak as a fraction of the route, matching the CMS comet dash (~12/100).

# constant DEFAULT_ARROW_COLOR

Glyph colour used when the stamp supplies no color.

# constant DEFAULT_ARROW_STYLE

Style key used when an unknown or absent arrowStyle is supplied.

# constant DEFAULT_STAMP_SPACING_PX

Distance in px between repeated stamps when the stamp supplies no spacingPx.

# constant ICON_BASE_PX

Base rendered size (device-independent px) for directions-renderer icons: rendered size = ICON_BASE_PX × scale.

# constant PULSE_PERIOD_MS

Pulse cycle length, matching the CMS preview's dr-pulse 1.5s keyframe.

Set:.<string:>

# constant validViewVariants

Allowed analytics view variants for context enrichment.

Methods

# cometWindow(distanceTraveled, length, fractionopt) → {Object|null}

Start/end distances (in meters) of the comet streak window for a given travelled distance. The streak is a fixed fraction of the route length; the head restarts at the route start when it passes the end (the tail clamps at the seam, so the streak re-grows from the start rather than wrapping).

Parameters:
Name Type Attributes Default Description
distanceTraveled number

Distance travelled so far, in meters.

length number

Total route length, in meters.

fraction number <optional>
COMET_FRACTION

Streak length as a fraction of length.

Window, or null when the route has no length.

Object | null

# deriveHoverGating(hoverRuleopt) → {Object}

Derives which hover effects the Mapbox v3 view should apply from the solution's hover state DisplayRule. Absent config falls back to the default hovered state, so hover stays on unless a solution explicitly neutralizes the rule.

Fill darken (polygon and extrusion share one flag) and icon scale are on/off — the Mapbox paint intensity is fixed; badge scale uses the rule's actual value.

Parameters:
Name Type Attributes Description
hoverRule DisplayRule <optional>

stateDisplayRules.hover, or undefined when no config is set.

Object

# getIconZoomRange()

Get union zoom range for icon+badge (icon view model shows when either is in range).

# hasContextSwitch(leg) → {boolean}

Checks if the given leg represents a context switch.

Parameters:
Name Type Description
leg Leg

The route leg to check for context switch.

Returns true if the leg is a context switch, false otherwise.

boolean

Hides the map provider's branding (logo and attribution control) by injecting a single, idempotent