[OpenLayers-Users] TileCache and KaMaps

Christopher Schmidt crschmidt at metacarta.com
Wed Dec 6 11:14:03 EST 2006


On Wed, Dec 06, 2006 at 10:22:25AM -0500, Chris Holmes wrote:
> 
> 
> Christopher Schmidt wrote:
> >On Tue, Dec 05, 2006 at 06:29:08PM -0500, Chris Holmes wrote:
> >>I'll also note that right now it seems to be having more blank images. 
> >>It's not all pre-cached.  I've actually consistently had problems with 
> >>areas that aren't pre-cached, they tend to not wait until the backend 
> >>has returned, instead just return the broken images.  It would be great 
> >>if I could get it so there's never the broken images, some just take a 
> >>lot longer to load.
> >
> >I think we've talked about this before on the mailing list? This is most 
> >likely an OpenLayers bug, if it's the same thing I've run into: have you
> >been able to reproduce it without OpenLayers in the loop?
> >
> >Basically, I don't trust OpenLayers WMS to always request tiles on grids
> >after looking at TileCache in OpenLayers for a while. Figuring out why
> >is high on my priority list for OpenLayers development, but at the
> >moment, OpenLayers development is not high on my priority list.
> 
> Oh yeah, I have brought this up before, but I think I brought up two 
> issues at once.  One was zoom levels over 16 not working right, which is 
> now fixed (thanks!), and I thought the answer to that was that 
> OpenLayers wasn't requesting tiles right.

Zoom level 16 is not really 'wrong' -- just a rounding error. The
'threshold' before was set such that if you requested a tile that was
different by more than .001% from the spec, you didn't get it. The goal
was to never return tiles to broken clients.

However, due to rounding errors, *OpenLayers* was broken client:
starting at 1.40625 and dividing by 2^16 gives you a pretty small
number. 

So, we bumped the threshold to accept differences of .1%...  because in
a 256x256 tile, that's still only a half pixel, which isn't going to be
visible.

So, that could be fixed in OpenLayers with more accurate math, but I'm
not willing to reimplment Javascript for the sake of rounding errors :)
and we instead went with accepting a bit more tolerance.


> But you're saying that it's actually the cause to both?  Just in 
> slightly different ways?  OpenLayers basically non-deterministically 
> sometimes won't make the right request?    Hrm, that is tough.  I'll let 
> you know if I find anything more deterministic.

Yep. That's the long and short of it. For reasons I don't understand,
OpenLayers occasionally gets confused as to where it's putting tiles. It
seems to do this more when tiles take longer to load (which is why
roadmap cartographers see it more than people using the standard vmap0
map). It seems to happen sometimes when dragging a lot, and it seems to
be more common if you resize the window.

Unfortunately, that's as far as I've gotten. We've done a fair number of
improvements to try to prevent this from being a major issue, but
unfortunately the underlying, hard to find problem still exists.

Regards,
-- 
Christopher Schmidt
MetaCarta



More information about the Users mailing list