구글 지도 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년 전 조회 800
13년 전 조회 2,038
13년 전 조회 739
13년 전 조회 1,091
13년 전 조회 1,795
13년 전 조회 1,118
13년 전 조회 777
13년 전 조회 1,478
13년 전 조회 3,785
13년 전 조회 506
13년 전 조회 578
13년 전 조회 761
13년 전 조회 3,904
13년 전 조회 1,248
13년 전 조회 1,421
13년 전 조회 1,437
13년 전 조회 736
13년 전 조회 612
13년 전 조회 757
13년 전 조회 1,571
13년 전 조회 934
13년 전 조회 1,269
13년 전 조회 2,467
13년 전 조회 927
13년 전 조회 1,251
13년 전 조회 1,364
13년 전 조회 711
13년 전 조회 3,463
13년 전 조회 1,222
13년 전 조회 2,736
13년 전 조회 1,076
13년 전 조회 763
13년 전 조회 808
13년 전 조회 685
13년 전 조회 1,258
13년 전 조회 1,345
13년 전 조회 2,661
13년 전 조회 4,242
13년 전 조회 701
13년 전 조회 3,265
13년 전 조회 642
13년 전 조회 1,100
13년 전 조회 698
13년 전 조회 1,076
13년 전 조회 1,825
13년 전 조회 1,139
13년 전 조회 619
13년 전 조회 1,281
13년 전 조회 890
13년 전 조회 1,290
13년 전 조회 1,765
13년 전 조회 1,065
13년 전 조회 718
13년 전 조회 1,903
13년 전 조회 1,184
13년 전 조회 770
13년 전 조회 711
13년 전 조회 1,070
13년 전 조회 607
13년 전 조회 1,718
13년 전 조회 1,003
13년 전 조회 1,020
13년 전 조회 653
13년 전 조회 1,290
13년 전 조회 2,099
13년 전 조회 615
13년 전 조회 514
13년 전 조회 689
13년 전 조회 3,281
13년 전 조회 746
13년 전 조회 1,304
13년 전 조회 1,078
13년 전 조회 726
13년 전 조회 7,727
13년 전 조회 1,100
13년 전 조회 1,750
13년 전 조회 751
13년 전 조회 1,084
13년 전 조회 916
13년 전 조회 1,888
13년 전 조회 3,316
13년 전 조회 1,531
13년 전 조회 3,235
13년 전 조회 1,411
13년 전 조회 3,852
13년 전 조회 1,400
13년 전 조회 898
13년 전 조회 1,867
13년 전 조회 2,650
13년 전 조회 1,568
13년 전 조회 1,378
13년 전 조회 3,132
13년 전 조회 1,159
13년 전 조회 718
13년 전 조회 1,616
13년 전 조회 850
13년 전 조회 5,171
13년 전 조회 828
13년 전 조회 1,215
13년 전 조회 811
🐛 버그신고