Geolocation doesn't work with cordova <p>I'm currently working on a mobile application with Intel XDK (In background it's Cordova finally, that's why I put Cordova in title.)</p> <p>With an Ajax request, I get some adresses and with these adresses I want to calculate the distance between them and the current position of user.</p> <p>So, I get adresses, I convert them and I make the difference.</p> <p>But actually, nothing is working !</p> <pre><code>function codeAddress(id, addresse) { geocoder.geocode( { 'address': addresse}, function(results, status) { if (status == google.maps.GeocoderStatus.OVER_QUERY_LIMIT) { setTimeout(function(){}, 100); } console.log(id); console.log(addresse); //document.addEventListener("intel.xdk.device.ready",function(){ if (navigator.geolocation) { if (status == google.maps.GeocoderStatus.OK) { navigator.geolocation.getCurrentPosition(function(position) { addressEvent = results[0].geometry.location; var pos = { lat: position.coords.latitude, lng: position.coords.longitude }; var position = new google.maps.LatLng(pos.lat, pos.lng) var resultat = google.maps.geometry.spherical.computeDistanceBetween(addressEvent, position); console.log(resultat); console.log(addressEvent); console.log(pos); console.log(position); var convert = Math.floor(resultat); var finalConvert = convert + " m"; var distance = document.createElement('span'); distance.innerHTML = finalConvert; distance.className = "geo"; document.getElementsByClassName('meta-info-geo')[id].appendChild(distance); }, function() { handleLocationError(true, infoWindow); }); } } //},false); }); } </code></pre> <p>In the console.log(id), console.log(addresse), I HAVE results ! </p> <p>Actually i'm getting 4 IDs and 4 adresses. </p> <p>I checked on all the topics I could find on StackOverFlow, and I had normally to add the line in // with the addEventListener but it changes nothing.</p> <p>Is there someone who knows how to change that ? </p> <p>ps : Of course, cordova geoloc is in the build and permissions are granted !</p> <p>EDIT : I'm targeting Android 4.0 min and iOS 5.1.1. I'm using SDK.</p> <p>EDIT 2 : <a href="https://i.stack.imgur.com/gk3X7.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/gk3X7.png" alt="enter image description here"></a></p>