MapTools.org

[Chameleon] my widgets don't widge

Bart van den Eijnden bartvde@xs4all.nl
Sun, 16 Nov 2003 11:01:27 +0100
------------vIriDREmyLAfwSFX3ICLiK
Content-Type: text/plain; format=flowed; charset=iso-8859-15
Content-Transfer-Encoding: 8bit

Hi Sara,

you should change the following part in your index.phtml file, so add the 
2 lines starting with $this:

class SampleApp extends Chameleon
{
    function SampleApp()
    {
      parent::Chameleon();
      $this->moMapSession = new MapSession_RW;
      $this->moMapSession->setTempDir( getSessionSavePath());
    }

You can leave out the CWCInitializeMap() function. For clarity I have 
attached a changed index.phtml file which should work for you.

Paul: shouldn't we update the sample app on www.maptools.org so no more 
people will run into these problems? Perhaps we can put the Geodan sample 
there instead of the old sample application?

Best regards,
Bart

PS: it is a good habit to always CC the list, so other people with similar 
problems in the future can search the archives.

On Sat, 15 Nov 2003 16:58:56 -0500, Sara Yurman <syurman@spatialfocus.com> 
wrote:

> Hi Bart,
>
> Many thanks for your email.  Here are some responses to your questions
>
>> With red box you mean the box with the red outline ofcourse, and not 
>> the complete map widget turning red like it does in Opera (this is a 
>> known issue).
>
> Yes, that's right.  No, I'm not an Opera user.
>
>> what browser are you using?
>
> I was using Mozilla 1.5 when I wrote.  I've tried IE from our one and 
> only Windows client and Galeon after that and got basically the same 
> results.  Cutting off the Ruler works reliably in IE, and doesn't in 
> Mozilla, but no other differences.
>
>  > My guess is that the problem will be in the constructor of your 
> sample > application.
>
> I've listed the index.phtml file below.  I might be missing something 
> here -- I'm still not seeing the problem.  It would be so wonderful if 
> it were something I did in here -- it could be easily fixed.
>
> Thanks again for your help.  If you see anything in here, I would so 
> appreciate hearing about it.
>
> Best,
>
> Sara
>
> *******************index.phtml below**********************************
> <?
> /*
>   * this is a sample of a minimal application script required to
>   * get a chameleon application running with a template and a
>   * local map file.  Most applications should actually just
>   * copy this file and modify the template and mapfile
>   * parts and should not need to do a lot more here.
>   */
> include( "/var/www/cwc2/htdocs/chameleon.php" );
>
> $szTemplate = "nlr.html";
> $szMapFile = "/var/www/cwc2/map/nlr.map";
>
> class SampleApp extends Chameleon
> {
>    function SampleApp()
>    {
>      parent::Chameleon();
>    }
>
>    function CWCInitializeMap()
>    {
>      $this->moMapSession = new MapSession_RW;
>      $this->moMapSession->setTempDir( getSessionSavePath());
>      parent::CWCInitializeMap();
>    }
>
>    function CWCLoadTemplate($szTemplateName)
>    {
>      $this->mszTemplate = implode("\n", file($szTemplateName));
>    }
> }
>
> $oApp =  new SampleApp();
> $oApp->CWCInitialize( $szTemplate, $szMapFile  );
> $oApp->CWCExecute();
> ?>



-- 
  
------------vIriDREmyLAfwSFX3ICLiK
Content-Disposition: attachment; filename=index.phtml
Content-Type: application/octet-stream; name=index.phtml
Content-Transfer-Encoding: 8bit

<?
/*
  * this is a sample of a minimal application script required to
  * get a chameleon application running with a template and a
  * local map file.  Most applications should actually just
  * copy this file and modify the template and mapfile
  * parts and should not need to do a lot more here.
  */
include( "/var/www/cwc2/htdocs/chameleon.php" );

$szTemplate = "nlr.html";
$szMapFile = "/var/www/cwc2/map/nlr.map";

class SampleApp extends Chameleon
{
   function SampleApp()
   {
     parent::Chameleon();
     $this->moMapSession = new MapSession_RW;
     $this->moMapSession->setTempDir( getSessionSavePath());
   }

   function CWCLoadTemplate($szTemplateName)
   {
     $this->mszTemplate = implode("\n", file($szTemplateName));
   }

}

$oApp =  new SampleApp();
$oApp->CWCInitialize( $szTemplate, $szMapFile  );
$oApp->CWCExecute();
?>
------------vIriDREmyLAfwSFX3ICLiK--



This archive was generated by Pipermail.