allow for accessing of default map values even if baseLayer has still not been set

git-svn-id: http://svn.openlayers.org/trunk/openlayers@807 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
euzuro
2006-06-27 23:31:47 +00:00
parent ff0e83d0a0
commit 9b53d22a31

View File

@@ -531,8 +531,12 @@ OpenLayers.Map.prototype = {
* @type String * @type String
*/ */
getProjection: function() { getProjection: function() {
var projection = this.baseLayer.getProjection(); var projection = null;
if (this.baseLayer != null) {
projection = this.baseLayer.getProjection();
}
if (projection == null) { if (projection == null) {
projection = this.projection; projection = this.projection;
} }
@@ -545,7 +549,11 @@ OpenLayers.Map.prototype = {
* @type String * @type String
*/ */
getMaxResolution: function() { getMaxResolution: function() {
var maxResolution = this.baseLayer.getMaxResolution(); var maxResolution = null
if (this.baseLayer != null) {
maxResolution = this.baseLayer.getMaxResolution();
}
if (maxResolution == null) { if (maxResolution == null) {
maxResolution = this.maxResolution; maxResolution = this.maxResolution;
@@ -558,12 +566,16 @@ OpenLayers.Map.prototype = {
* @type OpenLayers.Bounds * @type OpenLayers.Bounds
*/ */
getMaxExtent: function () { getMaxExtent: function () {
var maxExtent = this.baseLayer.getMaxExtent(); var maxExtent = null;
if (this.baseLayer != null) {
maxExtent = this.baseLayer.getMaxExtent();
}
if (maxExtent == null) { if (maxExtent == null) {
maxExtent = this.maxExtent; maxExtent = this.maxExtent;
} }
return maxExtent; return maxExtent;
}, },
@@ -572,10 +584,16 @@ OpenLayers.Map.prototype = {
* @type int * @type int
*/ */
getMaxZoomLevel: function() { getMaxZoomLevel: function() {
var maxZoomLevel = this.baseLayer.getMaxZoomLevel(); var maxZoomLevel = null;
if (this.baseLayer != null) {
maxZoomLevel = this.baseLayer.getMaxZoomLevel();
}
if (maxZoomLevel == null) { if (maxZoomLevel == null) {
maxZoomLevel = this.maxZoomLevel; maxZoomLevel = this.maxZoomLevel;
} }
return maxZoomLevel; return maxZoomLevel;
}, },
@@ -584,10 +602,16 @@ OpenLayers.Map.prototype = {
* @type int * @type int
*/ */
getMinZoomLevel: function() { getMinZoomLevel: function() {
var minZoomLevel = this.baseLayer.getMinZoomLevel(); var minZoomLevel = null;
if (this.baseLayer != null) {
minZoomLevel = this.baseLayer.getMinZoomLevel();
}
if (minZoomLevel == null) { if (minZoomLevel == null) {
minZoomLevel = this.minZoomLevel; minZoomLevel = this.minZoomLevel;
} }
return minZoomLevel; return minZoomLevel;
}, },