コード例 #1
0
  private void initializeMap() {
    mapView.setSatellite(settingsHelper.isSatelliteView());

    if (settingsHelper.isFirstLaunch()) {
      mapView.getController().setZoom(16);

      Location location = locationHelper.getLastLocation();
      if (location != null) {
        GeoPoint geoPoint = geoPoint(location);
        mapView.getController().setCenter(geoPoint);
      }

      settingsHelper.setFirstLaunch(false);
    }
  }
コード例 #2
0
 protected void centerMap() {
   if (locationHelper.getLastLocation() != null) {
     GeoPoint geoPoint = geoPoint(locationHelper.getLastLocation());
     MapController controller = mapView.getController();
     controller.animateTo(geoPoint);
   }
 }
コード例 #3
0
  public void noteClicked(OverlayItem item, int index) {
    suppressNextTap();

    mapView.getController().animateTo(item.getPoint());

    noteClicked(index);
  }
コード例 #4
0
  private void showSession() {
    if (sessionManager.isSessionSaved() && zoomToSession) {
      LocationConversionHelper.BoundingBox boundingBox = boundingBox(sessionManager.getSession());

      mapView.getController().zoomToSpan(boundingBox.getLatSpan(), boundingBox.getLonSpan());
      mapView.getController().animateTo(boundingBox.getCenter());
    }
  }
コード例 #5
0
 @Override
 public void onClick(View view) {
   switch (view.getId()) {
     case R.id.toggle_heat_map_button:
       toggleHeatMapVisibility();
       updateButtons();
       break;
     case R.id.zoom_in:
       mapView.getController().zoomIn();
       break;
     case R.id.zoom_out:
       mapView.getController().zoomOut();
       break;
     case R.id.locate:
       centerMap();
       break;
     case R.id.view_photo:
       Intents.viewPhoto(this, photoUri());
       break;
     default:
       super.onClick(view);
   }
 }
コード例 #6
0
 @Subscribe
 public void onEvent(DoubleTapEvent event) {
   mapView.getController().zoomIn();
 }