From 05658f12318ddfb3a39c02396f0e7a0d10a7842c Mon Sep 17 00:00:00 2001 From: crschmidt Date: Tue, 24 Mar 2009 21:38:57 +0000 Subject: [PATCH] Add a panDuration property to the map. This allows for a workaround for VirtualEarth panning with markers which causes drift, using the 'novibrate' example. Tests continue to pass. r=me (Closes #1947) git-svn-id: http://svn.openlayers.org/trunk/openlayers@9130 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- examples/ve-novibrate.html | 62 ++++++++++++++++++++++++++++++++++++++ lib/OpenLayers/Map.js | 11 ++++++- 2 files changed, 72 insertions(+), 1 deletion(-) create mode 100644 examples/ve-novibrate.html diff --git a/examples/ve-novibrate.html b/examples/ve-novibrate.html new file mode 100644 index 0000000000..2775583aac --- /dev/null +++ b/examples/ve-novibrate.html @@ -0,0 +1,62 @@ + + + OpenLayers Virtual Earth Example + + + + + + + + +

Virtual Earth Example

+ +
+ +

+ When using the PanZoom buttons with VirtualEarth, some 'drift' is + possible in markers. This page demonstrates how to use the + panMethod and panDuration properties to change the OpenLayers + settings to match VirtualEarth. +

+ +
+ + + + diff --git a/lib/OpenLayers/Map.js b/lib/OpenLayers/Map.js index 94cb7e288b..b15aac08bd 100644 --- a/lib/OpenLayers/Map.js +++ b/lib/OpenLayers/Map.js @@ -384,6 +384,15 @@ OpenLayers.Map = OpenLayers.Class({ */ panMethod: OpenLayers.Easing.Expo.easeOut, + /** + * Property: panDuration + * {Integer} The number of steps to be passed to the + * OpenLayers.Tween.start() method when the map is + * panned. + * Default is 50. + */ + panDuration: 50, + /** * Property: paddingForPopups * {} Outside margin of the popup. Used to prevent @@ -1472,7 +1481,7 @@ OpenLayers.Map = OpenLayers.Class({ lon: lonlat.lon, lat: lonlat.lat }; - this.panTween.start(from, to, 50, { + this.panTween.start(from, to, this.panDuration, { callbacks: { start: OpenLayers.Function.bind(function(lonlat) { this.events.triggerEvent("movestart");