3

For some reason this seems much harder to find than I thought it would be. I am working with a map display and I have set the zoom level to 15:

mapController.setZoom(15);

What are the different zoom levels equal to in distance? I am assuming is some kind of log or exponential scale. If I choose 1 or 18 for the zoom levels, what is the approximate distance that will be displayed on the screen for each zoom level on a map?

Devin Burke
  • 13,642
  • 12
  • 55
  • 82
Stagleton
  • 1,060
  • 3
  • 11
  • 35

3 Answers3

8

According to MapController.setZoom:

Sets the zoomlevel of the map. The value will be clamped to be between 1 and 21 inclusive, though not all areas have tiles at higher zoom levels. This just sets the level of the zoom directly; for a step-by-step zoom with fancy interstitial animations, use zoomIn() or zoomOut().

Parameters: zoomLevel - At zoomLevel 1, the equator of the earth is 256 pixels long. Each successive zoom level is magnified by a factor of 2.

Returns: the new zoom level, between 1 and 21 inclusive.

Marvin Pinto
  • 30,138
  • 7
  • 37
  • 54
  • 1
    Ok, so at zoom level 1 the screen displays about 40000km, then at level 2 20000km, level 3 10000km and so forth? – Stagleton Jan 03 '12 at 20:14
  • 1
    so soemthing like 40000/(2^n) should give me my answer where n is the zoom level...seem right? – Stagleton Jan 03 '12 at 20:15
  • I'm sure that will be a _very_ rough estimate but that also doesn't factor in the screen width. See this post for a bit more details. http://stackoverflow.com/a/6452332/1101070 – Marvin Pinto Jan 03 '12 at 20:29
  • Also, with the projection that Google Maps uses, the map scale varies by latitude -- it's different at the equator than in London, say. – tcarobruce Jan 03 '12 at 20:48
2

See the entry in the OpenStreetMap FAQ (OSM uses the same tiling system as Google).

Richard Fairhurst
  • 816
  • 1
  • 7
  • 15
1

If you are looking to zoom to include certain places take a look at zoomToSpan. That might help some of your issues. I used it to zoom in on a group of points, and just calculated the min/max points and was good to go.

MikeIsrael
  • 2,871
  • 2
  • 22
  • 34