Skip to content

Commit

Permalink
Merge pull request #705 from tensafefrogs/flight-path-clear-on-arm
Browse files Browse the repository at this point in the history
Clear the previous flight path when arming. Fixes #701.
  • Loading branch information
arthurbenemann committed Mar 26, 2014
2 parents c3ea4c0 + 5849b7e commit 600d840
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import com.google.android.gms.maps.model.PolylineOptions;

public class FlightMapFragment extends DroneMap implements
OnMapLongClickListener, OnMarkerClickListener, OnMarkerDragListener,GuidedDialogListener {
OnMapLongClickListener, OnMarkerClickListener, OnMarkerDragListener, GuidedDialogListener {

private static final int ZOOM_LEVEL = 20;

Expand Down Expand Up @@ -156,6 +156,12 @@ public boolean onMarkerClick(Marker marker) {
@Override
public void onDroneEvent(DroneEventsType event, Drone drone) {
switch (event) {
case ARMING:
// Clear the previous flight path when arming.
if (drone.state.isArmed()) {
clearFlightPath();
}
break;
case GPS:
droneLeashPath.update(drone.guidedPoint);
addFlightPathPoint(drone.GPS
Expand Down

0 comments on commit 600d840

Please sign in to comment.