As with the vector layer, feature overlays have getStyle and setStyle
This commit is contained in:
@@ -3,5 +3,5 @@
|
|||||||
@exportProperty ol.FeatureOverlay.prototype.getFeatures
|
@exportProperty ol.FeatureOverlay.prototype.getFeatures
|
||||||
@exportProperty ol.FeatureOverlay.prototype.setFeatures
|
@exportProperty ol.FeatureOverlay.prototype.setFeatures
|
||||||
@exportProperty ol.FeatureOverlay.prototype.setMap
|
@exportProperty ol.FeatureOverlay.prototype.setMap
|
||||||
@exportProperty ol.FeatureOverlay.prototype.setStyleFunction
|
@exportProperty ol.FeatureOverlay.prototype.setStyle
|
||||||
@exportProperty ol.FeatureOverlay.prototype.removeFeature
|
@exportProperty ol.FeatureOverlay.prototype.removeFeature
|
||||||
|
|||||||
@@ -52,6 +52,12 @@ ol.FeatureOverlay = function(opt_options) {
|
|||||||
*/
|
*/
|
||||||
this.postComposeListenerKey_ = null;
|
this.postComposeListenerKey_ = null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @private
|
||||||
|
* @type {ol.style.Style|Array.<ol.style.Style>|ol.feature.StyleFunction}
|
||||||
|
*/
|
||||||
|
this.style_ = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {ol.feature.StyleFunction|undefined}
|
* @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
|
* @todo stability experimental
|
||||||
*/
|
*/
|
||||||
ol.FeatureOverlay.prototype.setStyleFunction = function(styleFunction) {
|
ol.FeatureOverlay.prototype.setStyle = function(style) {
|
||||||
this.styleFunction_ = styleFunction;
|
this.style_ = style;
|
||||||
|
this.styleFunction_ = ol.feature.createStyleFunction(style);
|
||||||
this.requestRenderFrame_();
|
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.
|
* @return {ol.feature.StyleFunction|undefined} Style function.
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user