@Larry, um, thanks?

@Andrew, you got me going in the right direction. I hadn't noticed on
the Google Maps Ajax dynamic loading examples that they just used & in
the URL to load the Google JS script, & was indeed what was
causing the problem. Once I got that working I was able to use a
callback.

Once I got past that I was able to achieve what I was trying to do. My
goal was to ensure Google script invocations were only done once per
page - even if I called my function to write more than 1 map to a
single page.  So now my application has one function(with parameters
to configure the map) to write one or more maps to a page. And the
Google scripts are only loaded on pages that have a map, and they are
only loaded once regardless of how many maps are written to a page.

The working page is here:  http://www.myvrad.com/temp/googlemaps/g3.htm

Look at the page source for more details. I think it's a pretty cool
implementation.

- Bob


On May 22, 4:16 pm, Bob Archer <[email protected]> wrote:
> http://www.myvrad.com/temp/googlemaps/g1.htmhttp://www.myvrad.com/temp/googlemaps/g2.htm
>
> First link works, second produces error. Same key used on both pages.
>
> Second page produces js alert: "The Google Maps API server rejected
> your request. This could be because the API key used on this site was
> registered for a different site. You can generate a new key for this
> web site at %1$s.
>
> I'm trying to have all map related code returned by one function call.
> In my .Net application I have a Business Object in a User Control. The
> User Control could be used on any given page on the site.
>
> My goal is to be able to write a map to the page and call the map js
> libraries dynamically - which is what you see in the second pages code
> source. I don't want to include the map js libraries unnecessarily if
> a map isn't on the page.
>
> The code can write 1 or more map canvases to the page.
>
> Why doesn't this work? I'm finally asking after spending 2 days going
> through Google Groups, API docs and troubleshooting on my own.
>
> Thanks,
>
> - Bob
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Maps API" 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-API?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to