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:
ahocevar
2010-02-10 19:05:58 +00:00
parent e5e4d49d33
commit 2e47542fbe
2 changed files with 8 additions and 1 deletions

View File

@@ -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;
},