give map::getResolution a fallback from baseLayer to the 1st layer if in allOverlays mode. r=tschaub (closes #2479)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10043 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -1926,6 +1926,11 @@ OpenLayers.Map = OpenLayers.Class({
|
||||
var resolution = null;
|
||||
if (this.baseLayer != null) {
|
||||
resolution = this.baseLayer.getResolution();
|
||||
} else if(this.allOverlays === true && this.layers.length > 0) {
|
||||
// while adding the 1st layer to the map in allOverlays mode,
|
||||
// this.baseLayer is not set yet when we need the resolution
|
||||
// for calculateInRange.
|
||||
resolution = this.layers[0].getResolution();
|
||||
}
|
||||
return resolution;
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user