[Tilecache] An error occurred: couldn't calculate tile index for layer

Bill Woodall bwoodall at wardrobe.dhs.org
Wed Mar 7 18:33:16 EST 2007


Hi Brian,

Here is how TC does it ( from Layer.py  Layer.getResolution)

    def getResolution (self, (minx, miny, maxx, maxy)):
        return max( (maxx - minx) / self.size[0],
                    (maxy - miny) / self.size[1] )

self.size is the tile's width and height


.......Bill,

On Wed, 2007-03-07 at 16:30 -0500, Brian Pitts wrote:
> > Sorry: I forgot that the TileCache maxResolution changes based on 
> > your maxExtent.
> >
> > Two options:
> >
> > var mapOptions = {maxExtent: new  
> > OpenLayers.Bounds(-124.7,24.9,-66.9,49.3),                   
> > maxResolution:.703125};
> >
> > [US_States]
> > type=WMSLayer
> > url=http://wilson.library.emory.edu/~bpitts/cgi-bin/south
> > extension=png
> > bbox=-124.7,24.9,-66.9,49.3
> > maxResolution=1.40625
> 
> Thanks for the advice, but neither one changed the behavior of the 
> US_States layer. I left the second option live at the link I mentioned 
> previously. What's the formula for calculating maxResolution from 
> maxExtent?
> 
> -Brian
> 
> _______________________________________________
> Tilecache mailing list
> Tilecache at openlayers.org
> http://openlayers.org/mailman/listinfo/tilecache




More information about the Tilecache mailing list