Esempio n. 1
0
  public void draw() {
    if (!bEnableDrawing) return;

    for (Marker marker : markers) {
      marker.draw(map);
    }
  }
Esempio n. 2
0
  @Override
  protected void onDraw(Canvas canvas) {
    if (canvas == null) return;

    if (drawing.compareAndSet(false, true)) {
      List<Marker> collection = ARData.getMarkers();

      cache.clear();
      for (Marker m : collection) {
        m.update(canvas, 0, 0);
        if (m.isOnRadar()) cache.add(m);
        cache.add(m);
      }
      collection = cache;

      if (AugmentedActivity.useCollisionDetection) adjustForCollisions(canvas, collection);

      ListIterator<Marker> iter = collection.listIterator(collection.size());
      while (iter.hasPrevious()) {
        Marker marker = iter.previous();
        marker.draw(canvas);
      }
      if (AugmentedActivity.showRadar) radar.draw(canvas);
      drawing.set(false);
    }
  }