I have a latitude and longitude(GeoPoint) which is the center of map. I want to set zoom level of 4miles distance from latitude and longitude that I have.
Thanks in Advance,
I have a latitude and longitude(GeoPoint) which is the center of map. I want to set zoom level of 4miles distance from latitude and longitude that I have.
Thanks in Advance,
SOLVED :
from Androd google API : zoomlevel 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; 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.
So given the Equator E = 40075 Km or 21.638,8 miles given the distance to zoom D = 20 km or miles
the zoom level : L = log2(E/D)+1
This is the simple method I've used remember to set E= 21.638,8 if you want to use the miles...
Play with the
.setZoom(int);
parameter of your map. i think its around 15:so
myMap.setZoom(15);
You can use the setzoom()-function to do so. The code below can be found in this example.