title: Openlayers - Multiple styles for different Geometry Types
body: <p>So I'm using a <strong>single</strong> vector layer where I put all of my :  </p>
  
  <ul>
  <li>Points</li>
  <li>Polylines</li>
  <li>Polygons</li>
  </ul>
  
  <p>This is my code :</p>
  
  <pre><code>var source = new ol.source.Vector({ wrapX: false });
  var vector = new ol.layer.Vector({
      source: source,
      style: // styleFunction or style or [style] don't know...
  });
  </code></pre>
  
  <p>And I want to style the feature <strong>based on their type</strong>. I found this in the <a href="http://openlayers.org/en/v3.19.1/apidoc/ol.style.html" rel="nofollow noreferrer">documentation</a> but can't figure out how to use it :</p>
  
  <blockquote>
    <p>...
    A separate editing style has the following defaults:</p>
  </blockquote>
  
  <pre><code> styles[ol.geom.GeometryType.POLYGON] = [
     new ol.style.Style({
       fill: new ol.style.Fill({
         color: [255, 255, 255, 0.5]
       })
     })
   ];
   styles[ol.geom.GeometryType.LINE_STRING] = [
     ...
   ];
   styles[ol.geom.GeometryType.POINT] = [
     ...
   ];
  </code></pre>
  
  <p>Any ideas ?</p>