Add ol.layer.Vector renderFeatureFunction

This commit is contained in:
Tom Payne
2013-11-10 11:57:08 +01:00
parent f9282c90e4
commit 1acfa35783

View File

@@ -8,6 +8,7 @@ goog.require('ol.source.Vector');
* @enum {string}
*/
ol.layer.VectorProperty = {
RENDER_FEATURE_FUNCTION: 'renderFeatureFunction',
STYLE_FUNCTION: 'styleFunction'
};
@@ -34,6 +35,19 @@ ol.layer.Vector = function(opt_options) {
goog.inherits(ol.layer.Vector, ol.layer.Layer);
/**
* @return {function(ol.Feature): boolean|undefined} Render feature function.
*/
ol.layer.Vector.prototype.getRenderFeatureFunction = function() {
return /** @type {function(ol.Feature): boolean|undefined} */ (
this.get(ol.layer.VectorProperty.RENDER_FEATURE_FUNCTION));
};
goog.exportProperty(
ol.layer.Vector.prototype,
'getRenderFeatureFunction',
ol.layer.Vector.prototype.getRenderFeatureFunction);
/**
* @return {ol.style.StyleFunction|undefined} Style function.
*/
@@ -55,6 +69,21 @@ ol.layer.Vector.prototype.getVectorSource = function() {
};
/**
* @param {function(ol.Feature): boolean|undefined} renderFeatureFunction
* Render feature function.
*/
ol.layer.Vector.prototype.setRenderFeatureFunction =
function(renderFeatureFunction) {
this.set(
ol.layer.VectorProperty.RENDER_FEATURE_FUNCTION, renderFeatureFunction);
};
goog.exportProperty(
ol.layer.Vector.prototype,
'setRenderFeatureFunction',
ol.layer.Vector.prototype.setRenderFeatureFunction);
/**
* @param {ol.style.StyleFunction|undefined} styleFunction Style function.
*/