6

I am developing an android application that uses a google map in the background. When I start the application, I want to display a map of the hole word. According to the android google maps API v2: https://developers.google.com/maps/documentation/android/views the way to set a specific zoom value is "CameraUpdateFactory.zoomTo(float)" and the same api https://developers.google.com/maps/documentation/android/reference/com/google/android/gms/maps/CameraUpdateFactory#zoomTo(float) tells that the minimum argument to this function is 2. but when I call the function: mMap.moveCamera(CameraUpdateFactory.zoomTo(2)); The viewport of the world map is just a little bigger than Australia... How can I display the entire world map at once?

PS: for this experience I am using the google sample code, more specifically, the "MarkerDemoActivity.java"

Thanks in advance, João

Joao
  • 63
  • 2
  • 5
  • 1
    I think it may not be possible. Even in the regular Google Maps app you cannot zoom to a level where you can see the whole world. – Dror Dec 08 '12 at 17:24
  • 2
    Isn't this awkward? I have noticed that the standard google maps web application does not enable users to see the whole world, but if if zoom out entirely this google maps plugin you can indeed see the whole world... http://www.daftlogic.com/projects-google-maps-distance-calculator.htm why wouldn't it be possible to zoom out just a little bit more? – Joao Dec 08 '12 at 23:46
  • Also, the question http://stackoverflow.com/questions/9893680/google-maps-api-v3-show-the-whole-world shows how it is possible to do it in the web version of the google maps api... – Joao Dec 09 '12 at 00:04
  • @Joao Did you implement it? I want to achieve something similar with your issue.. – Menelaos Kotsollaris Mar 10 '15 at 15:39

2 Answers2

2

We can cover the whole map in android by using this code:

<com.google.android.gms.maps.MapView
            xmlns:map="http://schemas.android.com/apk/res-auto"               
            android:name="com.google.android.gms.maps.SupportMapFragment"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"         
            map:cameraZoom="1" //or 0
            map:liteMode="true"
             />
Pooja Soni
  • 82
  • 5
0

My guess for not being able to have zoom lower than 2 or 3 is because of a bug where VisibleRegion's bounds are calculated incorrectly when displayed area is bigger than 180 degrees: http://code.google.com/p/gmaps-api-issues/issues/detail?id=5285.

If this bug is fixed in a proper way (that is returned LatLngs are correct) and not by blocking zoom level 2 in that case, it might be very easy for Google Maps developers to just let us display whole map.

You may want to post a feature request there for level 0 zoom support.

MaciejGórski
  • 22,187
  • 7
  • 70
  • 94