[fusion-users] MapServer Legend Icons

Nolte, Tim Tim.Nolte at ipcswirelessinc.com
Mon Oct 26 23:25:50 EDT 2009


I'll work on this. Seems like and easy fix. Once I get the fix working
I'll send you the code changes. Thanks!

- 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
-----Original Message-----
From: fusion-users-bounces at lists.osgeo.org
[mailto:fusion-users-bounces at lists.osgeo.org] On Behalf Of Paul Spencer
Sent: Monday, October 26, 2009 3:07 PM
To: Nolte, Tim
Cc: fusion-users at lists.osgeo.org
Subject: Re: [fusion-users] MapServer Legend Icons

Ohhhhh - light goes on - doh!  You have 6 maps in the same map group!   
This will need a bit of work :)  We need to modify the scale_ranges  
array in the session so that it is subdivided by map name.  LoadMap  
needs to set

$_SESSION['scale_ranges'][$mapName]

and LoadScaleRanges needs to use the same thing when referencing it.   
Do you think you could make these changes and test?  If it works, I'll  
file the bug and commit.  If you don't want to try first, I can take a  
stab at it and commit but I'm not really set up to test right now.

Thanks Tim

Paul


On 2009-10-26, at 2:39 PM, Nolte, Tim wrote:

> What I am seeing with Firebug is that there are 6 calls to  
> LoadMap.php,
> which are my 5 main maps and 1 overview map. After the 5th LoadMap.php
> call then the LoadScaleRanges.php calls begin, there are 5 calls. One
> thing that I noticed also is that the MapTips are not working and what
> is being POSTed to the MapTip.php script is the wrong map for the  
> layer
> that I've selected for MapTips. Seems like there could be a problem  
> with
> using the SESSION if the LoadMap.php is not adding something to the
> SESSION to directly link the call to the LoadScaleRanges.php so that
> it's not pulling the wrong scale_ranges. Is there any debugging
> information that I can send?
>
> - 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
> -----Original Message-----
> From: fusion-users-bounces at lists.osgeo.org
> [mailto:fusion-users-bounces at lists.osgeo.org] On Behalf Of Paul  
> Spencer
> Sent: Monday, October 26, 2009 11:30 AM
> To: Nolte, Tim
> Cc: fusion-users at lists.osgeo.org
> Subject: Re: [fusion-users] MapServer Legend Icons
>
> 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/
>
> _______________________________________________
> 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/

_______________________________________________
fusion-users mailing list
fusion-users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/fusion-users



More information about the fusion-users mailing list