Geofence/Geofence/Geofence.Plugin.iOS/GeofenceImplementation.cs
/// <summary>
/// Get current 20 monitored regions.
/// </summary>
/// <param name="regions"></param>
/// <returns></returns>
Get current 20 monitored regions.
Get current 20 monitored regions .
public IList<GeofenceCircularRegion> GetCurrentRegions(IList<GeofenceCircularRegion> regions)
        {
            IList<GeofenceCircularRegion> nearestRegions = null;
            if (regions.Count > 20)
            {
                if (locationManager.Location != null)
                {
                    IEnumerable<GeofenceCircularRegion> nRegions = regions.OrderBy(r => CalculateDistance(locationManager.Location.Coordinate.Latitude, locationManager.Location.Coordinate.Longitude, r.Latitude, r.Longitude)).Take(20);
                    nearestRegions = nRegions.ToList();
                }
                else
                {
                    nearestRegions = regions.Take(20).ToList();
                }
            }
            else
            {
                nearestRegions = regions;
            }
            return nearestRegions;
        }
public IList < GeofenceCircularRegion > GetCurrentRegions ( IList < GeofenceCircularRegion > regions ) { IList < GeofenceCircularRegion > nearestRegions = null ; if ( regions . Count > 20 ) { if ( locationManager . Location != null ) { IEnumerable < GeofenceCircularRegion > nRegions = regions . OrderBy ( r => CalculateDistance ( locationManager . Location . Coordinate . Latitude , locationManager . Location . Coordinate . Longitude , r . Latitude , r . Longitude ) ) . Take ( 20 ) ; nearestRegions = nRegions . ToList ( ) ; } else { nearestRegions = regions . Take ( 20 ) . ToList ( ) ; } } else { nearestRegions = regions ; } return nearestRegions ; }
Get current 20 monitored regions.
Get current 20 monitored regions .
None
regions
IList<GeofenceCircularRegion>
None