구글 지도 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:"따이뜰!"
});
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 330 |
prosper
|
20년 전 | 2288 | |
| 329 |
prosper
|
20년 전 | 1919 | |
| 328 |
prosper
|
20년 전 | 1711 | |
| 327 | 20년 전 | 3778 | ||
| 326 | 20년 전 | 4865 | ||
| 325 |
hwatta
|
20년 전 | 2493 | |
| 324 |
|
20년 전 | 3150 | |
| 323 | 20년 전 | 5875 | ||
| 322 |
hwatta
|
20년 전 | 2860 | |
| 321 |
hwatta
|
20년 전 | 2332 | |
| 320 |
yesmoa
|
20년 전 | 4583 | |
| 319 | 20년 전 | 2697 | ||
| 318 | 20년 전 | 2244 | ||
| 317 |
kyodon
|
20년 전 | 2765 | |
| 316 | 20년 전 | 2588 | ||
| 315 |
|
20년 전 | 2890 | |
| 314 |
|
20년 전 | 3349 | |
| 313 |
|
20년 전 | 2654 | |
| 312 |
yesmoa
|
20년 전 | 4734 | |
| 311 | 20년 전 | 3288 | ||
| 310 |
홀로남은자
|
20년 전 | 4579 | |
| 309 | 20년 전 | 3014 | ||
| 308 | 20년 전 | 4145 | ||
| 307 | 20년 전 | 4382 | ||
| 306 | 20년 전 | 7044 | ||
| 305 | 20년 전 | 3877 | ||
| 304 | 20년 전 | 2776 | ||
| 303 |
크리스탈처럼
|
20년 전 | 4416 | |
| 302 | 20년 전 | 2217 | ||
| 301 |
|
20년 전 | 4335 | |
| 300 | 20년 전 | 3820 | ||
| 299 | 20년 전 | 2637 | ||
| 298 | 20년 전 | 4849 | ||
| 297 |
|
20년 전 | 2538 | |
| 296 | 20년 전 | 4545 | ||
| 295 | 20년 전 | 3577 | ||
| 294 | 20년 전 | 3598 | ||
| 293 | 20년 전 | 3827 | ||
| 292 | 20년 전 | 3223 | ||
| 291 |
yesmoa
|
20년 전 | 5962 | |
| 290 | 20년 전 | 2949 | ||
| 289 | 20년 전 | 5870 | ||
| 288 |
|
20년 전 | 2388 | |
| 287 |
|
20년 전 | 1819 | |
| 286 |
|
20년 전 | 2158 | |
| 285 |
|
20년 전 | 3551 | |
| 284 |
|
20년 전 | 2045 | |
| 283 |
|
20년 전 | 4406 | |
| 282 | 20년 전 | 3387 | ||
| 281 |
|
20년 전 | 2218 | |
| 280 |
|
20년 전 | 7822 | |
| 279 | 20년 전 | 5569 | ||
| 278 | 20년 전 | 3005 | ||
| 277 |
|
20년 전 | 5578 | |
| 276 | 20년 전 | 2368 | ||
| 275 | 20년 전 | 2625 | ||
| 274 | 20년 전 | 2405 | ||
| 273 | 20년 전 | 2241 | ||
| 272 | 20년 전 | 2169 | ||
| 271 | 20년 전 | 2636 | ||
| 270 | 20년 전 | 2676 | ||
| 269 | 20년 전 | 2518 | ||
| 268 | 20년 전 | 2704 | ||
| 267 | 20년 전 | 2386 | ||
| 266 | 20년 전 | 2576 | ||
| 265 | 20년 전 | 3519 | ||
| 264 |
|
20년 전 | 5382 | |
| 263 |
|
20년 전 | 3747 | |
| 262 | 20년 전 | 3205 | ||
| 261 |
허저비
|
20년 전 | 5948 | |
| 260 |
|
20년 전 | 5724 | |
| 259 | 20년 전 | 4151 | ||
| 258 | 20년 전 | 2385 | ||
| 257 | 20년 전 | 3207 | ||
| 256 | 20년 전 | 1920 | ||
| 255 | 20년 전 | 1590 | ||
| 254 | 20년 전 | 3160 | ||
| 253 | 20년 전 | 3556 | ||
| 252 | 20년 전 | 5140 | ||
| 251 | 20년 전 | 5831 | ||
| 250 | 20년 전 | 3689 | ||
| 249 | 20년 전 | 5036 | ||
| 248 | 20년 전 | 3305 | ||
| 247 | 20년 전 | 3659 | ||
| 246 |
|
20년 전 | 7968 | |
| 245 |
|
20년 전 | 5931 | |
| 244 | 20년 전 | 4498 | ||
| 243 |
|
20년 전 | 4078 | |
| 242 | 20년 전 | 2809 | ||
| 241 | 20년 전 | 2755 | ||
| 240 | 20년 전 | 2392 | ||
| 239 | 20년 전 | 1681 | ||
| 238 |
아우겐나이스
|
20년 전 | 2288 | |
| 237 |
email
|
20년 전 | 3703 | |
| 236 | 20년 전 | 4186 | ||
| 235 | 20년 전 | 10477 | ||
| 234 | 20년 전 | 5086 | ||
| 233 | 20년 전 | 3392 | ||
| 232 | 20년 전 | 3231 | ||
| 231 | 20년 전 | 3874 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기