goog.require('ol.Map');
goog.require('ol.RendererHint');
goog.require('ol.View2D');
goog.require('ol.layer.Tile');
goog.require('ol.layer.Vector');
goog.require('ol.source.GeoJSON');
goog.require('ol.source.OSM');

var geoJSONSource = new ol.source.GeoJSON(
    /** @type {ol.source.GeoJSONOptions} */ ({
      geoJSON: {
        'type': 'FeatureCollection',
        features: [
          {
            'type': 'Feature',
            'geometry': {
              'type': 'Point',
              'coordinates': [0, 0]
            }
          },
          {
            'type': 'Feature',
            'geometry': {
              'type': 'LineString',
              'coordinates': [[-1e7, -1e7], [1e7, 1e7]]
            }
          },
          {
            'type': 'Feature',
            'geometry': {
              'type': 'LineString',
              'coordinates': [[-1e7, 1e7], [1e7, -1e7]]
            }
          },
          {
            'type': 'Feature',
            'geometry': {
              'type': 'Polygon',
              'coordinates': [[[-5e6, -5e6], [0, 5e6], [5e6, -5e6]]]
            }
          },
          {
            'type': 'Feature',
            'geometry': {
              'type': 'MultiLineString',
              'coordinates': [
                [[-1e6, -7.5e5], [-1e6, 7.5e5]],
                [[1e6, -7.5e5], [1e6, 7.5e5]],
                [[-7.5e5, -1e6], [7.5e5, -1e6]],
                [[-7.5e5, 1e6], [7.5e5, 1e6]]
              ]
            }
          }
        ]
      }
    }));

var map = new ol.Map({
  layers: [
    new ol.layer.Tile({
      source: new ol.source.OSM()
    }),
    new ol.layer.Vector({
      source: geoJSONSource
    })
  ],
  renderer: ol.RendererHint.CANVAS,
  target: 'map',
  view: new ol.View2D({
    center: [0, 0],
    zoom: 2
  })
});

@@ -206,16 +206,369 @@
 e.OSM');
+%0Agoog.require('ol.style.DefaultStyleFunction');%0A%0A%0Avar styleFunction = function(feature) %7B%0A  switch (feature.getGeometry().getType()) %7B%0A    case ol.geom.GeometryType.MULTI_LINE_STRING:%0A      return %7B%0A        stroke: %7B%0A          color: 'green',%0A          width: 1%0A        %7D%0A      %7D;%0A    default:%0A      return ol.style.DefaultStyleFunction(feature);%0A  %7D%0A%7D;
 %0A%0Avar ge
@@ -2018,16 +2018,52 @@
 ONSource
+,%0A      styleFunction: styleFunction
 %0A    %7D)%0A

Add style function to GeoJSON demo