구글 지도 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:"따이뜰!"
});
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 7930 | 9년 전 | 468 | ||
| 7929 | 9년 전 | 406 | ||
| 7928 | 9년 전 | 479 | ||
| 7927 | 9년 전 | 382 | ||
| 7926 | 9년 전 | 694 | ||
| 7925 | 9년 전 | 416 | ||
| 7924 | 9년 전 | 401 | ||
| 7923 | 9년 전 | 388 | ||
| 7922 | 9년 전 | 418 | ||
| 7921 | 9년 전 | 434 | ||
| 7920 | 9년 전 | 344 | ||
| 7919 | 9년 전 | 354 | ||
| 7918 | 9년 전 | 508 | ||
| 7917 | 9년 전 | 363 | ||
| 7916 | 9년 전 | 450 | ||
| 7915 | 9년 전 | 460 | ||
| 7914 | 9년 전 | 472 | ||
| 7913 | 9년 전 | 648 | ||
| 7912 | 9년 전 | 477 | ||
| 7911 | 9년 전 | 401 | ||
| 7910 | 9년 전 | 458 | ||
| 7909 | 9년 전 | 568 | ||
| 7908 | 9년 전 | 507 | ||
| 7907 | 9년 전 | 435 | ||
| 7906 | 9년 전 | 458 | ||
| 7905 | 9년 전 | 433 | ||
| 7904 | 9년 전 | 417 | ||
| 7903 | 9년 전 | 427 | ||
| 7902 | 9년 전 | 598 | ||
| 7901 |
|
9년 전 | 770 | |
| 7900 | 9년 전 | 662 | ||
| 7899 | 9년 전 | 441 | ||
| 7898 | 9년 전 | 441 | ||
| 7897 | 9년 전 | 402 | ||
| 7896 | 9년 전 | 415 | ||
| 7895 | 9년 전 | 537 | ||
| 7894 | 9년 전 | 439 | ||
| 7893 | 9년 전 | 424 | ||
| 7892 | 9년 전 | 458 | ||
| 7891 | 9년 전 | 815 | ||
| 7890 | 9년 전 | 1233 | ||
| 7889 | 9년 전 | 770 | ||
| 7888 |
limsy1987
|
9년 전 | 580 | |
| 7887 | 9년 전 | 631 | ||
| 7886 | 9년 전 | 515 | ||
| 7885 | 9년 전 | 486 | ||
| 7884 | 9년 전 | 474 | ||
| 7883 | 9년 전 | 489 | ||
| 7882 | 9년 전 | 544 | ||
| 7881 | 9년 전 | 521 | ||
| 7880 | 9년 전 | 633 | ||
| 7879 | 9년 전 | 520 | ||
| 7878 | 9년 전 | 1296 | ||
| 7877 | 9년 전 | 816 | ||
| 7876 | 9년 전 | 563 | ||
| 7875 | 9년 전 | 632 | ||
| 7874 |
|
9년 전 | 833 | |
| 7873 | 9년 전 | 555 | ||
| 7872 | 9년 전 | 728 | ||
| 7871 | 9년 전 | 544 | ||
| 7870 | 9년 전 | 660 | ||
| 7869 | 9년 전 | 476 | ||
| 7868 | 9년 전 | 519 | ||
| 7867 | 9년 전 | 526 | ||
| 7866 | 9년 전 | 581 | ||
| 7865 | 9년 전 | 527 | ||
| 7864 | 10년 전 | 582 | ||
| 7863 | 10년 전 | 575 | ||
| 7862 | 10년 전 | 534 | ||
| 7861 | 10년 전 | 703 | ||
| 7860 | 10년 전 | 682 | ||
| 7859 | 10년 전 | 453 | ||
| 7858 | 10년 전 | 773 | ||
| 7857 | 10년 전 | 1157 | ||
| 7856 | 10년 전 | 580 | ||
| 7855 | 10년 전 | 820 | ||
| 7854 | 10년 전 | 756 | ||
| 7853 | 10년 전 | 655 | ||
| 7852 | 10년 전 | 575 | ||
| 7851 | 10년 전 | 583 | ||
| 7850 | 10년 전 | 648 | ||
| 7849 | 10년 전 | 413 | ||
| 7848 | 10년 전 | 476 | ||
| 7847 | 10년 전 | 730 | ||
| 7846 | 10년 전 | 505 | ||
| 7845 | 10년 전 | 488 | ||
| 7844 | 10년 전 | 443 | ||
| 7843 | 10년 전 | 487 | ||
| 7842 | 10년 전 | 466 | ||
| 7841 | 10년 전 | 433 | ||
| 7840 | 10년 전 | 450 | ||
| 7839 | 10년 전 | 512 | ||
| 7838 | 10년 전 | 558 | ||
| 7837 | 10년 전 | 392 | ||
| 7836 | 10년 전 | 446 | ||
| 7835 | 10년 전 | 529 | ||
| 7834 |
|
10년 전 | 1230 | |
| 7833 | 10년 전 | 496 | ||
| 7832 | 10년 전 | 469 | ||
| 7831 | 10년 전 | 634 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기