[OpenLayers-Users] OverviewMapControl config tips?

Tim Schaub tschaub at openplans.org
Thu Jan 3 12:32:21 EST 2008


Hey-

cmose wrote:
> My map is configured with the following options:
> var mapOptions = {
>     minExtent: new OpenLayers.Bounds(-1,-1,1,1),
>     maxExtent: new OpenLayers.Bounds(-180,-90,180,90),
>     restrictedExtent: new OpenLayers.Bounds(-180,-90,180,90),
>     maxResolution: 0.17578125,
>     numZoomLevels: 8,
>     buffer:1
> }
> 
> and my OverviewMapControl is configured with these options:
> var overviewMapOptions = {
>     mapOptions: {
>         maxResolution: 0.17578125,
>         numZoomLevels: 8
>     }
> }
> 

The extent rectangle on the overview map represents the extent of your 
main map.  If the resolution of your main map equals the resolution of 
your overview map, then the extent rectangle is trying to be as large 
(pixel dimension) as your main map viewport.  Assuming your overview map 
is smaller than your main map, this means the extent rectangle is trying 
to be bigger than the overview map.

You need to configure your overview map to display resolutions *greater* 
than your main map (more map units per pixel, smaller scale).  You can 
accomplish this in one of two ways:

1) decrease the maxResolution of your main map, or
2) increase the maxResolution of your overview map (through the 
mapOptions property of the control)

The latter may require increasing the max resolution in your TileCache 
config as well.

Make sense?
Tim

> (please forgive any typos as this was hand transcribed - the actual config
> is free of typos and works fine with my current TileCache setup).
> 
> The issue I have is that the OverviewMapControl is basically useless from
> zoom levels 0-3 - the red "extent" rectangle just fills the entire
> OverviewMapControl and can't actually be used to drag the map more then a
> very minuscule amount. I've looked over the js file but I think I'm just
> having a poor comprehension day as I'm not seeing what I can change to try
> and alleviate this.
> 
> Ideally the draggable rectangle would stay constant size regardless of the
> zoom level of the overviewmap/bounds of the "main" map.
> 
> Anyone have any hints/tips as to how I can accomplish this or at least
> provide a useable overviewmap at zoom levels 0-3?
> 
> Thanks!




More information about the Users mailing list