Convert Javascript GeoLocation to PhoneGap Build API GeoLocation

Closed Posted 6 years ago Paid on delivery
Closed Paid on delivery

I am using the following code: to grab my mobile webapp visitors location and post it to my server. I need to convert the code to use the PhoneGap background geoLocation API (found here: [login to view URL] ).

$(document).ready(function(){

onPageLoad();

});

function onPageLoad(){

var data;

if ([login to view URL]) {

var timeoutVal = 10 * 1000 * 1000;

[login to view URL](displayPosition, displayError,{

enableHighAccuracy: true,

timeout: timeoutVal,

maximumAge: 0

});

}

else {

alert("Geolocation is not supported by this browser");

}

function displayPosition(position) {

data="Latitude=" + [login to view URL] + "&Longitude=" + [login to view URL];

$.ajax({

type:"post",

url:"[login to view URL]",

data: data,

dataType: "text",

success: function () {

}

});

}

function displayError(error) {

var errors = {

1: 'Permission denied',

2: 'Position unavailable',

3: 'Request timeout'

};

if(errors[[login to view URL]]=='Permission denied'){

var timeoutVal = 10 * 1000 * 1000;

[login to view URL](

displayPosition,

displayError,

{ enableHighAccuracy: true, timeout: timeoutVal, maximumAge: 0 }

);

function displayPosition(position) {

data="Latitude=" + [login to view URL] + "&Longitude=" + [login to view URL];

}

displayPosition();

}else{

alert("Error: " + errors[[login to view URL]]);

}

}

displayPosition();

displayError();

}

Android JavaScript Mobile App Development PhoneGap PHP

Project ID: #16717170

About the project

8 proposals Remote project Active 5 years ago

8 freelancers are bidding on average $55 for this job

sureshdevi

I will convert javascript geolocation to phonegap build api geolocation on your mobile webapp. I will complete this work in a day. Looking for your reply to start this work immediately. I will be available online fr More

$25 USD in 1 day
(1102 Reviews)
7.9
saad2038

Hi, I can help you to convert JavaScript GeoLocation to cordova phonegap based GeoLocation. I've good expertise in phonegap and done loss of projects in phonegap. I can easily do the GeoLocation change for you. Please More

$55 USD in 2 days
(53 Reviews)
5.8
sudenis

Hi, It is more than you willing to pay but take a look: 1. ...to grab my mobile webapp visitors location You have webapp - that means you can not use PhoneGap API as is.... You need to convert your webapp to Cordov More

$140 USD in 5 days
(8 Reviews)
4.1
rahulsahu013

Hello Sir, I am an experienced Ionic developer who has 5 years of industry experience. I provide quality result in less time and low budget with full satisfaction. I build many projects from scratch and I have great More

$40 USD in 5 days
(12 Reviews)
3.8