Use ol.dom.createCanvasContext2D in ol.style.AtlasManager

This commit is contained in:
Frederic Junod
2016-04-05 11:22:48 +02:00
parent f645d81fee
commit f2c30cffe2

View File

@@ -3,6 +3,7 @@ goog.provide('ol.style.AtlasManager');
goog.require('goog.asserts');
goog.require('ol');
goog.require('ol.dom');
/**
* Provides information for an image inside an atlas manager.
@@ -286,19 +287,15 @@ ol.style.Atlas = function(size, space) {
/**
* @private
* @type {HTMLCanvasElement}
* @type {CanvasRenderingContext2D}
*/
this.canvas_ = /** @type {HTMLCanvasElement} */
(document.createElement('CANVAS'));
this.canvas_.width = size;
this.canvas_.height = size;
this.context_ = ol.dom.createCanvasContext2D(size, size);
/**
* @private
* @type {CanvasRenderingContext2D}
* @type {HTMLCanvasElement}
*/
this.context_ = /** @type {CanvasRenderingContext2D} */
(this.canvas_.getContext('2d'));
this.canvas_ = this.context_.canvas;
};