Example #1
0
        /// <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;
        }
Example #2
0
        /// <summary>
        /// Register a delegate to location updates.
        /// </summary>
        /// <param name="locationUpdatedDelegate"></param>
        public void OnLocationUpdatedEvent(LocationUpdatedDelegate locationUpdatedDelegate)
        {
            if (IsEnabled)
            {
                locationUpdatedDelegate(CurrentLocation, LastLocation);
            }

            OnLocationUpdatedDelegate += locationUpdatedDelegate;
        }
Example #3
0
 public void OnLocationUpdated(LocationUpdatedDelegate locationUpdatedDelegate)
 {
     onLocationUpdated += locationUpdatedDelegate;
 }