2012-04-18 152 views
2

嘿傢伙,當我加載我的網頁谷歌地圖開始加載,但它沒有完全加載。這是什麼控制檯打印出來:谷歌地圖圖像未加載

Resource interpreted as Image but transferred with MIME type text/html: "http://maps.googleapis.com/maps/gen_204?ev=api_viewport&cad=src:apiv3". 
Resource interpreted as Image but transferred with MIME type text/html: "http://maps.googleapis.com/maps/gen_204?ev=api_ads&cad=src:apiv3,ads:0". 
Resource interpreted as Image but transferred with MIME type text/html: "http://maps.googleapis.com/maps/gen_204?ev=api_marker&cad=src:apiv3,m:2,d:0,s:0". 

我知道它與內容類型有關,但我不知道如何設置它。我把這兩個元標籤放在我的標題中,但沒有運氣。

<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />

<meta http-equiv="content-type" content="text/html"; charset=utf-8">

我也將這個標籤在我的文件的頂部嘗試另一種方式:

<?php // header('Content-Type: application/x-javascript; charset=UTF-8'); ?>

但這並沒有幫助。

我正在使用PHP和MYSQL。有人能帶領我走向正確的方向嗎?謝謝。

+2

MIME類型錯誤不相關。每張地圖都是這樣做的,他們來自谷歌,沒有什麼可以改變這種行爲。您的標題需要與您提供的任何*相關。任何鏈接的機會? – 2012-04-18 07:26:36

+0

謝謝安德魯。不幸的是我沒有鏈接。我目前正在本地開發。我也想出了我的錯誤。我正在這樣做:new google.maps.LatLng(-103.6975488,36.8813329);然而,編寫這個的正確方法是這樣的:new google.maps.LatLng(36.8813329,-103.6975488); – cclerville 2012-04-18 12:45:09

+0

好的:-)。請寫一個答案(因此被標記爲已回答)或刪除問題(因爲它們都不相關!) – 2012-04-18 12:47:00

回答

1

我想出了爲什麼我的地圖沒有完全加載。我用這個來獲得一個位置:

new google.maps.LatLng(-103.6975488, 36.8813329);

但我需要做的是:

new google.maps.LatLng(36.8813329, -103.6975488);

感謝安德魯指出,MIME類型錯誤並不revelant。

+0

Arg和Google地圖仍然沒有顯示任何錯誤,只是空白的地圖,很難調試。 – 2014-11-03 21:55:25