구글 지도 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,959
13년 전 조회 3,179
13년 전 조회 1,897
13년 전 조회 2,264
13년 전 조회 2,949
13년 전 조회 2,272
13년 전 조회 1,946
13년 전 조회 2,651
13년 전 조회 4,932
13년 전 조회 1,659
13년 전 조회 1,739
13년 전 조회 1,887
13년 전 조회 5,000
13년 전 조회 2,355
13년 전 조회 2,573
13년 전 조회 2,574
14년 전 조회 1,867
14년 전 조회 1,720
14년 전 조회 1,887
14년 전 조회 2,688
14년 전 조회 2,033
14년 전 조회 2,358
14년 전 조회 3,548
14년 전 조회 2,015
14년 전 조회 2,330
14년 전 조회 2,435
14년 전 조회 1,794
14년 전 조회 4,543
14년 전 조회 2,319
14년 전 조회 3,851
14년 전 조회 2,178
14년 전 조회 1,853
14년 전 조회 1,899
14년 전 조회 1,753
14년 전 조회 2,290
14년 전 조회 2,418
14년 전 조회 3,763
14년 전 조회 5,347
14년 전 조회 1,751
14년 전 조회 4,336
14년 전 조회 1,725
14년 전 조회 2,188
14년 전 조회 1,811
14년 전 조회 2,150
14년 전 조회 2,902
14년 전 조회 2,240
14년 전 조회 1,688
14년 전 조회 2,363
14년 전 조회 1,990
14년 전 조회 2,373
14년 전 조회 2,836
14년 전 조회 2,195
14년 전 조회 1,808
14년 전 조회 2,988
14년 전 조회 2,268
14년 전 조회 1,853
14년 전 조회 1,775
14년 전 조회 2,169
14년 전 조회 1,671
14년 전 조회 2,841
14년 전 조회 2,095
14년 전 조회 2,090
14년 전 조회 1,738
14년 전 조회 2,402
14년 전 조회 3,208
14년 전 조회 1,711
14년 전 조회 1,591
14년 전 조회 1,811
14년 전 조회 4,381
14년 전 조회 1,857
14년 전 조회 2,393
14년 전 조회 2,186
14년 전 조회 1,813
14년 전 조회 8,844
14년 전 조회 2,172
14년 전 조회 2,867
14년 전 조회 1,856
14년 전 조회 2,224
14년 전 조회 2,038
14년 전 조회 3,003
14년 전 조회 4,443
14년 전 조회 2,675
14년 전 조회 4,359
14년 전 조회 2,533
14년 전 조회 4,978
14년 전 조회 2,526
14년 전 조회 2,057
14년 전 조회 2,990
14년 전 조회 3,783
14년 전 조회 2,678
14년 전 조회 2,509
14년 전 조회 4,277
14년 전 조회 2,299
14년 전 조회 1,837
14년 전 조회 2,734
14년 전 조회 1,938
14년 전 조회 6,285
14년 전 조회 1,935
14년 전 조회 2,315
14년 전 조회 1,912