create your custom JS file (if you don;t already have one) and put it in Custom/JS
The file should have this code:
AwareApp.getLocation = function (objName, objId, enableHighAccuracy, successCallback, errorCallback)
{
var me = this;
navigator.geolocation.getCurrentPosition (
function (position) {
me.writeLocation (position, objName, objId, successCallback);
},
function (error) {
alert("Please turn on Location Services");
errorCallback();
},
{
enableHighAccuracy: enableHighAccuracy
}
);
};