[mapserver-users] Changing layer template via URL

Steve Lime Steve.Lime at dnr.state.mn.us
Tue Jul 15 00:03:09 EDT 2008


The templatepattern takes a regex as an argument, sorry for the confusion. A "match-all" pattern
would simply be ".".

Steve

>>> Ian <iansgis at gmail.com> 07/14/08 6:28 PM >>>
Hello,

I'm using MapServer version 5.0.0 and can successfully change other
parameters via a URL, but am having trouble changing the layer template.  I
keep getting "loadLayer(): General error message. URL-based TEMPLATE
configuration failed pattern validation."

The documentation on TEMPLATEPATTERN is sparse but from another post
(
http://www.nabble.com/Dinamically-changing-HTML-Template-using-CGI-parameter--(instead-of-hardcoded)-td17626183.html
)

it sounds like it is necessary. Both templates work when hard-coded:

Mapfile:
  NAME "Test"
  STATUS ON
  TEMPLATEPATTERN ".*"
  ...
  LAYER
    NAME volcanoes
    TEMPLATE 'templates/volcanoes.html'
    ...

URL:
http://host/cgi-bin/mapserv?map=/maps/wms.map&mode=query&qlayer=volcanoes&mapxy=-121+40&map.layer[volcanoes]=TEMPLATE+'templates/volcanoesQuery.html
'

Thank you.



More information about the mapserver-users mailing list