Changeset 5627
- Timestamp:
- 01/02/08 14:36:12 (1 year ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/openlayers/lib/OpenLayers/Layer/EventPane.js
r5626 r5627 240 240 !(newZoom == oldZoom) ) { 241 241 242 var center = this.getMapObjectLonLatFromOLLonLat(newCenter);243 244 242 if (dragging && this.dragPanMapObject && 245 243 this.smoothDragPan) { … … 249 247 this.dragPanMapObject(dX, dY); 250 248 } else { 249 var center = this.getMapObjectLonLatFromOLLonLat(newCenter); 251 250 var zoom = this.getMapObjectZoomFromOLZoom(newZoom); 252 251 this.setMapObjectCenter(center, zoom, dragging); … … 283 282 var moLonLat = this.getMapObjectLonLatFromMapObjectPixel(moPixel); 284 283 lonlat = this.getOLLonLatFromMapObjectLonLat(moLonLat); 284 var xrem = this.map.size.w % 2; 285 var yrem = this.map.size.h % 2; 286 if(xrem != 0 || yrem != 0) { 287 // odd sized viewport 288 var olPx = viewPortPx.add(xrem, yrem); 289 var moPx = this.getMapObjectPixelFromOLPixel(olPx); 290 var moLoc = this.getMapObjectLonLatFromMapObjectPixel(moPx); 291 var olLoc = this.getOLLonLatFromMapObjectLonLat(moLoc); 292 // adjust by half a pixel in odd dimension(s) 293 lonlat.lon += (olLoc.lon - lonlat.lon) / 2; 294 lonlat.lat += (olLoc.lat - lonlat.lat) / 2; 295 } 285 296 } 286 297 return lonlat;
