I see your link returns somewhat of a valid address.
Here is my javascript function that is hitting the geocode API.
function searchLocations() {
var address = document.getElementById("addressInput").value;
var geocoder = new google.maps.Geocoder();
geocoder.geocode({address: address}, function(results, status) {
if (status == google.maps.GeocoderStatus.OK) {
searchLocationsNear(results[0].geometry.location)
} else {
alert(address + ' was not found');
}
});
}
function searchLocationsNear(center) {
clearLocations();
circle.setMap(null);
var radius = document.getElementById('radiusSelect').value;
var searchUrl = 'genxml.php?lat=' + center.lat() + '&lng=' + center.lng() + '&radius=' + radius;
downloadUrl(searchUrl, function(data) {
var customIcons = {
ALL: {icon: 'images/goog/star.png'},
ADL: {icon: 'images/goog/yellow.png'},
ADP: {icon: 'images/goog/blue.png'},
SUN: {icon: 'images/goog/red.png'},
IDL: {icon: 'images/goog/black.png'}
};
var xml = parseXml(data);
var markerNodes = xml.documentElement.getElementsByTagName("marker");
var bounds = new google.maps.LatLngBounds();
for (var i = 0; i < markerNodes.length; i++) {
var name = markerNodes[i].getAttribute("name");
var address = markerNodes[i].getAttribute("address");
var distance = parseFloat(markerNodes[i].getAttribute("distance"));
var latlng = new google.maps.LatLng(
parseFloat(markerNodes[i].getAttribute("lat")),
parseFloat(markerNodes[i].getAttribute("lng")));
var icon = customIcons[markerNodes[i].getAttribute("type")] || {};
createOption(name, distance, i);
createMarker(latlng, name, address, icon);
bounds.extend(latlng);
}
map.fitBounds(bounds);
// alert (map.getCenter.toString());
locationSelect.style.visibility = "visible";
locationSelect.onchange = function() {
var markerNum = locationSelect.options[locationSelect.selectedIndex].value;
google.maps.event.trigger(markers[markerNum], 'click');
};
// Add a Circle overlay to the map.
var mapCenter = '(' + center.lat() + ',' + center.lng() + ')';
var circleOptions = {
center: center,
map: map,
clickable: false,
radius: (radius * 1609.344),
fillColor: "#FF0000",
fillOpacity: 0.1,
strokeColor: "#FF0000",
strokeOpacity: 1.0,
strokeWeight: 3,
zIndex: 300};
circle.setOptions(circleOptions);
});
}
I will see if I can get my page on an internet facing site and link it so you can see it in action. Im trying to play with it to see what the users will see if I don't find a dealer in their "radius". I have more work to do on this to make it more robust.
Thank you for the help!