マップマーカーの位置をドロップダウンの変化に基づいて変更したい場合は、私が行っていることは、ドロップダウンイベントで緯度や経度を取得して、これらの座標を現在のマーカー、これは私のコードGoogleマップ:ドロップダウンでマップマーカーの位置を変更する
$("#location").change(function() {
var addr = ($('#location').val());
var geocoder = new google.maps.Geocoder();
geocoder.geocode({ 'address': addr }, function (results, status) {
if (status == google.maps.GeocoderStatus.OK) {
alert("location : " + results[0].geometry.location.lat() + " " + results[0].geometry.location.lng());
geoMarker.setMarkerOptions({
duration: duration,
easing: $('#easingOption').val()
});
} else {
alert("Something got wrong " + status);
}
});
});
HTMLです:
<select id="location">
<option>Dubai</option>
<option>Sharjah</option>
</select>
それは現在の座標を警告するが、私は私のマーカーの位置にこれらの座標を渡すん方法を知っておく必要があり
'geoMarker'は何ですか? –
あなたの問題を示す[最小、完全、テスト済みおよび読みやすい例](http://stackoverflow.com/help/mcve)を提供してください。 – geocodezip
関連する質問:[マップとマーカーが読み込まれた後に、選択ボックスのGoogleマップの場所を変更する](http://stackoverflow.com/questions/34466165/change-google-map-location-on-selectbox-change-after-the-マップとマーカーがロードされた) – geocodezip