2012-12-13 3 views
1


키없이 버전 3.8 을 사용하고 있습니다. 나는이 정확한 코드를 내 바탕 화면에서 (키가없는) 사용했고 괜찮 았지만 지금은 어떤 이유로 작동하지 않는다.

오타를 찾을 수 없으며 사용중인 키가 변경되지 않고 가져 오기 선언이 있습니까? 그것이 작동하고
왜이 간단한 Google지도 코드가 작동하지 않습니까?

<!DOCTYPE html> 
<html> 
    <head> 
     <title>asdfasdf</title> 
    </head> 
    <body onload = "initialize();"> 

     <!-- map here --> 
     <div id = "map"></div> 

     <!-- Google Maps API --> 
     <script type = "text/javascript" src = "http://maps.googleapis.com/maps/api/js?&amp;sensor=true&amp;v=3.8"></script> 

     <script type = "text/javascript"> 

      function initialize() 
      { 
       // object literal for map options 
       var myOptions = 
       { 
        center: new google.maps.LatLng(37.09024, -95.712891), // coordinates for center of map 30, 3 
        zoom: 4, // smaller number --> zoom out 
        mapTypeId: google.maps.MapTypeId.HYBRID // ROADMAP, SATELLITE, TERRAIN, or HYBRID 
       }; 

       // note: if the id has a dash in its' name, map instantiation doesn't work! 
       var map = new google.maps.Map(document.getElementById("map"), myOptions); 

      } // end of initialize 
     </script> 
    </body> 
</html> 
+0

변경 http://maps.googleapis.com/maps/api/js? & sensor = true & v = 3.8 to http://maps.googleapis.com/maps/api/js?&sensor=true&v=3.8 – Kotzilla

답변

2

:

은 여기 내 제거 다운 코드입니다. 지도 div가 표시되지 않도록 width/height을 입력하는 것을 잊었을 수 있습니다.

당신은 당신이 그것을 요청하는 경우 v3.9을 얻을 것이다, 여기 좀 http://jsfiddle.net/2HmMQ/

+0

하하, 맞습니다! Duh, 나는 내가 그 것을 놓쳤다 고 믿을 수 없다. 때때로 나는 단순한 것에 매달린다. 도와 주셔서 감사합니다. –

2

V3.8 is retired을 가질 수 있습니다.

지도에 크기가 없기 때문에 문제가 보이지 않습니다.

내가이 같은 크기, 뭔가주고지도의 DIV를 변경하는 경우 : 그것은 작동

 <div id="map" style="height:500px; width:600px;"></div> 

합니다.

+0

Ah v3.9 지금 정보를 제공해 주셔서 감사합니다. –

관련 문제