구글 지도 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년 전 조회 988
13년 전 조회 2,214
13년 전 조회 931
13년 전 조회 1,295
13년 전 조회 1,973
13년 전 조회 1,296
13년 전 조회 967
13년 전 조회 1,665
13년 전 조회 3,971
13년 전 조회 713
13년 전 조회 765
13년 전 조회 964
13년 전 조회 4,068
13년 전 조회 1,436
13년 전 조회 1,602
13년 전 조회 1,631
13년 전 조회 921
13년 전 조회 799
13년 전 조회 941
13년 전 조회 1,763
13년 전 조회 1,127
13년 전 조회 1,457
13년 전 조회 2,637
13년 전 조회 1,113
13년 전 조회 1,422
13년 전 조회 1,553
13년 전 조회 899
13년 전 조회 3,642
13년 전 조회 1,395
13년 전 조회 2,914
13년 전 조회 1,259
13년 전 조회 947
13년 전 조회 993
13년 전 조회 868
13년 전 조회 1,425
13년 전 조회 1,530
13년 전 조회 2,848
13년 전 조회 4,428
13년 전 조회 887
13년 전 조회 3,452
13년 전 조회 833
13년 전 조회 1,284
13년 전 조회 906
13년 전 조회 1,261
13년 전 조회 2,015
13년 전 조회 1,308
13년 전 조회 816
13년 전 조회 1,464
13년 전 조회 1,064
13년 전 조회 1,475
13년 전 조회 1,943
13년 전 조회 1,271
13년 전 조회 910
13년 전 조회 2,074
13년 전 조회 1,384
13년 전 조회 955
13년 전 조회 892
13년 전 조회 1,248
13년 전 조회 790
13년 전 조회 1,903
13년 전 조회 1,193
13년 전 조회 1,206
13년 전 조회 834
13년 전 조회 1,468
13년 전 조회 2,273
13년 전 조회 804
13년 전 조회 681
13년 전 조회 886
13년 전 조회 3,453
13년 전 조회 939
13년 전 조회 1,474
13년 전 조회 1,258
13년 전 조회 908
13년 전 조회 7,905
13년 전 조회 1,285
13년 전 조회 1,939
13년 전 조회 939
13년 전 조회 1,278
13년 전 조회 1,104
13년 전 조회 2,082
13년 전 조회 3,503
13년 전 조회 1,721
13년 전 조회 3,433
13년 전 조회 1,584
13년 전 조회 4,042
13년 전 조회 1,589
13년 전 조회 1,097
13년 전 조회 2,059
13년 전 조회 2,852
13년 전 조회 1,757
13년 전 조회 1,568
13년 전 조회 3,335
13년 전 조회 1,353
13년 전 조회 915
13년 전 조회 1,797
13년 전 조회 1,029
13년 전 조회 5,361
13년 전 조회 998
13년 전 조회 1,388
13년 전 조회 996