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