Geolocation

Table of Contents

Overview

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. See https://sites.google.com/a/chromium.org/dev/Home/chromium-security/deprecating-powerful-features-on-insecure-origins for more information.

Due to this change, this component now requires that your ICEfaces application is accessed using HTTPS protocol from the browser.

Getting Started

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>

Attributes

TagLib Documentation
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).

Event Listeners

None.

Client Behavior Events

None.

JavaScript API

None.

Keyboard Support

None.

Known Issues

Additional Resources

Sample Applications

This component appears in the following ICEfaces sample applications:

Tutorials

This component appears in the following ICEfaces tutorials:

None

Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.

© Copyright 2018 ICEsoft Technologies Canada Corp.