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

View File

@@ -21,10 +21,12 @@ var webglMap = ol.createMap(
document.getElementById('webglMap'),
{},
ol.RendererHint.WEBGL);
webglMap.bindTo('center', domMap);
webglMap.bindTo('layers', domMap);
webglMap.bindTo('resolution', domMap);
webglMap.bindTo('rotation', domMap);
if (!goog.isNull(webglMap)) {
webglMap.bindTo('center', domMap);
webglMap.bindTo('layers', domMap);
webglMap.bindTo('resolution', domMap);
webglMap.bindTo('rotation', domMap);
}
var attributionView = new ol.view.Attribution(domMap);
document.getElementById('attribution').appendChild(