What is zoom level 15 equivalent to? - android

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?

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.

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

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.

Related

Why is the Camera Position Zoom different from tiles' Zoom level in Mapbox GL Android?

I am showing the CameraPosition Zoom in a label on Mapview, and using a custom raster tiles' source and have noticed that the zoom level of tiles being shown on mapview and the zoom level of camera are actually different (For example, at Camera Zoom 14.something i was getting tiles for zoom level 16).
Does somebody know why could that have happened?
In order to maximize imagery sharpness throughout the fractional zoom range, raster tiles transition at half-zoom levels in Mapbox SDKs. So for instance, a z14 raster tile is used for the range [z13.5, z14.5).
(If you are using 256 pixel raster tiles, you may also observe a difference of +/- 1 zoom level between the zoom level reported by the map, and the zoom level in tile URLs. This is because Mapbox GL zoom levels are calibrated against 512 pixel tiles. 256 pixel tiles are therefore loaded at +1 z relative to the map zoom.)

How to calculate visible area from zoom? google maps api v2

I'm trying to achieve that camera update would center between two positions
BUT if resulting zoom level is bigger than 12 it should be set to 12.
So i need some:
CameraUpdateFactory.newLatLngBounds(bounds,padding);
But instead of padding there should be max zoom level.
My solution requires that i calculate exact screen bounds that will be after camera update and here i got stuck.
If you need to calculate map screen bounds, you should use VisibleRegion
VisibleRegion visibleRegion = googleMap.getProjection().getVisibleRegion();
read also this question, may be similar to what you need.

Loading map tiles after zoom level 19

I am working with osmdroid and trying to display map tiles past the zoom level of 19. I have set the mapview max zoom to be 20, and told the tile source to use a max level of 20 as well. I can "zoom" to the level 20 (it just appears more pixelated as it doesn't seem that Mapnik actually provide them at that level) which at the minute is OK, but then when I pan across to outside of the current tile no new tiles get loaded
mMapView.setMaxZoomLevel(20);
mMapView.getTileProvider().setTileSource(new XYTileSource("Mapnik", null,
0, 20, 256, ".png", new String[] {
"http://a.tile.openstreetmap.org/",
"http://b.tile.openstreetmap.org/",
"http://c.tile.openstreetmap.org/" }));
Is there a way to get it to load these tiles whilst still zoomed in? I have read some answers that say there is an issue with zooming past 19 in osmdroid (Android OSM zoom level 19 and above), so I am not sure if this is something to do with that...
As of right now, no. As you zoom in past the available tiles, the animator for zooming in stretches the previous tile to fill the screen during animation. Once the new tile is loaded, it's redrawn with the correct tile.
It's possible to attempt to retrieve tile current zoom -1, then stretch and crop it to fit the screen, but that functionality doesn't exist right now. Feel free to write it and open a pull request.

How can i set zoom level according to height from ground level (eg.1KM) in google map in android?

I am working with Google API and I want to show view of any location on Google map from particular height. I don't want to assign zoom level directly. I want to calculate it dynamically with respect to height (Eg. 1Km, 2Km, 3Km, etc.). If any one have idea please let me know.
Thanks in advance.
Try using map.setZoom(your value)
function addMarker(lat, lng, info) {
var pt = new google.maps.LatLng(lat, lng);
map.setCenter(pt);
map.setZoom(your desired zoom);
}
Referred: https://developers.google.com/maps/documentation/javascript/reference#Map
You won't find a direct, out-of-the-box solution for your problem because it depends on the size of the device and the distance from which you look at it.
For example, if you are holding you device at 40 centimeters from your eyes, and then you move it to 50 centimeters, the perceived distance to the ground will change a lot.
Anyway, you can estimate the distance using a formula to Calculate distance knowing actual and perceived size.
Using this formula you can calculate the perceived distance for each zoom level based on the perceived size of an object with a known size (a car or a building for example), the size of your device and the distance from which you're looking at it, and then find a relation to know what zoom level you need to apply to simulate a given altitude.
Take into account that this will always be an approximation because you can't be sure about the distance from which your users are looking at your map, and also because the map represents the earth in a plane, so the farther the zoom, the worse this method will be.

Google Map doesn't zoom out very much

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

Categories

Resources