Your code doesn't look like the code in this example:

http://code.google.com/apis/loader/#Dynamic

I think the problem is this function:

  function loadMaps() {
    var otherParams = {"other_params":"callback=mapsLoaded&sensor=false"};
    google.load("maps", "3", otherParams );
  }

With the callback option hidden inside otherParams, google.load() probably
does not realize that you need an asynchronous load - so it does a
document.write() which erases your document! Then you get document.body is
null and such.

Instead, change it to:

  function loadMaps() {
    google.load( 'maps', '3', {
      callback: mapsLoaded,
      other_params: 'sensor=false'
    });
  }

Also, you don't need an API key in your initial script tag that loads the
jsapi loader, unless you plan to start using the Earth API or another API
which needs a key. The V3 Maps API doesn't need one, so you can use:

<script type="text/javascript" src="http://www.google.com/jsapi";></script>

-Mike

On Mon, Jan 24, 2011 at 1:32 PM, kjh21 <[email protected]> wrote:

>
> No reasoning on my part other than trial and error at this point.
>
> Your question regarding my use of the onload attribute on the body tag
> rather than google.setOnLoadCallback seems to imply they serve the
> same purpose.
>
>
> The example I provided above (with the correct scoping of mapElement)
> can be found at
>
> http://threadtec.com/maps/v3_loader_test.html
>
> If you have problems accessing the URL it might be a DNS resolution
> issue that should resolve itself within 24hrs.
>
> I'm using FireFox 3.6.13. In that case, you'll need to open the Error
> Console to see exactly where in the process the loader fails.
>
>
> On Jan 24, 11:12 am, Chad Killingsworth
> <[email protected]> wrote:
> > Is there a reason you got rid of the google.setOnLoadCallback call in
> favor
> > of the onload attribute on the body tag?
> >
> > Also, if you'll actually post a link to your map, we might be able to
> offer
> > more help.
> >
> > Chad Killingsworth
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Maps JavaScript API v3" group.
> To post to this group, send email to
> [email protected].
> To unsubscribe from this group, send email to
> [email protected]<google-maps-js-api-v3%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/google-maps-js-api-v3?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps JavaScript API v3" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-maps-js-api-v3?hl=en.

Reply via email to