Книга: Beginning Android

Rugged Terrain

Rugged Terrain

Just as the Google Maps you use on your full-size computer can display satellite imagery, so too can Android maps.

MapView offers toggleSatellite(), which, as the names suggest, toggles on and off the satellite perspective on the area being viewed. You can have the user trigger these via an options menu or, in the case of NooYawk, via keypresses:

@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
 if (keyCode == KeyEvent.KEYCODE_S) {
  map.setSatellite(!map.isSatellite());
  return(true);
 } else if (keyCode == KeyEvent.KEYCODE_Z) {
  map.displayZoomControls(true);
  return(true);
 }
 return(super.onKeyDown(keyCode, event));
}

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


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