इस तरह मैंने पहले भी इस मुद्दे को संभाला है। मैं परिणाम की स्थिति की जांच करता हूं और यदि मुझे सीमा त्रुटि मिलती है और मैं थोड़ी देर के बाद इसे फिर से कोशिश करता हूं।
function Geocode(address) {
geocoder.geocode({
'address': address
}, function(results, status) {
if (status === google.maps.GeocoderStatus.OK) {
var result = results[0].geometry.location;
var marker = new google.maps.Marker({
position: result,
map: map
});
} else if (status === google.maps.GeocoderStatus.OVER_QUERY_LIMIT) {
setTimeout(function() {
Geocode(address);
}, 200);
} else {
alert("Geocode was not successful for the following reason:"
+ status);
}
});
}
अद्यतन: व्हाउप्स, गलती से सर्वर पक्ष भाग पर चमक गया। यहां एक सी # संस्करण है:
public XElement GetGeocodingSearchResults(string address)
{
var url = String.Format(
"https://maps.google.com/maps/api/geocode/xml?address={0}&sensor=false",
Uri.EscapeDataString(address));
var results = XElement.Load(url);
// Check the status
var status = results.Element("status").Value;
if(status == "OVER_QUERY_LIMIT")
{
Thread.Sleep(200);
GetGeocodingSearchResults(address);
}else if(status != "OK" && status != "ZERO_RESULTS")
{
// Whoops, something else was wrong with the request...
}
return results;
}
स्रोत
2012-03-21 14:22:29
हमें 3 जी पर लोगों के लिए एक ही OVER_QUERY_LIMIT त्रुटि मिली, जबकि जब वे वाईफाई का उपयोग कर रहे थे तो यह सही तरीके से काम कर रहा था। 3 जी के साथ समस्या यह है कि मैंने जो पढ़ा है, अधिकांश समय एनएटी का उपयोग किया जाता है, इसलिए एक ही प्रदाता के सभी उपयोगकर्ता एक ही सार्वजनिक पते को समाप्त कर सकते हैं और इस प्रकार यह आईपी पता आसानी से सीमा से अधिक हो जाएगा। – user276648