Platforms to show: All Mac Windows Linux Cross-Platform
CLLocationManagerMBS class
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
class | CoreLocation | MBS MacFrameworks Plugin | 9.6 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
The CLLocationManagerMBS class defines the interface for configuring the delivery of location- and heading-related events to your application. You use an instance of this class to establish the parameters that determine when location and heading events should be delivered. You can also a location manager object to retrieve the most recent location data.
To use a CLLocationManagerMBS object to deliver location events, create an instance, configure the desired accuracy and distance filter values, and call the startUpdatingLocation method. The location service returns an initial location as quickly as possible, returning cached information when available. After delivery of the initial event notification, the CLLocationManagerMBS object may deliver additional events if the minimum threshold distance (as specified by the distanceFilter property) is exceeded or a more accurate location value is determined.
Important: The user has the option of denying an application's access to the location service data. During its initial uses by an application, the Core Location framework prompts the user to confirm that using the location service is acceptable. If the user denies the request, the CLLocationManagerMBS object reports an appropriate error to its delegate during future requests.
See also documentation from Apple for the CLLocationManager class:
https://developer.apple.com/library/mac/#documentation/CoreLocation/Reference/CLLocationManager_Class/CLLocationManager/CLLocationManager.html
See WindowsLocationManagerMBS class for Windows.
- 10 events
- event didChangeAuthorizationStatus(status as Integer)
- event didEnterRegion(region as CLRegionMBS)
- event didExitRegion(region as CLRegionMBS)
- event didFailWithError(error as NSErrorMBS)
- event didFinishDeferredUpdatesWithError(error as NSErrorMBS)
- event didStartMonitoringForRegion(region as CLRegionMBS)
- event didUpdate(newLocation as CLLocationMBS, oldLocation as CLLocationMBS)
- event didUpdateHeading(newHeading as CLHeadingMBS)
- event didUpdateLocations(locations() as CLLocationMBS)
- event monitoringDidFailForRegion(region as CLRegionMBS, error as NSErrorMBS)
- 6 properties
- property desiredAccuracy as Double
- property distanceFilter as Double
- property Handle as Integer
- property location as CLLocationMBS
- property maximumRegionMonitoringDistance as Double
- property purpose as string
- 12 methods
- method Constructor
- method Destructor
- method dismissHeadingCalibrationDisplay
- method monitoredRegions as CLRegionMBS()
- method startMonitoringForRegion(region as CLRegionMBS)
- method startMonitoringSignificantLocationChanges
- method startUpdatingHeading
- method startUpdatingLocation
- method stopMonitoringForRegion(region as CLRegionMBS)
- method stopMonitoringSignificantLocationChanges
- method stopUpdatingHeading
- method stopUpdatingLocation
- 11 shared methods
- shared method authorizationStatus as Integer
- shared method CheckEvents
- shared method deferredLocationUpdatesAvailable as boolean
- shared method headingAvailable as boolean
- shared method kCLErrorDomain as string
- shared method kCLErrorUserInfoAlternateRegionKey as string
- shared method locationServicesAvailable as boolean
- shared method locationServicesEnabled as boolean
- shared method regionMonitoringAvailable as boolean
- shared method regionMonitoringEnabled as boolean
- shared method significantLocationChangeMonitoringAvailable as boolean
- 22 constants
Constants
Constant | Value | Description |
---|---|---|
kCLErrorDenied | 1 |
One of the error codes reported by the location manager error event.
Access to the location service was denied by the user. |
kCLErrorLocationUnknown | 0 |
One of the error codes reported by the location manager error event.
The location manager was unable to obtain a location value right now. |
Authorization Status Constants.
Constant | Value | Description |
---|---|---|
kCLAuthorizationStatusAuthorized | 3 |
This application is authorized to use location services. |
kCLAuthorizationStatusDenied | 2 |
The user explicitly denied the use of location services for this application or location services are currently disabled in Settings. |
kCLAuthorizationStatusNotDetermined | 0 |
The user has not yet made a choice regarding whether this application can use location services. |
kCLAuthorizationStatusRestricted | 1 |
This application is not authorized to use location services. The user cannot change this application's status, possibly due to active restrictions such as parental controls being in place. |
Device Orientation Constants
Constant | Value | Description |
---|---|---|
kCLDeviceOrientationFaceDown | 6 |
The device is held parallel to the ground with the screen facing downwards. |
kCLDeviceOrientationFaceUp | 5 |
The device is held parallel to the ground with the screen facing upwards. |
kCLDeviceOrientationLandscapeLeft | 3 |
The device is in landscape mode, with the device held upright and the home button on the right side. |
kCLDeviceOrientationLandscapeRight | 4 |
The device is in landscape mode, with the device held upright and the home button on the left side. |
kCLDeviceOrientationPortrait | 1 |
The device is in portrait mode, with the device held upright and the home button at the bottom. |
kCLDeviceOrientationPortraitUpsideDown | 2 |
The device is in portrait mode but upside down, with the device held upright and the home button at the top. |
kCLDeviceOrientationUnknown | 0 |
The orientation is currently not known. |
Corelocation Error Codes
Constant | Value | Description |
---|---|---|
kCLErrorGeocodeCanceled | 10 |
The geocode request was canceled. |
kCLErrorGeocodeFoundNoResult | 8 |
The geocode request yielded no result. |
kCLErrorGeocodeFoundPartialResult | 9 |
The geocode request yielded a partial result. |
kCLErrorHeadingFailure | 3 |
The heading could not be determined. |
kCLErrorNetwork | 2 |
The network was unavailable or a network error occurred. |
kCLErrorRegionMonitoringDenied | 4 |
Access to the region monitoring service was denied by the user. |
kCLErrorRegionMonitoringFailure | 5 |
A registered region cannot be monitored. |
kCLErrorRegionMonitoringResponseDelayed | 7 |
Core Location will deliver events but they may be delayed. |
kCLErrorRegionMonitoringSetupDelayed | 6 |
Core Location could not initialize the region monitoring feature immediately. |
This class has no sub classes.
Some examples using this class:
- /MacFrameworks/CoreLocation/CoreLocation to find computer location
- /MacFrameworks/CoreLocation/Locate Address Web
Blog Entries
- Find computer location
- MBS Xojo / Real Studio Plugins, version 14.5pr4
- MBS Xojo / Real Studio Plugins, version 13.5pr1
- MBS REALbasic plug-in 9.6
Xojo Developer Magazine
Videos
The items on this page are in the following plugins: MBS MacFrameworks Plugin.
CLLocationCoordinate2DMBS - CLLocationMBS