Changeset 2205
- Timestamp:
- 02/05/07 11:28:33 (2 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
sandbox/emanuel/animatedZooming/lib/OpenLayers/Control/OverviewMap.js
r2190 r2205 384 384 (this.ovmap.getExtent().containsBounds(testExtent))); 385 385 }, 386 387 updateOverview: function() { 388 var mapRes = this.map.getResolution(); 386 387 /* 388 * Updates the overview map. If the map is scaling (by zooming) the parameters 389 * define the values of the new resolution and bounds. 390 * 391 * @param {float} newResolution 392 * @param {OpenLayers.Bounds} bounds 393 */ 394 updateOverview: function(newResolution, bounds) { 395 //set new map resolution only by scaling 396 if (newResolution) 397 var mapRes = newResolution; 398 else 399 var mapRes = this.map.getResolution(); 389 400 var targetRes = this.ovmap.getResolution(); 390 401 var resRatio = targetRes / mapRes; … … 398 409 this.ovmap.setCenter(this.map.center, 399 410 this.ovmap.getZoomForResolution(targetRes)); 400 this.updateRectToMap( );411 this.updateRectToMap(bounds); 401 412 }, 402 413 … … 422 433 423 434 /** 424 * Updates the extent rectangle position and size to match the map extent 425 */ 426 updateRectToMap: function() { 435 * Updates the extent rectangle position and size to match the map extent 436 * If the map is scaling (by zooming) the parameter defines the 437 * new bounds of the current map 438 * 439 * @param {OpenLayers.Bounds} bounds 440 */ 441 updateRectToMap: function(bounds) { 427 442 // The base layer for overview map needs to be in the same projection 428 443 // as the base layer for the main map. This should be made more robust. … … 432 447 } 433 448 } 434 var pxBounds = this.getRectBoundsFromMapBounds(this.map.getExtent()); 449 450 if (!bounds) 451 bounds=this.map.getExtent(); 452 var pxBounds = this.getRectBoundsFromMapBounds(bounds); 435 453 this.setRectPxBounds(pxBounds); 436 454 },
