openlayers/ol3 — pull request #2638 by elemoine (2014-08-27 08:44:43+00:00)
Title: Allow passing undefined to ol.layer.Vector#setStyle

This PR changes the `ol.layer.Vector#setStyle` to make it more consistent with the way the `ol.layer.Vector` constructor treats the `style` option.

Currently, if the `style` option is `undefined` or `null`, the `ol.layer.Vector` constructor uses the default style function as the style. The `setCenter` fails (js error) if it is passed `null` or `undefined`.

This PR makes the constructor and the `setCenter` behave in a similar way. If the style passed to the function is `null` then a `null` style (and an `undefined` style function) is used. If `undefined` is passed then the default style function is used.

This allows to easily reset a vector layer to using the default style, without having to export the `ol.style.defaultStyleFunction` symbol.

Please review.