From 7e312bf59643dc68f5ca9128793a08d970d99bd3 Mon Sep 17 00:00:00 2001 From: euzuro Date: Wed, 16 Aug 2006 05:59:37 +0000 Subject: [PATCH] if zoom hasnt changed, use PanToLatLong() instead of setCenter() git-svn-id: http://svn.openlayers.org/trunk/openlayers@1231 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Layer/VirtualEarth.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) 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();