From 1df168849e92b83e32c86ed081aa72a7d318fb88 Mon Sep 17 00:00:00 2001 From: euzuro Date: Sat, 17 Jun 2006 12:06:06 +0000 Subject: [PATCH] make sure vemap is loaded before trying to move it git-svn-id: http://svn.openlayers.org/trunk/openlayers@606 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Layer/VirtualEarth.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) 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); + } },