[Chameleon] scalebar widget/ print friendly page/session

Julien-Samuel Lacroix jlacroix at mapgears.com
Thu Jun 14 09:37:16 EDT 2007


Hi,
Did you try to set the scalebar color in your main page?

 From what I've seen of this discussion and understood of your problem, 
you could simply set the scalebar color in your index.phtml page. 
Instead of reopening the session in your PrinterFriendly page and reset 
the scalebar, simply set the color in the main page between the 
CWCInitialise and the CWCExecute:

$oApp->CWCInitialise();
$oApp->moMapSession->oMap->scalebar->label->color->setRGB(255,255,255);
$oApp->CWCExecute();

This way the scalebar will always have the same color in the main page.

Julien

Delfos, Jacob wrote:
> It appears that you are starting a new session, rather than continuing 
> the existing one. You should open the existing session by doing 
> something like this:
>  
>    define("LOAD_MAPSESSION", "1");
>    include_once("../session.inc.php");
>    $oMap =& $oMapSession->oMap;
>  
> You must make sure that the "sid" form variable is passed into the page 
> that is doing this. Be aware that whereas Firefox can see the form 
> variables from the main page that a popup or Iframe originates from, 
> Internet Explorer can NOT, such that the "sid" must be passed specifically.
>  
> Hope that works.
>  
> regards,
>  
> Jacob
>  
> 
>     ------------------------------------------------------------------------
>     *From:* Brent Lund [mailto:Brent.Lund at state.mn.us]
>     *Sent:* 14 June 2007 03:58
>     *To:* Brent Lund; Delfos, Jacob; chameleon at lists.maptools.org
>     *Subject:* RE: [Chameleon] scalebar widget/ print friendly page/session
> 
>     Jacob,
> 
>      
> 
>     As a follow up.  
> 
>      
> 
>     Using the code below, my print preview generates a session map file
>     which indeed shows the scale bar label to be white.   However the
>     next time I zoom (change extent, map layers) on the original page
>     the scalebar label is Black.   So there must be another place in the
>     session variables where the scale label color is set.
> 
>      
> 
>     ------------------------------------------------------------------------
> 
>     *From:* chameleon-bounces at lists.maptools.org
>     [mailto:chameleon-bounces at lists.maptools.org] *On Behalf Of *Brent Lund
>     *Sent:* Wednesday, June 13, 2007 12:10 PM
>     *To:* Delfos, Jacob; chameleon at lists.maptools.org
>     *Subject:* RE: [Chameleon] scalebar widget/ print friendly page/session
> 
>      
> 
>      
> 
>     I’m evidently missing something in reverting.   After I call
>     CWCExecute to generate the page, I reset the scalebar label to
>     white, but the initial page is not seeing this.  (It’s still using
>     the label color kicked out by the print friendly page)
> 
>      
> 
>> 
>       $oApp->CWCExecute();
> 
>     session_start();
> 
>     $oApp->moMapSession->oMap->scalebar->label->color->setRGB(255,255,255);
> 
>     $_SESSION['gszCurrentState'] = $oApp->moMapSession->saveState();
> 
>     session_write_close();
> 
>> 
>      
> 
>      
> 
>     ------------------------------------------------------------------------
> 
>     *From:* Delfos, Jacob [mailto:Jacob.Delfos at maunsell.com]
>     *Sent:* Tuesday, June 12, 2007 6:59 PM
>     *To:* Brent Lund; chameleon at lists.maptools.org
>     *Subject:* RE: [Chameleon] scalebar widget/ print friendly page/session
> 
>      
> 
>     Hi Brent,
> 
>      
> 
>     Whatever you do after your widget changes the style of the scalebar
>     gets applied to your session in general once you use this command:
> 
>      
> 
>     $_SESSION['gszCurrentState'] = $oMapSession->saveState();
> 
>      
> 
>     So either avoid having to save the changes to your session, or
>     revert whatever it is you did as soon as your image has been
>     produced, and then save it again.
> 
>      
> 
>     regards,
> 
>      
> 
>     Jacob
> 
>      
> 
>      
> 
>          
> 
>         ------------------------------------------------------------------------
> 
>         *From:* chameleon-bounces at lists.maptools.org
>         [mailto:chameleon-bounces at lists.maptools.org] *On Behalf Of
>         *Brent Lund
>         *Sent:* 12 June 2007 23:22
>         *To:* chameleon at lists.maptools.org
>         *Subject:* [Chameleon] scalebar widget/ print friendly page/session
> 
>         I have a page where the scalebar background is non-white and the
>         scalebar text is white.   The user has the option to view a
>         “Print Friendly” page where the scalebar has black text.   The
>         problem is after viewing the “PF” page, the scalebar on the
>         original page takes on the properties of the “PF” page.   I know
>         the session variables are being changed – is there a way to
>         either prevent or undo the changes?
> 
>          
> 
>         Thanks,
> 
>          
> 
>         Brent Lund
> 
>          
> 
>          
> 
>     This email and any attachments are intended solely for the named
>     recipient and are confidential. The copying or distribution of them
>     or any information they contain by anyone other than the named
>     recipient is prohibited. If you have received this document in
>     error, please notify the sender and delete all copies from your
>     computer system and destroy all hard copies. It is the recipient's
>     responsibility to check this email and any attachments to this email
>     for viruses before use.
> 
> This email and any attachments are intended solely for the named 
> recipient and are confidential. The copying or distribution of them or 
> any information they contain by anyone other than the named recipient is 
> prohibited. If you have received this document in error, please notify 
> the sender and delete all copies from your computer system and destroy 
> all hard copies. It is the recipient's responsibility to check this 
> email and any attachments to this email for viruses before use.
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Chameleon mailing list
> Chameleon at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/chameleon

-- 
Julien-Samuel Lacroix
Mapgears
http://www.mapgears.com/


More information about the Chameleon mailing list