diff --git a/lib/OpenLayers/Layer/VirtualEarth.js b/lib/OpenLayers/Layer/VirtualEarth.js index cf115eb50a..340a9efb10 100644 --- a/lib/OpenLayers/Layer/VirtualEarth.js +++ b/lib/OpenLayers/Layer/VirtualEarth.js @@ -41,12 +41,17 @@ OpenLayers.Layer.VirtualEarth.prototype = if (this.vemap != null) { var olCenter = this.map.getCenter(); - var olZoom = this.map.getZoom(); - var veCenter = this.getVELatLongFromOLLonLat(olCenter); - var veZoom = this.getVEZoomFromOLZoom(olZoom); - this.vemap.SetCenterAndZoom(veCenter, veZoom); + if (zoomChanged) { + var olZoom = this.map.getZoom(); + var veZoom = this.getVEZoomFromOLZoom(olZoom); + + this.vemap.SetCenterAndZoom(veCenter, veZoom); + } else { + this.vemap.PanToLatLong(veCenter); + } + } }, @@ -55,6 +60,7 @@ OpenLayers.Layer.VirtualEarth.prototype = * */ loadVEMap:function() { + // create div and set to same size as map var veDiv = OpenLayers.Util.createDiv(this.name); var sz = this.map.getSize();