Platforms to show: All Mac Windows Linux Cross-Platform

Back to CLLocationMBS class.

CLLocationMBS.Constructor(latitude as Double, longitude as Double)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method CoreLocation MBS MacFrameworks Plugin 9.6 ✅ Yes ❌ No ❌ No ✅ Yes All
Initializes and returns a location object with the specified latitude and longitude.
Example
dim c as new CLLocationMBS(50,7)

MsgBox c.description

// example output: <+50.00000000, +7.00000000> +/- 0.00m (speed -1.00 mps / course -1.00) @ 2009-08-28 23:59:58 +0200

latitude: The latitude of the coordinate point.
longitude: The longitude of the coordinate point.

Typically, you acquire location objects from the location service, but you can use this method to create new location objects for other uses in your application. When using this method, the other properties of the object are initialized to appropriate values. In particular, the altitude and horizontalAccuracy properties are set to 0, the verticalAccuracy property is set to -1 to indicate that the altitude value is invalid, and the timestamp property is set to the time at which the instance was initialized.

Requires Mac OS X 10.6

See also:

CLLocationMBS.Constructor(latitude as Double, longitude as Double, altitude as Double, horizontalAccuracy as Double, verticalAccuracy as Double, course as Double, speed as Double, timestamp as date)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method CoreLocation MBS MacFrameworks Plugin 11.2 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Initializes a location object with the specified coordinate and course information.

latitude and longitude: A coordinate structure containing the latitude and longitude values.
altitude: The altitude value for the location.
horizontalAccuracy: The accuracy of the coordinate value. Specifying a negative number indicates that the coordinate value is invalid.
verticalAccuracy: The accuracy of the altitude value. Specifying a negative number indicates that the altitude value is invalid.
course: The direction of travel for the location.
speed: The current speed associated with this location.
timestamp: The time to associate with the location object. Typically, you would set this to the current time.

Typically, you acquire location objects from the location service, but you can use this method to create new location objects for other uses in your application.

Available on Mac OS X 10.7 or newer.

See also:

CLLocationMBS.Constructor(latitude as Double, longitude as Double, altitude as Double, horizontalAccuracy as Double, verticalAccuracy as Double, timestamp as date)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method CoreLocation MBS MacFrameworks Plugin 9.6 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Initializes and returns a location object with the specified coordinate information.
Example
dim c as new CLLocationMBS(1,2,3,4,5,nil)

MsgBox c.description

coordinate: A coordinate structure containing the latitude and longitude values.
altitude: The altitude value for the location.
horizontalAccuracy: The accuracy of the coordinate value. Specifying a negative number indicates that the coordinate value is invalid.
verticalAccuracy: The accuracy of the altitude value. Specifying a negative number indicates that the altitude value is invalid.
timestamp: The time to associate with the location object. Typically, you would set this to the current time.

Typically, you acquire location objects from the location service, but you can use this method to create new location objects for other uses in your application.

See also:

CLLocationMBS.copy as CLLocationMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method CoreLocation MBS MacFrameworks Plugin 9.6 ✅ Yes ❌ No ❌ No ✅ Yes All
Creates a copy of the object.
Example
dim c as new CLLocationMBS(5,6)

dim n as CLLocationMBS = c.copy

MsgBox n.description

Internally a new CLLocation object is created with a copy of the data.

CLLocationMBS.distanceFromLocation(location as CLLocationMBS) as Double

Type Topic Plugin Version macOS Windows Linux iOS Targets
method CoreLocation MBS MacFrameworks Plugin 9.6 ✅ Yes ❌ No ❌ No ✅ Yes All
Returns the distance (in meters) between the two locations.
Example
// Nickenich  50° 24' 48" N, 7° 19' 47" E
// Andernach 50° 26' 23" N, 7° 24' 6" E

dim c1 as new CLLocationMBS(50.439722, 7.40167) // Andernach
dim c2 as new CLLocationMBS(50.413333, 7.32972) // Nickenich

MsgBox str(c1.distanceFromLocation(c2))+" meter"

This method measures the distance between the two locations by tracing a line between them that follows the curvature of the Earth. The resulting arc is a smooth curve and does not take into account specific altitude changes between the two locations.

The items on this page are in the following plugins: MBS MacFrameworks Plugin.


The biggest plugin in space...