From HTML5 Builder
Jump to: navigation, search
GeolocationHideAndSeek.php (sample application).

The Geolocation component gives you awareness of user’s geolocation.

You can use it to request the location of the device, and if the user allows it, you will be able to get the data and keep track of any change on the location, speed, heading, and more.

For example, you can build applications that display different content depending on the country where the user currently is, display their location on a map, or even implement a web-based navigation system.


The Geolocation component requests the client’s geolocation data to the web browser. This call produces one of two results:

  • If the data is retrieved successfully, the OnChange event is triggered.
  • If an error occurs, the OnError event is triggered instead.

If the component’s Enabled property is set to true, the component will request the current location right after the page is loaded. If you set Repeat to true, the component will also retireve location updates whenever the position of the user agent’s device changes. Once the page is loaded, you can also control the component manually with the client-side functions it provides.

Client-side Features

Client-side Events

Documented in the RPCL Reference.

Client-side Functions

Note: In order to call these functions, prefix them with ComponentName. For example: Geolocation1FunctionName();.


Requests the current geolocation data and watches for position changes.


Disables the watching of the position changes.


Performs a single request for the current position.

Server-side Features

Properties, Methods and Events

Documented in the RPCL Reference.

Help Resources

Video Tutorials

Sample Applications

On the HTML5 folder inside the sample applications directory you will find a form showcasing the Geolocation component:

  • GeolocationHideAndSeek.php. Displays your location on a map, as long as you let the application know it. You can play around, “hide”, “show up” and move around, and the application will be able to react to these actions.


See Also