title: open layers 3 - Draw route along road
body: <p>I have a web service which returns a list of coordinates for a route between two points.</p>
  
  <pre><code>if (points.length &gt; 0) {
  
      var routeLayer = new ol.layer.Vector({
          source: new ol.source.Vector({
              features: [new ol.Feature({ geometry: new ol.geom.LineString(points, 'XY') })]
          }),
          style: new ol.style.Style({
              fill: new ol.style.Fill({ color: '#0091ea', weight: 8 }),
              stroke: new ol.style.Stroke({ color: '#0091ea', width: 4 })
          }),
          name: 'routeLayer'
      });
  
      map.addLayer(routeLayer);
  }
  </code></pre>
  
  <p>The issue I'm having is that the web service only returns points when the user needs to make a turn, gets to a roundabout or a junction. This results in straight lines being drawn between points, which does not look right when the roads are curved.</p>
  
  <p>Is there a way to draw the route only along roads, or is the only option (using OL3) to get the web service to return a lot more points to account for curving roads?</p>
  
  <p>OL3 is not essential to the project but it is what we've been using so far so sticking with it would be preferable. </p>