Correct center setting, thanks @elemoine
This commit is contained in:
@@ -263,13 +263,15 @@ goog.exportProperty(
|
|||||||
*/
|
*/
|
||||||
ol.View2D.prototype.pan = function(map, delta, opt_duration) {
|
ol.View2D.prototype.pan = function(map, delta, opt_duration) {
|
||||||
var currentCenter = this.getCenter();
|
var currentCenter = this.getCenter();
|
||||||
if (goog.isDef(currentCenter) && goog.isDef(opt_duration)) {
|
if (goog.isDef(currentCenter)) {
|
||||||
map.requestRenderFrame();
|
if (goog.isDef(opt_duration)) {
|
||||||
map.addPreRenderFunction(ol.animation.pan({
|
map.requestRenderFrame();
|
||||||
source: currentCenter,
|
map.addPreRenderFunction(ol.animation.pan({
|
||||||
duration: opt_duration,
|
source: currentCenter,
|
||||||
easing: ol.easing.linear
|
duration: opt_duration,
|
||||||
}));
|
easing: ol.easing.linear
|
||||||
|
}));
|
||||||
|
}
|
||||||
this.setCenter(new ol.Coordinate(
|
this.setCenter(new ol.Coordinate(
|
||||||
currentCenter.x + delta.x, currentCenter.y + delta.y));
|
currentCenter.x + delta.x, currentCenter.y + delta.y));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user