You are not logged in.

#1 2008-08-08 13:43:43

Barguast
Member
Registered: 2008-07-24
Posts: 4

Complex mathematical question... Help!

Okay... tongue

If I have a viewport of the Slippy map (Mercator projection) which is 'w' pixels wide, and 'h' pixels high, and we're at zoom-level 'Z', what is the range of x and y Mercator coordinates?

For example, if the viewport is 256 x 256 and we're at zoom level 0, then there should be a range of 360 x-coordinates (-180 to 180 degrees), and 360 y-coordinates (also -180 degrees).

I know, a bit of a strange question. Please reply if you have any questions (or answers for that matter!)

Offline

#2 2008-08-08 14:34:43

Barguast
Member
Registered: 2008-07-24
Posts: 4

Re: Complex mathematical question... Help!

Nevermind, I figured it out;

x-span = 360 * (width / (256 * (2 ^ zoom)))
y-span = 360 * (height / (256 * (2 ^ zoom)))

big_smile

Offline

Board footer

Powered by FluxBB