use of net.osmand.plus.helpers.AvoidSpecificRoads.AvoidSpecificRoadsCallback in project Osmand by osmandapp.
the class ImpassableRoadsLayer method applyNewObjectPosition.
@Override
public void applyNewObjectPosition(@NonNull Object o, @NonNull LatLon position, @Nullable final ApplyMovedObjectCallback callback) {
if (o instanceof RouteDataObject) {
final RouteDataObject object = (RouteDataObject) o;
final OsmandApplication application = activity.getMyApplication();
application.getAvoidSpecificRoads().replaceImpassableRoad(activity, object, position, false, new AvoidSpecificRoadsCallback() {
@Override
public void onAddImpassableRoad(boolean success, RouteDataObject newObject) {
if (callback != null) {
callback.onApplyMovedObject(success, newObject);
}
}
@Override
public boolean isCancelled() {
return callback != null && callback.isCancelled();
}
});
}
}
Aggregations