javascript - Geocoding with Google Maps without OVER_QUERY_LIMIT errors - Trying with PHP-Solution -
I hope that you can actually help I try to stop Google Map-AP-error "OVER_QUERY_LIMIT" I want to solve it with PHP rather than using Javascript and playing with timeout etc. For this I have changed this line:
geocoder.geocode ({'address': address}, function (result, status) { this With the script:
var url_addr = encodeurIComponent (address); $ .getJSON ('geocode.php?) Also I have a PHP-script to get the Geocode-coordinates:
/ P> $ params = "address =". Urlencode ($ _GET {'addr'}); $ url = 'http: //maps.googleapis. Com / maps / api / geocode / json? Sensor = false & amp; '. $ Params; $ json = file_get_contents ($ url); $ status = json_decode ($ json) -> status; // more Over_query_limit status for $ ($ string (= '' / 'Jason' Json; echo;
After running it I can see the named PHP-script in the debugger console with an attachment like /geocode.php?addr=432345 ...
Next to my JS-scripts I want to check if google.maps.GeocoderStatus is OK. So I call:
if (status == google.maps.GeocoderStatus.OK) {if (result [1]) {console.log ("everything is fine"); } And {console.log ("GeoCode is not OK"); }
But nothing happens It seems that the situation does not reach the other.
Do you have any ideas?
Thank you and respect, Stephen
I recommend using.
https://maps.google.com/maps/api/geocode/json?address= ". $ Params." & Amp; Key = ". $." & Amp; Sensor = $ key = Your Google API Key <
Comments
Post a Comment