シングルクリックでこの機能を呼び出すが、シングルクリックでは機能しない。シングルクリックが機能しない
<input id="search" type="button" onClick="codeAddress();" value="Search Location" />
function codeAddress() {
geocoder = new google.maps.Geocoder();
var address = document.getElementById("box").value;
geocoder.geocode({ 'address': address}, function(results, status) {
if (status == google.maps.GeocoderStatus.OK) {
a = results[0].geometry.location.lat();
b = results[0].geometry.location.lng();
myLatlng = new google.maps.LatLng(a, b);
}
else {
alert("Geocode was not successful for the following reason: " + status);
}
});
initialize();
}
これはエラーの最も詳細な説明である「それが動作していない」私はいつもこのサイト – madalinivascu
に乗るは、Google Maps JavaScript API V3を含めていますか?問題を示す[mcve]を入力してください。 – geocodezip