OverviewSince 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.
Getting StartedTo 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
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 ListenersNone. Client Behavior EventsNone. JavaScript APINone. Keyboard SupportNone. Known Issues
Additional ResourcesSample ApplicationsThis component appears in the following ICEfaces sample applications: TutorialsThis component appears in the following ICEfaces tutorials: None |
Geolocation
© Copyright 2021 ICEsoft Technologies Canada Corp.