Google マップ上に銀行支店の複数の場所をマーカーの形で表示する Google マップ aspx ページを設計しました。別の aspx ページからポップアップ ウィンドウとして Google マップ ページが表示され、これらの銀行支店がデータベースから取得されます。今私の要件は、ユーザーが別のaspxページのドロップダウンリストから選択した場所を示すGoogleマップページ(ページロード自体)で1つのマーカーのみをアニメーション化することです。すべてのマーカーをアニメーション化したくありません。
次のように toggleBounce() 関数を適用しましたが、すべてのマーカーをアニメーション化します
(function (Mycontent) { geocoder.geocode({ 'address': locarr[i] }, function (results, status) { if (status == google.maps.GeocoderStatus.OK) { map.setCenter(results[0].geometry.location); var marker = new google.maps.Marker({ map: map, position: results[0].geometry.location, icon: icon1, info: InfoPopUp, animation: google.maps.Animation.DROP }); function toggleBounce() { if (marker.getAnimation() != null) { marker.setAnimation(null); } else { marker.setAnimation(google.maps.Animation.BOUNCE); window.setTimeout( function () { marker.setAnimation(null); }, 5000); } } google.maps.event.addListener(marker, 'mouseover', function () { InfoPopUp.open(map, marker); InfoPopUp.setContent(Mycontent); marker.setIcon(icon1); }); google.maps.event.addListener(marker, 'mouseout', function () { InfoPopUp.close(map, marker); marker.setIcon(icon1); }); bounds.extend(marker.getPosition()); google.maps.event.addListener(marker, 'click', toggleBounce); } // end if else { alert('Geocode was not successful for the following reason: ' + '\n' + status); } }); // geocoder ends })(Mycontent);
私は Google マップの設計に慣れていないので、その解決策が見つかりませんでした。誰でも私を助けてください。どんな助けもかなりのものです。
前もって感謝します...