Google地圖打不開的解決辦法,Google地圖解決辦法

來源:互聯網
上載者:User

Google地圖打不開的解決辦法,Google地圖解決辦法

Google地圖被中國防火牆封殺,所以不用直接引用http://maps.googleapis.com/maps/api/js?sensor=false&language=en這網域名稱下的Google地圖api,而是改為http://maps.google.cn/maps/api/js?sensor=false這個地址,google.cn在國內的網域名稱沒有被封殺,可以使用。

注意:google.cn雖然可以使用,但是會輸出部分js引用到google.com的資源,導致地圖呈現會延時,所以不要將Google地圖api放到你的內容前面,如head標籤裡面,而是放到內容或者html結束標籤最後,防止你的頁面內容一直是空白,瀏覽器無法顯示內容。

也不要用window.onload事件來繪製,要不Google地圖顯示不及時,因為要載入google.com的資源,而google.com資源被攔截,會導致知道請求逾時(大概2分鐘)才會繪製出Google地圖。

使用Google的回調參數來傳遞一個回呼函數名稱,經測試這樣比使用window.onload事件快呈現出Google地圖。

範例程式碼:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>網站引用Google地圖打不開解決辦法:使用google.cn</title></head><body><div id="map_canvas" class="map" style="height: 350px;width: 500px;"></div></body><script type="text/javascript" src="http://maps.google.cn/maps/api/js?sensor=false&callback=renderGoogleMap"></script><script type="text/javascript">  function renderGoogleMap() {    var geocoder = new google.maps.Geocoder();    geocoder.geocode({ 'address': '廣西桂林市中心廣場' }, function (results, status) {      if (status == google.maps.GeocoderStatus.OK) {        map.setCenter(results[0].geometry.location);      } else {        alert("Geocode was not successful for the following reason: " + status);      }    });    var mapOptions = {      zoom: 17,      mapTypeId: google.maps.MapTypeId.ROADMAP    };    var map = new google.maps.Map(document.getElementById("map_canvas"), mapOptions);  }</script></body></html>


Google地圖怎開不了了一開啟就是錯誤什的 我下好多了都是這樣的

退出來後再登入就可以了
 
Google地球開不了怎辦最新解決辦法

你可以把 203.208.46.30 kh.google.com 複製到以“開始”----“運行”裡-----(可複製粘貼)輸入:
\WINDOWS\system32\drivers\etc
以記事本開啟的 hosts ”檔案名稱下。也可以直接到C盤裡找到。
《網上說的直接加入203.208.46.30 kh.google.com有可能加不上去》

然後再把裡邊的內容全部複製,在別的檔案夾了建一個文字文件就名字改成hosts.txt

然後開啟,然後把你前邊複製的內容粘貼到裡邊,然後儲存。

之後把檔案名稱 hosts.txt 改成 hosts,就是去掉了.txt

然後刪掉原始 hosts 這個檔案,把你現在產生的檔案放裡邊

退出之後再開啟Google地圖,看看是不是進去了!
 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.