[Tilecache] Problem with resolution
Yves Jacolin
yjacolin at free.fr
Wed Feb 28 05:02:43 EST 2007
Hi Eric,
Thanks very much for this tips. I get this resolutions:
4938.886622189033,2469.443110945165,1411.110349115227,705.5551745557
614,...
This seems incorrect, isn'it ?
Regards,
Y.
Le Mercredi 28 Février 2007 08:37, vous avez écrit :
> On 2/27/07, Yves Jacolin <yjacolin at free.fr> wrote:
> > Hi,
> >
> > I am using OL with a WMS serveur (same layer than the vmap0 WMS from
> > metacarta). All this is hosted by a quiet good server. But the 'tiles'
> > take some time to be displayed. So I am now trying to use TileCache to
> > improve this but I have some problem to set it up. I modified OL as is:
> >
> > var options = {maxResolution: 0.04578125,
> > maxZoomLevel: 13,
> > minZoomLevel: 5,
> > numZoomLevels : 7,
> > controls:[]};
> > map = new OpenLayers.Map('map', options);
> >
> > And my tilecache.cfg:
> >
> > [vmap]
> > type=MapServerLayer
> > layers=regions
> > mapfile=/var/local/name/project/vmap.map
> > resolutions=0.1,0.04578125,0.00071533203125
> > levels=7
> > extension=gif
> >
> > If I go to the maxZoom level or the minZoom level, all is ok, I can see
> > the map, if I change the zoom between this two level, the map doesn't
> > appear.
> >
> > Any idea? How can I find all the resolution values?
>
> Hi Yves,
>
> You can define the scales in your map options, using something like this:
>
> var myScales = [ 3750, 7500, 15000, 30000, 60000, 120000 ];
> var options = { scales: myScales, ... };
> map = new OpenLayers.Map($('map'), options);
>
> And to get the corresponding resolution values use the
> OpenLayers.Util.getResolutionFromScale() method. E.g.
>
> var str = "";
> for (var i = 0; i < myScales.length; i++) {
> str += OpenLayers.Util.getResolutionFromScale(myScales[i], 'm') + ',';
> }
>
> Hope this helps,
--
Yves Jacolin
---
http://yjacolin.gloobe.org
More information about the Tilecache
mailing list