As with the vector layer, feature overlays have getStyle and setStyle

This commit is contained in:
Tim Schaub
2014-02-12 16:03:03 -07:00
parent a1f714f7dc
commit 477c369f6c
2 changed files with 21 additions and 4 deletions

View File

@@ -52,6 +52,12 @@ ol.FeatureOverlay = function(opt_options) {
*/
this.postComposeListenerKey_ = null;
/**
* @private
* @type {ol.style.Style|Array.<ol.style.Style>|ol.feature.StyleFunction}
*/
this.style_ = null;
/**
* @private
* @type {ol.feature.StyleFunction|undefined}
@@ -235,15 +241,26 @@ ol.FeatureOverlay.prototype.setMap = function(map) {
/**
* @param {ol.feature.StyleFunction} styleFunction Style function.
* @param {ol.style.Style|Array.<ol.style.Style>|ol.feature.StyleFunction} style
* Overlay style.
* @todo stability experimental
*/
ol.FeatureOverlay.prototype.setStyleFunction = function(styleFunction) {
this.styleFunction_ = styleFunction;
ol.FeatureOverlay.prototype.setStyle = function(style) {
this.style_ = style;
this.styleFunction_ = ol.feature.createStyleFunction(style);
this.requestRenderFrame_();
};
/**
* @return {ol.style.Style|Array.<ol.style.Style>|ol.feature.StyleFunction}
* Overlay style.
*/
ol.FeatureOverlay.prototype.getStyle = function() {
return this.style_;
};
/**
* @return {ol.feature.StyleFunction|undefined} Style function.
*/