Add ol.layer.Vector.defaultStyleFunction

This commit is contained in:
Tom Payne
2013-12-12 10:59:48 +01:00
parent a7d6730259
commit c672eca749

View File

@@ -35,6 +35,21 @@ ol.layer.Vector = function(opt_options) {
goog.inherits(ol.layer.Vector, ol.layer.Layer);
/**
* @param {ol.Feature} feature Feature.
* @param {number} resolution Resolution.
* @return {Array.<ol.style.Style>} Styles.
*/
ol.layer.Vector.defaultStyleFunction = function(feature, resolution) {
var featureStyleFunction = feature.getStyleFunction();
if (goog.isDef(featureStyleFunction)) {
return featureStyleFunction.call(feature, resolution);
} else {
return null;
}
};
/**
* @return {function(ol.geom.Geometry): boolean|undefined} Render geometry
* function.