Reuse the frame state viewHints array if defined
This commit is contained in:
@@ -256,10 +256,17 @@ ol.View.prototype.getCenter = function() {
|
||||
|
||||
|
||||
/**
|
||||
* @param {Array.<number>=} opt_hints Destination array.
|
||||
* @return {Array.<number>} Hint.
|
||||
*/
|
||||
ol.View.prototype.getHints = function() {
|
||||
return this.hints_.slice();
|
||||
ol.View.prototype.getHints = function(opt_hints) {
|
||||
if (opt_hints !== undefined) {
|
||||
opt_hints[0] = this.hints_[0];
|
||||
opt_hints[1] = this.hints_[1];
|
||||
return opt_hints;
|
||||
} else {
|
||||
return this.hints_.slice();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user