【发布时间】:2012-04-18 02:43:07
【问题描述】:
嘿伙计们,当我加载我的网页时,谷歌地图开始加载,但是它没有完全加载。这是控制台打印出来的:
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。有人可以引导我朝着正确的方向前进。谢谢。
【问题讨论】:
-
MIME 类型错误不相关。每张地图都这样做,它们来自谷歌,你无法改变这种行为。您的标题需要与 您 所服务的任何内容相关。有链接的机会吗?
-
谢谢安德鲁。不幸的是我没有链接。我现在在本地开发。我也发现了我的错误。我正在这样做:新 google.maps.LatLng(-103.6975488, 36.8813329);然而,正确的写法是这样的:new google.maps.LatLng(36.8813329,-103.6975488);
-
很好:-)。请写一个答案(所以它被标记为已回答)或删除问题(因为它都不相关!)
标签: php google-maps-api-3 content-type