Add updateWhileAnimating option
With this option, vector batches will be recreated with every frame. For animations, this means that vector data won't be clipped to the extent at which the animation started.
This commit is contained in:
@@ -36,6 +36,7 @@ ol.layer.Vector = function(opt_options) {
|
||||
|
||||
delete baseOptions.style;
|
||||
delete baseOptions.renderBuffer;
|
||||
delete baseOptions.updateWhileAnimating;
|
||||
goog.base(this, /** @type {olx.layer.LayerOptions} */ (baseOptions));
|
||||
|
||||
/**
|
||||
@@ -61,6 +62,13 @@ ol.layer.Vector = function(opt_options) {
|
||||
|
||||
this.setStyle(options.style);
|
||||
|
||||
/**
|
||||
* @type {boolean}
|
||||
* @private
|
||||
*/
|
||||
this.updateWhileAnimating_ = goog.isDef(options.updateWhileAnimating) ?
|
||||
options.updateWhileAnimating : false;
|
||||
|
||||
};
|
||||
goog.inherits(ol.layer.Vector, ol.layer.Layer);
|
||||
|
||||
@@ -113,6 +121,15 @@ ol.layer.Vector.prototype.getStyleFunction = function() {
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @return {boolean} Whether the rendered layer should be updated while
|
||||
* animating.
|
||||
*/
|
||||
ol.layer.Vector.prototype.getUpdateWhileAnimating = function() {
|
||||
return this.updateWhileAnimating_;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {function(ol.Feature, ol.Feature):number|null|undefined} renderOrder
|
||||
* Render order.
|
||||
|
||||
Reference in New Issue
Block a user