구글 지도 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,807
13년 전 조회 3,030
13년 전 조회 1,735
13년 전 조회 2,106
13년 전 조회 2,791
13년 전 조회 2,126
13년 전 조회 1,779
13년 전 조회 2,492
13년 전 조회 4,784
13년 전 조회 1,505
13년 전 조회 1,601
13년 전 조회 1,759
13년 전 조회 4,842
13년 전 조회 2,208
13년 전 조회 2,421
13년 전 조회 2,432
13년 전 조회 1,715
13년 전 조회 1,584
13년 전 조회 1,752
13년 전 조회 2,560
13년 전 조회 1,898
13년 전 조회 2,224
13년 전 조회 3,391
13년 전 조회 1,878
13년 전 조회 2,185
13년 전 조회 2,288
13년 전 조회 1,672
13년 전 조회 4,384
13년 전 조회 2,168
13년 전 조회 3,705
13년 전 조회 2,016
13년 전 조회 1,717
13년 전 조회 1,767
13년 전 조회 1,623
13년 전 조회 2,150
13년 전 조회 2,288
13년 전 조회 3,629
13년 전 조회 5,202
13년 전 조회 1,632
13년 전 조회 4,190
13년 전 조회 1,583
13년 전 조회 2,062
13년 전 조회 1,664
13년 전 조회 2,011
13년 전 조회 2,763
13년 전 조회 2,107
13년 전 조회 1,562
13년 전 조회 2,222
13년 전 조회 1,837
13년 전 조회 2,234
13년 전 조회 2,689
14년 전 조회 2,040
14년 전 조회 1,659
14년 전 조회 2,856
14년 전 조회 2,133
14년 전 조회 1,717
14년 전 조회 1,624
14년 전 조회 2,021
14년 전 조회 1,523
14년 전 조회 2,687
14년 전 조회 1,949
14년 전 조회 1,958
14년 전 조회 1,591
14년 전 조회 2,260
14년 전 조회 3,056
14년 전 조회 1,563
14년 전 조회 1,450
14년 전 조회 1,665
14년 전 조회 4,244
14년 전 조회 1,712
14년 전 조회 2,254
14년 전 조회 2,054
14년 전 조회 1,665
14년 전 조회 8,704
14년 전 조회 2,041
14년 전 조회 2,709
14년 전 조회 1,706
14년 전 조회 2,081
14년 전 조회 1,904
14년 전 조회 2,865
14년 전 조회 4,297
14년 전 조회 2,522
14년 전 조회 4,216
14년 전 조회 2,400
14년 전 조회 4,832
14년 전 조회 2,379
14년 전 조회 1,930
14년 전 조회 2,858
14년 전 조회 3,659
14년 전 조회 2,555
14년 전 조회 2,372
14년 전 조회 4,146
14년 전 조회 2,162
14년 전 조회 1,709
14년 전 조회 2,600
14년 전 조회 1,814
14년 전 조회 6,152
14년 전 조회 1,797
14년 전 조회 2,165
14년 전 조회 1,787