2013-10-16 18 views
1

我們的網站上的所有頁面(大約40個)使用Google地圖時出現嚴重問題。對不起,我們沒有圖像可用&Google搜索機器人

谷歌搜索機器人索引「對不起,我們沒有任何可用的圖像」,爲我們的頁面,即它實際上認爲這就是我們的內容(在網站管理員工具我們的首要內容的關鍵詞之一是「對不起」

我們已經做了。大量的試驗和谷歌總是映射加載我們,所以真的不知道是什麼問題

我們使用鏈接到我們的HTML一個獨立的js文件

的JS的一個例子是:

var map = null; 
function initialize() { 
    var myOptions = { 
    zoom: 10, 
    center: new google.maps.LatLng(53.5, -1.78), 
    mapTypeControl: false, 
    mapTypeControlOptions: {style: google.maps.MapTypeControlStyle.DROPDOWN_MENU}, 
    navigationControl: true, 
    disableDefaultUI: true, 
    mapTypeId: google.maps.MapTypeId.TERRAIN 

    } 
    map = new google.maps.Map(document.getElementById("map_canvas"), 
           myOptions); 

    google.maps.event.addListener(map, 'click', function() { 
     infowindow.close(); 
     }); 


// Add marker to the map 

    var point = new google.maps.LatLng(53.34932, -1.56504); 
     var marker = createMarker(point,'1. Blacka Moor<br>An excursion onto the Moors west of Sheffield and making the most of the fine riding in the area - a bona fide Peak District Mountain Biking Classic.<br>Route Grade: medium. Distance: 16.5km') 


} 

var infowindow = new google.maps.InfoWindow({ 
     size: new google.maps.Size(150, 50), 
     maxWidth: 300 
    }); 

function createMarker(latlng, html) { 
    var contentString = html; 
    var marker = new google.maps.Marker({ 
     position: latlng, 
     map: map, 
     zIndex: Math.round(latlng.lat()*-100000)<<5 
     }); 

    google.maps.event.addListener(marker, 'click', function() { 
     infowindow.setContent(contentString); 
     infowindow.open(map,marker); 
     }); 
} 

,並在我們的HTML頭,我們有:

<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script> 
<style type="text/css"> 
html, body { height: 100%; } 
</style> 

<script type="text/javascript" src="assets/googlemapscripts/darkpeakscript.js"></script> 

<script type="text/javascript"> 
    window.onload = function() { 
     initialize(); 
    } 
</script> 

,並在體內

<div id="map_canvas" style="width: 630px; height: 450px; font-family: 'Trebuchet MS', Arial, Helvetica, sans-serif; font-size: 0.8em;"></div> 

感謝 豐富

+0

你見過這個嗎? - > http://webmasters.stackexchange.com/questions/53323/google-bot-sees-sorry-we-have-no-imagery-here-on-pages-with-google-maps – davidkonrad

回答

1

我的假設是,Google不會對全面評估所有代碼頁面上,但也會使用啓發式。基於這個假設,我做了以下工作:

  1. 用「隨機」ID(對於地圖)和style =「display:none;」創建一個div。

  2. 創建一個有一個img標籤使用相同的「隨機」 ID和非腳本標記(我用一個靜態地圖圖像作爲後備這裏)

  3. 創建(自定義)JavaScript函數這裏獨特的ID必須被傳遞來初始化你的地圖並切換地圖元素上的顯示。

到目前爲止,沒有任何地圖「抱歉,我們沒有圖像」被索引。

相關問題