JavaScript Reference

Local Navigation

Geolocation API

Object

Description

Availability

Coordinates

Contains a set of geographic coordinates.

6.0 or later

Geolocation

Acquires the location information associated with the hosting BlackBerry device.

6.0 or later

Position

Contains the geographical position of the BlackBerry device at a specific time.

6.0 or later

Object: Coordinates

Availability

BlackBerry Device Software version 6.0 or later

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.

Back To Top

Coordinates properties

Property name

Type

Description

Status

Support level

Availability

latitude

double

Returns the geographic latitude, in decimal degrees.

read only

Geolocation

6.0 or later

longitude

double

Returns the geographic longitude, in decimal degrees.

read only

Geolocation

6.0 or later

Back To Top

Object: Geolocation

Availability

BlackBerry Device Software version 6.0 or later

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.

Back To Top

Geolocation methods

Method name

Description

Support level

Availability

clearWatch()

Stops the Geolocation.watchPosition() method from monitoring the device position.

Geolocation

6.0 or later

getCurrentPosition()

Attempts to asynchronously obtain the current location of the device.

Geolocation

6.0 or later

watchPosition()

Monitors the position of the device and calls the given callback function every time the position changes.

Geolocation

6.0 or later

Back To Top

Object: Position

Availability

BlackBerry Device Software version 6.0 or later

The Position object contains the geographical position of the BlackBerry device at the specific time that it was acquired by the Geolocation object.

Back To Top

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

Geolocation

6.0 or later

Back To Top
Next topic: HTML API
Previous topic: UIEvent methods

Was this information helpful? Send us your comments.