Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

google map API zoom range

Tags:

google-maps

I am using google map API version-3 , I was trying with different zoom value, I have randomly done for some numbers started with 1 upto 100 , map gets zoom in for increasing numbers but some level giving same result, I mean I am getting same zoom for 30 and 100.

I like to know , what is the exact range for zoom?

like image 338
Robin Michael Poothurai Avatar asked Feb 20 '12 05:02

Robin Michael Poothurai


People also ask

How do I zoom in Google Maps API?

Users can zoom the map by clicking the zoom controls. They can also zoom and pan by using two-finger movements on the map for touchscreen devices.

What is the maximum zoom level in Google Map?

Overview. The Google Maps API provides map tiles at various zoom levels for map type imagery. Most roadmap imagery is available from zoom levels 0 to 18, for example. Satellite imagery varies more widely as this imagery is not generated, but directly photographed.

What is the minimum zoom level in Google Map?

Furthermore, the maximum value of Google Maps Zoom level is 22. Therefore, the defined maximum value must be below or equal to 22, which is the default. The minimum value of Zoom Level is 0 by default, it can be changed by the shortcode as well.


4 Answers

Google Maps basics

Zoom Level - zoom

0 - 19

0 lowest zoom (whole world)

19 highest zoom (individual buildings, if available) Retrieve current zoom level using mapObject.getZoom()

like image 124
Himanshu Avatar answered Oct 23 '22 00:10

Himanshu


Available Zoom Levels

Zoom level 0 is the most zoomed out zoom level available and each integer step in zoom level halves the X and Y extents of the view and doubles the linear resolution.

Google Maps was built on a 256x256 pixel tile system where zoom level 0 was a 256x256 pixel image of the whole earth. A 256x256 tile for zoom level 1 enlarges a 128x128 pixel region from zoom level 0.

As correctly stated by bkaid, the available zoom range depends on where you are looking and the kind of map you are using:

  • Road maps - seem to go up to zoom level 22 everywhere
  • Hybrid and satellite maps - the max available zoom levels depend on location. Here are some examples:
  • Remote regions of Antarctica: 13
  • Gobi Desert: 17
  • Much of the U.S. and Europe: 21
  • "Deep zoom" locations: 22-23 (see bkaid's link)

Note that these values are for the Google Static Maps API which seems to give one more zoom level than the Javascript API. It appears that the extra zoom level available for Static Maps is just an upsampled version of the max-resolution image from the Javascript API.

Map Scale at Various Zoom Levels

Google Maps uses a Mercator projection so the scale varies substantially with latitude. A formula for calculating the correct scale based on latitude is:

meters_per_pixel = 156543.03392 * Math.cos(latLng.lat() * Math.PI / 180) / Math.pow(2, zoom)

Formula is from Chris Broadfoot's comment.

like image 22
JeremyD Avatar answered Oct 23 '22 00:10

JeremyD


What you're looking for are the scales for each zoom level. Use these:

20 : 1128.497220
19 : 2256.994440
18 : 4513.988880
17 : 9027.977761
16 : 18055.955520
15 : 36111.911040
14 : 72223.822090
13 : 144447.644200
12 : 288895.288400
11 : 577790.576700
10 : 1155581.153000
9  : 2311162.307000
8  : 4622324.614000
7  : 9244649.227000
6  : 18489298.450000
5  : 36978596.910000
4  : 73957193.820000
3  : 147914387.600000
2  : 295828775.300000
1  : 591657550.500000
like image 30
Rahul Shinde Avatar answered Oct 23 '22 02:10

Rahul Shinde


The range depends on where you are looking at. Some places only have zoom levels of 15 or so, where as other places have 23 (or possibly more). Google Maps has a getMaxZoomAtLatLng API call you can make to retrieve the max zoom level.

like image 12
bkaid Avatar answered Oct 23 '22 02:10

bkaid