구글 지도 질문좀 드릴께요 고수님들 좀 봐주세용 정보
구글 지도 질문좀 드릴께요 고수님들 좀 봐주세용본문
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 끝 -->
문제는 처음글의 주소만 반영되고 지도가 보이기는 맨나중글 하나에만 지도가 보입니다.
어떻게 수정해야 게시물마다 지도가 나올까요?,,,,
<?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 끝 -->
댓글 전체