Legend works in 4.4, but not in 4.6 and above

Ken Lord kenlord at GMAIL.COM
Mon Jul 3 16:15:17 EDT 2006


Hi Jason,

Your problem may have to do with how you have symbolized features on
your map, rather than with the HTML Legend template.

I had the same problem with my legends with the same symptoms,  with
mapserver 4.6, and 4.8 (i think 4.4 was affected too).

I think I went about a year with only 2 or 3 others reporting a
problem like this on the list, so it doesn't seem to affect everyone.

Check how you've symbolized layers with Line features, or layers that
have styles that specificly symbolize outlines of polygons in your map
layers.

If any are lines are symbolized using a cartoline symbol with
ANTIALIAS TRUE within the style object of that layer class mapserver
will crash in an unpredictable manner, usually not when the main page
and map are drawn, but when the HTML Legend is being produced.

Sometimes it will work, sometimes it won't. Sometimes it will report
one of those infamous CGI script header errors.  Hit refresh a few
times and you will probably see each variation.

I filed Bug report on this at least a year ago with more recent
updates, and brought it up when a major testing of the symbolization
system was announced in March of this year.

Test your system by removing (or # -ing out) all your map layers and
add them back one by one until it starts failing.

The documentation (last time i checked) does not say to avoid using
ANTIALIAS on cartoline symbols.

I it would be a great help if the gods above added a check in the code
to ignore ANTIALIAS in the case of cartoline symbols if it can't be
made to work properly.

Cheers,
Ken Lord
Vancouver BC

On 7/3/06, Steve Lime <Steve.Lime at dnr.state.mn.us> wrote:
> Can you post the legend output from each version?
>
> Steve
>
> >>> "Sievers, Jason" <jsievers at CO.LINN.OR.US> 7/3/2006 11:19:23 AM >>>
> I have an HTML legend template file that works wonderfully in MapServer 4.4
> and below.  However when using MapServer 4.6 and above my legend breaks.  I
> have thoroughly searched and tested for other possible problems but I have
> concluded that the problem must lie somewhere in MapServer.  Either
> MapServer 4.6 and above reads HTML Legend template files differently than
> older versions, or this is a bug in MapServer 4.6 and above.  MapServer 4.6
> and above handle the legend well when the mapfile contains a few layers.
> But when the number of layers gets large (~10-15), the legend file's code is
> never even entered.  The CGI legend tag in my HTML file is simply skipped.
> I have included my template file below.  I am fairly desperate so any
> thoughts are helpful.  I would like to move to MapServer 4.8 but need the
> legend to work first.  Thanks.
>
>
>
>
> [leg_layer_html order_metadata=orderby opt_flag=15]
>
>            [if name=display oper=isset]
>
>                        <SCRIPT type="text/javascript">
>
>                                    i03++;
>                                    sLayerOrClassName[i03] = "&lyr&" +
> "[leg_layer_name]";
>                                    sDisplayName[i03] = "[metadata
> name=display]";
>                                    iMinScale[i03] = "[metadata
> name=minscl]";
>                                    iMaxScale[i03] = "[metadata
> name=maxscl]";
>
>                        </SCRIPT>
>
>                        [if name=grp oper=isset]
>
>                                    <SCRIPT type="text/javascript">
>
>                                                sGrp[i03] = "[metadata
> name=grp]";
>
>                                    </SCRIPT>
>
>                        [/if]
>
>                        [if name=layer_type oper=neq value=3]
>
>                                    <SCRIPT type="text/javascript">
>
>                                                bLayerType3[i03] = false;
>
>                                    </SCRIPT>
>
>                        [/if]
>
>                        [if name=layer_type oper=eq value=3]
>
>                                    <SCRIPT type="text/javascript">
>
>                                                bLayerType3[i03] = true;
>
>                                    </script>
>
>                        [/if]
>
>                        [if name=layer_status oper=eq value=1]
>
>                                    <SCRIPT type="text/javascript">
>
>                                                bLayerOn[i03] = true;
>
>                                    </SCRIPT>
>
>                        [/if]
>
>                        [if name=href oper=isset]
>
>                                    <SCRIPT type="text/javascript">
>
>                                                sHref[i03] = "[metadata
> name=href]";
>
>                                    </SCRIPT>
>
>                        [/if]
>
>                        [if name=desc oper=isset]
>
>                                    <SCRIPT type="text/javascript">
>
>                                                sDesc[i03] = "[metadata
> name=desc]";
>
>                                    </SCRIPT>
>
>                        [/if]
>
>            [/if]
>
> [/leg_layer_html]
>
>
>
> [leg_class_html opt_flag=15]
>
>            [if name=display oper=isset]
>
>                        <SCRIPT type="text/javascript">
>
>                                    i03++;
>                                    sLayerOrClassName[i03] = "&cls&" +
> "[leg_class_name]";
>                                    sImageName[i03] = "[leg_icon width=20
> height=10]";
>
>                        </SCRIPT>
>
>            [/if]
>
> [/leg_class_html]
>
>
>
>
>
> Jason Sievers
> Linn County, Oregon
>



More information about the mapserver-users mailing list