Add ol.layer.Vector renderFeatureFunction
This commit is contained in:
@@ -8,6 +8,7 @@ goog.require('ol.source.Vector');
|
|||||||
* @enum {string}
|
* @enum {string}
|
||||||
*/
|
*/
|
||||||
ol.layer.VectorProperty = {
|
ol.layer.VectorProperty = {
|
||||||
|
RENDER_FEATURE_FUNCTION: 'renderFeatureFunction',
|
||||||
STYLE_FUNCTION: 'styleFunction'
|
STYLE_FUNCTION: 'styleFunction'
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -34,6 +35,19 @@ ol.layer.Vector = function(opt_options) {
|
|||||||
goog.inherits(ol.layer.Vector, ol.layer.Layer);
|
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.
|
* @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.
|
* @param {ol.style.StyleFunction|undefined} styleFunction Style function.
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user