示例#1
0
  private boolean tapZoom(final MotionEvent event) {
    if (zoomIn_.hit(event)) {
      if (zoomIn_.enabled()) mapView_.getController().zoomIn();
      return true;
    } // if ...
    if (zoomOut_.hit(event)) {
      if (zoomOut_.enabled()) mapView_.getController().zoomOut();
      return true;
    } // if ...

    return false;
  } // tapPrevNext
示例#2
0
  public ZoomButtonsOverlay(final Context context, final MapView mapView) {
    super(context);

    mapView_ = mapView;

    final int offset = OverlayHelper.offset(context);
    final float radius = OverlayHelper.cornerRadius(context);

    final Resources res = context.getResources();
    zoomIn_ = new OverlayButton(res.getDrawable(R.drawable.btn_plus), offset, offset * 2, radius);
    zoomIn_.rightAlign().bottomAlign();

    zoomOut_ =
        new OverlayButton(
            res.getDrawable(R.drawable.btn_minus), zoomIn_.right() + offset, offset * 2, radius);
    zoomOut_.rightAlign().bottomAlign();
  } // ZoomButtonsOverlay
示例#3
0
 public boolean onDoubleTap(final MotionEvent event) {
   return zoomIn_.hit(event) || zoomOut_.hit(event);
 } // onDoubleTap
示例#4
0
 public void drawButtons(final Canvas canvas, final MapView mapView) {
   zoomIn_.enable(mapView.canZoomIn());
   zoomIn_.draw(canvas);
   zoomOut_.enable(mapView.canZoomOut());
   zoomOut_.draw(canvas);
 } // drawButtons