[OpenLayers-Users] overview map

Tim Schaub tschaub at openplans.org
Tue Feb 5 00:15:37 EST 2008


Hey-

matthewsnape wrote:
> Hi,
> 
> I have developed a map and I wish to add an overview control that shows one
> of the overlay layers.  The resolututions are set so that the user can not
> view the entire extents.  Therefore, I would like the overview map to show a
> zoom level a couple of levels higher than the main map control.  However, I
> get the following error:
> 
> bounds has no properties
> http://www.openlayers.org/api/OpenLayers.js
> Line 533
> 
> The part of the code code is as follows:
> 
> var options = {
> size:new OpenLayers.Size(200,200),
> 
> layers: [tms_50k],
> minRatio: 3, maxRatio: 3,
>     

So, this may not be your only problem, but it certainly is a problem. 
See the following docs for a description of minRatio and maxRatio. 
These properties represent a range of suitable overview resolution : 
main map resolution ratios.

http://dev.openlayers.org/apidocs/files/OpenLayers/Control/OverviewMap-js.html#OpenLayers.Control.OverviewMap.minRatio

and

http://trac.openlayers.org/wiki/Control/OverviewMap#Customzoombehavior

After looking over those two docs, if you still think you want minRatio 
to equal maxRatio, write back.

Tim



> mapOptions : {  maxExtent: new
> OpenLayers.Bounds(500000.000000,100000.000000,600000.000000,260000.000000),
> units: 'meters',
> projection: 'EPSG:27700',
> resolutions :
> [12.34722222,8.466666667,3.527777778,2.822222222,2.5,1.763888889] }
> };
> 
> var overview = new OpenLayers.Control.OverviewMap(options);   
> 
> 
> Thanks.




More information about the Users mailing list