Skip to content

Drawing Lanes

Lanes are the fundamental building block of an Apollo HD map. Every other element (junctions, signals, overlaps, the routing graph) is defined in relation to lanes.

Draw a lane

  1. Click Draw Lane in the toolbar (or press L)
  2. Click on the map to place the first centerline point
  3. Continue clicking to add intermediate vertices
  4. Double-click the last point to finish the lane

The lane's left and right boundary lines appear immediately, offset from the centerline by width / 2 meters using turf.lineOffset.

Lane anatomy

         left boundary
    ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─

    ─────────────────────────────   ← center line (drawn / stored)

    ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─
         right boundary

The centerline is the only geometry stored in the editor. Boundaries are derived at render time and at export time.

Edit a lane

  1. Click Select (or press S) and click the lane centerline
  2. Drag any vertex to reposition it
  3. Click a segment to add a new vertex (mapbox-gl-draw direct_select mode)
  4. Press Delete / Backspace to remove the selected lane

Lane properties

With a lane selected, the Properties panel shows:

PropertyUnitDefaultApollo field
Widthmeters3.75left_sample / right_sample (derived)
Speed limitkm/h (displayed), m/s (stored)50 km/hspeed_limit
Lane typeenumCITY_DRIVINGtype
TurnenumNO_TURNturn
DirectionenumFORWARDdirection
Left boundary typeenumDOTTED_WHITEleft_boundary.boundary_type
Right boundary typeenumDOTTED_WHITEright_boundary.boundary_type

Lane type values

ValueApollo enumTypical use
City DrivingCITY_DRIVINGStandard road lane
BikingBIKINGBike lane
SidewalkSIDEWALKPedestrian path
ParkingPARKINGOn-street parking
ShoulderSHOULDERRoad shoulder
SharedSHAREDShared pedestrian/bike

Boundary type values

ValueRenderingLane change allowed
DOTTED_WHITEdashed whiteYes
DOTTED_YELLOWdashed yellowYes
SOLID_WHITEsolid whiteNo
SOLID_YELLOWsolid yellowNo
DOUBLE_YELLOWdouble solid yellowNo
CURBsolid thickNo
UNKNOWNdefault

Routing implication

The routing map generator only creates lane-change edges between lanes whose shared boundary is DOTTED_WHITE or DOTTED_YELLOW. Set boundaries correctly or lane changes will not be available in the routing graph.

Boundary rendering styles

Each boundary type renders as a distinct MapLibre line style:

  • Dotted boundaries → dashed line (line-dasharray: [4, 4])
  • Solid boundaries → solid line
  • Double yellow → two parallel lines rendered via offset layers
  • Curb → thick solid line (line-width: 3)

Lane fill color is keyed to lane type:

Lane typeFill color
CITY_DRIVINGblue-gray
BIKINGgreen
SIDEWALKorange
PARKINGpurple
SHOULDERbrown

Direction arrows

A chevron arrow is drawn at the midpoint of each lane centerline, pointing in the lane's heading direction. This makes it easy to verify FORWARD vs BACKWARD direction visually.

Released under the MIT License.