New OpenLayers.CANVAS_SUPPORTED constant
This commit is contained in:
@@ -110,8 +110,7 @@ OpenLayers.Renderer.Canvas = OpenLayers.Class(OpenLayers.Renderer, {
|
|||||||
* {Boolean} Whether or not the browser supports the renderer class
|
* {Boolean} Whether or not the browser supports the renderer class
|
||||||
*/
|
*/
|
||||||
supported: function() {
|
supported: function() {
|
||||||
var canvas = document.createElement("canvas");
|
return OpenLayers.CANVAS_SUPPORTED;
|
||||||
return !!canvas.getContext;
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1435,6 +1435,15 @@ OpenLayers.IS_GECKO = (function() {
|
|||||||
return ua.indexOf("webkit") == -1 && ua.indexOf("gecko") != -1;
|
return ua.indexOf("webkit") == -1 && ua.indexOf("gecko") != -1;
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constant: CANVAS_SUPPORTED
|
||||||
|
* {Boolean} True if canvas 2d is supported.
|
||||||
|
*/
|
||||||
|
OpenLayers.CANVAS_SUPPORTED = (function() {
|
||||||
|
var elem = document.createElement('canvas');
|
||||||
|
return !!(elem.getContext && elem.getContext('2d'));
|
||||||
|
})();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constant: BROWSER_NAME
|
* Constant: BROWSER_NAME
|
||||||
* {String}
|
* {String}
|
||||||
|
|||||||
Reference in New Issue
Block a user