In the code below table locs includes some names from different regions in Greece. For each region I call graphicMap function to find latitude and longitude through Geocoding Service and create a marker on map.
But from index 12 and after it show error.
See the results below:
Error : ΧΑΝΙΩΝ
OK : ΑΝΔΡΑΒΙΔΑΣ - ΚΥΛΛΗΝΗΣ
OK : ΒΕΡΟΙΑΣ
OK : ΑΒΔΗΡΩΝ
OK : ΑΧΑΡΝΩΝ
OK : ΑΣΤΥΠΑΛΑΙΑΣ
OK : ΡΕΘΥΜΝΗΣ
OK : ΓΑΛΑΤΣΙΟΥ
OK : ΔΕΛΦΩΝ
OK : ΒΕΛΒΕΝΤΟΥ
OK : ΖΑΓΟΡΑΣ - ΜΟΥΡΕΣΙΟΥ
OK : ΒΕΛΟΥ ΒΟΧΑΣ
If I remove for example the record ΑΧΑΡΝΩΝ, the value of ΧΑΝΙΩΝ works properly.
Has google set limits on search through Geocoding Service?
Is this because I haven't bought an API KEY?
Thanks in advance!
geocodeLatLong( JXMapContent , map , mapSet , graphic , graph , pins ){
/**
**** @procedure
**** Split and create table with the regions
**** Iterate table and find coordinates for each region
**/
var locs = JXMapContent.split( "," ) , u , length_table = locs.length;
for( u = 0; u < length_table; u++ )
{
graph( locs[ u ] , map , graphic , pins );
}
}
graphicMap( _location , map , graphic , pins ){
var geocoderRequest = {
address: _location
};
graphic.geocode( geocoderRequest, function(results, status) {
if (status === google.maps.GeocoderStatus.OK){
var marker = new google.maps.Marker({
map:map,
position : results[0].geometry.location,
icon:"images/marker.png",
animation:google.maps.Animation.DROP
});
pins.push( marker );
marker.addListener('click', function() {
for (var i = 0; i < pins.length; i++) {
pins[i].setAnimation(null);
}
if( this.getAnimation() !== null) {
this.setAnimation(null);
} else {
this.setAnimation(google.maps.Animation.BOUNCE);
}
});
console.log( "OK : " + _location );
}else{
console.log( "Error : " + _location );
}
});
}