Sorry to be raising this from the dead, but 1) It still comes up as an 'answer' to this problem and 2) I've found a better solution.
There is an optional 3rd argument on the google.load
function that takes an object of configuration options. One of the options is callback
. It also gets rid of the need for a separate setOnLoadCallback
call.
E.g.
google.load('visualization', '1.0', {
'packages': "charttype",
'callback': $jQ.proxy(me.setupChart, me)
});
So:
<script src="https://www.google.com/jsapi"></script>
<script>
$(document).ready(function () {
function mapsLoaded() {
etc etc etc
}
google.load("maps", "2", {"callback" : mapsLoaded});
});
</script>
See:
https://developers.google.com/loader/#Dynamic