Making sure that new base layer becomes visible.
The new base layer may previously have been out of range, in which case setVisibility(true) would do nothing if the layer was visible already. So we check if it was previously out of range, and redraw it if necessary.
This commit is contained in:
@@ -1161,6 +1161,11 @@ OpenLayers.Map = OpenLayers.Class({
|
||||
|
||||
if(!this.allOverlays || this.baseLayer.visibility) {
|
||||
this.baseLayer.setVisibility(true);
|
||||
// Layer may previously have been visible but not in range.
|
||||
// In this case we need to redraw it to make it visible.
|
||||
if (this.baseLayer.inRange === false) {
|
||||
this.baseLayer.redraw();
|
||||
}
|
||||
}
|
||||
|
||||
// recenter the map
|
||||
|
||||
Reference in New Issue
Block a user