Mike,
Your explanation of the behavior as well as resolution were right on.
All this arises in the context of migrating an application from Maps
v2 to Maps v3 and, in the course,
generally reworking things to employ more recent practices.
I still have some questions regarding loading multiple API's.
The loader documentation that appears here
http://code.google.com/apis/loader/#intro
cites the following example
<script type="text/javascript">
google.load("search", "1");
google.load("jquery", "1.4.2");
google.load("jqueryui", "1.7.2");
</script>
and states
"After you call google.load, you can use all of the loaded modules in
your web page."
That seems ambiguous since there are three separate calls to
google.load( );
Does the absence of a callback cause the load(s) to happen
synchronously?
I want to ensure first that the page/DOM is loaded and then all API's
before executing any application level code
so having the loads happen synchronously and in series is fine.
I am not so much concerned about using asynchronous behavior intended,
presumably, to better manage load-time latencies.
On Jan 24, 4:55 pm, Michael Geary <
m...@mg.to> wrote:
> 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
>
> >
google-maps-js-a...@googlegroups.com<
google-maps-js-api-v3%2Bunsu...@googlegroups.com>
> > .