두 개의 마커가있는지도가 있습니다.Google Maps API V3 :지도 외부에서 특정 마커로 이동하는 방법?
지도의 초기보기에는 하나의 마커 만 표시되며 클릭하면지도를 두 번째 마커로 이동하는지도 옆에 링크를 제공하고 싶습니다.
<script type="text/javascript">
function initialize() {
var latlng = new google.maps.LatLng(50.823817, -0.135634);
var myOptions = {
zoom: 13,
center: latlng,
mapTypeId: google.maps.MapTypeId.ROADMAP,
mapTypeControlOptions: {
style: google.maps.MapTypeControlStyle.DROPDOWN_MENU
} ,
scaleControl: false
};
var map = new google.maps.Map(document.getElementById("map"), myOptions);
// 1st marker
var marker1 = new google.maps.Marker({ position: new google.maps.LatLng(50.823817, -0.135634), map: map, title: 'my title' });
var infowindow = new google.maps.InfoWindow({ content: 'my window content' });
google.maps.event.addListener(marker1, 'click', function() { infowindow.open(map, marker1); });
// 2nd marker
var marker2 = new google.maps.Marker({ position: new google.maps.LatLng(51.5262405, -0.074549), map: map, title: 'my 2nd title'});
var infowindow2 = new google.maps.InfoWindow({ content: 'content for my 2nd window' });
google.maps.event.addListener(marker2, 'click', function() { infowindow2.open(map, marker2); });
}
</script>
을 그래서 내가 좋겠 :
여기내가 지금까지 가지고 무엇 http://arts.brighton.ac.uk/contact-university-of-brighton-faculty-of-arts (지도 아래의 링크를 참고) : 여기
는 API의 V2를 사용하여, 내가 원하는 걸의 데모입니다 추가하려는 곳은marker2
에 대한 링크이며, 일부 이동 거리는 50-odd miles, 예
<a href="#marker2">Second location</a>
.
어떻게하면됩니까?
편집 :