示例#1
0
 @Override
 protected void onResume() {
   super.onResume();
   Settings.setCurrentActivity(this);
   mMapview.invalidate();
   mOverlayZones.requestRedraw();
   mOverlayPosition.requestRedraw();
   Guide g = A.getGuidingContent().getGuide();
   mOverlayGuidance.show(g != null);
   mOverlayGuidance.requestRedraw();
 }
示例#2
0
  @Override
  public void receiveGuideEvent(
      Guide guide, String targetName, float azimuthToTarget, double distanceToTarget) {

    Guide g = A.getGuidingContent().getGuide();
    mOverlayGuidance.show(g != null);
    mOverlayGuidance.requestRedraw();
  }
示例#3
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    mMapview = new MapView(this);
    mMapview.setClickable(true);
    mMapview.setBuiltInZoomControls(true);

    mMapFile = getIntent().getStringExtra(MAPFILE);
    File file = new File(mMapFile);
    mMapview.setMapFile(file);
    setContentView(mMapview);

    // --- draw current position
    // Drawable marker = getResources().getDrawable(R.drawable.icon_gc_wherigo);

    mPaintVisibleZoneFill.setStyle(Paint.Style.FILL);
    mPaintVisibleZoneFill.setColor(Color.BLUE);
    mPaintVisibleZoneFill.setAlpha(64);

    mPaintVisibleZoneBorder.setStyle(Paint.Style.STROKE);
    mPaintVisibleZoneBorder.setColor(Color.BLUE);
    mPaintVisibleZoneBorder.setAlpha(128);
    mPaintVisibleZoneBorder.setStrokeWidth(3);

    // mOverlayGuidance = new OverlayGuidance();
    mMapview.getOverlays().add(mOverlayGuidance);
    Guide g = A.getGuidingContent().getGuide();
    mOverlayGuidance.show(g != null);
    mOverlayGuidance.requestRedraw();

    // mOverlayPosition = new OverlayPosition(this,mMapview);
    mMapview.getOverlays().add(mOverlayPosition);
    mOverlayPosition.requestRedraw();

    // mOverlayZones = new OverlayZones();
    mMapview.getOverlays().add(mOverlayZones);
    mOverlayZones.requestRedraw();
  }
示例#4
0
  public void onLocationChanged(Location location) {
    if ((mLocation == null)
        || (mLocation.getLongitude() != location.getLongitude())
        || (mLocation.getLatitude() != location.getLatitude())
        || (mLocation.getBearing() != location.getBearing())
        || (mLocation.getAccuracy() != location.getAccuracy())) {
      mLocation = location;

      // ----
      mOverlayPosition.onLocationChanged(location);
      mOverlayPosition.requestRedraw();

      if (mOverlayGuidance != null) {
        Guide g = A.getGuidingContent().getGuide();
        mOverlayGuidance.show(g != null);
        mOverlayGuidance.onLocationChanged(location);
        mOverlayGuidance.requestRedraw();
      }

      // center map
      mMapview.setCenter(new GeoPoint(mLocation.getLatitude(), mLocation.getLongitude()));
    }
  }
示例#5
0
 @Override
 public void guideStop() {
   mOverlayGuidance.hide();
   mOverlayGuidance.requestRedraw();
 }
示例#6
0
 @Override
 public void guideStart() {
   Guide g = A.getGuidingContent().getGuide();
   mOverlayGuidance.show(g != null);
   mOverlayGuidance.requestRedraw();
 }
示例#7
0
  @Override
  public void refresh() {

    mOverlayZones.requestRedraw();
  }