If opts.layers == [], you get an error in map construction.
This is problematic if you don't want to use any of the provided base layers, eg. you want to instead later call addLayer() and initCenter() yourself.
Fortunately there's a two-line fix for this, just don't call initCenter unless we got opts.layers:
Thanks, fixed this by instead checking for if (this.baseLayer), so that it's not tied to the options implementation. If that fails to work please open a new issue.
If opts.layers == [], you get an error in map construction. This is problematic if you don't want to use any of the provided base layers, eg. you want to instead later call addLayer() and initCenter() yourself.
Fortunately there's a two-line fix for this, just don't call initCenter unless we got opts.layers:
--- a/js/olwidget.js +++ b/js/olwidget.js @@ -279,7 +279,11 @@ olwidget.Map = OpenLayers.Class(OpenLayers.Map, { } if (layers.length > 0) { this.addLayers(layers);