[Chameleon] ttt_query.html and query widget

Paul Spencer pagameba at magma.ca
Wed Sep 1 08:07:26 EDT 2004


the existance of the TEMPLATE tag is required to make queries work due 
to the internal structure of MapServer and its origins as a CGI/template 
processor.  In order to make a layer usefully queryable (?), you also 
need to set a tolerance > 0 and the associated toleranceunits (normally 

The chameleon query widget does not use the template, it is simply there 
to make mapserver think that the layer should be queried.  The value 
assigned to TEMPLATE can be any value.  It will always be ignored.

The radio buttons are in the template to demonstrate the use of the 
SelectLayers widget.  The SelectLayers widget simply marks layers as 
selected for use by other widgets.  It can handle both single and 
multiselect modes.  The use of radio buttons was arbitrary.  The 
SelectLayers widget actually exposes a javascript function to set a 
layer as selected, and uses a form variable that other widgets or 
javascript code can use.  It also sets metadata on the selected layers 
when the page is submitted so widgets that work directly on the map file 
have a mechanism for finding out about selected layers.

Some widgets need layers to be selected in order to function, for 
instance the ExpressionBuilder widget builds a filter expression for the 
currently selected layer.

Other widgets can be developed that rely on this, for instance it is 
conceiveable that a QuerySelectedLayers widget could be developed that 
would use the selected layer(s) to restrict querying beyond what is 
normal for mapserver.

Note that in mapscript we can set the TEMPLATE value on the fly to make 
a layer queryable (except for WMS layers) ...



Ken Sanderson wrote:

> Hello all. I was wrestling with getting the query widget to work with my
> layers (using 1.99b). By using the one layer in the samples that allowed
> you to query it I was able to determine in order for me to query a layer
> I needed to define its template property. I noticed in the samples that
> they have:
>       TEMPLATE "ttt_query.html"
> I also noticed that ttt_query.html doesn't exist, at least it doesn't in
> any of my chameleon folders. Does the query widget just default to
> QueryResults.phtml if it cant find the file in the TEMPLATE property, or
> how is this working if the file actually exists?
> On a related note does the radio buttons in the enhanced samples
> 'sample_enhanced.html' have any impact upon what layers are queried?
> Doesn't seem like it does, which brings up my next question. What are
> the radio buttons for?
> Thanks,
> Ken
> _______________________________________________
> Chameleon mailing list
> Chameleon at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/chameleon

|Paul Spencer                           pspencer at dmsolutions.ca   |
|Applications & Software Development                              |
|DM Solutions Group Inc                 http://www.dmsolutions.ca/|

More information about the Chameleon mailing list