[mapserver-users] php/Mapscript query

Steven Bowden steveb at bundaberg.qld.gov.au
Tue Jun 25 19:02:44 PDT 2002


Hi List,
Hopefully somebody can point me in the right direction.
I am using mapserv 3.6.0 and php/mapscript with php 4.1.2 as CGI.

I am having trouble with the processquerytemplate method.
I can get it to process a layers template when the template is a file
but when the template is a URL I get nothing returned.  I would assume
that I am meant to get the template URL back as a string with the
specified tags replaced with their actual value.  Have I got the layer
set up correctly?  Am I calling it correctly in php?

##### Layer #######
LAYER
  NAME parcels_shaded
  GROUP cadaster
  CONNECTIONTYPE postgis
  CONNECTION "user=gis dbname=blis host=blis"
  TYPE polygon
  STATUS on
  MAXSCALE 9999
  DATA "geom from bucc"
  LABELITEM "tag"
  HEADER parcels_header.html
  FOOTER parcels_footer.html
  TEMPLATE "parcels.html"
  #TEMPLATE
"http://blis/blis/action.php?action=query&value=[tag]&image=[img]"
  CLASS
     Name "Parcels"
     COLOR 0 128 0
  END
END

#### Php ########
 $queryresult = $map->queryByPoint($query_point,MS_SINGLE,5);
 echo $queryresult . "<br>";
 $queryimg = $map->drawquery();
 $query_url=$queryimg->saveWebImage(MS_PNG,1,1,0);
 $queryarray["test"] = "steve";
 $template = $map->processquerytemplate($queryarray);
echo "<hr>";
echo $template;
echo "<hr>";
Even though the [tag] tag isn't in the queryarray that gets passed to
processquerytemplate, it still substitutes the correct values into the
template file, I just had to pass something to it to get it to work.
The commented out template line in the layer doesn't return anything
where the uncommented template does.

Any help would be greatly appreciated.
Thanks
Steve

~~~~~~~~~~~~~~~~~~~~~~~~
Steven Bowden
GIS Officer
Bundaberg City Council
~~~~~~~~~~~~~~~~~~~~~~~~~

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20020626/a954fe3b/attachment.htm>


More information about the MapServer-users mailing list