Книга: Beginning Android

Center

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 setCenter() on the MapController.

This takes a GeoPoint as a parameter. A GeoPoint represents a location, via latitude and longitude. The catch is that the GeoPoint stores latitude and longitude as integers representing the actual latitude and longitude multiplied by 1E6. This saves a bit of memory versus storing a float or double, and it probably speeds up some internal calculations Android needs to do to convert the GeoPoint into a map position. However, it does mean you have to remember to multiply the “real world” latitude and longitude by 1E6.

Оглавление книги

Оглавление статьи/книги

Генерация: 0.184. Запросов К БД/Cache: 2 / 0
поделиться
Вверх Вниз