FindViewById
AddView getZoomControls
Then, you can manually get the zoom controls to appear by calling on your , or they will automatically appear when the user pans the map as seen in Figure 34‑1.
Figure 34‑1. Map with zoom indicator and compass rose
Center
Typically, you will need to control what the map is showing, beyond the zoom level, such as the user’s current location, or a location saved with some data in your activity. To change the map’s position, call on the .
This takes a as a parameter. A represents a location, via latitude and longitude. The catch is that the stores latitude and longitude as integers representing the actual latitude and longitude multiplied by . This saves a bit of memory versus storing a or , and it probably speeds up some internal calculations Android needs to do to convert the into a map position. However, it does mean you have to remember to multiply the “real world” latitude and longitude by .
Дата добавления: 2015-05-16; просмотров: 711;