Legend works in 4.4, but not in 4.6 and above

Steve Lime Steve.Lime at DNR.STATE.MN.US
Mon Jul 3 11:17:28 PDT 2006


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