[Tilecache] RS: RV: Internal organisation

Christopher Schmidt crschmidt at metacarta.com
Wed Oct 7 16:30:15 EDT 2009


On Wed, Oct 07, 2009 at 10:21:30PM +0200, Vidal, Antoni wrote:
> 
> > What's x?
> 
> The tile identifier in the x direction.
> 
> And how can I get this value?

Given what? And why do you need to?

Generally speaking, something like:

    var x = Math.round ((bounds.left - this.maxExtent.left) / (res * this.tileSize.w));
    var y = Math.round ((this.maxExtent.top - bounds.top) / (res * this.tileSize.h));
    var z = this.map.getZoom();

where res is the resolution of the current zoom, would be the x and y values.
But apparently you already have Y somehow, since you're not asking about that
value.

I think I'm confused here. 

Regards,
-- 
Christopher Schmidt
MetaCarta



More information about the Tilecache mailing list