[Chameleon] Creating a new widget

Rob Male robm at thuringowa.qld.gov.au
Wed Sep 20 20:20:21 EDT 2006


Hello List,

I'm trying you create a widget using the tutorial from here
http://chameleon-tiki.maptools.org/tiki-index.php?page=Developing+a+new
+Chameleon+Widget#attachments

Everthing works up to when I modify  
"function GetJavascriptFunctions()"  by adding the following.

#########################################
    function GetJavascriptFunctions()
    {
        // init vars
        $aReturn = parent::GetJavascriptFunctions();

        /////////  ADD CODE HERE IF NECESSARY /////////
        // show the report
        $szShowReport = strlen( $this->mszReport ) >
0?"alert('".$this->mszReport."')":"";
        $szJsFunctionName = "showReport";
        $szFunction = <<<EOT
        {
         {$szShowReport};
         return true;
        }
EOT;

$aReturn[$szJsFunctionName] = $szFunction;

        // return
        return $aReturn;

    // end GetJavascriptFunctions() function
    }
#########################################

If the application is loaded with this function enabled everthing is
displayed except the map and the key map. Also the mouse click will not
submit.

Is anyone able to help ?

Really all I want is a widget that will allow me to display a list of
feature names from a postgis database, for example street names, and
zoom to the feature selected from the list.

I have an application that does pretty well all that I need, except this
searching ablility, and unfortunately without searching it is as good as
useless.

Is anyone able to point me to some detailed documentation on Chameleon
eg "Chameleon for Dummies",(I know it is wishful thinking, but no harm
in asking). I've been struggling for months as most of the documentation
I've found assumes you already have a pretty good grasp of PHP,
Javascript, Mapserver and even Chameleon. Unfortunately in my case this
is not so. 

I was very impressed when I first discovered Chameleon after trying to
generate an application from scratch using Mapscript (especially the
zoom box) but getting to this point and not being able to proceed any
further is making me think I should "cut my losses" and return to
mapscript, where at least I could do the searching that I require.

Well I've had my whinge, if anyone has any suggestions (now be nice)
please let me know.

Cheers 
Rob Male
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maptools.org/pipermail/chameleon/attachments/20060921/0550d858/attachment.html


More information about the Chameleon mailing list