cancel
Showing results for 
Search instead for 
Did you mean: 

GPS Tracking through SUP Mobile workflows

Former Member
0 Kudos

Hi Friends

How to Track GPS location in Workflows(HWC)? Is it possiable in SUP? If possible plz send how to solve?

Thanx in Advance.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hello,

Currently SUP hybrid web container does not allow you to access device function with SUP 2.1,you can access camera but not GPS,however you can try out HTML5 code in cutom.js to get GPS location,the sample code is given below.

navigator.geolocation.getCurrentPosition(foundLocation, noLocation);

function foundLocation(position) {

var lat = position.coords.latitude;

var lon = position.coords.longitude;

var userLocation = lat + ', ' + lon;

$("#business-current-location, #people-current-location").remove();

$("#Near-Me")

.watermark("Current Location")

.after("<input type='hidden' name='business-current-location' id='business-current-location' value='"userLocation"' />");

$("#people-Near-Me")

.watermark("Current Location")

.after("<input type='hidden' name='people-current-location' id='people-current-location' value='"userLocation"' />");

}

regards

kaushik