Allow renderer to have a buffer.

This commit is contained in:
Tim Schaub
2012-07-07 16:50:22 -06:00
parent dc409ebcc4
commit ddd57426b5
4 changed files with 78 additions and 28 deletions

View File

@@ -1,6 +1,7 @@
goog.provide('ol.renderer.MapRenderer');
goog.require('goog.style');
goog.require('goog.math.Size');
/**
* @constructor
@@ -13,6 +14,12 @@ ol.renderer.MapRenderer = function(container) {
* @protected
*/
this.container_ = container;
/**
* @type {goog.math.Size}
* @private
*/
this.containerSize_ = null;
/**
* @type {ol.Loc}
@@ -28,6 +35,20 @@ ol.renderer.MapRenderer = function(container) {
};
/**
* @return {goog.math.Size}
* @protected
*/
ol.renderer.MapRenderer.prototype.getContainerSize = function() {
// TODO: listen for resize and set this.constainerSize_ null
// https://github.com/openlayers/ol3/issues/2
if (goog.isNull(this.containerSize_)) {
this.containerSize_ = goog.style.getSize(this.container_);
}
return this.containerSize_;
};
/**
* @param {Array.<ol.layer.Layer>} layers
* @param {ol.Loc} center