2014-07-11 172 views
0

HI我在我的页面http://topdoctor.eu.pn/ 上遇到Google地图API的问题,其中与医生相关的名称包含指向其地址的链接。 正如我在API访问下在code.google.com中创建API key并在生成密钥的Simple API Access下创建密钥。 然后,我有手创乐团在我的网站Google maps API javascript

var map; 

var directionsDisplay = new google.maps.DirectionsRenderer({ 'map': map,draggable: true }); 
var mapprint; 

    function initialize() 
    { 
     var myCenter=new google.maps.LatLng(00,00); 
    var marker; 
    var mapProp = { 
     center:myCenter, 
     zoom:14, 
     mapTypeId:google.maps.MapTypeId.ROADMAP 
     }; 
    map=new google.maps.Map(document.getElementById("googleMap"),mapProp); 
     marker=new google.maps.Marker({ 
     position:myCenter, 
     icon:"Your image path on map", 
     }); 
    marker.setMap(map); 
      var info ="Your Info"; 


     var myOptions = { 
       content: info 
       ,disableAutoPan: false 
       ,maxWidth: 0 
       ,pixelOffset: new google.maps.Size(20, -158) //used for positioning left,right 
       ,zIndex: null 
       ,boxStyle: { 
        background: "" 
        ,opacity: 1.0 
        ,width: "220px" 
       } 
       ,closeBoxMargin: "10px 2px 2px 2px" 
       ,closeBoxURL: "" 
       ,infoBoxClearance: new google.maps.Size(1, 1) 
       ,isHidden: false 
       ,pane: "floatPane" 
       ,enableEventPropagation: false 
       ,url:"http://www.topdoctor.eu.pn/" 
      }; 
     var ib = new InfoBox(myOptions); 
     google.maps.event.addListener(marker, "click", function (e) { 
       ib.open(map, this); 
      }); 

      google.maps.event.addListener(map, "click", function (e) { 
       ib.closeListener_ = google.maps.event.addDomListener(map, 'click', ib.getCloseClickHandler_()); 
       ib.close(); 

      }); 
      google.maps.event.addListener(ib, "click", function (e) { 

       window.parent.location.href = "http://www.topdoctor.eu.pn/"; 
      }); 

      google.maps.event.trigger(map, 'resize'); 

    } 
    google.maps.event.addDomListener(window, 'load', initialize); 
    </script> 
    <style type="text/css"> 
    body{background-color:#fff;} 
    </style> 

    <div id="googleMap" class="gmap" style="width: 100%; height: 100%;"></div> 



    <div id="map-canvas"> 



    </div><!-- map --> 

,但地图上没有显示,或者说,关键是未启用或限额达到即使没有或很少的流量是在网站上。

回答

0

确保Google Maps JavaScript API的状态为ON,并在那里写下Courtesy limit: 25,000 requests/day表示您可以在一天内请求25,000个。 用于检查整个请求的详细信息点击Report菜单并检查API的流量详细信息。如果它跨越限制,那么您将无法在该特定日期使用API​​。

所有你可以找到here

+0

的API被启用,我得到这些统计数据。 流量报告为TopDoctor 总要求请求/ 天3峰值0.54平均 \t 开始日期 2014年6月14日 \t 采样周期 28天 所以没有办法已经达到极限,但地图不会显示在配置文件下 – user3829857

+0

使用右侧的链接查看您的数据使用情况'下载历史配额使用数据' –

+0

即可显示此\t 地图API v3 请求数# \t \t 每日配额:25k \t \t 28天总计:15 – user3829857