Route with MapLibre Customization

Calculate and display a route with MapLibre layer customizations on it.

View on GitHub
SDK 1.0.0-rc.7

The Tarragona to Barcelona route draws in red over a dark casing, with a dashed core down the middle and toll stretches in their own blue dash.

  • Named layers such as routeOutline and routeTollRoadOutline take raw MapLibre paint and layout from RoutingModule.create. Each merges property by property onto the layer the SDK built, so one override leaves the rest of the route alone.
  • additional adds a layer the SDK does not ship, positioned by beforeID and narrowed to the chosen route by SELECTED_ROUTE_FILTER.

Related examples