Ejemplo n.º 1
0
  /**
   * Plot all buildings referred to in the given information about plotting a schedule.
   *
   * @param schedulePlot All information about the schedule and route to plot.
   */
  private void plotBuildings(SchedulePlot schedulePlot) {

    // CPSC 210 Students: Complete this method by plotting each building in the
    // schedulePlot with an appropriate message displayed
    if (schedulePlot.getSections().size() == 0) {
      AlertDialog aDialog = createSimpleDialog("Schedule To Plot Is Empty");
      aDialog.show();
    } else {
      for (Section s : schedulePlot.getSections()) {
        plotABuilding(
            s.getBuilding(),
            "Building: " + s.getBuilding().getName(),
            "Schedule for: " + schedulePlot.getName() + " " + s.getCourseInfo(),
            schedulePlot.getIcon());
      }
    }

    // CPSC 210 Students: You will need to ensure the buildingOverlay is in
    // the overlayManager. The following code achieves this. You should not likely
    // need to touch it
    OverlayManager om = mapView.getOverlayManager();
    om.add(buildingOverlay);
  }