구글맵이 오류났는데...

구글맵이 오류났는데...

QA

구글맵이 오류났는데...

본문

구글맵이 오류났는데 팁자료이나 스킨 없나요?

이 질문에 댓글 쓰기 :

답변 3

<? 
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>

답변을 작성하시기 전에 로그인 해주세요.
전체 123,663 | RSS
QA 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT