title: OpenLayers: Can't add a linestring of coordinates to a map
body: <p>I am having trouble showing a linestring based on an existing coordinate list and would appreciate some help. Below is my code, which shows an OpenLayers5 map, but no linestring overlaid.</p>
  
  <p>I've read a bunch of different of different threads 
  (<a href="https://stackoverflow.com/questions/30888181/openlayers-3-simple-linestring-example">OpenLayers 3: simple LineString example</a>) and API docs, but I can't work out what I'm missing.</p>
  
  <p><a href="https://i.stack.imgur.com/cKuXz.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/cKuXz.jpg" alt="map with no linestring overlay"></a></p>
  
  <pre><code>&lt;!doctype html&gt;
  &lt;html&gt;
  &lt;head&gt;
      &lt;meta charset="UTF-8"&gt;
  
    &lt;link rel="stylesheet" href="https://cdn.rawgit.com/openlayers/openlayers.github.io/master/en/v5.3.0/css/ol.css" type="text/css"&gt;
    &lt;script src="https://cdn.rawgit.com/openlayers/openlayers.github.io/master/en/v5.3.0/build/ol.js"&gt;&lt;/script&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
    &lt;div id="map" class="map"&gt;&lt;/div&gt;
  
    &lt;script type="text/javascript"&gt;   
      var view = new ol.View({
        center: ol.proj.fromLonLat([10,50]),
        zoom: 14
      })
  
      //Dummy coords
      var coordinates = [
        [10, 50],
        [11, 51],
        [12, 55]
      ];
  
      var layerLines = new ol.layer.Vector({
          source: new ol.source.Vector({
              features: [new ol.Feature({
                  geometry: new ol.geom.LineString(coordinates),
                  name: 'Line'
              })]
          }),
          style : new ol.style.Style({
            stroke : new ol.style.Stroke({ 
              strokeColor: '#ff0000',
              strokeWidth: 5                      
            })
          })
      });
  
      var map = new ol.Map({
        target: 'map',
        layers: [
          new ol.layer.Tile({
            source: new ol.source.OSM()
          })
        ],
        view: view
      });
  
      map.addLayer(layerLines);
  
      &lt;/script&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p><a href="https://jsfiddle.net/gqe61am2/" rel="nofollow noreferrer">JSFiddle link</a></p>