Changeset 5224
- Timestamp:
- 11/20/07 17:21:54 (1 year ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/openlayers/lib/OpenLayers/Layer/EventPane.js
r5028 r5224 226 226 227 227 var center = this.getMapObjectLonLatFromOLLonLat(newCenter); 228 var zoom = this.getMapObjectZoomFromOLZoom(newZoom); 229 this.setMapObjectCenter(center, zoom); 228 229 if (dragging && this.dragPanMapObject) { 230 var res = this.map.resolution; //readability 231 var dX = (newCenter.lon - oldCenter.lon) / res; 232 var dY = (newCenter.lat - oldCenter.lat) / res; 233 this.dragPanMapObject(dX, dY); 234 } else { 235 var zoom = this.getMapObjectZoomFromOLZoom(newZoom); 236 this.setMapObjectCenter(center, zoom, dragging); 237 } 230 238 } 231 239 } trunk/openlayers/lib/OpenLayers/Layer/Google.js
r5002 r5224 120 120 termsOfUse.style.bottom = ""; 121 121 122 //can we do smooth panning? (some versions don't) 123 if ( !this.mapObject.G || !this.mapObject.G.qb || 124 (typeof this.mapObject.G.qb != "function") ) { 125 126 this.dragPanMapObject = null; 127 } 128 122 129 } catch (e) { 123 130 // do not crash … … 336 343 337 344 /** 345 * APIMethod: dragPanMapObject 346 * 347 * Parameters: 348 * dX - {Integer} 349 * dY - {Integer} 350 */ 351 dragPanMapObject: function(dX, dY) { 352 var newX = this.mapObject.G.left - dX; 353 var newY = this.mapObject.G.top + dY; 354 this.mapObject.G.qb(newX, newY); 355 }, 356 357 /** 338 358 * APIMethod: getMapObjectCenter 339 359 *
