protect viewport-lonlat translation functions in the case no baselayer is defined

git-svn-id: http://svn.openlayers.org/branches/openlayers/2.0@1283 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
euzuro
2006-08-17 17:20:30 +00:00
parent b1cfe16347
commit 36ec579e39

View File

@@ -931,7 +931,11 @@ OpenLayers.Map.prototype = {
* @private
*/
getLonLatFromViewPortPx: function (viewPortPx) {
return this.baseLayer.getLonLatFromViewPortPx(viewPortPx);
var lonlat = null;
if (this.baseLayer != null) {
lonlat = this.baseLayer.getLonLatFromViewPortPx(viewPortPx);
}
return lonlat;
},
/**
@@ -944,7 +948,11 @@ OpenLayers.Map.prototype = {
* @private
*/
getViewPortPxFromLonLat: function (lonlat) {
return this.baseLayer.getViewPortPxFromLonLat(lonlat);
var px = null;
if (this.baseLayer != null) {
px = this.baseLayer.getViewPortPxFromLonLat(lonlat);
}
return px;
},