Add marker if no marker found.
This commit is contained in:
parent
fb110c4f09
commit
fe8eb244d5
|
|
@ -250,6 +250,7 @@ public class MainActivity extends AppCompatActivity implements IOrientationConsu
|
|||
|
||||
private void markAsFound() {
|
||||
List<WayPointLocation> wpls = serviceGps.foundNearObjects();
|
||||
boolean findMarker = false;
|
||||
for (WayPointLocation wpl : wpls) {
|
||||
if (wpl != null && !wpl.isFound()) {
|
||||
wpl.setFound();
|
||||
|
|
@ -265,9 +266,16 @@ public class MainActivity extends AppCompatActivity implements IOrientationConsu
|
|||
}
|
||||
}
|
||||
serviceGps.addPointObjectDog();
|
||||
findMarker = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (wpls.isEmpty() || !findMarker) {
|
||||
// if no object is near
|
||||
WayPointLocation wpl = serviceGps.addPointObjectDog();
|
||||
GeoPoint gp = new GeoPoint(wpl.getLatitude(), wpl.getLongitude(), wpl.getAltitude());
|
||||
addMarker(gp, true);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
Loading…
Reference in New Issue