【问题标题】:Message: Invalid argument. Google maps消息:无效的参数。谷歌地图
【发布时间】:2011-09-12 18:06:23
【问题描述】:

正在尝试调试此 Google 地图错误。

适用于除 IE 之外的所有测试浏览器。有时标记会显示,有时不会。

http://www.ecompanies.nl/pilot/warenhuis/breda.html

网页错误详情 消息:无效的参数。 线路:27 字符:56 代码:0 网址:http://maps.gstatic.com/intl/nl_nl/mapfiles/api-3/5/6a/main.js

【问题讨论】:

  • 您是否仍有问题,或者该问题已在网站上解决?什么版本的 IE?
  • 你解决了这个问题吗?我有同样的问题。

标签: jquery google-maps google-maps-api-3


【解决方案1】:

我遇到了这个问题,对我来说,结果证明它与 document.ready() 上的 jquery ajax 调用发生冲突。值得注意的细节:

  • 包含上面引用的这个 gstatic 文件
  • 包括 jquery 1.6.4,在 noConflict() 模式下
  • 包括 jquery UI 1.8.14
  • 在 document.ready() 上执行 ajax 调用以填充 div(购物车小部件、多少商品、多少等)

为了解决,我最终得到了这样的结果:

// wrap ajax call in a function, then figure out if we execute it now, or delay.
var f = function(){
  $.getJSON('/ajax_handler/', function(data){/* do stuff */});
}
// check if google code is present (not sure how robust this is)
if(window['google']){ // We've got some Google, delay ajax call by 5s.
  setTimeout(f, 5000); // this was the lowest i could safely go, unfortunately.
} else { // No Google, do the ajax call immediately
  f();
}

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-07-04
    • 1970-01-01
    • 1970-01-01
    • 2015-03-03
    • 1970-01-01
    相关资源
    最近更新 更多