GProjection().fromLatLngToPixel(point,zoom)
The rest of the formula is straight forward:
Convert your lat lon to a pixel position.
Divide each component by 256 (the tilesize)
Discard any fractions to give integer values for x and y
Pick a tile version number, like "ap.31"
Build the URL like
http://mt0.google.com/mt?n=404&v=" + version + &x=" + x
+ "&y=" +y+ "&zoom=" + (17-zoom)
I can show you the code for GProjection().fromLatLngToPixel(point,zoom),
but it relies on some other stuff that's already been pre-calculated
when the GProjection was created. It looks like this:
var c=this,d=c.Te[b],e=D(d.x+a.lng()*c.Ve[b]),f=Qa(Math.sin(xd(a.lat()))
,-0.9999,0.9999),g=D(d.y+0.5*Math.log((1+f)/(1-f))*-c.We[b]);
With "e" and "g" being the values that you want.
I think c.Te[b] is equivalent to GPoint(256*2^(b+1),256*2^(b+1)) and
c.Ve[b] is 256*2^(b+1)/360, but I could easily be out by a factor of 2
either way.
--
The Blackpool Community Church Javascript Team
http://www.econym.demon.co.uk/googlemaps/