Smooth GDragging at last. Thanks to overstdr for digging up the getDragObject method. With v2.93 and later we no longer get flickers on panning. Non-API smooth dragging is no longer supported. r=crschmidt,me (closes #1402)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@6492 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -46,13 +46,11 @@ OpenLayers.Control.DragPan = OpenLayers.Class(OpenLayers.Control, {
|
||||
*/
|
||||
panMap: function(xy) {
|
||||
this.panned = true;
|
||||
var deltaX = this.handler.last.x - xy.x;
|
||||
var deltaY = this.handler.last.y - xy.y;
|
||||
var size = this.map.getSize();
|
||||
var newXY = new OpenLayers.Pixel(size.w / 2 + deltaX,
|
||||
size.h / 2 + deltaY);
|
||||
var newCenter = this.map.getLonLatFromViewPortPx( newXY );
|
||||
this.map.setCenter(newCenter, null, this.handler.dragging);
|
||||
this.map.pan(
|
||||
this.handler.last.x - xy.x,
|
||||
this.handler.last.y - xy.y,
|
||||
{dragging: this.handler.dragging, animate: false}
|
||||
);
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user