<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. Plus, make sure the maxExtent in your OL constructor matches the TC bbox parameter. </DIV>
<DIV> </DIV>
<DIV>Shawn<BR>>>> On 8/26/2009 at 8:21 AM, "Jan van der Ven" <j.vanderven@magion.nl> 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"> </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><html xmlns=<A class=moz-txt-link-rfc2396E href="http://www.w3.org/1999/xhtml">"http://www.w3.org/1999/xhtml"</A>> <BR> <head> <BR> <title>TileCache</title> <BR> <script src="js/OpenLayers.js"></script> <BR> <!--script type="text/javascript" src="lib/proj4js-compressed.js"></script--> <BR> <script type="text/javascript" <BR> src=<A class=moz-txt-link-rfc2396E href="http://maps.google.com/maps?file=api&v=2&key=">"http://maps.google.com/maps?file=api&amp;v=2&amp;key="</A>></script> <BR><BR><BR> </head> <BR> <body> <BR> <div style="width:100%; height:100%" id="map"></div> <BR> <script defer="defer" type="text/javascript"> <BR> biskurl = <A class=moz-txt-link-rfc2396E href="http:///">"http://"</A> + window.location.host + "/"; <BR> map = new OpenLayers.Map('map',{ <BR> projection:'EPSG:900913', <BR> maxResolution:156543.0339, <BR> units:'m', <BR> numZoomLevels:20 <BR> }); <BR> layerSwitchControl = new OpenLayers.Control.LayerSwitcher(); <BR> map.addControl(layerSwitchControl); <BR> var layer = new OpenLayers.Layer.Google( "Satelliet" , {'sphericalMercator':true, type: G_SATELLITE_MAP}); <BR> layer.addOptions({ <BR> isBaseLayer: true, <BR> buffer: 1, <BR> // without this line I never get out of Africa when zooming in <BR> maxExtent: new OpenLayers.Bounds(-20037508.34,-20037508.34,20037508.34,20037508.34) <BR> }); <BR> map.addLayer(layer); <BR> // this seems to do nothing <BR> map.restrictedExtent = new OpenLayers.Bounds(513236.42635, 6779582.22281, 539836.512, 6805952.99756); <BR> // add a tilecache layer <BR> tilelayer = new OpenLayers.Layer.WMS( <BR> 'New-tilecache', <BR> '<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> { <BR> layers:'bisk', <BR> format:'image/png' <BR> }, <BR> { <BR> isBaseLayer:false, <BR> sphericalMercator:true, <BR> displayOutsideMaxExtent:true // firebug says maxExtent = -180,-90, 180, 90 <BR> }); <BR> map.addLayer(tilelayer); <BR> map.setCenter(513236, 6779582); <BR> map.zoomTo(12); <BR> </script> <BR> </body> <BR></html> <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&FORMAT=image%2Fpng&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&EXCEPTIONS=application%2Fvnd.ogc.se_inimage&SRS=EPSG%3A900913&BBOX=528152.7394125,6780180.1557938,537936.67903125,6789964.0954125&WIDTH=256&HEIGHT=256">http://example.com/cgi-bin/tilecache-2.10/tilecache.cgi?LAYERS=bisk&FORMAT=image%2Fpng&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&EXCEPTIONS=application%2Fvnd.ogc.se_inimage&SRS=EPSG%3A900913&BBOX=528152.7394125,6780180.1557938,537936.67903125,6789964.0954125&WIDTH=256&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> </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 <mailto:j.vanderven@MAGION.nl><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 <http://www.MAGION.nl><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"> <o:p></o:p></SPAN></P>
<DIV align=left><FONT size=2 face=Arial></FONT> </DIV>
<DIV> </DIV></DIV></BODY></HTML>