BUI logo BBjGeolocation

Creation

BBjAPI > BBjSysGui > BBjGeolocation

Description

In BBj 11.0 and higher, the BBjGeolocation object provides an interface to the browser's geolocation subsystem.

Creation

The BBjGeolocation object is accessed using the following BBjSysGui method:

Return Value

Method

BBjGeolocation

getGeolocation()

Methods of BBjGeolocation

Return Value

Method

void

clearCallback(int eventType)

void

getCurrentPosition()

double

getMaximumAge()

double

getTimeout()

boolean

isHighAccuracy()

void

setCallback(int eventType, String gosubLabel)

void

setCallback(int eventType, CustomObject customObject!, String methodName)

void

setHighAccuracy(boolean highAccuracy)

void

setMaximumAge(double seconds)

void

setTimeout(double seconds)

Events

Callback Code

Object-oriented Event

Read Record Event

Code

ON_GEOLOCATION_POSITION

BBjGeolocationEvent

Geolocation Event

G

ON_GEOLOCATION_WATCH

BBjGeolocationEvent

Geolocation Event

G

Geolocation watch events are automatically returned when the ON_GEOLOCATION_WATCH callback is registered. Geolocation position events are returned when the ON_GEOLOCATION_POSITION callback is registered, then getCurrentPosition() is invoked.

Remarks

Geolocation is currently BUI-specific and might not be available in all browsers. If geolocation is not available, BBjSysGui::getGeolocation() throws an error.

Example 1

rem ' Get the BBjGeolocation object

sysgui! = bbjapi().openSysGui("X0")
geolocation! = sysgui!.getGeolocation()

Example 2

See Also

BBjAPI

BBjSysGui

BBj Object Variables

BBj Object Assignment

BBj Object Error Handling

BBj Object Operators

Geolocation API Specification

BBj Object Diagram for an illustration of the relationship between BBjObjects.