Note that there are some explanatory texts on larger screens.

plurals
  1. POPhoneGap 1.5.0 Cordova - Google geocoder not working after a few requests (Android)
    primarykey
    data
    text
    <p>I use PhoneGap 1.5.0 Cordova for Android, I modified PhoneGap Android official test/example project and tested it on two different phones. I send Google geocoding requests but after a few iterations it just stops working. the same code was ok with PhoneGap 1.4.1</p> <p>Can you please explain this? Did you already found a solution?</p> <p>Here is the code:</p> <pre><code>Geocoder: function() { var serviceurl = 'http://maps.googleapis.com/maps/api/geocode/json', geocode, geocodeCoords, geocodeAddress; geocode = function(req, cb) { $.extend(req, { sensor : true, region : 'it', language : 'it' }); var qs = $.param(req); $.ajax({ type: 'GET', url : serviceurl, data : qs, success : function(d) { cb(d.results, d.status); }, error : function(xhr, status, e) { alert('geocode error: ' + status); console.log(e); cb([], status || 'http error'); } }); }; geocodeCoords = function(coords, cb) { var req = { latlng : [coords.latitude, coords.longitude].join(',') }; geocode(req, function(arr, s) { cb(arr, s); }); }; geocodeAddress = function(addr, cb) { var req = { address : addr }; geocode(req, function(arr, s) { cb(arr, s); }); }; /* * 1: obj.coords =&gt; { latitude: 0, longitude: 0 } 2: obj.address =&gt; * string */ this.geocode = function(obj, cb) { if (obj &amp;&amp; obj.coords) { geocodeCoords(obj.coords, cb); } else if (obj &amp;&amp; obj.address) { geocodeAddress(obj.address, cb); } else { throw new Error('geocoder failure: nothing to geocode'); } }; return this; } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload