/// <summary> /// Register a delegate to location updates. /// /// The `useRawIfEnabled` method if for situations where we want the latest data, /// like when we are adding objects at runtime. /// /// </summary> /// <param name="locationUpdatedDelegate"></param> /// <param name="useRawIfEnabled"></param> public void OnLocationUpdatedEvent(LocationUpdatedDelegate locationUpdatedDelegate, bool useRawIfEnabled = false) { if (IsEnabled) { locationUpdatedDelegate(CurrentLocation, useRawIfEnabled ? Provider.LastLocationRaw : LastLocation); } OnLocationUpdatedDelegate += locationUpdatedDelegate; }
/// <summary> /// Register a delegate to location updates. /// </summary> /// <param name="locationUpdatedDelegate"></param> public void OnLocationUpdatedEvent(LocationUpdatedDelegate locationUpdatedDelegate) { if (IsEnabled) { locationUpdatedDelegate(CurrentLocation, LastLocation); } OnLocationUpdatedDelegate += locationUpdatedDelegate; }
public void OnLocationUpdated(LocationUpdatedDelegate locationUpdatedDelegate) { onLocationUpdated += locationUpdatedDelegate; }