[Chameleon] Creating a new widget
Delfos, Jacob
Jacob.Delfos at maunsell.com
Wed Sep 20 22:03:14 EDT 2006
Rob,
I'm not completely sure, but I think after this line:
$szFunction = <<<EOT
Maybe you should have:
function showReport()
{
{$szShowReport};
return true;
}
You can always check the source of the resulting page, to see what the
function body ended up looking like.
I believe there is a widget that puts values in a drop-down box
(quickzoom), which may do what you want. Alternatively, for searching
you can use the LocateByAttribute widget. I have recently adjusted it to
work with (hopefully) all vector formats (tested with TAB, DGN, DXF,
PostGIS, ESRI Personal Geodatabase). PostGIS required a little
workaround, but on my end it does now work. It's in CVS, or e-mail me if
you can't access CVS.
regards,
Jacob
________________________________
From: chameleon-bounces at lists.maptools.org
[mailto:chameleon-bounces at lists.maptools.org] On Behalf Of Rob Male
Sent: 21 September 2006 08:20
To: chameleon at lists.maptools.org
Subject: [Chameleon] Creating a new widget
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/f7385525/attachment.html
More information about the Chameleon
mailing list