Add ol.layer.Vector.defaultStyleFunction
This commit is contained in:
@@ -35,6 +35,21 @@ ol.layer.Vector = function(opt_options) {
|
|||||||
goog.inherits(ol.layer.Vector, ol.layer.Layer);
|
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
|
* @return {function(ol.geom.Geometry): boolean|undefined} Render geometry
|
||||||
* function.
|
* function.
|
||||||
|
|||||||
Reference in New Issue
Block a user