테스트 사이트 - 개발 중인 베타 버전입니다

구글 지도 질문좀 드릴께요 고수님들 좀 봐주세용

· 14년 전 · 1576
2011-07-12 AM 03-49-22.jpg
list.skin.php 파일에 밑에와 같이 하니까 지도가 나오긴하는데
문제는 처음글의 주소만 반영되고 지도가 보이기는 맨나중글 하나에만 지도가 보입니다.
어떻게 수정해야 게시물마다 지도가 나올까요?,,,,

<?php

//키발급은 http://code.google.com/intl/ko/apis/maps/signup.html 사이트에서 사용할 사이트 url을 입력후 발급받으면 됨.

$api_key = "xxxxx";
?><!-- 구글에서 키발급밭은후 68번라인 $api_key ="키" 넣어주삼 -->



<!-- 구글 API 시작 -->
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>


<script src="http://maps.google.com/maps?file=api&amp;v=1&amp;sensor=true&amp;key=<?=$api_key?>" type="text/javascript"></script>



<script type="text/javascript">
var map = null;
var geocoder = null;
function initialize()
{
if (GBrowserIsCompatible())
{
map = new GMap2(document.getElementById("map_canvas")); //지도를 표시할 영역지정하여 map인스턴스 생성
map.setUIToDefault();
geocoder = new GClientGeocoder();

showAddress("<?=$list[$i][wr_8]?>"); //실제 주소를 날리고 좌표를 콜백받아 처리할 함수
}
}

function showAddress(address) {
if (geocoder) {
geocoder.getLatLng(
address,
function(point) {
if (!point) {
alert(address + " not found");
} else {
map.setCenter(point, 16);
var marker = new GMarker(point);


map.addOverlay(marker); //지도좌표에 표시할 마크

}
}
);
}
}
</script>



<body>
<body onload="initialize()" onunload="GUnload()" style="margin:0px;">
<div id="map_canvas" style="float:right; width:465px;height:160px;"></div>
</body>

<!-- 구글 API 끝 -->

댓글 작성

댓글을 작성하시려면 로그인이 필요합니다.

로그인하기

게시글 목록

번호 제목
284508
284499
284492
284490
284484
284481
284478
284476
284474
284472
284470
284458
284457
284454
284453
284447
284446
284444
284441
284440