diff --git a/lib/OpenLayers/Layer/EventPane.js b/lib/OpenLayers/Layer/EventPane.js index 71bcb10242..ad5892e32b 100644 --- a/lib/OpenLayers/Layer/EventPane.js +++ b/lib/OpenLayers/Layer/EventPane.js @@ -15,6 +15,18 @@ * - */ OpenLayers.Layer.EventPane = OpenLayers.Class(OpenLayers.Layer, { + + /** + * APIProperty: smoothDragPan + * {Boolean} smoothDragPan determines whether non-public/internal API + * methods are used for better performance while dragging EventPane layers. + * When not in sphericalMercator mode, the smoother dragging doesn't + * actually move north/south directly with the number of pixels moved, + * resulting in a slight offset when you drag your mouse north south with + * this option on. If this visual disparity bothers you, you should turn + * this option off, or use spherical mercator. Default is on. + */ + smootherDragging: true, /** * Property: isBaseLayer @@ -226,7 +238,8 @@ OpenLayers.Layer.EventPane = OpenLayers.Class(OpenLayers.Layer, { var center = this.getMapObjectLonLatFromOLLonLat(newCenter); - if (dragging && this.dragPanMapObject) { + if (dragging && this.dragPanMapObject && + this.smoothDragPan) { var resolution = this.map.getResolution(); var dX = (newCenter.lon - oldCenter.lon) / resolution; var dY = (newCenter.lat - oldCenter.lat) / resolution;