구글 지도 API 에서요...

구글 지도 API 를 공부하고 있는 왕초보 입니다. ^^

구글에서는 튜토리얼 예제를 제공하고 있는데요.

아래는 지도 가운데 마커를 하고 설명으로..Hello World! 를 보여주는 예제 입니다.

그런데.. 다른 주변에 마커 하나를 더 찍으려면 어떻게 해야하는지요 ? ㅠㅠ

고수님들의 답변을 바랍니다. ㅠㅠ





<!DOCTYPE html>
<html DIR="LTR">
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no"  /> <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<title>Google Maps JavaScript API v3 예제: 간단한 이벤트</title>
<link href="/maps/documentation/javascript/examples/default.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="https://maps.google.com/maps/api/js?sensor=false"></script>
<script type="text/javascript">
 var map;
 function initialize() {
   var myLatlng = new google.maps.LatLng(-25.363882,131.044922);
   var myOptions = {
     zoom: 4,
     center: myLatlng,
     mapTypeId: google.maps.MapTypeId.ROADMAP
   }
   map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);

   google.maps.event.addListener(map, 'zoom_changed', function() {
     setTimeout(moveToDarwin, 1500);
   });

   var marker = new google.maps.Marker({
       position: myLatlng,
       map: map,
       title:"Hello World!"
   });
   google.maps.event.addListener(marker, 'click', function() {
     map.setZoom(8);
   });
 }

 function moveToDarwin() {
   var darwin = new google.maps.LatLng(-12.461334, 130.841904);
   map.setCenter(darwin);
 }

</script>
</head>
<body onload="initialize()">
 <div id="map_canvas"></div>
</body>
</html>
|

댓글 1개

var marker = new google.maps.Marker({
position: myLatlng,
map: map,
title:"Hello World!"
});
윗 부분을 한번더 써주시면 됩니다.
//표시할 위치
var myLatlng2 = new google.maps.LatLng(표시할 위치 좌표값,표시할 위치 좌표값);
//마커생성
var marker2 = new google.maps.Marker({
position: myLatlng2,
map: map,
title:"따이뜰!"
});
댓글을 작성하시려면 로그인이 필요합니다.

프로그램

+
제목 글쓴이 날짜 조회
13년 전 조회 1,776
13년 전 조회 3,015
13년 전 조회 1,704
13년 전 조회 2,078
13년 전 조회 2,753
13년 전 조회 2,100
13년 전 조회 1,746
13년 전 조회 2,461
13년 전 조회 4,756
13년 전 조회 1,485
13년 전 조회 1,575
13년 전 조회 1,725
13년 전 조회 4,819
13년 전 조회 2,179
13년 전 조회 2,393
13년 전 조회 2,400
13년 전 조회 1,682
13년 전 조회 1,562
13년 전 조회 1,723
13년 전 조회 2,529
13년 전 조회 1,865
13년 전 조회 2,192
13년 전 조회 3,362
13년 전 조회 1,847
13년 전 조회 2,150
13년 전 조회 2,262
13년 전 조회 1,638
13년 전 조회 4,359
13년 전 조회 2,137
13년 전 조회 3,675
13년 전 조회 1,987
13년 전 조회 1,689
13년 전 조회 1,737
13년 전 조회 1,593
13년 전 조회 2,121
13년 전 조회 2,265
13년 전 조회 3,603
13년 전 조회 5,176
13년 전 조회 1,611
13년 전 조회 4,164
13년 전 조회 1,560
13년 전 조회 2,038
13년 전 조회 1,645
13년 전 조회 1,982
13년 전 조회 2,735
13년 전 조회 2,080
13년 전 조회 1,540
13년 전 조회 2,199
13년 전 조회 1,808
13년 전 조회 2,203
13년 전 조회 2,660
13년 전 조회 2,015
13년 전 조회 1,629
13년 전 조회 2,830
14년 전 조회 2,104
14년 전 조회 1,682
14년 전 조회 1,598
14년 전 조회 2,006
14년 전 조회 1,496
14년 전 조회 2,663
14년 전 조회 1,914
14년 전 조회 1,922
14년 전 조회 1,557
14년 전 조회 2,226
14년 전 조회 3,028
14년 전 조회 1,532
14년 전 조회 1,419
14년 전 조회 1,634
14년 전 조회 4,207
14년 전 조회 1,675
14년 전 조회 2,225
14년 전 조회 2,023
14년 전 조회 1,637
14년 전 조회 8,678
14년 전 조회 2,016
14년 전 조회 2,682
14년 전 조회 1,679
14년 전 조회 2,045
14년 전 조회 1,861
14년 전 조회 2,838
14년 전 조회 4,265
14년 전 조회 2,497
14년 전 조회 4,193
14년 전 조회 2,377
14년 전 조회 4,806
14년 전 조회 2,351
14년 전 조회 1,894
14년 전 조회 2,831
14년 전 조회 3,633
14년 전 조회 2,520
14년 전 조회 2,341
14년 전 조회 4,120
14년 전 조회 2,132
14년 전 조회 1,682
14년 전 조회 2,571
14년 전 조회 1,787
14년 전 조회 6,119
14년 전 조회 1,766
14년 전 조회 2,140
14년 전 조회 1,750