Mark,

There's a slight issue with your javascript. It will only work if the
'resource' that it trying to be loaded is in an info balloon. My main
usage is adding overlays to the map.

Is there an event that would catch this?

On Oct 23, 10:06 am, Mark <[EMAIL PROTECTED]> wrote:
> Barry, thanks for pointing out the known issue - I've starred it so
> lets hope it gets fixed soon.
>
> epoch, a servlet to do the redirect seems the most sensible solution
> glad to hear it works easily.
>
> For those of us who can't rely on a server side solution though I've
> figured out a simple Javascript solution. Once you have created your
> map object (in a variable called map I would assume) simple add the
> following javascript
>
> GEvent.addListener(map, "infowindowopen", function()
> {
>         var balloon = document.getElementById("iw_kml");
>
>         if (balloon != null)
>         {
>                 var imgs = balloon.getElementsByTagName("img");
>
>                 for (var i = 0 ; i < imgs.length ; ++i)
>                 {
>                         var index = imgs[i].src.indexOf("/mapsatt");
>
>                         if (index != -1)
>                         {
>                                 imgs[i].src = "http://maps.google.com"; +
> imgs[i].src.substr(index);
>                         }
>                 }
>         }
>
> });
>
> Basically this listens for the info window (aka balloon) being opened
> and then grabs the div in which the content is placed (it has an id of
> iw_kml which hopefully won't change anytime soon) and then looks for
> all images and fixes the src attribute if needed.
>
> Hope that helps,
>
> Mark
--~--~---------~--~----~------------~-------~--~----~
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