I am using the code below to loop thorugh a series of postcodes to map
points on a map of a predefined list of bubsinesses.
With UK postcodes it works fine, however when feeding it German or US
postcodes it doesn't seem to work, Is there not some kind of
documentation anywhere that informs you on the correct postcode
structure for different countries, when performing a localSearch? That
way I could make sure they are well formed at server side.
Please view my bottom two lines of my function to see where I am
making the call.
function usePointFromPostcode(postcode, callbackFunction) {
localSearch.setSearchCompleteCallback(null,
function() {
if (localSearch.results[0])
{ var resultLat = localSearch.results[0].lat;
var resultLng = localSearch.results[0].lng;
var point = new GLatLng(resultLat,resultLng);
bounds.extend(point);
var marker = createMarker(point,"<div
style='width:
240px'>"+addArray[i] +"<\/div>", addArray[i])
map.addOverlay(marker);
map.setZoom(map.getBoundsZoomLevel(bounds));
map.setCenter(bounds.getCenter());
// This sets a flag so we know which address to
use.
if(i < postcodeArray.length - 1){
usePointFromPostcode(postcodeArray [i+1])
i = i+1
}
}else{
if(i < postcodeArray.length - 1){
usePointFromPostcode(postcodeArray [i+1])
i = i+1
}
}
});
//localSearch.execute(postcode + ", UK");
localSearch.execute(postcode );
}
If anyone has any ideas that would be much appreciated.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google AJAX APIs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/google-ajax-search-api?hl=en
-~----------~----~----~----~------~----~------~--~---