eon_cordova_gps object

This object provides information about the device's location, such as latitude and longitude.

Functions

of_configure

Description

Configures the parameters for the GPS search. When successful, the oe_success event will be triggered; when failed, the oe_error event will be triggered.

Syntax

of_configure ( eon_str_cordova_gps astr_gps )

Parameter

astr_gps - This structure carries the following values:

  • desiredaccuracy - The desired accuracy of the geolocation system. Values: 0 (highest power, highest accuracy), 10, 100, 1000 (lowest power, lowest accuracy).

  • stationaryRadius - When stopped, the minimum distance the device must move beyond the stationary location for aggressive background-tracking to engage.

  • distanceFilter - The minimum distance (measured in meters) a device must move horizontally before an update event is generated.

Return value

None.

of_init

Description

Connects with the Cordova geolocation plugin, detects if the plugin is available to call, and binds the current PowerBuilder object with the JavaScript object defined by the plugin. After that, the PowerBuilder object has all of the methods and properties that the JavaScript object has.

Syntax

of_init ( )

Return value

Integer.

1 - Success.

-1 - It is called in PowerBuilder or PowerServer Web, or there is an error.

of_start

Description

Enables location tracking.

Syntax

of_start ( )

Return value

None.

of_stop

Description

Disables location tracking.

Syntax

of_stop ( )

Return value

None.

Events

oe_success

Description

Occurs when the function is successfully executed. If the JavaScript function in the Cordova plugin returns any value, that value will be passed to the as_message parameter.

Syntax

oe_success ( string as_message )

Parameter

as_message - A JSON-format string which contains the location data.

Return value

None

Properties

eon_str_cordova_gps_info ieon_gps_info

The structure for storing the detailed location data.

oleobject ieon_ole

PowerBuilder OLEObject object to be connected with the Cordova plugin.

powerobject ipo_bindevent

PowerBuilder object to be bound with the JavaScript object.

string is_errorevent

Stores the error event name of the PowerBuilder object.

string is_errorText

Stores the error information returned by the JavaScript function when execution failed.

string is_jserrorText

Stores the JavaScript error information when JavaScript call fails.

string is_successevent

Stores the success event name of the PowerBuilder object.

string is_successText

Stores the value returned by the JavaScript function when execution is successful.

Structures

eon_str_cordova_gps

Description

Struct.

Stores the information of the device GPS.

Property

Type

Variable Name

Description

long

desiredaccuracy

The desired accuracy of the geolocation system.

long

stationaryradius

When stopped, the minimum distance the device must move beyond the stationary location for aggressive background-tracking to engage.

long

distancefilter

The minimum distance (measured in meters) a device must move horizontally before an update event is generated.

eon_str_cordova_gps_info

Description

Struct.

Stores the information of the device's location.

Property

Type

Variable Name

Description

long

time

The timestamp of the location.

decimal { 2 }

speed

The speed.

decimal { 2 }

altitude

The altitude of the location.

decimal { 2 }

bearing

The bearing of the location

decimal { 2 }

longitude

The longitude of the location.

decimal { 2 }

latitude

The latitude of the location.

decimal { 2 }

accuracy

The accuracy of the location.

string

serviceprovider

The GPS service provider.

boolean

debug