Degrade gracefully if WebGL is not supported

This commit is contained in:
Tom Payne
2012-08-07 15:53:51 +02:00
parent 74a332d166
commit c53e91e205
+6 -4
View File
@@ -21,10 +21,12 @@ var webglMap = ol.createMap(
document.getElementById('webglMap'), document.getElementById('webglMap'),
{}, {},
ol.RendererHint.WEBGL); ol.RendererHint.WEBGL);
webglMap.bindTo('center', domMap); if (!goog.isNull(webglMap)) {
webglMap.bindTo('layers', domMap); webglMap.bindTo('center', domMap);
webglMap.bindTo('resolution', domMap); webglMap.bindTo('layers', domMap);
webglMap.bindTo('rotation', domMap); webglMap.bindTo('resolution', domMap);
webglMap.bindTo('rotation', domMap);
}
var attributionView = new ol.view.Attribution(domMap); var attributionView = new ol.view.Attribution(domMap);
document.getElementById('attribution').appendChild( document.getElementById('attribution').appendChild(