Uncommit unrelated part of r5433.

git-svn-id: http://svn.openlayers.org/trunk/openlayers@5626 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
crschmidt
2008-01-02 19:27:14 +00:00
parent af76852841
commit 4effccbb97

View File

@@ -239,6 +239,8 @@ OpenLayers.Layer.EventPane = OpenLayers.Class(OpenLayers.Layer, {
if ( !(newCenter.equals(oldCenter)) ||
!(newZoom == oldZoom) ) {
var center = this.getMapObjectLonLatFromOLLonLat(newCenter);
if (dragging && this.dragPanMapObject &&
this.smoothDragPan) {
var resolution = this.map.getResolution();
@@ -246,7 +248,6 @@ OpenLayers.Layer.EventPane = OpenLayers.Class(OpenLayers.Layer, {
var dY = (newCenter.lat - oldCenter.lat) / resolution;
this.dragPanMapObject(dX, dY);
} else {
var center = this.getMapObjectLonLatFromOLLonLat(newCenter);
var zoom = this.getMapObjectZoomFromOLZoom(newZoom);
this.setMapObjectCenter(center, zoom, dragging);
}
@@ -281,18 +282,6 @@ OpenLayers.Layer.EventPane = OpenLayers.Class(OpenLayers.Layer, {
var moPixel = this.getMapObjectPixelFromOLPixel(viewPortPx);
var moLonLat = this.getMapObjectLonLatFromMapObjectPixel(moPixel);
lonlat = this.getOLLonLatFromMapObjectLonLat(moLonLat);
var xrem = this.map.size.w % 2;
var yrem = this.map.size.h % 2;
if(xrem != 0 || yrem != 0) {
// odd sized viewport
var olPx = viewPortPx.add(xrem, yrem);
var moPx = this.getMapObjectPixelFromOLPixel(olPx);
var moLoc = this.getMapObjectLonLatFromMapObjectPixel(moPx);
var olLoc = this.getOLLonLatFromMapObjectLonLat(moLoc);
// adjust by half a pixel in odd dimension(s)
lonlat.lon += (olLoc.lon - lonlat.lon) / 2;
lonlat.lat += (olLoc.lat - lonlat.lat) / 2;
}
}
return lonlat;
},