[OpenLayers-Users] [Tilecache] Problems with OpenLayers overview map

Christopher Schmidt crschmidt at metacarta.com
Tue Jul 31 12:09:36 EDT 2007


On Tue, Jul 31, 2007 at 04:52:50PM +0100, David Herbert wrote:
> (Apologies for posting to both lists - not sure which one it belongs
> in!).
> 
> I have Tilecache 1.9rc3 running as a CGI, and have had trouble getting
> my OpenLayers overview map to display anything since.  If I look in
> Firefox at pageinfo->media, I find that the tiles which should have
> displayed my overview map are zero length, and if I type one such URL
> e.g:
> 
> http://10.48.1.76:8084/?LAYERS=Coastline%20and%20bathymetry&STYLES=sggis_bathymetry_polygon%2Csggis_coastline&FORMAT=image%2Fpng&TRANSPARENT=off&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&EXCEPTIONS=application%2Fvnd.ogc.se_inimage&SRS=EPSG%3A2007056&BBOX=-1616%2C61560%2C-1104%2C62072&WIDTH=256&HEIGHT=256
> 
> into the browser, I get the following error:
> 
> An error occurred: can't find resolution index for 2.000000. Available
> resolutions are: 
> [200.37037000000001, 100.185185, 50.092592500000002,
> 25.046296250000001, 12.523148125000001, 6.2615740625000003,
> 3.1307870312500001, 1.5653935156250001, 0.78269675781250003,
> 0.39134837890625002, 0.19567418945312501, 0.097837094726562504,
> 0.048918547363281252, 0.024459273681640626, 0.012229636840820313,
> 0.0061148184204101565, 0.0030574092102050783, 0.0015287046051025391,
> 0.00076435230255126956, 0.00038217615127563478]
> 
> The overview map is given the following options:
> 
> var sgOverviewOpts = {
>     'maxExtent' : new OpenLayers.Bounds(-82000,7800,80000,116000),     
>  
>     'maxResolution' : 200.370370,     
>     'minResolution' : 0.5,
>     'units' : 'm',
>     'projection' : EPSG:2007056   
> };
> 
> var overview = new OpenLayers.Control.OverviewMap(sgOverviewOpts);
> map.addControl(overview);

"The thing to keep in mind here is that the OverviewMap control is a
control, not a map. This is an important distinction. The OverviewMap
control has a map, but it is not a map itself. To set options on the
control, use properties of the options object as you would with other
controls. To set properties on the little map that the OverviewMap
control controls, use the special mapOptions property of the options
object." --
http://trac.openlayers.org/wiki/Control/OverviewMap#Custommapoptions-projectionsextentsetc.

Regards,
-- 
Christopher Schmidt
MetaCarta



More information about the Users mailing list