Permalink
Browse files

Fixing issue #72 -- only calling initCenter when base layers are pres…

…ent.
  • Loading branch information...
1 parent 3b63089 commit 56a16d30002208e4a9fec8165b75509a5d0e2d97 @yourcelf yourcelf committed Jul 20, 2011
Showing with 5 additions and 1 deletion.
  1. +5 −1 js/olwidget.js
View
@@ -280,7 +280,11 @@ olwidget.Map = OpenLayers.Class(OpenLayers.Map, {
}
if (layers.length > 0) {
this.addLayers(layers);
- this.initCenter();
+ if (this.baseLayer) {
+ // Only initCenter if we have base layers -- otherwise, user is
+ // responsible for adding and then calling initCenter.
+ this.initCenter();
+ }
}
this.selectControl = new OpenLayers.Control.SelectFeature(
this.vectorLayers);

0 comments on commit 56a16d3

Please sign in to comment.