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

· 14년 전 · 1616
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&v=1&sensor=true&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 끝 -->

첨부파일

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

그누4 질문답변

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기 기존 게시물은 열람만 가능합니다.

+
제목 글쓴이 날짜 조회
14년 전 조회 1,675
14년 전 조회 1,545
14년 전 조회 1,053
14년 전 조회 798
14년 전 조회 766
14년 전 조회 1,499
14년 전 조회 960
14년 전 조회 747
14년 전 조회 1,731
14년 전 조회 1,617
14년 전 조회 1,040
14년 전 조회 982
14년 전 조회 1,524
14년 전 조회 716
14년 전 조회 730
14년 전 조회 788
14년 전 조회 762
14년 전 조회 905
14년 전 조회 776
14년 전 조회 960
🐛 버그신고