[OpenLayers-Users] TileCache works when used through wms layer but not as a TileCache Layer

Brent Pedersen bpederse at gmail.com
Thu Jan 10 14:00:03 EST 2008


here's a patch that fixes that. i just checked the code in Layer.py
from tilecache to see what it did.

svn diff TileCache.js
Index: TileCache.js
===================================================================
--- TileCache.js        (revision 5710)
+++ TileCache.js        (working copy)
@@ -103,8 +103,8 @@
         var res = this.map.getResolution();
         var bbox = this.maxExtent;
         var size = this.tileSize;
-        var tileX = Math.floor((bounds.left - bbox.left) / (res * size.w));
-        var tileY = Math.floor((bounds.bottom - bbox.bottom) / (res * size.h));
+        var tileX = Math.round((bounds.left - bbox.left) / (res * size.w));
+        var tileY = Math.round((bounds.bottom - bbox.bottom) / (res * size.h));
         var tileZ = this.map.zoom;
         /**
          * Zero-pad a positive integer.



On Jan 10, 2008 10:23 AM, Erik Uzureau <erik.uzureau at metacarta.com> wrote:
> Hi everyone... Lance is still stuck on this. Can anyone help?
>
> Here is an updated email that he's sent. Notice how there is a
> stripe of duplicated tiles on the lefthand side... seems strange.
>
> http://www.dyasdesigns.com/croatia/zagrebopenerror.htm
>
>
> -e
>
>
> On 12/9/07, Lance Dyas <lancelot at inetnebr.com> wrote:
> > To give a little more clue the most obvious error is
> >  TileCache Layer is doubling a Stripe of the tiles on left side at the
> > outer most zoom
> >
> > http://www.dyasdesigns.com/croatia/zagrebopen2.htm
> >
> > after zooming in some of the top row(s) of tiles are being repeated
> >
> > Lance Dyas wrote:
> > > Works great as a WMS but and through TileCache but not as  TileCache Layer
> > >
> > > here it is as a WMS
> > > http://www.dyasdesigns.com/croatia/zagrebopen.htm
> > >
> > > but switching to a TileCache.... layer does some wierd things.. really
> > > wierd things?
> > > http://www.dyasdesigns.com/croatia/zagrebopen2.htm
> > > _______________________________________________
> > > Users mailing list
> > > Users at openlayers.org
> > > http://openlayers.org/mailman/listinfo/users
> > >
> > > .
> > >
> > >
> >
> > _______________________________________________
> > Users mailing list
> > Users at openlayers.org
> > http://openlayers.org/mailman/listinfo/users
> >
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
>



More information about the Users mailing list