[mapserver-users] [map] tag and $mapObj->processTemplate()

Daniel Morissette morissette at dmsolutions.ca
Tue Aug 20 13:34:15 PDT 2002


Alex Rice wrote:
> 
> I'm using Perl mapscript & am mapscript newbie. I noticed that
> the  $mapObj->processTemplate() method does not replace the [map]
> tag in my template. The mapserv CGI does replace the [map] field
> in my template. The mapserver docs mention something about the
> savemap CGI parameter being required, but it's not clear. How can
> I get mapscript to process the [map] tag in my template?
> 

See the PHP MapScript docs for $mapObj->processTemplate() in 
http://mapserver.gis.umn.edu/doc36/phpmapscript-class-guide.html
Only tags that correspond to a member of the mapObj will be replaced in
the template by default.  And if you pass the second argument
(generateimages) as TRUE then the [img], [scalebar], etc. will be
automagically generated and replaced as well.

[map] seems to be specific to the CGI mode, that's why it's not handled
by the function.  According to the MapServer templates docs, it is
enabled only if the SAVEMAP CGI parameter is enabled (apparently to save
the state of the map to a temporary file).

Note that since you have the map path in your script you can pass it via
the first argument to the processTemplate() method.  There is an example
of this in the PHP MapScript docs... not sure how that would work in
Perl though.

I hope that helps.

Daniel
-- 
------------------------------------------------------------
 Daniel Morissette               morissette at dmsolutions.ca
 DM Solutions Group              http://www.dmsolutions.ca/
------------------------------------------------------------
  Don't put for tomorrow what you can do today, because if 
      you enjoy it today you can do it again tomorrow.



More information about the MapServer-users mailing list