0

我有一个使用 Heroku 的 Facebook 应用程序,我使用谷歌地图。谷歌地图仅在 Firefox 浏览器中显示。Chrome 一个 IE 就不会显示了!

我不明白为什么,我需要你的帮助!

https://apps.facebook.com/sectorsase/

<!DOCTYPE html>
<html>
<head>
<script type='text/javascript' src='http://maps.google.com/maps/api/js?sensor=false'></script>


<script>
function initialize()
{

var IPos=new google.maps.LatLng(4.256,4.568);
var mapProp = {
  center:new google.maps.LatLng(44.438683,26.027269),
  zoom:13,
  disableDefaultUI:true,
  draggable: false, 
  zoomControl: false, 
  scrollwheel: false, 
  disableDoubleClickZoom: true,
  mapTypeId:google.maps.MapTypeId.ROADMAP
  };
var map=new google.maps.Map(document.getElementById('googleMap'),mapProp);

var marker=new google.maps.Marker({
  position:IPos,
  icon:'icn.png'

  });
 var myCity = new google.maps.Circle({
  center:IPos,
  radius:3,
  strokeColor:'#0000FF',
  strokeOpacity:0.8,
  strokeWeight:2,
  fillColor:'#0000FF',
  fillOpacity:0.4
  });

  myCity.setMap(map); 
  marker.setMap(map);
}

google.maps.event.addDomListener(window, 'load', initialize);
google.maps.event.trigger(map, 'resize');
</script>
</head>

<body>
<center><div id='googleMap' style='width:500px;height:380px;'></div></center>

</body>
</html>

IE 错误:

SEC7111: HTTPS security is compromised by http://maps.google.com/maps/api/js?sensor=false 
map.php
SCRIPT1002: Syntax error 
map.php, line 17 character 33

铬错误:

[blocked] The page at https://quiet-everglades-2697.herokuapp.com/map.php ran insecure content from http://maps.google.com/maps/api/js?sensor=false.  map.php:1 Uncaught ReferenceError: google is not defined map.php:49
4

1 回答 1

4

根据您提供的错误,我将假设您正在查看的页面是 HTTPS。您正在从非 HTTPS 源加载 Google Maps API。只需将script标签更改为https://maps.google.com/maps/api/js?sensor=false. 或者更好//maps.google.com/maps/api/js?sensor=false的是它会自动为您填写 http 或 https。

于 2013-07-24T13:42:27.293 回答