Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

JavaScript methods to use location-based services

by Retired on ‎02-17-2010 10:56 AM (1,826 Views)


This article applies to the following:

  • BlackBerry® Device Software 4.0.2
  • BlackBerry® smartphones with Global Positioning System (GPS) capabilities


A number of JavaScript® methods were introduced in BlackBerry Device Software 4.0.2, which allows web developers to use location-based services, available on BlackBerry smartphones with GPS capabilities, in their web content.

The following methods and properties are available to developers to request GPS related information:

- Requests the BlackBerry location be updated.


blackberry.location.onLocationUpdate(var method)
- Registers a callback method to be called when the location changes.


blackberry.location.setAidMode(var aidMode)
- Sets the aid mode to be used: 0 = cellsite, 1 = assisted, 2 = autonomous


- Boolean value whether GPS is supported on this BlackBerry.


- The current longitude.


- The current latitude.

Users Online
Currently online: 33 members 5,970 guests
Please welcome our newest community members: