
BBjGeolocation
Description
In BBj 11.00 and higher, the BBjGeolocation object provides an interface to the browser's geolocation subsystem.
Creation
BBjAPI > BBjSysGui > BBjGeolocation
The BBjGeolocation object is accessed using the following BBjSysGui method:
|
Return Value |
Method |
|---|---|
|
BBjGeolocation |
Methods of BBjGeolocation
|
Return Value |
Method |
|---|---|
|
void |
clearCallback(int eventType) |
|
void |
|
|
double |
|
|
double |
|
|
boolean |
|
|
void |
setCallback(int eventType, String gosubLabel) |
| void |
setCallback(int eventType, CustomObject customObj, String methodName) |
| void |
setCallback(int eventType, Object object, String methodName) |
|
void |
setHighAccuracy(boolean highAccuracy) |
|
void |
setMaximumAge(double seconds) |
|
void |
setTimeout(double seconds) |
Events
|
Callback Code |
Object-oriented Event |
Read Record Event |
Code |
|---|---|---|---|
|
Geolocation Event |
G |
||
|
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 only available in the BUI and DWC browser clients. Because of the sensitivity of location information, browsers only make it available in secure connections (HTTPS or localhost). Browsers explicitly request permission from the user to make location information available in the context of a specific web page. In clients other than BUI and DWC, BBjSysGui::getGeolocation() throws an error.
Example 1
|
Example 2
See Also
BBj Object Creation and Assignment
See the BBj Object Diagram for an illustration of the relationship between BBj Objects.