diff --git a/lib/OpenLayers/Layer/VirtualEarth.js b/lib/OpenLayers/Layer/VirtualEarth.js index 6b3216dd7a..dc3c7189ec 100644 --- a/lib/OpenLayers/Layer/VirtualEarth.js +++ b/lib/OpenLayers/Layer/VirtualEarth.js @@ -42,11 +42,13 @@ OpenLayers.Layer.VirtualEarth.prototype = */ moveTo:function(bounds,zoomChanged) { - var olCenter = this.map.getCenter(); - var olZoom = this.map.getZoom(); - - this.vemap.SetCenterAndZoom(new VELatLong(olCenter.lat, olCenter.lon), - olZoom + 1); + if (this.vemap != null) { + var olCenter = this.map.getCenter(); + var olZoom = this.map.getZoom(); + + this.vemap.SetCenterAndZoom(new VELatLong(olCenter.lat, olCenter.lon), + olZoom + 1); + } },