구글 지도 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년 전 조회 802
13년 전 조회 2,039
13년 전 조회 741
13년 전 조회 1,091
13년 전 조회 1,795
13년 전 조회 1,118
13년 전 조회 777
13년 전 조회 1,478
13년 전 조회 3,787
13년 전 조회 507
13년 전 조회 578
13년 전 조회 764
13년 전 조회 3,904
13년 전 조회 1,251
13년 전 조회 1,422
13년 전 조회 1,439
13년 전 조회 736
13년 전 조회 613
13년 전 조회 757
13년 전 조회 1,572
13년 전 조회 935
13년 전 조회 1,269
13년 전 조회 2,467
13년 전 조회 928
13년 전 조회 1,252
13년 전 조회 1,364
13년 전 조회 711
13년 전 조회 3,464
13년 전 조회 1,222
13년 전 조회 2,736
13년 전 조회 1,077
13년 전 조회 763
13년 전 조회 808
13년 전 조회 685
13년 전 조회 1,258
13년 전 조회 1,345
13년 전 조회 2,661
13년 전 조회 4,242
13년 전 조회 702
13년 전 조회 3,266
13년 전 조회 642
13년 전 조회 1,102
13년 전 조회 699
13년 전 조회 1,077
13년 전 조회 1,826
13년 전 조회 1,139
13년 전 조회 620
13년 전 조회 1,283
13년 전 조회 890
13년 전 조회 1,292
13년 전 조회 1,765
13년 전 조회 1,065
13년 전 조회 718
13년 전 조회 1,905
13년 전 조회 1,184
13년 전 조회 770
13년 전 조회 712
13년 전 조회 1,072
13년 전 조회 608
13년 전 조회 1,719
13년 전 조회 1,003
13년 전 조회 1,020
13년 전 조회 654
13년 전 조회 1,291
13년 전 조회 2,099
13년 전 조회 616
13년 전 조회 516
13년 전 조회 690
13년 전 조회 3,281
13년 전 조회 747
13년 전 조회 1,304
13년 전 조회 1,080
13년 전 조회 728
13년 전 조회 7,728
13년 전 조회 1,102
13년 전 조회 1,750
13년 전 조회 752
13년 전 조회 1,088
13년 전 조회 918
13년 전 조회 1,890
13년 전 조회 3,316
13년 전 조회 1,534
13년 전 조회 3,237
13년 전 조회 1,411
13년 전 조회 3,852
13년 전 조회 1,401
13년 전 조회 899
13년 전 조회 1,867
13년 전 조회 2,652
13년 전 조회 1,569
13년 전 조회 1,379
13년 전 조회 3,133
13년 전 조회 1,160
13년 전 조회 719
13년 전 조회 1,617
13년 전 조회 852
13년 전 조회 5,171
13년 전 조회 829
13년 전 조회 1,216
13년 전 조회 813
🐛 버그신고