구글맵이 오류났는데...
본문
구글맵이 오류났는데 팁자료이나 스킨 없나요?
답변 3
저..실례지만 혹시 구글 api private key는 넣으셨나요?...안에서 해당코드가 보이진않네요..
소스를 보지 않은 이상 답변을 드릴수가 없네요
<?
include_once("../../lib_/fn_config.php");
include_once(ROOT_DIR."/skin_/header.php")
?>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script src="https://maps.googleapis.com/maps/api/js?sensor=false"></script>
<script lang="javascript">
$(function(){
var geocoder = new google.maps.Geocoder();
function initialize(){
// var address=$("#dwd_addr1").find("p").first().text();
var address=$("#dwd_addr1").text();
var dump =google_loadmap(address);
};
$(".btn_addr_view").bind("click",function(e){
e.preventDefault();
var id=$(this).attr("data-id");
// var address = $("#dwd_addr"+id).find("p").first().text();
var address = $("#dwd_addr"+id).text();
var dump =google_loadmap(address);
});
function google_loadmap(addr) {
var lat="";
var lng="";
var dump=geocoder.geocode({'address':addr},
function(results, status){
if(results != ""){
var location=results[0].geometry.location;
lat=location.lat();
lng=location.lng();
var latlng = new google.maps.LatLng(lat , lng);
var myOptions = {
zoom: 16,
center: latlng,
mapTypeControl: true,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
var marker = new google.maps.Marker({ //마커 설정
map : map,
position : map.getCenter() //마커 위치
// icon : image //마커 이미지
});
}else{
$("#map_canvas").html("<div style='font-size:20px; color:blue;margin-top:220px;text-align:center;'>위도와 경도를 찾을 수 없습니다.<div>");
}
return true;
}
)
return true;
}
initialize();
});
function get_area2(targ , aval)
{
document.getElementById('ifrm').src = '/mik_lib/get_area.php?targ='+targ+'&aval='+aval;
}
</script>
</head>
<body>
<?
include(ROOT_DIR."/skin_/top.php");
//$table = 'notice';
$table =($_GET['table']) ? ($_GET['table']):'notice';
$mode = ($_GET['mode']) ? $_GET['mode'] : 'list';
?>
<div id="container">
<!-- content-->
<div id="content">
<?
include ROOT_DIR."/lib_/fn_menu_faq.php";
include BOARD_ROOT."/board.php";
?>
<div id="map_canvas" style=" width:514px; height:624px; margin-top:76px; float:right" class="box">
</div>
<!--content --></div>
<!--container --></div>
<?
include(ROOT_DIR."/skin_/footer.php");
?>
<iframe src="/" id="ifrm" name="ifrm" width="0" height="0" style="border:solid 1px #000000;" border="0"></iframe>
</body>
</html>