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

@@ -7,13 +7,12 @@ goog.provide('ol.render.canvas.ReplayGroup');
goog.require('goog.array');
goog.require('goog.asserts');
goog.require('goog.dom');
goog.require('goog.dom.TagName');
goog.require('goog.object');
goog.require('goog.vec.Mat4');
goog.require('ol.BrowserFeature');
goog.require('ol.array');
goog.require('ol.color');
goog.require('ol.dom');
goog.require('ol.extent');
goog.require('ol.extent.Relationship');
goog.require('ol.geom.flat.simplify');
@@ -1820,20 +1819,11 @@ ol.render.canvas.ReplayGroup = function(tolerance, maxExtent, resolution) {
*/
this.replaysByZIndex_ = {};
/**
* @type {HTMLCanvasElement}
*/
var hitDetectionCanvas = /** @type {HTMLCanvasElement} */
(goog.dom.createElement(goog.dom.TagName.CANVAS));
hitDetectionCanvas.width = 1;
hitDetectionCanvas.height = 1;
/**
* @private
* @type {CanvasRenderingContext2D}
*/
this.hitDetectionContext_ = /** @type {CanvasRenderingContext2D} */
(hitDetectionCanvas.getContext('2d'));
this.hitDetectionContext_ = ol.dom.createCanvasContext2D(1, 1);
/**
* @private