Hi,<br>&nbsp;I just got tilecache working on xp and win 2003, and with my wms (using manifold gis) the open layers example works great. However, I configured tilecache in the hopes of using it in conjunction with google maps. However, it appears that tilecache is not honoring the wms requests that are being generated from the script in google maps (see below). The requests are valid, if I point the script directly at the wms, the tiles come back just fine. But when i put tilecache in between, I get&nbsp; <br>

<br><pre>An error occurred: Current y value 37.718590 is too far from tile corner y 37.968750<br><br></pre>You can see the working google map with tiles coming back directly from the wms here:<br><br><br><a href="http://warbler2.cit.cornell.edu/pfw-maps/wms-without-cache.html">http://warbler2.cit.cornell.edu/pfw-maps/wms-without-cache.html</a><br>
<br><br>the entry in tilecache.cfg looks like this<br>
<br>[google-tiles]<br>type=WMS<br>url=<a href="http://mycomputer.com/local-wms/wms.asp" target="_blank">http://mycomputer.com/local-wms/wms.asp</a><br>layers=Active_Year_2005<br>tms_type=google<br><br><br>I use the following script to convert the mercator coords to lat lng,&nbsp; which i modified from here (<a href="http://johndeck.blogspot.com/#114071052432996324" target="_blank">http://johndeck.blogspot.com/#114071052432996324</a>)<br>

<br>/**<br>&nbsp;* GoogleMapsWmsOverlays<br>&nbsp;* @param {Object} opts<br>&nbsp;* &nbsp;&nbsp;&nbsp; @param {String} myLayers The layers requested from wms<br>&nbsp;*&nbsp; @param {String} myFormat The image format<br>&nbsp;*&nbsp; @param {String} myBaseURL The url of the wms server<br>

&nbsp;*&nbsp; @param {Number} myOpacity opacity<br>&nbsp;*&nbsp; @param {String} myStyles wms styles<br>&nbsp;*&nbsp; @param {Number} myMercLevel The level at which switch to lat/lng is made??<br>&nbsp;*/<br>function GoogleMapsWmsOverlay(opts){<br>&nbsp;&nbsp;&nbsp; var me = this;<br>

&nbsp;&nbsp;&nbsp; me.MAGIC_NUMBER=6356752.3142;<br>&nbsp;&nbsp;&nbsp; me.WGS84_SEMI_MAJOR_AXIS = 6378137.0;<br>&nbsp;&nbsp;&nbsp; me.WGS84_ECCENTRICITY = 0.0818191913108718138;<br>&nbsp;&nbsp;&nbsp; me.DEG2RAD=0.0174532922519943;<br>&nbsp;&nbsp;&nbsp; me.PI=3.14159267;<br>&nbsp;&nbsp;&nbsp; me.FORMAT_DEFAULT=&quot;image/png&quot;; //Default image format, used if none is specified<br>

&nbsp;&nbsp;&nbsp; me.MERC_ZOOM_DEFAULT = 15; //Google Maps Zoom level at which we switch from Mercator to Lat/Long.<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; me.Options = {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; myLayers: opts.myLayers || &quot;error&quot;,<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; myFormat: opts.myFormat || me.FORMAT_DEFAULT,<br>

&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; myBaseURL: opts.myBaseURL || &quot;error&quot;,<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; myStyles: opts.myStyles || &quot;&quot;<br>&nbsp;&nbsp;&nbsp; }<br>}<br><br>GoogleMapsWmsOverlay.prototype.dd2MercMetersLng = function(p_lng) {<br>&nbsp;&nbsp;&nbsp; var me = this;<br>

&nbsp;&nbsp;&nbsp; return me.WGS84_SEMI_MAJOR_AXIS * (p_lng * me.DEG2RAD);<br>}<br><br>GoogleMapsWmsOverlay.prototype.dd2MercMetersLat = function(p_lat) {<br>&nbsp;&nbsp;&nbsp; var me = this;<br>&nbsp;&nbsp;&nbsp; var lat_rad = p_lat * me.DEG2RAD;<br>&nbsp;&nbsp;&nbsp; return me.WGS84_SEMI_MAJOR_AXIS * <br>

&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Math.log(Math.tan((lat_rad + me.PI / 2) / 2) *<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;Math.pow( ((1 - me.WGS84_ECCENTRICITY * Math.sin(lat_rad)) /<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;(1 + me.WGS84_ECCENTRICITY * Math.sin(lat_rad))), (me.WGS84_ECCENTRICITY/2)));<br>

}<br><br>/**<br>&nbsp;* use?<br>&nbsp;*/<br>GoogleMapsWmsOverlay.prototype.customOpacity = function() {<br>&nbsp;&nbsp;&nbsp; &nbsp;<br>&nbsp;&nbsp;&nbsp; &nbsp;return this.myOpacity; <br>}<br><br>GoogleMapsWmsOverlay.prototype.customGetTileUrl = function(a,b,c) {<br>&nbsp;&nbsp;&nbsp; var opts = this.Options;<br>

&nbsp;&nbsp;&nbsp; /*if (opts.myMercZoomLevel == undefined) {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; opts.myMercZoomLevel = MERC_ZOOM_DEFAULT;<br>&nbsp;&nbsp;&nbsp; }*/<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; var lULP = new GPoint(a.x*256,(a.y+1)*256);<br>&nbsp;&nbsp;&nbsp; var lLRP = new GPoint((a.x+1)*256,a.y*256);<br>

&nbsp;&nbsp;&nbsp; var lUL = G_NORMAL_MAP.getProjection().fromPixelToLatLng(lULP,b,c);<br>&nbsp;&nbsp;&nbsp; var lLR = G_NORMAL_MAP.getProjection().fromPixelToLatLng(lLRP,b,c);<br><br>&nbsp;&nbsp;&nbsp; // switch between Mercator and DD if merczoomlevel is set<br>&nbsp;&nbsp;&nbsp; // NOTE -it is now safe to use Mercator exclusively for all zoom levels (if your WMS supports it)<br>

&nbsp;&nbsp;&nbsp; // so you can just use the two lines of code below the IF (&amp; delete the ELSE)<br>&nbsp;&nbsp;&nbsp; // drg &amp; doq are topozone layers--- they don&#39;t work with epsg:54004<br>&nbsp;&nbsp;&nbsp;&nbsp; /*if (opt.myLayers!=&quot;drg&quot; &amp;&amp; opt.myLayers!=&quot;doq&quot;) {<br>

&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; var lBbox=dd2MercMetersLng(lUL.x)+&quot;,&quot;+dd2MercMetersLat(lUL.y)+&quot;,&quot;+dd2MercMetersLng(lLR.x)+&quot;,&quot;+dd2MercMetersLat(lLR.y);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; //Change for GeoServer - 41001 is mercator and installed by default.<br>

&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; var lSRS=&quot;EPSG:54004&quot;;<br>&nbsp;&nbsp;&nbsp; } else {*/<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; //var lBbox=lUL.x.toFixed(6)+&quot;,&quot;+lUL.y.toFixed(6)+&quot;,&quot;+lLR.x.toFixed(6)+&quot;,&quot;+lLR.y.toFixed(6);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; var lBbox=lUL.x+&quot;,&quot;+lUL.y+&quot;,&quot;+lLR.x+&quot;,&quot;+lLR.y;<br>

&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; var lSRS=&quot;EPSG:4326&quot;;<br>&nbsp;&nbsp;&nbsp; //} <br>&nbsp;&nbsp;&nbsp; var lURL=opts.myBaseURL;<br>&nbsp;&nbsp;&nbsp; lURL+=&quot;?REQUEST=GetMap&quot;;<br>&nbsp;&nbsp;&nbsp; lURL+=&quot;&amp;SERVICE=WMS&quot;;<br>&nbsp;&nbsp;&nbsp; lURL+=&quot;&amp;VERSION=1.1.1&quot;;<br>&nbsp;&nbsp;&nbsp; lURL+=&quot;&amp;EXCEPTIONS=application/vnd.ogc.se_inimage&quot;;<br>

&nbsp;&nbsp;&nbsp; lURL+=&quot;&amp;LAYERS=&quot;+opts.myLayers;<br>&nbsp;&nbsp;&nbsp; lURL+=&quot;&amp;STYLES=&quot;+opts.myStyles;<br>&nbsp;&nbsp;&nbsp; lURL+=&quot;&amp;FORMAT=&quot;+opts.myFormat;<br>&nbsp;&nbsp;&nbsp; lURL+=&quot;&amp;BGCOLOR=0xFFFFFF&quot;;<br>&nbsp;&nbsp;&nbsp; lURL+=&quot;&amp;TRANSPARENT=TRUE&quot;;<br>

&nbsp;&nbsp;&nbsp; lURL+=&quot;&amp;SRS=&quot;+lSRS; //use CRS for v1.3.0<br>&nbsp;&nbsp;&nbsp; lURL+=&quot;&amp;BBOX=&quot;+lBbox;<br>&nbsp;&nbsp;&nbsp; lURL+=&quot;&amp;WIDTH=256&quot;;<br>&nbsp;&nbsp;&nbsp; lURL+=&quot;&amp;HEIGHT=256&quot;;<br>&nbsp;&nbsp;&nbsp; //lURL+=&quot;&amp;reaspect=false&quot;;<br>

&nbsp;&nbsp;&nbsp; //document.write(lURL + &quot;&lt;br/&gt;&quot;)<br>&nbsp;&nbsp;&nbsp; //alert(&quot; url is &quot; + lURL);<br>&nbsp;&nbsp;&nbsp; return lURL;<br>}<br><br>GoogleMapsWmsOverlay.prototype.getTileLayer = function(){<br>&nbsp;&nbsp;&nbsp; var me = this;<br>&nbsp;&nbsp;&nbsp; var tileLayer = new GTileLayer(new GCopyrightCollection(&quot;&quot;), 0, 17);<br>

&nbsp;&nbsp;&nbsp; tileLayer.Options = me.Options;<br>&nbsp; &nbsp;&nbsp;&nbsp; tileLayer.getTileUrl = me.customGetTileUrl;<br>&nbsp;&nbsp;&nbsp; return tileLayer;<br>}<br><br><br>My maps in manifold are in mercator, but it has no problem accpeting the lat/lng requests, and spitting back the correct mercator tiles. Any help would be greatly appreciated!<br>

chris-<br><br>-- <br><br>Chris Marx<br>Programmer/Analyst<br>Cornell Lab of Ornithology<br>159 Sapsucker Woods Rd.<br>Ithaca, NY 14850<br>t. 1.607.254.1142<br><a href="http://www.birds.cornell.edu/" target="_blank">http://www.birds.cornell.edu/</a><br>