TEMPLATE in map file doesn't run, why?

Daniele Margotti margottid at COMUNE.LUGO.RA.IT
Wed Jul 20 00:58:27 PDT 2005


A TEMPLATE is an existing .html file that is used by CGI Mapserver as a
"skeleton" page: in this page, there are some fields that Mapserver
substitutes with the image of the map, the scalebar, the reference map,
and other variables (current scale, current extent, and so on).

This TEMPLATE must be defined in the WEB section of the mapfile
(http://mapserver.gis.umn.edu/doc44/mapfile-reference.html#web).


You can also use a TEMPLATE in the CLASS section
(http://mapserver.gis.umn.edu/doc44/mapfile-reference.html#class) or -
if you want the same template for each class of a layer - in the LAYER
section
(http://mapserver.gis.umn.edu/doc44/mapfile-reference.html#layer) of the
mapfile.

In this case, the TEMPLATE (this also must be an existing .html file) is
used by CGI Mapserver when you query the map: the template contains
field that are substituted with vaules of the queried attributes.


In your example mapfile, the TEMPLATE instruction as the following
meaning:
"When you query the map, show results (for this layer) using
http://www.nusvirtual.com as template".
The question is: is this a good template file?

But I suggest you to use a "local" .html file as a template.

	Daniele


-----Original Message-----
From: UMN MapServer Users List [mailto:MAPSERVER-USERS at LISTS.UMN.EDU] On
Behalf Of SUBSCRIBE MAPSERVER-USERS Nuri
Sent: Wednesday, July 20, 2005 9:32 AM
To: MAPSERVER-USERS at LISTS.UMN.EDU
Subject: [UMN_MAPSERVER-USERS] TEMPLATE in map file doesn't run, why?


Hi,

I inserted a TEMPLATE instruction in my map file but the link doesn't
run in the map.

Someone could tell me why I'm doing wrong? Thank you.

This is my map file:


MAP
  IMAGETYPE      PNG
  EXTENT   20.000000 18.000000 50.000000 110.000000
  SIZE           500 350
  SHAPEPATH      "data"
  IMAGECOLOR     255 180 0
  SYMBOLSET      "symbols/symbols35.sym"
  FONTSET "fonts/fonts.list"

  # Start of LAYER DEFINITIONS
--------------------------------------------
-

  LAYER # Capa de raster
    NAME mapafig
    DATA "raster/figueres.tif"
    STATUS DEFAULT
    TYPE RASTER
    PROCESSING "BANDS=1,2,3"
    OFFSITE 0 0 255
  END # Fi capa de raster

  LAYER
    NAME "prova"
    TEMPLATE "http://www.nusvirtual.com"    <--------
????????????????????
    TYPE POINT
    CONNECTIONTYPE OGR
    CONNECTION "mapa21.ovf"
    DATA "mapa21"
    LABELITEM "id"
    #PROJECTION
    #  "init=epsg:4326"
    #END

    CLASS
      SYMBOL 'symbols/prova.gif'
      #SIZE 6
      COLOR 255 0 0
      LABEL
     SIZE MEDIUM
     TYPE BITMAP
     COLOR 0 0 0
      END
    END
END

  # End of LAYER DEFINITIONS ------------------------------- END # end
of map file



More information about the MapServer-users mailing list