This example use the ol.geom.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.