구글 지도 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:"따이뜰!"
});
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 4230 |
|
13년 전 | 1556 | |
| 4229 | 13년 전 | 1114 | ||
| 4228 | 13년 전 | 2108 | ||
| 4227 | 13년 전 | 798 | ||
| 4226 |
|
13년 전 | 815 | |
| 4225 |
천국의눈믈
|
13년 전 | 630 | |
| 4224 |
visualp
|
13년 전 | 1435 | |
| 4223 |
visualp
|
13년 전 | 1050 | |
| 4222 |
visualp
|
13년 전 | 766 | |
| 4221 |
visualp
|
13년 전 | 5300 | |
| 4220 | 13년 전 | 1906 | ||
| 4219 | 13년 전 | 1148 | ||
| 4218 | 13년 전 | 642 | ||
| 4217 | 13년 전 | 9440 | ||
| 4216 | 13년 전 | 1555 | ||
| 4215 |
|
14년 전 | 573 | |
| 4214 | 14년 전 | 561 | ||
| 4213 | 14년 전 | 1428 | ||
| 4212 |
visualp
|
14년 전 | 2011 | |
| 4211 | 14년 전 | 1552 | ||
| 4210 | 14년 전 | 822 | ||
| 4209 |
|
14년 전 | 2050 | |
| 4208 | 14년 전 | 2052 | ||
| 4207 | 14년 전 | 3001 | ||
| 4206 | 14년 전 | 1098 | ||
| 4205 |
SGFlash
|
14년 전 | 1285 | |
| 4204 | 14년 전 | 810 | ||
| 4203 | 14년 전 | 893 | ||
| 4202 | 14년 전 | 2115 | ||
| 4201 | 14년 전 | 908 | ||
| 4200 | 14년 전 | 2377 | ||
| 4199 | 14년 전 | 630 | ||
| 4198 |
visualp
|
14년 전 | 3505 | |
| 4197 |
visualp
|
14년 전 | 728 | |
| 4196 | 14년 전 | 2089 | ||
| 4195 |
미사카10777호
|
14년 전 | 3468 | |
| 4194 |
senseme
|
14년 전 | 775 | |
| 4193 | 14년 전 | 953 | ||
| 4192 | 14년 전 | 1306 | ||
| 4191 |
DreamT
|
14년 전 | 802 | |
| 4190 |
onlymilk74
|
14년 전 | 1312 | |
| 4189 | 14년 전 | 1248 | ||
| 4188 | 14년 전 | 1371 | ||
| 4187 | 14년 전 | 1104 | ||
| 4186 |
|
14년 전 | 733 | |
| 4185 | 14년 전 | 1195 | ||
| 4184 | 14년 전 | 1169 | ||
| 4183 |
visualp
|
14년 전 | 1046 | |
| 4182 |
visualp
|
14년 전 | 622 | |
| 4181 |
|
14년 전 | 618 | |
| 4180 |
techer
|
14년 전 | 952 | |
| 4179 | 14년 전 | 526 | ||
| 4178 | 14년 전 | 3076 | ||
| 4177 | 14년 전 | 598 | ||
| 4176 | 14년 전 | 945 | ||
| 4175 | 14년 전 | 596 | ||
| 4174 |
|
14년 전 | 632 | |
| 4173 |
|
14년 전 | 1859 | |
| 4172 |
|
14년 전 | 907 | |
| 4171 | 14년 전 | 1393 | ||
| 4170 | 14년 전 | 665 | ||
| 4169 | 14년 전 | 1292 | ||
| 4168 | 14년 전 | 1772 | ||
| 4167 | 14년 전 | 810 | ||
| 4166 | 14년 전 | 1320 | ||
| 4165 |
visualp
|
14년 전 | 811 | |
| 4164 | 14년 전 | 1177 | ||
| 4163 | 14년 전 | 2604 | ||
| 4162 | 14년 전 | 657 | ||
| 4161 |
onlymilk74
|
14년 전 | 4791 | |
| 4160 | 14년 전 | 681 | ||
| 4159 | 14년 전 | 869 | ||
| 4158 | 14년 전 | 708 | ||
| 4157 | 14년 전 | 3389 | ||
| 4156 | 14년 전 | 505 | ||
| 4155 | 14년 전 | 837 | ||
| 4154 | 14년 전 | 1138 | ||
| 4153 | 14년 전 | 1141 | ||
| 4152 | 14년 전 | 634 | ||
| 4151 | 14년 전 | 1240 | ||
| 4150 | 14년 전 | 721 | ||
| 4149 | 14년 전 | 624 | ||
| 4148 |
쉽다zzz
|
14년 전 | 2254 | |
| 4147 | 14년 전 | 953 | ||
| 4146 | 14년 전 | 575 | ||
| 4145 | 14년 전 | 579 | ||
| 4144 | 14년 전 | 1615 | ||
| 4143 | 14년 전 | 766 | ||
| 4142 | 14년 전 | 1177 | ||
| 4141 | 14년 전 | 1160 | ||
| 4140 |
|
14년 전 | 1770 | |
| 4139 |
visualp
|
14년 전 | 1847 | |
| 4138 |
visualp
|
14년 전 | 1113 | |
| 4137 | 14년 전 | 769 | ||
| 4136 | 14년 전 | 709 | ||
| 4135 | 14년 전 | 958 | ||
| 4134 | 14년 전 | 1114 | ||
| 4133 | 14년 전 | 2530 | ||
| 4132 | 14년 전 | 577 | ||
| 4131 | 14년 전 | 891 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기