我正在使用网站http://www.houston.ind.br/api/map/map1/rota.htm作为开发类似内容的示例。当我使用firefox从我的本地文件系统运行该东西时,事情变得正常但是当我将页面(我的或上面提到的那个)上传到服务器时它不再有效。我尝试用我用google api获得的谷歌键代替,但这没有任何区别。
我查看了已启用的API以获取我的密钥,几乎所有内容都无法使用。
知道发生了什么事吗?我需要其他类型的谷歌密钥吗?
答案 0 :(得分:0)
我能够通过在下一行中将http更改为https来使其工作
<script src=" https://maps.google.com/?file=api&v=2.x&key=ABQIAAAAA9cb-iZ2XyrDiJe40QcIixSYNaUY3kVpdSwiLlIjooxsqEAfDxQTzxBRZuWS5Ya5YKFT2LGaMMA-IQ"
type="text/javascript"></script>
答案 1 :(得分:-1)
<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>