I am using Google Map API v3. I got error "Geocode was not successful for the following reason: OVER_QUERY_LIMIT" when I try to display markers on map. 11 markers are shown properly on Map but not more that that. Please help me to solve this error. My Code is
function initialize() {
//alert("hi");
geocoder = new google.maps.Geocoder();
<?php
$sql="select meta_value from wp_postmeta where meta_key='_alkurn_distributor_address'";
$res=mysql_query($sql);
while($row=mysql_fetch_array($res))
{
?>
var address="<?php echo $row['meta_value'];?>";
geocoder = new google.maps.Geocoder();
var lat='';
var lng=''
geocoder.geocode( { 'address': address}, function(results, status) {
if (status == google.maps.GeocoderStatus.OK) {
lat = results[0].geometry.location.lat(); //getting the lat
lng = results[0].geometry.location.lng(); //getting the lng
map.setCenter(results[0].geometry.location);
var marker = new google.maps.Marker({
map: map,
position: results[0].geometry.location
});
} else {
console.log("Geocode was not successful for the following reason: " + status);
}
});
<?php } ?>
var chicago = new google.maps.LatLng(36.4278,-15.9);
var myOptions = {
zoom: 2,
center: chicago,
mapTypeId: google.maps.MapTypeId.ROADMAP
}
map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
google.maps.event.addListener(map, "click", function() {
document.getElementById('info').innerHTML = "";
});
kmlLayer.setMap(map);
google.maps.event.addListener(kmlLayer, 'click', openIW);
}
Please help me to solve my error.