<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Verdana;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Geneva;
        panose-1:2 11 5 3 3 4 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.MsoPlainText, li.MsoPlainText, div.MsoPlainText
        {mso-style-priority:99;
        mso-style-link:"Texte brut Car";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Verdana","sans-serif";}
span.TextebrutCar
        {mso-style-name:"Texte brut Car";
        mso-style-priority:99;
        mso-style-link:"Texte brut";
        font-family:"Verdana","sans-serif";}
.MsoChpDefault
        {mso-style-type:export-only;}
@page Section1
        {size:612.0pt 792.0pt;
        margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang=FR-CA link=blue vlink=purple>
<div class=Section1>
<p class=MsoPlainText><span lang=EN-US>Hi everyone<br>
<br>
First, thanks to Gabriele for the pointer on the “after-load image
resizing” trick. We manage to make it work, though some bugs occurred.<br>
<br>
Since ka-Map! Main development language is English, support for non-english characters
is null. That produced some bug on the xhr.js file when using the call
function, as well as the utf-8 encode added to the url-encoding on the
legend_dim.php.<br>
<br>
To make a short story, the legend.php would first create the image, the
javascript would then call the legend_dim.php to resize them. Since on my
mapfile, the group and layer name contains spaces and acute characters (such as
é), the legend_dim would receive url-encoded string, that, once decoded, would
be in utf-8… losing my real layer name.<br>
<br>
To prevent that, we edited xhr.js to use POST methods when send 3 and more
parameters to prevent url-encoding as well as specified a charset for its
header (on setRequestHeader). We also converted utf-8 string into iso-8859-1
(using PHP’s iconv).<br>
<br>
If anyone need the base code provided by Gabriele, see <a
href="http://lists.maptools.org/pipermail/ka-map-users/2007-July/003054.html">http://lists.maptools.org/pipermail/ka-map-users/2007-July/003054.html</a>
.<o:p></o:p></span></p>
<p class=MsoPlainText><span lang=EN-US>You might as well add a similar piece of
code when the legend is first generating, near line 450 of kaLegend.js.<o:p></o:p></span></p>
<p class=MsoPlainText><span lang=EN-US>Here’s the code I used…<o:p></o:p></span></p>
<p class=MsoPlainText><span lang=EN-US> call('legend_dim.php?map=' +
this.kaMap.currentMap + '&scale=' + this.kaMap.getCurrentScale() +
'&g=' + oLayer.name, this , evalFromPhp);<br>
<br>
That’s it for the image size bug.<br>
<br>
Also, as Gabriele pointed out, $oMap->drawLegend method does not take account
of the MAXSCALE/MINSCALE properties of the CLASS inside the layer. It does seem
to accept the layers one though. I guess that is a bug that will/should
hopefully be fixed.<br>
<br>
I shall also review the script to check for “code injection/ajax abuse”,
since there is an eval used… It seem obvious to me that not much input
validation is made on ka-Map!, eventhough not much is to be inputted :D . <br>
<br>
So thanks again.</span><o:p></o:p></p>
<p class=MsoPlainText><span lang=EN-US><o:p> </o:p></span></p>
<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><b><span
style='font-size:13.5pt;font-family:"Geneva","sans-serif"'>Nickolas Simard</span></b><span
style='font-size:12.0pt;font-family:"Times New Roman","serif"'><br>
</span><span style='font-size:10.0pt;font-family:"Geneva","sans-serif"'>Programmeur</span><span
style='font-size:12.0pt;font-family:"Times New Roman","serif"'><br>
<br>
</span><b><span style='font-size:13.5pt;font-family:"Verdana","sans-serif";
color:#9EA4A4'>madie</span></b><b><span style='font-size:13.5pt;font-family:
"Verdana","sans-serif";color:#FFAE31'> solution publicité</span></b><span
style='font-size:12.0pt;font-family:"Times New Roman","serif"'><br>
</span><span style='font-size:10.0pt;font-family:"Verdana","sans-serif"'>418 548-5556 poste 45 . 1 866 776-0007</span><span
style='font-size:7.5pt;font-family:"Verdana","sans-serif";color:#9EA4A4'> <br>
</span><span style='font-size:10.0pt;font-family:"Verdana","sans-serif";
color:#666666'>2655, boul. du Royaume, Bureau 600<br>
Jonquière (Québec) G7S 4S9<br>
</span><b><span style='font-size:10.0pt;font-family:"Verdana","sans-serif";
color:#666666'>www.madie.ca</span></b><span style='font-size:12.0pt;font-family:
"Times New Roman","serif"'><o:p></o:p></span></p>
<p class=MsoPlainText><o:p> </o:p></p>
<p class=MsoPlainText><span lang=FR>-----Message d'origine-----<br>
De : Gabriele B [mailto:gabbag981@hotmail.com] <br>
Envoyé : 18 septembre 2007 05:07<br>
À : nsimard@madie.ca<br>
Cc : ka-map-users@lists.maptools.org<br>
Objet : kaLegend image size problem...</span><o:p></o:p></p>
<p class=MsoPlainText><o:p> </o:p></p>
<p class=MsoPlainText>Hi Nickolas<o:p></o:p></p>
<p class=MsoPlainText><o:p> </o:p></p>
<p class=MsoPlainText>I already had this problem... See the thread named
kaLegend bug fixed in the <o:p></o:p></p>
<p class=MsoPlainText>archives of july 2007.<o:p></o:p></p>
<p class=MsoPlainText><o:p> </o:p></p>
<p class=MsoPlainText>However seems that the problems occurs when you use
MAXSCALE/MINSCALE <o:p></o:p></p>
<p class=MsoPlainText>properties....<o:p></o:p></p>
<p class=MsoPlainText><o:p> </o:p></p>
<p class=MsoPlainText>Hope this helps..<o:p></o:p></p>
<p class=MsoPlainText><o:p> </o:p></p>
<p class=MsoPlainText>Gabriele B<o:p></o:p></p>
<p class=MsoPlainText><o:p> </o:p></p>
<p class=MsoPlainText>_________________________________________________________________<o:p></o:p></p>
<p class=MsoPlainText>Se hai fatto un bel viaggio raccontalo sul nuovo Diari di
viaggio <o:p></o:p></p>
<p class=MsoPlainText>http://diaridiviaggio.it.msn.com/<o:p></o:p></p>
<p class=MsoPlainText><o:p> </o:p></p>
</div>
</body>
</html>