Early build Baidu Map of the environment do not say, a search on the internet a lot, here only talk about the scale of the map, the great God can directly bypass
First initialize the object of a Baidu map inside the class
Private Baidumap Mbaidumap;
Then class in the OnCreate method.
Mbaidumap = Mmapview.getmap ();
Mmapview is the name of the Baidu control Com.baidu.mapapi.map.MapView after the ID is initialized
And then
Mapstatusupdate mapstatusupdate = Mapstatusupdatefactory.zoomby (2);
Mbaidumap.animatemapstatus (mapstatusupdate);
The key here is to explain the floating-point variable behind Zoomby.
We all know that Baidu Map has a total of {"10 meters", "20 meters", "50 meters", "100 meters", "200 meters", "500 meters", "1-kilometer", "2-kilometer", "5-kilometer", "10-kilometer", "20-kilometer", "25-kilometer", "50-kilometer", "100-kilometer", " 200-kilometer "," 500-kilometer "," 1000-kilometer "," 2000-kilometer "}
18 Levels of Zoom
Above is the zoom level
The number inside the Zoomby represents the zoom level.
"8,+∞): zoom level greater than or equal to 8 is 10 meters
"7, 8): zoom level greater than or equal to 7 less than 8 is 20 meters
"6, 7): zoom level greater than or equal to 6 less than 7 is 50 meters
"5, 6): zoom level greater than or equal to 5 less than 6 is 100 meters
"4, 5): zoom level greater than or equal to 4 less than 5 is 200 meters
"3, 4): zoom level greater than or equal to 3 less than 4 is 500 meters
"2, 3): zoom level greater than or equal to 2 less than 3 is 1-kilometer
"1, 2): zoom level greater than or equal to 1 less than 2 is 2-kilometer
"0, 1): zoom level greater than or equal to 0 less than 1 is 5-kilometer
"-1, 0): greater than or equal to-1 is less than 0 zoom level is 10-kilometer
"-2,-1): greater than or equal to-2 less than-1 zoom level is 20-kilometer
"-3,-2): greater than or equal to-3 less than-2 zoom level is 25-kilometer
"-4,-3): greater than or equal to-4 less than-3 zoom level is 50-kilometer
"-5,-4): greater than or equal to-5 less than-4 zoom level is 100-kilometer
"-6,-5): greater than or equal to-6 less than-5 zoom level is 200-kilometer
"-7,-6): greater than or equal to-7 less than-6 zoom level is 500-kilometer
"-8,-7): greater than or equal to-8 less than-7 zoom level is 1000-kilometer
(-∞,-8): A zoom level of less than 8 is 2000-kilometer
Recommendation: Write the zoom level of the best written on the outside of Registerlocationlistener, to avoid a period of time to zoom back to the original state.
Map zoom levels in the Android Baidu map