Since 4.0
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.
HTTPS Required
Recent browser releases have begun restricting access to certain powerful features, including geolocation tracking, to make them only accessible when the page content accessed via "secure origins" (such as HTTPS), where the full ancestor chain is also secure.
Due to this change, this component now requires that your ICEfaces application is accessed using HTTPS protocol from the browser.
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:form>
<mobi:geolocation id="geolocation"
latitude="#{bean.latitude}"
longitude="#{bean.longitude}"
altitude="#{bean.altitude}"
direction="#{bean.direction}" />
<h:commandButton value="Submit" />
</h:form>
TagLib Documentation
This section covers attributes involved in the typical use-cases for this component.
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).
None.
None.
None.
None.
This component appears in the following ICEfaces sample applications: