I have built a simple app that uses a Google MapActivity.  On top of
the Map, I have 2 overlays, a Marathon Course and the position of a
runner.  The latter position overlay simply shows an updated blue
dot.  I update the location of the dot every second but the screen
does not refresh.  If I tap the scrren then the dot updates.

Am I missing some hard refresh call somewhere?  My Overlay code is
small and shown below.  Note that it does go into the draw routine
every second and the point is changed.

Thanks,

Chris






public class GhostOverlay extends ItemizedOverlay<OverlayItem> {

  private OverlayItem _ghost = new
OverlayItem(getPoint(39.55122004263103,
                        -105.13980455696583), "Ghost", "Start of
ride");

  public GhostOverlay(Drawable arg0) {
    super(arg0);
    populate();
  }


  private GeoPoint getPoint(double lat, double lon) {
    return(new GeoPoint((int)(lat*1000000.0), (int)(lon*1000000.0)));
  }


  protected OverlayItem createItem(int i) {
    return _ghost;
  }

  public int size() {
    return 1;
  }

  @Override
  public void draw(Canvas canvas, MapView mv, boolean shadow) {
    super.draw(canvas, mv, shadow);
  }


  /**
   * Update the location of the ghost runner, called every second.
   * Is there a refresh I need to call?  The screen only updates when
I
   * tap it or switch a tab and come back.
   * @param loc the 2D location of the runner.
   */
  public void drawGhost(Coord2D loc) {
    _ghost = new OverlayItem(getPoint(loc.y, loc.x), "Ghost", "");
    populate();
  }
}

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to