谷歌地图方向工作在本地,但不从网络服务器



我使用网站http://www.houston.ind.br/api/map/map1/rota.htm作为示例来开发类似的东西。当我使用firefox从我的本地文件系统运行这个东西时,一切正常,但是当我将页面(无论是我的还是上面引用的)上传到服务器时,它不再工作。我试着用谷歌api替换我获得的谷歌密钥,但这没有区别。

我查看了我的密钥所启用的api,几乎打开了所有的api,但都无济于事。

知道是怎么回事吗?我需要其他类型的谷歌密钥吗?

我能够使它工作通过更改http为https在以下行

<script src=" https://maps.google.com/?file=api&amp;v=2.x&amp;key=ABQIAAAAA9cb-iZ2XyrDiJe40QcIixSYNaUY3kVpdSwiLlIjooxsqEAfDxQTzxBRZuWS5Ya5YKFT2LGaMMA-IQ"
      type="text/javascript"></script>
<div style='overflow:hidden;height:292px;width:1286px;margin-left:0.7cm; padding:5px 5px 5px 5px; '>
<div id='gmap_canvas' style='height:292px;width:1286px;'></div>
<style>#gmap_canvas img{max-width:none!important;background:none!important}</style>
</div> 
<a href='https://embedmaps.org/'>Baal vattika</a> 
<script type='text/javascript' src='https://embedmaps.com/google-maps-authorization/script.js?id=a3c2ec770a2f881655fbdd614aa3d259bdbd1e89'>
</script>
<script type='text/javascript'>
function init_map(){
  var myOptions = {zoom:12,center:new google.maps.LatLng(13.0649666,80.22328349999998),mapTypeId: google.maps.MapTypeId.ROADMAP};
  map = new google.maps.Map(document.getElementById('gmap_canvas'), myOptions);
  marker = new google.maps.Marker({map: map,position: new google.maps.LatLng(13.0649666,80.22328349999998)});
  infowindow = new google.maps.InfoWindow({content:'<strong>Baal vattika</strong><br>51B, 2nd St, Gill Nagar, Choolaimedu, Chennai, Tamil Nadu 600094<br>600094 chennai<br>'});
   google.maps.event.addListener(marker, 'click', function(){infowindow.open(map,marker);});
   infowindow.open(map,marker);}
   google.maps.event.addDomListener(window, 'load', init_map);
</script>

最新更新