Mapscript layer: value for query template

Nyk Cowham ncowham at forumone.com
Thu Apr 12 16:31:19 EDT 2001


Fellow developers:

I am using mapscript (perl) to build a generic mapserver application
using Template Toolkit in place of mapserv's template mechanism. I use
$map->{web}->{template} to get the main map template name, but there
does not seem to be a corresponding attribute exposed to get the value
of a query template specified in a map file as:

LAYER
   NAME watershed
   TYPE POLYGON
   STATUS ON
   DATA hucs00p020
   MAXSCALE 20050000
   LABELITEM "Map_label"
   LABELMAXSCALE 20050000
   QUERY
      TEMPLATE "watershed.ttml"
   END
   CLASS
      NAME "Hydro Unit"
      OUTLINECOLOR 255 166 33
      LABEL
          SIZE large
          COLOR 255 166 33
          TYPE BITMAP
      END
   END
END

I tried using $layer->{query}->{template} - but that is not recognized.
Although the published documentation does not mention it - I found that:
	$qryObj = new queryObj($layer);

returns a reference to an object with the attributes 'expression' and
'template' as members. When I dereference these I get a value for
expression as 'expressionObjPtr=SCALAR(0x8345574)' and a null value for
template.  I am not interested in the value for expression at this
point, but I am interested in getting the value for template. What am I
missing here? Do I have to specify a queryitem and expression to get
this value, or is there something else I'm missing?

Thanks for any insight that you can provide.

Nyk Cowham
Forum One Communications
http://www.forumone.com/
Communicate Collaborate Change the world
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Nyk Cowham.vcf
Type: text/x-vcard
Size: 220 bytes
Desc: Nyk Cowham.vcf
Url : http://lists.osgeo.org/pipermail/mapserver-users/attachments/20010412/12252604/NykCowham.vcf


More information about the mapserver-users mailing list