This example use the ol.coordinate.offsetCoords() function to draw an offset line with a dash symbol.
NB: some problem may occur when offsetting lines with acute convex angles... You should probably look at JSTS to handle this cases.