[Chameleon] Developing a new widget
Julien-Samuel Lacroix
jlacroix at mapgears.com
Wed Apr 5 10:22:57 EDT 2006
Hi Fabio,
The GetJavascript*() widget functions should return an array. In PHP the
array are acces like this:
ArrayName[key] = value;
Try replacing
> $aReturn$szJsFunctionName
> <http://chameleon-tiki.maptools.org/$szJsFunctionName> = $szFunction;
by:
$aReturn[$szJsFunctionName] = $szFunction;
And replace:
> $aReturnshowReport>'showReport'
> <http://chameleon-tiki.maptools.org/%3Ci> = "showReport();\n";
by
$aReturn['showReport'] = "showReport();\n";
Julien
Fabio Zottele wrote:
> Hi, I am Fabio zottele from Italy (University of Trento).
> I am developing a new widget: the user click on the map, retrives the
> coordinate of the point and then several other funny things will happen
> (POSTGIS connections, updating remote tables, starting phisical models
> ...).
> I am referring to the "Developing a new Chameleon widget" in the wiki
> page.
> Still I have some problems:
>
> adding this code:
>
> $szShowReport = strlen( $this->mszReport ) >
> 0?"alert('".$this->mszReport."')":"";
> $szJsFunctionName = "showReport";
> $szFunction = <<<EOT
> function {$szJsFunctionName}()
> {
> {$szShowReport};
> return true;
> }
> EOT;
> $aReturn$szJsFunctionName
> <http://chameleon-tiki.maptools.org/$szJsFunctionName> = $szFunction;
>
>
> and this code
>
> // show report
> $aReturnshowReport>'showReport'
> <http://chameleon-tiki.maptools.org/%3Ci> = "showReport();\n";
>
> and reloading the page, nothing happans. Actually a notice is thrown
> saying: "Use of undefined constant showReport".
>
> Any help is welcome!
>
> Thanks, Fabio
> _______________________________________________
> 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