I've faced the same problem recently and fixed it by redrawing the
infowindow once the image loads.
(Actually i'm using Mike's ELabel not the infowindow but the technique
is the same).
Your page is XHTML and the onload attribute for IMG elements is not
valid in XHTML so you'd need to add the onload event using javascript
btw.
I'd suggest you wrap your infowindow contents in a DIV element with an
id and then open your infowindow.
Use myDiv.getElementsByTagName('img') to get a node list of all IMG
elements within the infowindow and loop through them adding an onload
event listener to each image.
The onload event listener can then set width and height attributes for
any IMG elements once the image has been retrieved from the server and
redraw the infowindow.
Watch the redraw process doesn't go into an infinite loop - only add
the onload event listener to an IMG element the first time it is
displayed.
I'd rather not post a link to my (currently being developed) map on
the group so if you'd like to see the code i've used then send me an
email.
Martin.
On 26 Oct, 22:16, Papa Bear <[email protected]> wrote:
> I have a map with a fair number of markers, each with a bit of
> information that gets displayed in the infoWindow. The markers
> represent boundary monuments on the US - Canadian border. Here's the
> map:
>
> http://members.bellatlantic.net/~vze2h6gy/papabear/BM_Station_GMap.ht...
>
> Some of the markers (about 20 out of the total of several hundred)
> also display a thumb nail photo. These are the ones I have actually
> visited,
>
> The map is generated client-side and it's all vanilla java script.
> The data is in a separate .js file and consists of several arrays of
> objects. Although I am still tinkering with the code, functionally it
> basically works, (although like many others it was written and
> debugged using Firefox, so I haven't checked every last little feature
> under IE).
>
> The problem: all the verbal content comes from the server where my map
> comes from, so it is generally all resident on the client's PC once
> the thing gets loaded. The photos, however, come from another server
> and they are generally only pulled down when the info Window is
> created. They are specified using html <img ...> tags. Most times
> things work fine, but a noticeable fraction of the time the text will
> appear and the infoWindow will be brought up before the photo
> arrives. When it does arrive, it gets put where it belongs, but more
> often than not, it will go outside the bounds of the infoWindow.
>
> I have a general idea how large the thumbnails with be, but a goodly
> number have an odd aspect ratio which I can't predict in advance, so I
> can't just pre allocate the right
> amount of space in the <div ...> that holds the <img ...>.
>
> I can do an updateInfoWindow(), and that indeed works, but I don't
> know when to do it. If I wait say 250 msec and call it, it may be too
> soon or too late. And when I do it too far out, I get an annoying
> flicker.
>
> Any suggestions? Any one know a way to tell when the photo gets
> loaded? Is there some Dom event for that? How do fancy professional
> sites handle this sort of thing?
>
> If you want to see the affect, try clicking on the markers with these
> names of the map:
> Hereford
> Beecher Tablet
> Hill Tablet
> Metallak
> Pros (which is hiding behind Spect)
> the unlabeled marker on the upper right end of the border
> the unlabeled marker on the lower left end of the border
> the unlabeled marker at the upper left, where the green markers start.
>
> I you have fast service to my photo server, maybe you won't see the
> problem. For me it's about 50 / 50.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---