<HTML xmlns:o = "urn:schemas-microsoft-com:office:office"><HEAD>
<META content="text/html; charset=iso-8859-15" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.18813"></HEAD>
<BODY style="MARGIN: 4px 4px 1px; FONT: 10pt Segoe UI">
<DIV>I had a similar problem in the past and if I recall, it was a matter of specifying the resolution in both the OL constructor and the TC config.&nbsp; Plus, make sure the maxExtent in your OL constructor matches the TC bbox parameter.&nbsp; </DIV>
<DIV>&nbsp;</DIV>
<DIV>Shawn<BR>&gt;&gt;&gt; On 8/26/2009 at 8:21 AM, "Jan van der Ven" &lt;j.vanderven@magion.nl&gt; wrote:<BR></DIV>
<DIV style="BORDER-LEFT: #050505 1px solid; BACKGROUND-COLOR: #f3f3f3; MARGIN: 0px 0px 0px 15px; PADDING-LEFT: 7px">
<DIV><FONT size=2 face=Arial><FONT size=3 face="Times New Roman">&nbsp;</FONT> 
<DIV style="FONT-FAMILY: -moz-fixed; FONT-SIZE: 13px" lang=x-western class=moz-text-flowed>Dear list, <BR><BR><BR>I have a problem with tilecache. My tiles are not rendered because they are not aligned with the grid. <BR><BR>Here is my sample map: <BR><BR>&lt;html xmlns=<A class=moz-txt-link-rfc2396E href="http://www.w3.org/1999/xhtml">"http://www.w3.org/1999/xhtml"</A>&gt; <BR>&nbsp;&lt;head&gt; <BR>&nbsp;&nbsp; &lt;title&gt;TileCache&lt;/title&gt; <BR>&nbsp;&nbsp; &lt;script src="js/OpenLayers.js"&gt;&lt;/script&gt; <BR>&nbsp;&nbsp; &lt;!--script type="text/javascript" src="lib/proj4js-compressed.js"&gt;&lt;/script--&gt; <BR>&nbsp;&nbsp; &lt;script type="text/javascript" <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; src=<A class=moz-txt-link-rfc2396E href="http://maps.google.com/maps?file=api&amp;v=2&amp;key=">"http://maps.google.com/maps?file=api&amp;amp;v=2&amp;amp;key="</A>&gt;&lt;/script&gt; <BR><BR><BR>&nbsp;&lt;/head&gt; <BR>&nbsp;&lt;body&gt; <BR>&nbsp;&nbsp; &lt;div style="width:100%; height:100%" id="map"&gt;&lt;/div&gt; <BR>&nbsp;&nbsp; &lt;script defer="defer" type="text/javascript"&gt; <BR>&nbsp;&nbsp; biskurl = <A class=moz-txt-link-rfc2396E href="http:///">"http://"</A> + window.location.host + "/"; <BR>&nbsp;&nbsp; map = new OpenLayers.Map('map',{ <BR>&nbsp;&nbsp;&nbsp;&nbsp; projection:'EPSG:900913', <BR>&nbsp;&nbsp;&nbsp;&nbsp; maxResolution:156543.0339, <BR>&nbsp;&nbsp;&nbsp;&nbsp; units:'m', <BR>&nbsp;&nbsp;&nbsp;&nbsp; numZoomLevels:20 <BR>&nbsp;&nbsp; }); <BR>&nbsp;&nbsp; layerSwitchControl = new OpenLayers.Control.LayerSwitcher(); <BR>&nbsp;&nbsp; map.addControl(layerSwitchControl); <BR>&nbsp;&nbsp; var layer = new OpenLayers.Layer.Google( "Satelliet" , {'sphericalMercator':true, type: G_SATELLITE_MAP}); <BR>&nbsp;&nbsp; layer.addOptions({ <BR>&nbsp;&nbsp;&nbsp;&nbsp; isBaseLayer: true, <BR>&nbsp;&nbsp;&nbsp;&nbsp; buffer: 1, <BR>&nbsp;&nbsp;&nbsp;&nbsp; // without this line I never get out of Africa when zooming in <BR>&nbsp;&nbsp;&nbsp;&nbsp; maxExtent: new OpenLayers.Bounds(-20037508.34,-20037508.34,20037508.34,20037508.34) <BR>&nbsp;&nbsp; }); <BR>&nbsp;&nbsp; map.addLayer(layer); <BR>&nbsp;&nbsp; // this seems to do nothing <BR>&nbsp;&nbsp; map.restrictedExtent = new OpenLayers.Bounds(513236.42635, 6779582.22281, 539836.512, 6805952.99756); <BR>&nbsp;&nbsp; // add a tilecache layer <BR>&nbsp;&nbsp; tilelayer = new OpenLayers.Layer.WMS( <BR>&nbsp;&nbsp;&nbsp;&nbsp; 'New-tilecache', <BR>&nbsp;&nbsp;&nbsp;&nbsp; '<A class=moz-txt-link-freetext href="http://example.com/cgi-bin/tilecache-2.10/tilecache.cgi">http://example.com/cgi-bin/tilecache-2.10/tilecache.cgi</A>?', <BR>&nbsp;&nbsp;&nbsp;&nbsp; { <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; layers:'bisk', <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; format:'image/png' <BR>&nbsp;&nbsp;&nbsp;&nbsp; }, <BR>&nbsp;&nbsp;&nbsp;&nbsp; { <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; isBaseLayer:false, <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sphericalMercator:true, <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; displayOutsideMaxExtent:true // firebug says maxExtent = -180,-90, 180, 90 <BR>&nbsp;&nbsp; }); <BR>&nbsp;&nbsp; map.addLayer(tilelayer); <BR>&nbsp;&nbsp; map.setCenter(513236, 6779582); <BR>&nbsp;&nbsp; map.zoomTo(12); <BR>&nbsp;&nbsp; &lt;/script&gt; <BR>&nbsp;&lt;/body&gt; <BR>&lt;/html&gt; <BR><BR>And here is the relevant part of tilecache.cfg: <BR><BR>[bisk] <BR>type=MapServerLayer <BR>layers=Nieuw-ms <BR>mapfile=/var/www/bisk/html/maps/a.map <BR>srs=EPSG:900913 <BR>extension=png <BR>spherical_mercator=true <BR><BR>And I tried it without any resolutions, with this one: <BR>resolutions=76.43702827148438,38.21851413574219,19.109257067871095,9.554628533935547,4.777314266967774,2.388657133483887,1.1943285667419434,0.5971642833709717,0.29858214168548586,0.14929107084274293 <BR><BR>And instead of that with: <BR>maxResolution=156543.0339 <BR><BR>But every tile request, such as: <BR><A class=moz-txt-link-freetext href="http://example.com/cgi-bin/tilecache-2.10/tilecache.cgi?LAYERS=bisk&amp;FORMAT=image%2Fpng&amp;SERVICE=WMS&amp;VERSION=1.1.1&amp;REQUEST=GetMap&amp;STYLES=&amp;EXCEPTIONS=application%2Fvnd.ogc.se_inimage&amp;SRS=EPSG%3A900913&amp;BBOX=528152.7394125,6780180.1557938,537936.67903125,6789964.0954125&amp;WIDTH=256&amp;HEIGHT=256">http://example.com/cgi-bin/tilecache-2.10/tilecache.cgi?LAYERS=bisk&amp;FORMAT=image%2Fpng&amp;SERVICE=WMS&amp;VERSION=1.1.1&amp;REQUEST=GetMap&amp;STYLES=&amp;EXCEPTIONS=application%2Fvnd.ogc.se_inimage&amp;SRS=EPSG%3A900913&amp;BBOX=528152.7394125,6780180.1557938,537936.67903125,6789964.0954125&amp;WIDTH=256&amp;HEIGHT=256</A> <BR><BR>returns the error: <BR>An error occurred: Current x value 528152.739413 is too far from tile corner x 528332.738613 <BR><BR><BR>Can anyone point me in the right direction? <BR><BR>Kind regards, <BR><BR><BR>Jan <BR><BR><BR></DIV></FONT></DIV>
<DIV>&nbsp;</DIV>
<P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN style="FONT-FAMILY: Verdana; FONT-SIZE: 10pt">--<o:p></o:p></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN style="FONT-FAMILY: Verdana; FONT-SIZE: 10pt">Jan H. van der Ven<o:p></o:p></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN style="FONT-FAMILY: Verdana; FONT-SIZE: 10pt">MAGION Industrial Software Solutions<o:p></o:p></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN style="FONT-FAMILY: Verdana; FONT-SIZE: 10pt">Wolga 5<o:p></o:p></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN style="FONT-FAMILY: Verdana; FONT-SIZE: 10pt">2491 BK Den Haag<o:p></o:p></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN style="FONT-FAMILY: Verdana; FONT-SIZE: 10pt">The Netherlands<o:p></o:p></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN style="FONT-FAMILY: Verdana; FONT-SIZE: 10pt">Mobile : + 31 (0)6 - 55361734<o:p></o:p></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN style="FONT-FAMILY: Verdana; FONT-SIZE: 10pt">Phone : +31 (0)70-4442770<o:p></o:p></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN style="FONT-FAMILY: Verdana; FONT-SIZE: 10pt">Fax : +31 (0)70-4442082<o:p></o:p></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN style="FONT-FAMILY: Verdana; FONT-SIZE: 10pt">E-mail : j.vanderven@MAGION.nl &lt;mailto:j.vanderven@MAGION.nl&gt;<o:p></o:p></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN style="FONT-FAMILY: Verdana; FONT-SIZE: 10pt">Web : www.MAGION.nl &lt;http://www.MAGION.nl&gt;<o:p></o:p></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN style="FONT-FAMILY: Verdana; FONT-SIZE: 10pt">Notice of Confidentiality<o:p></o:p></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN style="FONT-FAMILY: Verdana; FONT-SIZE: 10pt">This transmission is intended for the named addressee only. It contains information which may be confidential and which may also be privileged. Unless you are the named addressee (or authorised to receive it for the addressee) you may not copy or use it, or disclose it to anyone else. If you have received this transmission in error please notify the sender immediately.<o:p></o:p></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN style="FONT-FAMILY: Verdana; FONT-SIZE: 10pt">&nbsp;<o:p></o:p></SPAN></P>
<DIV align=left><FONT size=2 face=Arial></FONT>&nbsp;</DIV>
<DIV>&nbsp;</DIV></DIV></BODY></HTML>