예제 #1
0
 /**
  * removes the previous car overlay and replaces it with a new car overlay that represents the
  * users car at a specific geopoint
  *
  * @param point for geopoint of car
  * @author WWPowers 3-31-2010
  * @author ricky barrette
  */
 public void setCar(GeoPoint point) {
   isCarFound = false;
   hasLeftCar = false;
   mCarPoint = point;
   mCarOverlay = new FindMyCarOverlay(getActivity(), point);
   mMap.getMap().getOverlays().add(mCarOverlay);
   mMap.setDestination(mCarPoint);
 }
예제 #2
0
  /**
   * removes the car overlay from the mapview.
   *
   * @return true if successful
   * @author ricky barrette
   */
  public boolean removeCar() {

    mCarPoint = null;
    mDistance.setText("0");
    mSettings.edit().remove(Settings.LAT).remove(Settings.LON).commit();
    mMap.setDestination(null);
    if (mListener != null) mListener.onCarDeleted();
    if (mDirections != null) {
      mDirections.removePath();
      mDirections = null;
    }

    try {
      mMap.getMap().getOverlays().remove(mCarOverlay);
    } catch (Exception e) {
      return false;
    }
    return true;
  }