They say you shouldn’t take your work home but, if you’re lucky, sometimes your curiosity is piqued by something that you just have to investigate on your own time. No, I’m not talking about cyber stalking the office babes on their Facebook pages, quiet down at the back. This week, I’ve been putting the finishing touches to our new conference call scheduler application and, while implementing a Google maps tool for calculating time zone differences, I started thinking about their zoom levels. I can’t tell you how many times I’ve tried to print off directions and found that the route was too small to be clear, then zoomed in and found the route didn’t quite fit all on one screen. It seems like a big leap at those times, yet when you’re looking at the whole world, or zoom all the way in to one street, the contrast between stages isn’t nearly so obvious. So what is the change in scale each time you click the plus or minus?
The application Google supply contains a suite of useful procedures, including one which tells you the longitude and latitude of the four corners of the visible area at any one time. So I wrote a small script that would subtract the latitude difference between the top and bottom of the map view whenever I clicked a button, giving me the real distance that was represented by the height of the map area. Then all I had to do was click, zoom in, click.. and so on.
Zoom levels in Google are represented by numbers which you can see if you use the ‘link’ button on the normal maps site.
The most zoomed out level is 0 and the most zoomed in is 17 (it used to be 15 but as better quality aerial photography and streetview came along it was extended). Here are the relevant distances for a few zoom levels, in degrees.
(As an aside, to convert longitude difference to miles, divide the Earth’s circumference in miles (24,901.463) by 360. Amusingly, because I am 12 years old inside my head, this comes out at about 69)
Anyway, the numbers look pretty arbitrary, right? I pasted the results into Excel and created a third column with a formula which divided each number in the list by the one after it. Here’s what I got:
Ho ho! Looks like that third column is pretty much constant, except at the top end. That’s probably down to inaccuracies in the projection. All flat maps have errors when you try to show a spherical shape on a flat map and they’re always worse near the poles. But otherwise, case closed! Every click on the Google map zoom doubles or halves the size of what you can see. Which is why it seems like such a big difference when I’m trying to print those directions.
Only one question remains: how can I use this knowledge to impress the girls in the office?