구글 지도 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:"따이뜰!"
});
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 4430 | 13년 전 | 825 | ||
| 4429 | 13년 전 | 1148 | ||
| 4428 | 13년 전 | 1940 | ||
| 4427 | 13년 전 | 1059 | ||
| 4426 | 13년 전 | 521 | ||
| 4425 | 13년 전 | 9876 | ||
| 4424 |
|
13년 전 | 839 | |
| 4423 |
|
13년 전 | 708 | |
| 4422 |
aequum
|
13년 전 | 1286 | |
| 4421 | 13년 전 | 2410 | ||
| 4420 | 13년 전 | 1204 | ||
| 4419 | 13년 전 | 889 | ||
| 4418 |
한번잘해보자
|
13년 전 | 671 | |
| 4417 | 13년 전 | 1578 | ||
| 4416 | 13년 전 | 871 | ||
| 4415 | 13년 전 | 2249 | ||
| 4414 | 13년 전 | 679 | ||
| 4413 | 13년 전 | 677 | ||
| 4412 | 13년 전 | 816 | ||
| 4411 | 13년 전 | 1437 | ||
| 4410 |
|
13년 전 | 695 | |
| 4409 | 13년 전 | 2164 | ||
| 4408 |
visualp
|
13년 전 | 531 | |
| 4407 |
visualp
|
13년 전 | 3086 | |
| 4406 |
visualp
|
13년 전 | 3253 | |
| 4405 |
visualp
|
13년 전 | 3152 | |
| 4404 |
visualp
|
13년 전 | 2977 | |
| 4403 |
|
13년 전 | 666 | |
| 4402 |
gender
|
13년 전 | 621 | |
| 4401 | 13년 전 | 1112 | ||
| 4400 |
aequum
|
13년 전 | 1378 | |
| 4399 | 13년 전 | 586 | ||
| 4398 | 13년 전 | 668 | ||
| 4397 |
|
13년 전 | 579 | |
| 4396 |
aequum
|
13년 전 | 4659 | |
| 4395 |
|
13년 전 | 549 | |
| 4394 |
aequum
|
13년 전 | 4931 | |
| 4393 |
|
13년 전 | 1264 | |
| 4392 | 13년 전 | 1053 | ||
| 4391 |
mirrV
|
13년 전 | 528 | |
| 4390 |
파워웹프로
|
13년 전 | 702 | |
| 4389 | 13년 전 | 1224 | ||
| 4388 |
Coding
|
13년 전 | 700 | |
| 4387 |
aequum
|
13년 전 | 1359 | |
| 4386 | 13년 전 | 868 | ||
| 4385 | 13년 전 | 722 | ||
| 4384 | 13년 전 | 786 | ||
| 4383 | 13년 전 | 2899 | ||
| 4382 | 13년 전 | 606 | ||
| 4381 | 13년 전 | 1169 | ||
| 4380 | 13년 전 | 803 | ||
| 4379 |
|
13년 전 | 746 | |
| 4378 | 13년 전 | 663 | ||
| 4377 | 13년 전 | 3300 | ||
| 4376 |
aequum
|
13년 전 | 1214 | |
| 4375 |
클로로다인
|
13년 전 | 648 | |
| 4374 |
DDFACTORY
|
13년 전 | 719 | |
| 4373 |
까탈스런ET
|
13년 전 | 705 | |
| 4372 | 13년 전 | 801 | ||
| 4371 | 13년 전 | 565 | ||
| 4370 |
|
13년 전 | 644 | |
| 4369 |
프리프리닷
|
13년 전 | 1302 | |
| 4368 | 13년 전 | 3166 | ||
| 4367 |
soing
|
13년 전 | 1574 | |
| 4366 |
|
13년 전 | 683 | |
| 4365 |
|
13년 전 | 622 | |
| 4364 |
|
13년 전 | 757 | |
| 4363 |
|
13년 전 | 621 | |
| 4362 |
|
13년 전 | 725 | |
| 4361 |
|
13년 전 | 841 | |
| 4360 |
|
13년 전 | 649 | |
| 4359 |
|
13년 전 | 3124 | |
| 4358 |
|
13년 전 | 3038 | |
| 4357 | 13년 전 | 841 | ||
| 4356 | 13년 전 | 1340 | ||
| 4355 | 13년 전 | 965 | ||
| 4354 | 13년 전 | 814 | ||
| 4353 | 13년 전 | 3372 | ||
| 4352 | 13년 전 | 2374 | ||
| 4351 | 13년 전 | 1960 | ||
| 4350 |
|
13년 전 | 1875 | |
| 4349 | 13년 전 | 650 | ||
| 4348 |
aequum
|
13년 전 | 1406 | |
| 4347 | 13년 전 | 657 | ||
| 4346 |
|
13년 전 | 565 | |
| 4345 | 13년 전 | 597 | ||
| 4344 |
aequum
|
13년 전 | 1002 | |
| 4343 |
|
13년 전 | 1038 | |
| 4342 |
aequum
|
13년 전 | 1628 | |
| 4341 | 13년 전 | 799 | ||
| 4340 |
2번호랑이
|
13년 전 | 1001 | |
| 4339 |
|
13년 전 | 1167 | |
| 4338 | 13년 전 | 1163 | ||
| 4337 | 13년 전 | 519 | ||
| 4336 |
aequum
|
13년 전 | 1705 | |
| 4335 | 13년 전 | 884 | ||
| 4334 | 13년 전 | 1183 | ||
| 4333 |
Sturmvogel
|
13년 전 | 959 | |
| 4332 |
aequum
|
13년 전 | 1281 | |
| 4331 |
aequum
|
13년 전 | 1394 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기