make tween panning use Map::moveByPx. p=aabt, r=me (closes #3098)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@11536 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -1606,31 +1606,25 @@ OpenLayers.Map = OpenLayers.Class({
|
||||
return;
|
||||
}
|
||||
|
||||
var from = {
|
||||
lon: center.lon,
|
||||
lat: center.lat
|
||||
};
|
||||
var to = {
|
||||
lon: lonlat.lon,
|
||||
lat: lonlat.lat
|
||||
};
|
||||
this.panTween.start(from, to, this.panDuration, {
|
||||
var from = this.getPixelFromLonLat(center);
|
||||
var to = this.getPixelFromLonLat(lonlat);
|
||||
var vector = { x: to.x - from.x, y: to.y - from.y };
|
||||
var last = { x: 0, y: 0 };
|
||||
|
||||
this.panTween.start( { x: 0, y: 0 }, vector, this.panDuration, {
|
||||
callbacks: {
|
||||
start: OpenLayers.Function.bind(function(lonlat) {
|
||||
start: OpenLayers.Function.bind(function() {
|
||||
this.events.triggerEvent("movestart");
|
||||
}, this),
|
||||
eachStep: OpenLayers.Function.bind(function(lonlat) {
|
||||
lonlat = new OpenLayers.LonLat(lonlat.lon, lonlat.lat);
|
||||
this.moveTo(lonlat, this.zoom, {
|
||||
'dragging': true,
|
||||
'noEvent': true
|
||||
});
|
||||
eachStep: OpenLayers.Function.bind(function(px) {
|
||||
var x = px.x - last.x,
|
||||
y = px.y - last.y;
|
||||
this.moveByPx(x, y);
|
||||
last.x = Math.round(px.x);
|
||||
last.y = Math.round(px.y);
|
||||
}, this),
|
||||
done: OpenLayers.Function.bind(function(lonlat) {
|
||||
lonlat = new OpenLayers.LonLat(lonlat.lon, lonlat.lat);
|
||||
this.moveTo(lonlat, this.zoom, {
|
||||
'noEvent': true
|
||||
});
|
||||
done: OpenLayers.Function.bind(function(px) {
|
||||
this.moveTo(lonlat, this.zoom, {noEvent: true});
|
||||
this.events.triggerEvent("moveend");
|
||||
}, this)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user