labelAnchorForLine

Find the midpoint of line (by cumulative chord length) and the bearing of the segment containing it. Used by MvtVectorLayer to place single labels along LINESTRING features under MvtStyleRule.LabelPlacement.LINE.

Returns null for degenerate input (fewer than 2 vertices or zero total length).

Uses local equirectangular bearing (atan2(Δlon × cos(lat), Δlat)) — accurate enough for road-segment-scale labels, much cheaper than great-circle azimuth.