Ticket #884: OverviewMap.js.diff
| File OverviewMap.js.diff, 2.3 kB (added by ahocevar, 1 year ago) |
|---|
-
/mnt/d/eclipse/workspace/openlayers/lib/OpenLayers/Control/OverviewMap.js
old new 510 510 this.ovmap = new OpenLayers.Map(this.mapDiv.id, options); 511 511 this.ovmap.addLayers(this.layers); 512 512 this.ovmap.zoomToMaxExtent(); 513 // check extent rectangle border width 513 this.calculateBorderCompensation(); 514 }, 515 516 /** 517 * Method: calculateBorderCompensation 518 * Check extent rectangle border width and calculate the 519 * compensation values for width/height 520 */ 521 calculateBorderCompensation: function() { 514 522 this.wComp = parseInt(OpenLayers.Element.getStyle(this.extentRectangle, 515 523 'border-left-width')) + 516 524 parseInt(OpenLayers.Element.getStyle(this.extentRectangle, … … 515 523 'border-left-width')) + 516 524 parseInt(OpenLayers.Element.getStyle(this.extentRectangle, 517 525 'border-right-width')); 518 this.wComp = (this.wComp) ? this.wComp : 2;526 this.wComp = (this.wComp) ? this.wComp : 0; 519 527 this.hComp = parseInt(OpenLayers.Element.getStyle(this.extentRectangle, 520 528 'border-top-width')) + 521 529 parseInt(OpenLayers.Element.getStyle(this.extentRectangle, … … 520 528 'border-top-width')) + 521 529 parseInt(OpenLayers.Element.getStyle(this.extentRectangle, 522 530 'border-bottom-width')); 523 this.hComp = (this.hComp) ? this.hComp : 2; 524 }, 531 this.hComp = (this.hComp) ? this.hComp : 0; 525 532 533 if (this.hComp == 0 && this.wComp == 0) { 534 window.setTimeout((function() { 535 this.calculateBorderCompensation(); 536 }).bind(this), 100); 537 } else { 538 this.updateOverview(); 539 } 540 }, 541 526 542 /** 527 543 * Method: updateRectToMap 528 544 * Updates the extent rectangle position and size to match the map extent
