Hello! I need to make a geocoding by many radio buttons.
For example i have this:
<input type="radio" id="radio1" name="radio" value="Moscow"
onclick="codeAddress(this.value);" />
<input type="radio" id="radio2" name="radio" value="Helsinki"
onclick="codeAddress(this.value);" />
<input type="radio" id="radio3" name="radio" value="New York"
onclick="codeAddress(this.value);" />
and use this JS script:
function codeAddress(address) {
geocoder.geocode( { 'address': address}, function(results, status) {
if (status == google.maps.GeocoderStatus.OK) {
map.setCenter(results[0].geometry.location);
map.setZoom(13);
} else {
alert("Geocode was not successful for the following reason: " +
status);
}
});
}
but nothing work!
At the same time if you withdraw after this alert(address);
before geocoder.geocode.... it's work and intercept value.
Please, help me!
--
You received this message because you are subscribed to the Google Groups
"Google Maps JavaScript API v3" 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-maps-js-api-v3?hl=en.