<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1400" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Bart,</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I actually noticed this problem happening with
other images as well (e.g. buttons, legend images, etc, after a submit). They
just show up as broken images. And that was on a dial-up connection. I don't
think it's anything wrong with the chameleon code, but rather something with how
apache interacts with PHP. Chameleon probably pushes that to its limits. The
fact that it is so hard to reproduce when you want it to happen makes it
annoying to debug. What hardware do you run? I have it happening on a P4 2.8GHz,
win2k, Apache 2.0.48.</FONT></DIV>
<DIV><FONT face=Arial size=2>By the way, the file I sent you
(MapDHTMLWidget.widget.php.forCWC1.0.4) has an extra <<<EOT on
line 998, which must be removed.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I think the best fix would be if every image in
chameleon (legend, button, mapimage, etc.) had an 'onError' attribute, which
would invoke a function that reloads that image after a delay. I have tried to
find out whether there is a function to check whether an image loaded
successfully (e.g. by checking filesize), but I couldn't find one.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>BTW Bart, I am Dutch. Moved to Australia 4.5
years ago.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>regards,</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Jacob</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>-----Original Message-----<BR>From: <A
href="mailto:chameleon-bounces@lists.maptools.org">chameleon-bounces@lists.maptools.org</A>
[mailto:chameleon-bounces@lists.maptools.org] On Behalf Of <A
href="mailto:bartvde@xs4all.nl">bartvde@xs4all.nl</A><BR>Sent: 27 August 2004
16:38<BR>To: <A
href="mailto:chameleon@lists.maptools.org">chameleon@lists.maptools.org</A><BR>Subject:
RE: [Chameleon] mapDHTMLwidget occassionally fails</FONT></DIV>
<DIV> </DIV><FONT face=Arial size=2>
<DIV><BR>Hi Jacob,</DIV>
<DIV> </DIV>
<DIV>thanks. I'll give your fix a try.</DIV>
<DIV> </DIV>
<DIV>Paul, since more people are experiencing these problems, has the cause
of<BR>this problem been identified and will it be fixed in the next
Chameleon?<BR>Will this change the way the Chameleon map load now works?</DIV>
<DIV> </DIV>
<DIV>BTW Jacob: did you write the Dutch with an automatic translator, or
you<BR>actually speak it?</DIV>
<DIV> </DIV>
<DIV>Best regards,<BR>Bart</DIV>
<DIV> </DIV>
<DIV>><BR>> Hi Bart,<BR>><BR>> It's not really a fix, more like a
cover-up. I did it for the 1.0.4<BR>> version,<BR>> but just now I managed
to get a similar solution working for 1.99.<BR>><BR>> For 1.99, in
mapDHTMLwidget.js, add the following code at the end:<BR>><BR>>
--------------------------------------<BR>> var backupURL = "";<BR>>
function imageErrorOccurred (mapurl)<BR>>
{<BR>> //alert (mapurl);<BR>>
document.images["MapLayerDivImg"].src =<BR>>
document.images["mapimage"].src;<BR>> backupURL =
mapurl;<BR>>
setTimeout("reloadImage()",500);<BR>> }<BR>><BR>>
function reloadImage()<BR>> {<BR>>
document.images['MapLayerDivImg'].src = backupURL;<BR>>
}<BR>> ------------------------------------------<BR>><BR>> Then place
the following attribute in your MapLayerDivImg definition:<BR>><BR>>
onError=\"imageErrorOccurred(gMapDHTMLURL)\"<BR>><BR>><BR>> What it
does: when the image breaks, it immediately replaces the image<BR>> source
with that of the empty white pixel (to prevent the user from seeing<BR>>
a<BR>> broken image), and after a small delay it loads the correct url into
the<BR>> image. It works for me.<BR>><BR>> It's a slightly different
implementation in version 1.0.4 (you'd have to<BR>> modify
mapDHTMLimage.widget.php). I'm not sure which one you're after, so<BR>> I'll
attach both files. Use the JS for 1.99, the php for 1.0.4.<BR>><BR>>
regards,<BR>><BR>> Jacob<BR>><BR>><BR>> P.S. Sorry voor de
onmeundig lelijke PHP code. Geen idee wa'k doe in die<BR>> taal. (Forgive me
my ugly PHP coding. Have been too lazy to look for good<BR>>
tutorial.)<BR>><BR>><BR>><BR>><BR>><BR>><BR>><BR>><BR>><BR>><BR>><BR>><BR>></DIV>
<DIV> </DIV>
<DIV>_______________________________________________<BR>Chameleon mailing
list<BR><A
href="mailto:Chameleon@lists.maptools.org">Chameleon@lists.maptools.org</A><BR><A
href="http://lists.maptools.org/mailman/listinfo/chameleon">http://lists.maptools.org/mailman/listinfo/chameleon</A><BR></FONT></DIV></BODY></HTML>