[ka-Map-users] RE: kaLegend image size problem...

Nickolas Simard nsimard at madie.ca
Tue Sep 18 11:12:07 EDT 2007


Hi everyone

First, thanks to Gabriele for the pointer on the “after-load image resizing”
trick. We manage to make it work, though some bugs occurred.

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.

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.

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).

If anyone need the base code provided by Gabriele, see
http://lists.maptools.org/pipermail/ka-map-users/2007-July/003054.html .

You might as well add a similar piece of code when the legend is first
generating, near line 450 of kaLegend.js.

Here’s the code I used


         call('legend_dim.php?map=' + this.kaMap.currentMap + '&scale=' +
this.kaMap.getCurrentScale() + '&g=' + oLayer.name, this , evalFromPhp);

That’s it for the image size bug.

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.

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 . 

So thanks again.

 

Nickolas Simard
Programmeur

madie solution publicité
418 548-5556 poste 45  .  1 866 776-0007 
2655, boul. du Royaume, Bureau 600
Jonquière (Québec) G7S 4S9
www.madie.ca

 

-----Message d'origine-----
De : Gabriele B [mailto:gabbag981 at hotmail.com] 
Envoyé : 18 septembre 2007 05:07
À : nsimard at madie.ca
Cc : ka-map-users at lists.maptools.org
Objet : kaLegend image size problem...

 

Hi Nickolas

 

I already had this problem... See the thread named kaLegend bug fixed in the


archives of july 2007.

 

However seems that the problems occurs when you use MAXSCALE/MINSCALE 

properties....

 

Hope this helps..

 

Gabriele B

 

_________________________________________________________________

Se hai fatto un bel viaggio raccontalo sul nuovo Diari di viaggio 

http://diaridiviaggio.it.msn.com/

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maptools.org/pipermail/ka-map-users/attachments/20070918/de8cd40e/attachment.html


More information about the ka-Map-users mailing list