[fusion-users] MapServer Legend Icons

Paul Spencer pspencer at dmsolutions.ca
Mon Oct 26 11:29:53 EDT 2009


Hi Tim,

The legend icon stuff is working in another project that Paul  
Deschamps is working on, he has multiple map files and a menu for  
changing between them.  The legend does appear to update correctly  
when changing maps.

The way it *should* work is that LoadMap.php populates a session  
variable 'scale_ranges' with an array of each scale range of each  
class of each layer.  LoadScaleRanges.php uses this array to get the  
class for each scale range and draw the icon at the appropriate scale  
for that class and then combines them all into a single image, and  
returns a set of CSS offset values for use by the legend - so each  
scale range has the same image source but different offsets.

I suspect what is going wrong is that the scale_ranges array is  
somehow the wrong one.  We need to know what sequence is causing  
this.  Is LoadScaleRanges being called before LoadMap finishes?  Or  
are you programmatically changing maps while loading them or between  
loading and calling LoadScaleRanges?

Cheers

Paul


On 2009-10-26, at 10:38 AM, Nolte, Tim wrote:

> Last week I had posted about a problem with my legend icons not  
> showing
> up. I have multiple MapServer mapfiles defined. I'm not sure if the
> problem I'm having is solely related to having multiple mapfiles or  
> that
> I recently updated to the latest Fusion trunk. I can say that the
> problem with the legend icons is because of an error in
> layers\MapServer\php\LoadScaleRanges.php, the section that it is  
> having
> a problem with is:
>
> 	$oImg = $oClass->createLegendIcon($nIconWidth, $nIconHeight);
>
> This is failing with the error:
>
> 	Fatal error: Call to a member function createLegendIcon() on a
> non-object
>
> If I change the code to make sure that '$oClass' is not NULL then  
> legend
> icons do get created but they are not being created correctly. I'm not
> sure if this is something where I need to use a different built-in
> function to use one of the default Fusion layer icons? If anyone has  
> any
> ideas it would be a big help.
>
> - Tim
>
> ----
> Timothy J Nolte - tnolte at ilpcs.com
> Network Planning Engineer
>
> iPCS Wireless, Inc.
> 4717 Broadmoor Ave, Suite G
> Kentwood, MI 49512
>
> Office: 616-656-5163
> PCS:    616-706-2438
> Fax:    616-554-6484
> Web: www.ipcswirelessinc.com
> _______________________________________________
> fusion-users mailing list
> fusion-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/fusion-users


__________________________________________

    Paul Spencer
    Chief Technology Officer
    DM Solutions Group Inc
    http://research.dmsolutions.ca/



More information about the fusion-users mailing list