마

구글 지도 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:"따이뜰!"
});
댓글을 작성하시려면 로그인이 필요합니다.

프로그램

8,188건
+
제목 글쓴이 날짜 조회
16-03-02 조회 3,239
16-01-19 조회 2,526
15-12-23 조회 2,959
15-12-08 조회 3,674
14-10-30 조회 5,731
14-06-06 조회 5,553
12-08-30 조회 3,909
12-08-20 조회 3,828
12-07-15 조회 5,157
12-07-13 조회 3,628
12-07-06 조회 3,856
12-06-27 조회 3,366
12-06-23 조회 3,568
12-05-03 조회 5,181
12-04-20 조회 4,124
12-03-29 조회 4,630
12-03-22 조회 4,718
12-03-22 조회 3,509
12-03-21 조회 3,281
12-03-11 조회 3,713
12-03-06 조회 4,263
12-02-22 조회 4,532
12-02-17 조회 3,327
12-02-17 조회 6,179
12-02-14 조회 6,135
12-02-06 조회 4,260
12-01-18 조회 3,212
12-01-06 조회 3,442
11-12-30 조회 3,911
11-12-30 조회 7,056
11-12-21 조회 3,280
11-12-21 조회 4,243
11-12-16 조회 3,271
11-12-15 조회 3,322
11-12-15 조회 3,419
11-12-15 조회 4,222
11-12-09 조회 3,226
11-12-09 조회 3,307
11-12-07 조회 2,873
11-12-07 조회 3,960
11-12-05 조회 4,415
11-12-02 조회 3,861
11-12-01 조회 2,729
11-12-01 조회 2,775
11-12-01 조회 2,761