The Core Location namespace revolves around tracking and monitoring user location, the device's entry-and-exit from regions (either fixed or iBeacon-based), and geocoding between addresses and locations.
Geocoding use-cases center on the CoreLocation.CLGeocoder class. Geocoding is simple:
C# Example
async void GeocodeToConsoleAsync (string address) {
var geoCoder = new CLGeocoder();
var placemarks = await geoCoder.GeocodeAddressAsync(address);
foreach (var placemark in placemarks) {
Console.WriteLine(placemark);
}
As is reverse-geocoding:
C# Example
async void ReverseGeocodeToConsoleAsync (CLLocation location) {
var geoCoder = new CLGeocoder();
var placemarks = await geoCoder.ReverseGeocodeLocationAsync(location);
foreach (var placemark in placemarks) {
Console.WriteLine(placemark);
}
}
Other use-cases typically will start with the CoreLocation.CLLocationManager class:
Tracking the device's location Region monitoring (Geofencing) iBeacon rangingThese use-cases are discussed in the CoreLocation.CLLocationManager class documentation.
| Type | Reason |
|---|---|
| CLActivityType | An enumeration whose values specify different types of activity. |
| CLAuthorizationChangedEventArgs | Provides data for the CoreLocation.CLAuthorizationChangedEventArgs.AuthorizationChanged event. |
| CLAuthorizationStatus | An enumeration whose values specify the current status of authorization to use location services. |
| CLBeacon | Represents a local-area device that can be used for fine-grained location monitoring. |
| CLBeaconRegion | CoreLocation region determined by an iBeacon. |
| CLCircularRegion | A CoreLocation.CLRegion defined by a center and a radius (in meters). |
| CLDeviceOrientation | An enumeration whose values represent the device's physical orientation. |
| CLError | Errors returned by the CLLocationManager. |
| CLFloor | Information describing a building level. |
| CLGeocodeCompletionHandler | A delegate that is the completionHandler in calls to CoreLocation.CLGeocoder.GeocodeAddress. |
| CLGeocoder | Provides support for converting between an address in text form and a location described using latitude and longitude or to convert from a latitue and longitude to a user-friendly location (street, city, state, country). |
| CLHeading | Heading data as generated by the CLLocationManager. |
| CLHeadingUpdatedEventArgs | Provides data for the CoreLocation.CLHeadingUpdatedEventArgs.UpdatedHeading event. |
| CLLocation | Location information as generated byt he CLLocationManager class. |
| CLLocationCoordinate2D | Geographical coordinates. |
| CLLocationDistance | A class whose static members define constants relating to filtering and maximum distance. |
| CLLocationManager | Manages the delivery of location, region, and heading events to your application. |
| CLLocationManagerDelegate | Virtual methods on this class receive notifications from the CLLocationManager. |
| CLLocationManagerDelegate_Extensions | Extension methods to the CoreLocation.ICLLocationManagerDelegate interface to support all the methods from the CoreLocation.CLLocationManagerDelegate protocol. |
| CLLocationManagerEventArgs | Event arguments generated by the CoreLocation.CLLocationManager.ShouldDisplayHeadingCalibration event. |
| CLLocationsUpdatedEventArgs | Provides data for the CoreLocation.CLLocationsUpdatedEventArgs.LocationsUpdated event. |
| CLLocationUpdatedEventArgs | Provides data for the CoreLocation.CLLocationUpdatedEventArgs.UpdatedLocation event. |
| CLPlacemark | Associates data such as street address with a coordinate. |
| CLProximity | An enumeration whose values specify the physical proximity of an iBeacon. |
| CLRegion | The base class for trackable geographical regions. |
| CLRegionBeaconsFailedEventArgs | Provides data for the CoreLocation.CLRegionBeaconsFailedEventArgs.RangingBeaconsDidFailForRegion event. |
| CLRegionBeaconsRangedEventArgs | Provides data for the CoreLocation.CLRegionBeaconsRangedEventArgs.DidRangeBeacons event. |
| CLRegionErrorEventArgs | Provides data for the CoreLocation.CLRegionErrorEventArgs.MonitoringFailed event. |
| CLRegionEventArgs | Provides data for the CoreLocation.CLRegionEventArgs.DidStartMonitoringForRegion, CoreLocation.CLRegionEventArgs.RegionEntered and CoreLocation.CLRegionEventArgs.RegionLeft events. |
| CLRegionState | An enumeration whose values specify whether the device is inside or outside a region or unknown. |
| CLRegionStateDeterminedEventArgs | Provides data for the CoreLocation.CLRegionStateDeterminedEventArgs.DidDetermineState event. |
| CLVisit | Relates a location and radius with an arrival and departure time. |
| CLVisitedEventArgs | Provides data for the CoreLocation.CLVisitedEventArgs.DidVisit event. |
| ICLLocationManagerDelegate | Interface representing the required methods (if any) of the protocol CoreLocation.CLLocationManagerDelegate. |