【发布时间】:2020-05-21 05:30:28
【问题描述】:
在应用中,我们使用谷歌地图为不同国家的用户提供服务。
主要代码...
/// It works until February 4, 2020, but now it can't load the map correctly.
/// I haven't made any changes...
///
MapManager.loadGMapAPIScript = function(){
var script = doc.createElement("script");
script.id = "map_api_script";
script.type = "text/javascript";
script.src = "http://maps.google.cn/maps/api/js?sensor=false&v=3.40&key="my-googlemap-key-here"&callback=initialize_";
script.defer = "true";
script.async = "true";
if(MapLanguage.language){
script.src += "&language=" + MapLanguage.language;
}
doc.body.appendChild(script);
};
控制台错误日志:“net::ERR_ABORTED 503(服务不可用)”
- “maps.google.cn”好像无法访问了?
- "maps.googleapis.com" 有效,但在中国没有 VPN 就无法访问。
问:在没有VPN的情况下,如何在中国和其他地区继续使用GoogleMap-JS?
【问题讨论】:
-
什么不起作用?与昨天相比有什么变化?您在 javascript 控制台中遇到什么错误?您使用的是什么确切 API URL?您是否使用有效的 API 密钥?等等等等等等。
-
您能帮我重新打开这个问题吗?谢谢~
-
有人(你?)举报了this issue。如果不是你,你也应该报告你的。
-
Google 回答:自 2020 年 2 月 3 日起,Google Maps Platform API 将不再托管在 google.cn 域中。这样,所有从 google.cn 域加载 Google Maps Platform API 的请求都将返回一个错误。
-
@xomena 非常感谢。所以...对我来说没有比更改地图或使用 VPN 更好的方法了吗?