@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(); }
@Override public void receiveGuideEvent( Guide guide, String targetName, float azimuthToTarget, double distanceToTarget) { Guide g = A.getGuidingContent().getGuide(); mOverlayGuidance.show(g != null); mOverlayGuidance.requestRedraw(); }
@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(); }
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 void guideStop() { mOverlayGuidance.hide(); mOverlayGuidance.requestRedraw(); }
@Override public void guideStart() { Guide g = A.getGuidingContent().getGuide(); mOverlayGuidance.show(g != null); mOverlayGuidance.requestRedraw(); }
@Override public void refresh() { mOverlayZones.requestRedraw(); }