예제 #1
0
  @Override
  public void receiveGuideEvent(
      Guide guide, String targetName, float azimuthToTarget, double distanceToTarget) {

    Guide g = A.getGuidingContent().getGuide();
    mOverlayGuidance.show(g != null);
    mOverlayGuidance.requestRedraw();
  }
예제 #2
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();
 }
예제 #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()));
    }
  }
 @Override
 public ScaleOverlay createAddScaleOverlay(Activity activity) {
   MapsforgeOverlay ovl = new MapsforgeOverlay(activity, overlayType.ScaleOverlay);
   getOverlays().add(ovl);
   return (ScaleOverlay) ovl.getBase();
 }
 @Override
 public PositionOverlay createAddPositionOverlay(Activity activity) {
   MapsforgeOverlay ovl = new MapsforgeOverlay(activity, overlayType.PositionOverlay);
   getOverlays().add(ovl);
   return (PositionOverlay) ovl.getBase();
 }
예제 #7
0
 @Override
 public void guideStop() {
   mOverlayGuidance.hide();
   mOverlayGuidance.requestRedraw();
 }
예제 #8
0
 @Override
 public void guideStart() {
   Guide g = A.getGuidingContent().getGuide();
   mOverlayGuidance.show(g != null);
   mOverlayGuidance.requestRedraw();
 }
예제 #9
0
  @Override
  public void refresh() {

    mOverlayZones.requestRedraw();
  }