Google maps GoogleMapsDirections可以在本地工作,但不能在web服务器上工作

Google maps GoogleMapsDirections可以在本地工作,但不能在web服务器上工作,google-maps,Google Maps,我正在使用这个网站作为一个样本来开发类似的东西。当我使用firefox从本地文件系统运行该程序时,一切正常,但当我将页面(我的页面或上面提到的页面)上传到服务器时,它就不再工作了。我试着用谷歌api替换我获得的谷歌密钥,但这没有什么区别 我查看了我的钥匙启用的API,几乎所有的东西都打开了,但都没有用 知道发生了什么吗?我需要其他类型的google密钥吗?我可以通过在下面一行中将http更改为https来实现 <script src=" https://maps.google.com/?f

我正在使用这个网站作为一个样本来开发类似的东西。当我使用firefox从本地文件系统运行该程序时,一切正常,但当我将页面(我的页面或上面提到的页面)上传到服务器时,它就不再工作了。我试着用谷歌api替换我获得的谷歌密钥,但这没有什么区别

我查看了我的钥匙启用的API,几乎所有的东西都打开了,但都没有用


知道发生了什么吗?我需要其他类型的google密钥吗?

我可以通过在下面一行中将http更改为https来实现

<script src=" https://maps.google.com/?file=api&amp;v=2.x&amp;key=ABQIAAAAA9cb-iZ2XyrDiJe40QcIixSYNaUY3kVpdSwiLlIjooxsqEAfDxQTzxBRZuWS5Ya5YKFT2LGaMMA-IQ"
      type="text/javascript"></script>


#gmap_画布img{最大宽度:无!重要;背景:无!重要}
函数init_map(){
var myOptions={zoom:12,中间:new google.maps.LatLng(13.0649666,80.223283499998),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.2232834999998)});
infowindow=new google.maps.infowindow({内容:'Baal vattika
51B,第二街,Gill Nagar,Choolaimedu,钦奈,泰米尔纳德邦600094
600094钦奈
'); google.maps.event.addListener(标记,'click',function(){infowindow.open(映射,标记);}); infowindow.open(地图、标记);} google.maps.event.addDomListener(窗口'load',初始化映射);
链接页面适合我,但是…您应该更新您的代码(您仍然使用V2代码)尝试将其复制到另一台服务器。为什么不将其上载到另一台服务器?如果您愿意,版主可以随意删除此内容。
<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>