2011-09-26 5 views

답변

2

나는 혼란 스럽습니다. Google Closure는 자바 스크립트 라이브러리이므로 Google지도 자바 스크립트 API 만 사용할 수 있습니까? 다음과 같이하십시오.

<script type="text/javascript" src="http://maps.googleapis.com/maps/ap/js?sensor=set_to_true_or_false"> 
</script> 
<script type="text/javascript"> 
    function initialize() { 
    var latlng = new google.maps.LatLng(-34.397, 150.644); 
    var myOptions = { 
     zoom: 8, 
     center: latlng, 
     mapTypeId: google.maps.MapTypeId.ROADMAP 
    }; 
    var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions); 
    } 

그리고 나서 document.getElementById()를 원하는대로 변경할 수 있습니다.

참조 : Google Maps Javascript API

+0

아니 할 수 있습니다 Google이 아닌 폐쇄 munges 구글 맵 API 변수 이름과 같은 – Zubair

+0

@Zubair, [기타 질문]에 링크 된 externs 존 (HTTP : // 유래.하지 co.kr/questions/7620153/downloading-the-google-maps-api-v3) Google Maps 변수 이름 바꾸기를 방지합니다. – hyperslug

관련 문제