[fusion-users] MapServer Legend Icons
Nolte, Tim
Tim.Nolte at ipcswirelessinc.com
Wed Nov 4 16:08:17 EST 2009
Paul,
I attempted this, however what I found was that the way the loading
process happens it is not enough to just stick the scale ranges into the
PHP $_SESSION. I'm finding that all of the individual maps in many cases
don't yet exist in the SESSION when the corresponding LoadScaleRanges is
called. Do you have any thoughts on how Fusion could be changed to only
call LoadScaleRanges 1 time after all of the LoadMap calls have
finished? I think this could be the fix. The only other option I see is
that the whole scale ranges creation process needs to be duplicated in
LoadScaleRanges script. I'm not sure but perhaps this functionality
needs to be added to the Utilities script?
----
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