Files
openlayers/src/ol/canvas/canvas.js
Tim Schaub a2c70dba85 Provide ol.canvas instead of ol.canvas.SUPPORTED
This is not currently used outside the library, so it is not exported.
2013-09-15 15:54:01 -06:00

24 lines
460 B
JavaScript

goog.provide('ol.canvas');
goog.require('goog.dom');
goog.require('goog.dom.TagName');
/**
* Is supported.
* @const
* @type {boolean}
*/
ol.canvas.SUPPORTED = (function() {
if (!('HTMLCanvasElement' in goog.global)) {
return false;
}
try {
var canvas = /** @type {HTMLCanvasElement} */
(goog.dom.createElement(goog.dom.TagName.CANVAS));
return !goog.isNull(canvas.getContext('2d'));
} catch (e) {
return false;
}
})();