Add ol.dom.createCanvasContext2D function

This commit is contained in:
Frederic Junod
2014-04-01 16:25:02 +02:00
parent 0b21c6bea7
commit 55de0a54b9
12 changed files with 63 additions and 118 deletions

View File

@@ -4,10 +4,10 @@ goog.provide('ol.renderer.canvas.Map');
goog.require('goog.asserts');
goog.require('goog.dom');
goog.require('goog.dom.TagName');
goog.require('goog.style');
goog.require('goog.vec.Mat4');
goog.require('ol.css');
goog.require('ol.dom');
goog.require('ol.layer.Image');
goog.require('ol.layer.Tile');
goog.require('ol.layer.Vector');
@@ -34,12 +34,18 @@ ol.renderer.canvas.Map = function(container, map) {
goog.base(this, container, map);
/**
* @private
* @type {CanvasRenderingContext2D}
*/
this.context_ = ol.dom.createCanvasContext2D();
/**
* @private
* @type {HTMLCanvasElement}
*/
this.canvas_ = /** @type {HTMLCanvasElement} */
(goog.dom.createElement(goog.dom.TagName.CANVAS));
this.canvas_ = this.context_.canvas;
this.canvas_.style.width = '100%';
this.canvas_.style.height = '100%';
this.canvas_.className = ol.css.CLASS_UNSELECTABLE;
@@ -51,13 +57,6 @@ ol.renderer.canvas.Map = function(container, map) {
*/
this.renderedVisible_ = true;
/**
* @private
* @type {CanvasRenderingContext2D}
*/
this.context_ = /** @type {CanvasRenderingContext2D} */
(this.canvas_.getContext('2d'));
/**
* @private
* @type {!goog.vec.Mat4.Number}