I am using Leaflet Map and extension called Leaflet.MultiOptionsPolyline to draw a multicolor polyline.
(here some demos: http://hgoebl.github.io/Leaflet.MultiOptions