구글 지도 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,781
13년 전 조회 3,018
13년 전 조회 1,711
13년 전 조회 2,084
13년 전 조회 2,762
13년 전 조회 2,106
13년 전 조회 1,753
13년 전 조회 2,467
13년 전 조회 4,764
13년 전 조회 1,491
13년 전 조회 1,583
13년 전 조회 1,736
13년 전 조회 4,827
13년 전 조회 2,188
13년 전 조회 2,402
13년 전 조회 2,413
13년 전 조회 1,691
13년 전 조회 1,568
13년 전 조회 1,731
13년 전 조회 2,535
13년 전 조회 1,872
13년 전 조회 2,201
13년 전 조회 3,370
13년 전 조회 1,852
13년 전 조회 2,156
13년 전 조회 2,268
13년 전 조회 1,646
13년 전 조회 4,362
13년 전 조회 2,145
13년 전 조회 3,682
13년 전 조회 1,993
13년 전 조회 1,692
13년 전 조회 1,743
13년 전 조회 1,599
13년 전 조회 2,127
13년 전 조회 2,270
13년 전 조회 3,610
13년 전 조회 5,182
13년 전 조회 1,616
13년 전 조회 4,172
13년 전 조회 1,565
13년 전 조회 2,044
13년 전 조회 1,652
13년 전 조회 1,989
13년 전 조회 2,739
13년 전 조회 2,086
13년 전 조회 1,546
13년 전 조회 2,203
13년 전 조회 1,814
13년 전 조회 2,207
13년 전 조회 2,670
13년 전 조회 2,021
14년 전 조회 1,641
14년 전 조회 2,836
14년 전 조회 2,110
14년 전 조회 1,692
14년 전 조회 1,606
14년 전 조회 2,009
14년 전 조회 1,499
14년 전 조회 2,668
14년 전 조회 1,922
14년 전 조회 1,927
14년 전 조회 1,563
14년 전 조회 2,232
14년 전 조회 3,034
14년 전 조회 1,539
14년 전 조회 1,427
14년 전 조회 1,641
14년 전 조회 4,217
14년 전 조회 1,682
14년 전 조회 2,233
14년 전 조회 2,034
14년 전 조회 1,641
14년 전 조회 8,689
14년 전 조회 2,022
14년 전 조회 2,690
14년 전 조회 1,681
14년 전 조회 2,054
14년 전 조회 1,871
14년 전 조회 2,845
14년 전 조회 4,272
14년 전 조회 2,501
14년 전 조회 4,197
14년 전 조회 2,385
14년 전 조회 4,812
14년 전 조회 2,360
14년 전 조회 1,900
14년 전 조회 2,836
14년 전 조회 3,637
14년 전 조회 2,530
14년 전 조회 2,346
14년 전 조회 4,124
14년 전 조회 2,141
14년 전 조회 1,690
14년 전 조회 2,575
14년 전 조회 1,792
14년 전 조회 6,123
14년 전 조회 1,776
14년 전 조회 2,147
14년 전 조회 1,759