• 다음맵 로드뷰

    2016. 10. 31.

    by. Yo.

    728x90

    다음맵에서 지원하는 로드뷰 샘플 코드입니다.


    추가로 위경도 정보를 읽어와서 표시할수 있도록 했습니다.




    <!DOCTYPE html>
    <html>
    
    <head>
    	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    	<title>로드뷰</title>
    	<script src="http://code.jquery.com/jquery-latest.min.js"></script>
    	<script type="text/javascript" src="http://apis.daum.net/maps/maps3.js?apikey=51e40b674ec6f718ea6f04246c850e6de7ec841a" charset="utf-8"></script>
    	<script type="text/javascript">
    		function init() {
    			var p = new daum.maps.LatLng(37.567874958332034, 126.97975671440324);
    			var rc = new daum.maps.RoadviewClient();
    			var rv = new daum.maps.Roadview(document.getElementById("roadview"));
    			rc.getNearestPanoId(p, 50, function (panoid) {
    				rv.setPanoId(panoid, p);
    			});
    			daum.maps.event.addListener(rv, "position_changed", function () {
    				$("#latlon").val(rv.getPosition());
    			});
    		}
    	</script>
    </head>
    
    <body onload="init()">
    	<div id="roadview" style="width:600px;height:400px;"></div>
    	<input type="text" id="latlon" style="width:450px;"/>
    </body>
    
    </html>
    


    728x90

    댓글