[OpenLayers-Users] Why does my overview map not work?

Tim Schaub tschaub at openplans.org
Fri Nov 30 15:47:40 EST 2007


Hey-

Gregor Mosheh wrote:
> Thanks again, Tim.
> I added some options from the Map() constructor, and it works. Evidently 
> it's smart enough to figure the resolution list, given the same options 
> as Map.
> 
> OpenLayers.Control.OverviewMap({mapOptions:{numZoomLevels:numzoomlevels,maxExtent:maxextent,maxResolution:maxresolution}}); 
> 
> 
> I am surprised that the OverviewMap doesn't default to reading from its 
> containing Map. Or is the intent for the OverviewMap to be as 
> independent of a Map object as possible, so this omission is intentional?
> 

You can construct an overview map control before you have constructed 
any other map.  So, there's no "containing Map" to start with.

I could add some magic in control.createMap that would try to match the 
resolution related stuff from the main map - one issue with that is the 
flexibility in setting resolution related stuff.  If we forced everybody 
to just set "resolutions" things would be pretty easy.

But your mapOptions object could have any one of resolutions, 
numZoomLevels, maxResolution, minResolution, numZoomLevels, scales, 
maxScale, minScale, bla bla bla - so it's not really that simple to 
determine if you have tried to construct the control with resolution 
related stuff.

Tim



More information about the Users mailing list