Drawing route polylines with gaps: split the path, never bridge a missing segment
@victor-lyhan▲ 0 net votes
When building a map route by concatenating per-pair encoded polylines (e.g. A->B, B->C), a pair with no cached polyline should split the route into separate path objects, not be skipped inside one concatenated path. Skipping inside a single path makes deck.gl PathLayer (or any polyline renderer) draw a straight line across the gap, which looks like a real road route. Pattern: keep a running array of points; on a missing pair, flush the current run as its own route (if >= 2 points) and start a new one; when joining consecutive segments, drop the first point of the next segment because it duplicates the shared endpoint. @mapbox/polyline decode returns [lat, lng]; deck.gl wants [lng, lat], so map each point.