구글 지도 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>
구글에서는 튜토리얼 예제를 제공하고 있는데요.
아래는 지도 가운데 마커를 하고 설명으로..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개
13년 전
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:"따이뜰!"
});
position: myLatlng,
map: map,
title:"Hello World!"
});
윗 부분을 한번더 써주시면 됩니다.
//표시할 위치
var myLatlng2 = new google.maps.LatLng(표시할 위치 좌표값,표시할 위치 좌표값);
//마커생성
var marker2 = new google.maps.Marker({
position: myLatlng2,
map: map,
title:"따이뜰!"
});
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 230 | 20년 전 | 2094 | ||
| 229 | 20년 전 | 3152 | ||
| 228 | 20년 전 | 3343 | ||
| 227 | 20년 전 | 2418 | ||
| 226 | 20년 전 | 5499 | ||
| 225 | 20년 전 | 2541 | ||
| 224 | 20년 전 | 2981 | ||
| 223 | 20년 전 | 4218 | ||
| 222 | 20년 전 | 2615 | ||
| 221 | 20년 전 | 2304 | ||
| 220 | 20년 전 | 3692 | ||
| 219 | 20년 전 | 2087 | ||
| 218 | 20년 전 | 3588 | ||
| 217 | 20년 전 | 2500 | ||
| 216 | 20년 전 | 2939 | ||
| 215 | 20년 전 | 2245 | ||
| 214 | 20년 전 | 3353 | ||
| 213 | 20년 전 | 2937 | ||
| 212 | 20년 전 | 3078 | ||
| 211 | 20년 전 | 2168 | ||
| 210 | 20년 전 | 1932 | ||
| 209 | 20년 전 | 2383 | ||
| 208 | 20년 전 | 2013 | ||
| 207 | 20년 전 | 1694 | ||
| 206 | 20년 전 | 1867 | ||
| 205 | 20년 전 | 3965 | ||
| 204 | 20년 전 | 1687 | ||
| 203 | 20년 전 | 2031 | ||
| 202 | 20년 전 | 2369 | ||
| 201 | 20년 전 | 1844 | ||
| 200 | 20년 전 | 2974 | ||
| 199 | 20년 전 | 2016 | ||
| 198 | 20년 전 | 2100 | ||
| 197 | 20년 전 | 3672 | ||
| 196 | 20년 전 | 3012 | ||
| 195 | 20년 전 | 2126 | ||
| 194 | 20년 전 | 10274 | ||
| 193 | 20년 전 | 2271 | ||
| 192 | 20년 전 | 1619 | ||
| 191 | 20년 전 | 2685 | ||
| 190 | 20년 전 | 2303 | ||
| 189 | 20년 전 | 1706 | ||
| 188 | 20년 전 | 1504 | ||
| 187 | 20년 전 | 1928 | ||
| 186 | 20년 전 | 1753 | ||
| 185 | 20년 전 | 1801 | ||
| 184 | 20년 전 | 2384 | ||
| 183 | 20년 전 | 1595 | ||
| 182 | 20년 전 | 1501 | ||
| 181 | 20년 전 | 1642 | ||
| 180 | 20년 전 | 2740 | ||
| 179 | 20년 전 | 1828 | ||
| 178 | 20년 전 | 1878 | ||
| 177 | 20년 전 | 2004 | ||
| 176 | 20년 전 | 1814 | ||
| 175 | 20년 전 | 1884 | ||
| 174 | 20년 전 | 1714 | ||
| 173 | 20년 전 | 2073 | ||
| 172 | 20년 전 | 1798 | ||
| 171 | 20년 전 | 2583 | ||
| 170 | 20년 전 | 2301 | ||
| 169 | 20년 전 | 2578 | ||
| 168 | 20년 전 | 1515 | ||
| 167 | 20년 전 | 1601 | ||
| 166 | 20년 전 | 2175 | ||
| 165 | 20년 전 | 1662 | ||
| 164 | 20년 전 | 3793 | ||
| 163 | 20년 전 | 2689 | ||
| 162 | 20년 전 | 2112 | ||
| 161 | 20년 전 | 2822 | ||
| 160 | 20년 전 | 1758 | ||
| 159 | 20년 전 | 1635 | ||
| 158 | 20년 전 | 2589 | ||
| 157 | 20년 전 | 1515 | ||
| 156 | 20년 전 | 1776 | ||
| 155 | 20년 전 | 3253 | ||
| 154 | 20년 전 | 1924 | ||
| 153 | 20년 전 | 1642 | ||
| 152 | 20년 전 | 4978 | ||
| 151 | 20년 전 | 4598 | ||
| 150 | 20년 전 | 3540 | ||
| 149 | 20년 전 | 3817 | ||
| 148 | 20년 전 | 7101 | ||
| 147 | 20년 전 | 3570 | ||
| 146 | 20년 전 | 2649 | ||
| 145 | 20년 전 | 2642 | ||
| 144 | 20년 전 | 7179 | ||
| 143 | 20년 전 | 4625 | ||
| 142 | 20년 전 | 1912 | ||
| 141 | 20년 전 | 3270 | ||
| 140 | 20년 전 | 1991 | ||
| 139 | 20년 전 | 1616 | ||
| 138 | 20년 전 | 2332 | ||
| 137 | 20년 전 | 1809 | ||
| 136 | 20년 전 | 1473 | ||
| 135 | 20년 전 | 1815 | ||
| 134 | 20년 전 | 2991 | ||
| 133 | 20년 전 | 2473 | ||
| 132 | 20년 전 | 1721 | ||
| 131 | 20년 전 | 1667 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기