The mobi:geolocation component uses the HTML5 geolocation API to capture the user's geolocation data, including latitude, longitude, direction, and altitude. The user is asked for permission to provide this information, as soon as the page is loaded. Once this information is captured it can be sent to the server by simply submitting the form.
To use the Geolocation component, put the mobi:geolocation tag inside a form and bind its attributes to backing bean properties where the captured information is to be stored. Also add a means of submitting the form, so that the captured information can be uploaded to the server.
<h:commandButton value="Submit" />
This section covers attributes involved in the typical use-cases for this component. For reference, the complete taglib documentation for this component is available here.
The latitude attribute is where the user's latitude is going to be saved (in decimal degrees).
The longitude attribute is where the user's longitude is going to be saved (in decimal degrees).
The altitude attribute is where the user's altitude is going to be saved (in meters).
The direction attribute is where the user's direction is going to be saved (in degrees from the North).
Client Behavior Events
This component appears in the following ICEfaces sample applications:
This component appears in the following ICEfaces tutorials: