구글 지도 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,429
13년 전 조회 2,646
13년 전 조회 1,376
13년 전 조회 1,724
13년 전 조회 2,403
13년 전 조회 1,741
13년 전 조회 1,393
13년 전 조회 2,120
13년 전 조회 4,392
13년 전 조회 1,120
13년 전 조회 1,190
13년 전 조회 1,362
13년 전 조회 4,464
13년 전 조회 1,814
13년 전 조회 2,025
13년 전 조회 2,031
13년 전 조회 1,321
13년 전 조회 1,185
13년 전 조회 1,348
13년 전 조회 2,159
13년 전 조회 1,518
13년 전 조회 1,828
13년 전 조회 3,025
13년 전 조회 1,504
13년 전 조회 1,831
13년 전 조회 1,908
13년 전 조회 1,272
13년 전 조회 4,019
13년 전 조회 1,791
13년 전 조회 3,334
13년 전 조회 1,644
13년 전 조회 1,358
13년 전 조회 1,373
13년 전 조회 1,257
13년 전 조회 1,795
13년 전 조회 1,939
13년 전 조회 3,254
13년 전 조회 4,889
13년 전 조회 1,274
13년 전 조회 3,841
13년 전 조회 1,207
13년 전 조회 1,691
13년 전 조회 1,302
13년 전 조회 1,643
13년 전 조회 2,415
13년 전 조회 1,807
13년 전 조회 1,202
13년 전 조회 1,866
13년 전 조회 1,485
13년 전 조회 1,887
13년 전 조회 2,328
13년 전 조회 1,707
13년 전 조회 1,292
13년 전 조회 2,551
13년 전 조회 1,797
13년 전 조회 1,334
13년 전 조회 1,266
13년 전 조회 1,663
13년 전 조회 1,195
13년 전 조회 2,376
13년 전 조회 1,596
13년 전 조회 1,574
13년 전 조회 1,237
13년 전 조회 1,947
13년 전 조회 2,758
13년 전 조회 1,177
13년 전 조회 1,067
13년 전 조회 1,314
13년 전 조회 3,937
13년 전 조회 1,343
13년 전 조회 1,907
13년 전 조회 1,690
13년 전 조회 1,294
13년 전 조회 8,387
13년 전 조회 1,682
13년 전 조회 2,352
13년 전 조회 1,327
13년 전 조회 1,682
13년 전 조회 1,528
13년 전 조회 2,506
13년 전 조회 3,935
13년 전 조회 2,165
13년 전 조회 3,862
13년 전 조회 2,038
13년 전 조회 4,475
13년 전 조회 1,989
13년 전 조회 1,522
13년 전 조회 2,479
13년 전 조회 3,242
13년 전 조회 2,168
13년 전 조회 1,982
13년 전 조회 3,756
13년 전 조회 1,766
13년 전 조회 1,312
13년 전 조회 2,230
13년 전 조회 1,431
13년 전 조회 5,783
13년 전 조회 1,411
13년 전 조회 1,819
13년 전 조회 1,387