quokka
quokka

Reputation: 313

Message: Invalid argument. Google maps

Trying to debug this Google maps error.

Works in all tested browsers except IE. Sometimes markers show, sometimes they won't.

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

Webpage error details Message: Invalid argument. Line: 27 Char: 56 Code: 0 URI: http://maps.gstatic.com/intl/nl_nl/mapfiles/api-3/5/6a/main.js

Upvotes: 1

Views: 749

Answers (1)

YellowShark
YellowShark

Reputation: 2269

I had this problem, and for me, it turned out to be a conflict with a jquery ajax call on document.ready(). notable details:

  • was including this gstatic file ref'd above
  • was including jquery 1.6.4, in noConflict() mode
  • was including jquery UI 1.8.14
  • was executing an ajax call to populate a div (a cart widget, how many items, how much etc.), on document.ready()

to solve, i ended up with something like this:

// 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();
}

Upvotes: 1

Related Questions