2014-06-23 11 views
-3

나는 내 문제에 대한 해결책을 많이 읽었지만 그 중 아무 것도 나를 위해 일하지 않았습니다. 내지도가 여기에 Google지도는 로딩되지 않습니다

를로드하지 않는 것은 내 HTML

<script src="https://maps.googleapis.com/maps/api/js?v=3.exp"></script> 
    <script> 
var map; 
function initialize() { 
    var mapOptions = { 
    zoom: 8, 
    center: new google.maps.LatLng(41.7429109,24.391538699999955) 
    }; 
    map = new google.maps.Map(document.getElementById('map-canvas'), 
     mapOptions); 
} 

google.maps.event.addDomListener(window, 'load', initialize); 

    </script> 

</head> 
<body onload="initialize()"> 


      <div id="map_canvas"></div> 
</body> 

이다 나는 문제가 여기 어딘가에 생각 CSS는

body { 
    height:100%; 
    width:100%; 
    margin: 0; 
    padding: 0; 
    line-height: 1.5em; 
    font-family: Georgia, "Times New Roman", Times, serif; 
    font-size: 12px; 
    color: #666; 
    background:#302f2f ; 
} 

    #map_canvas { 
    width:300px; 
    height:300px; 
    } 

그래서 당신의 HTML 요소의 ID를 가지고

+0

map-canvas와 같지 않음 –

답변

0

나에게 도움을 주시기 바랍니다 'map_canvas', 자바 스크립트에 'map-canvas'가 있습니다.

ID를 잘못 입력했기 때문에 요소를 찾을 수 없습니다. : o)

+0

고맙습니다. 이렇게 많은 실수를하고 있습니다. 그들을 찾기가 어렵습니다. – vitarist

+0

가장 쉬운 방법은 google chrome을 실행하고 F12를 누르는 것입니다. 오류 메시지를 표시하고 오류 메시지를 클릭하면 코드의 문제로 안내합니다. 잠시 후 특정 메시지와 일반적인 메시지를 연결하기 시작합니다. – hairmot

관련 문제