2013-07-24 61 views
0

我有一個使用Heroku的facebook應用程序,我使用它的谷歌地圖。谷歌地圖僅在Firefox瀏覽器中顯示。 Chrome瀏覽器不會顯示它!谷歌地圖只顯示在Firefox

我不明白爲什麼,我需要你的幫助!

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 

CHROME錯誤:

[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 
+0

檢查您的Javascript控制檯是否存在可能的錯誤。 –

+0

我在問題上添加了錯誤檢查 –

回答

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。

+0

非常感謝 –