[OpenLayers-Dev] OverviewMap extentRectangle

Tim Schaub tschaub at openplans.org
Thu Jul 26 13:10:08 EDT 2007


Jeff Dege wrote:
> In Openlayers/Control/OverviewMap.js, in the function
> OpenLayers.Control.OverviewMap.setRectPxBounds(), we have two lines:
> 
> 	this.extentRectangle.style.height = parseInt(Math.max(bottom -
> top, 0))+ 'px';
> 	this.extentRectangle.style.width = parseInt(Math.max(right -
> left, 0)) + 'px';
> 
> These set the width and height of the extent rectangle, as it is being
> drawn in the OverviewMap.
> 
> Because of the Math.max(..., 0), we prevent negative widths or heights.
> But we do allow for zero widths and height.  Which means that the
> extentRectangle is sometimes not drawn at all.
> 
> This is only an issue if you are using a single-scaled overview map, or
> if you have maxRatio set fairly large.  But if you are using a
> single-scaled overview map, you probably want the extent rectangle to be
> drawn.
> 
> MapServer replaces the box with a cross-hair, when the box gets small.
> I'm not suggesting that, right now.  But I do think that we should set
> the minimum size of the extentRectangle so that it is always visible.
> 
> I've been playing with this in IE6, and from what I can see, widths and
> heights of 1 are also no drawn.  So I'd suggest:
> 
> 	this.extentRectangle.style.height = parseInt(Math.max(bottom -
> top, 2))+ 'px';
> 	this.extentRectangle.style.width = parseInt(Math.max(right -
> left, 2)) + 'px';

Please add your thoughts to ticket #472 - which was opened for this purpose.

http://trac.openlayers.org/ticket/472

Tim




More information about the Dev mailing list