How to make a complex symbolization of the line?
I do not know what this style is called, but you need something like this:
I can't find information anywhere on how to set such a style, although they are often found on schematic maps.
For the second use an array of two styles
[
new ol.style.Style({
stroke: new ol.style.Stroke({
width: 5,
color: 'black'
})
}),
new ol.style.Style({
stroke: new ol.style.Stroke({
width: 3,
color: 'white',
lineCap: 'butt',
lineDash: [9, 9]
})
})
]