I'm currently developing an android application which uses the Google Maps API V2. As you can see in the topic title, the Map class extends MapFragment. What I want to do is set a minimum zoom so that, we could see all the continents on the screen when we zoom out. Currently, we can't see all the continents with the default map settings.
This is currently not possible to show entire world, but it has already been requested on gmaps-api-issues. Star that issue to give it a higher priority.
You can update the position of the camere + zoom level in this way:
mCameraZoom = 15.00f;
mMap.animateCamera(CameraUpdateFactory.newCameraPosition(CameraPosition.fromLatLngZoom(l, mCameraZoom)));
Related
Hao, stackoverflow!
I'm using Android Maps Utils to cluster markers, it's a little bit tricky, but generally ok.
Map Utils has some default value, on which zoom level it splits one cluster to several clusters or markers. I just need to do it earlier i.e. i need to start split items on bigger zoom level rather then default value.
I think it's not about shoudRenderAsCluster(cluster), cause this callback called already with splitted clusters after this default zoom level.
I've tried GridBasedAlgorithm (really strange behavior when zooming out) and NonHierarchicalDistanceBasedAlgorithm (it seems default).
Thanks!
I have this map (supportMapFragment) and it doesn't zoom out more than this.
I remember that sometime ago I was able to zoom out till see the whole planisphere, but now I can't even see a continent!
The only thing I've changed is to use SupportMapFragment instead of MapFragment (because it's inserted in a SlidingPaneLayout, that wants support fragments). It's possibile that support map isn't able to zoom out more than this?
Thank you!
This is by design you cannot see the whole map, but it was already requested on gmaps-api-issues -> issue 5724 to support this. Star it to give it a higher priority.
I have a feeling that the above issue is blocked by another issue reported there.
From my observations there is no difference between SupportMapFragment and MapFragment when it comes to min zoom level. One thing that matters is device's screen size (or more specifically fragment's size).
From your screenshot I can see zoom level 3. If you want to be able to zoom out to 2, you have to make your fragment a bit smaller. Try adding 50dp margins as a test.
Based on documentation,
The desired zoom level, in the range of 2.0 to 21.0. Values below this range are set to 2.0, and values above it are set to 21.0. Increase the value to zoom in.
Not all areas have tiles at the largest zoom levels.
Googlemap gm;
LatLng cur_Latlng = new LatLng(21.0000, 78.0000);
gm.moveCamera(CameraUpdateFactory.newLatLng(cur_Latlng));
gm.animateCamera(CameraUpdateFactory.zoomTo(10));
gm.getUiSettings().setZoomControlsEnabled(true);
You can increase level from 2.0 to 21.0
I have an app that use the old google map API and add a layer over the map to display a more precise map of my own over the map.
I'm trying to do this in the API v2 using the TileOverlay but the text of the google map are displayed over my tiles.
Here are 2 screenshots, one with the map, and one with the map with an overlay (just based on the API demo)
I tried to add a big Z-Index to the tiles without any results.
Is there any way to really cover the map with custom tiles ?
The reason why you keep seeing the labels, is that in google maps v2 the labels are rendered locally instead of being part of tile bitmaps. The benefit of this, is that you can rotate the map and still have the labels without rotation for easy reading.
Solution
The only solution I know so far is to disable the map base layer using setMapType(MAP_TYPE_NONE). However, this may have the undesireble effect of also disabling parts of the map that are not being covered by your overlay.
Regards.
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
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"
/>
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.
I have one marker displayed and centered in my ItemizedOverlay in maps, currently I call setZoom(19).
But how can I control the zoom level? i.e. I want to zoom in as detailed as possible, but still showing the map in satellite mode clear.
I have noticed that if you zoom in to far everything just goes black. How can I zoom into the most detailed level without going to far?
Any help most appreciated...
Just use
setZoom(mapview.getMaxZoomLevel());
https://developers.google.com/maps/documentation/android/reference/com/google/android/maps/MapView
the solution is: look at the UiSettings in api v2 reference, there is the "setMaxZoomLevel" and "setMinZoomLevel".
Setup the max zoom level to the one that doesn't show a black screen (make some tests), then call the setZoom(mapview.getMaxZoomLevel());
Regards.