The map now has a viewport and can render to a container.

This commit is contained in:
ahocevar
2012-06-21 18:56:48 +02:00
parent 8f90db58dc
commit e9e5fd27dc
3 changed files with 34 additions and 2 deletions

View File

@@ -74,6 +74,12 @@ ol.Map = function() {
*/
this.maxRes_ = undefined;
/**
* @private
* @type {Element}
*/
this.viewport_ = null;
/**
* @private
* @type {ol.event.Events}
@@ -332,6 +338,16 @@ ol.Map.prototype.setMaxRes = function(res) {
ol.Map.prototype.setContainer = function(container) {
this.events_.setElement(container);
this.container_ = container;
this.setViewport();
};
ol.Map.prototype.setViewport = function() {
if (!this.viewport_) {
this.viewport_ = goog.dom.createDom(
'div', 'ol-viewport'
);
goog.dom.appendChild(this.container_, this.viewport_);
}
};
/**