panmethod option on map to allow for the turning off of animated panning.
Includes example. All tests pass. r=tschaub. (Closes #1356) git-svn-id: http://svn.openlayers.org/trunk/openlayers@6411 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -325,6 +325,14 @@ OpenLayers.Map = OpenLayers.Class({
|
||||
*/
|
||||
panTween: null,
|
||||
|
||||
/**
|
||||
* Property: panMethod
|
||||
* {Function} The Easing function to be used for tweening. Default is
|
||||
* OpenLayers.Easing.Expo.easeOut. Setting this to 'null' turns off
|
||||
* animated panning.
|
||||
*/
|
||||
panMethod: OpenLayers.Easing.Expo.easeOut,
|
||||
|
||||
/**
|
||||
* Constructor: OpenLayers.Map
|
||||
* Constructor for a new OpenLayers.Map instance.
|
||||
@@ -1317,9 +1325,9 @@ OpenLayers.Map = OpenLayers.Class({
|
||||
* lonlat - {<OpenLayers.Lonlat>}
|
||||
*/
|
||||
panTo: function(lonlat) {
|
||||
if (this.getExtent().containsLonLat(lonlat)) {
|
||||
if (this.panMethod && this.getExtent().containsLonLat(lonlat)) {
|
||||
if (!this.panTween) {
|
||||
this.panTween = new OpenLayers.Tween(OpenLayers.Easing.Expo.easeOut);
|
||||
this.panTween = new OpenLayers.Tween(this.panMethod);
|
||||
}
|
||||
var center = this.getCenter();
|
||||
var from = {
|
||||
|
||||
Reference in New Issue
Block a user