Geolocation API
Object: Coordinates
The Coordinates object is a property of the Position object. It contains the geographical position of the BlackBerry device at the specific time that it was acquired by the Geolocation object.
If any of the properties of this object cannot be determined, they are assigned a value of null.
Coordinates properties
Object: Geolocation
The Geolocation object is a child of the Navigator object. It is used to acquire the location information associated with the hosting device. The location information is acquired by applying a user-agent specific algorithm, creating a Position object, and populating that object with appropriate data accordingly.
The user must provide consent before the BlackBerry device can retrieve the geographic coordinates.
Geolocation methods
|
Method name |
Description |
Support level |
Availability |
|---|---|---|---|
|
clearWatch() |
Stops the Geolocation.watchPosition() method from monitoring the device position. |
6.0 or later |
|
|
getCurrentPosition() |
Attempts to asynchronously obtain the current location of the device. |
6.0 or later |
|
|
watchPosition() |
Monitors the position of the device and calls the given callback function every time the position changes. |
6.0 or later |
Object: Position
The Position object contains the geographical position of the BlackBerry device at the specific time that it was acquired by the Geolocation object.
Position properties
|
Property name |
Type |
Description |
Status |
Support level |
Availability |
|---|---|---|---|---|---|
|
coords |
Coordinates |
Returns a Coordinates object that contains the geographic position of the BlackBerry device. |
read only |
6.0 or later |